/* 风格 11 · 后台 Admin Panel
   浅灰工作区 + 白面板 + 1px 线 + 单一蓝。系统 UI 字体 13px，数字等宽。
   刻意常规：左侧导航树、面包屑、KPI、筛选表单、可排序数据表、分页、状态标签。 */
html[data-style="admin"] {
  --bg: #f4f5f7;
  --panel: #ffffff;
  --line: #e3e6ea;
  --line-strong: #cfd4db;
  --text: #1c2128;
  --sec: #5c6570;
  --blue: #2a5bd7;
  --blue-deep: #1d4bb8;
  --blue-bg: #eaf0fd;
  --green: #1f6b3b;
  --green-bg: #e5f5ea;
  --amber: #8a5a00;
  --red: #b3261e;
  --ui: system-ui, -apple-system, "Segoe UI", Roboto, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;
  color-scheme: light;
  background: var(--bg);
  color: var(--text);
  font-family: var(--ui);
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}
html[data-style="admin"] body { background: var(--bg); }
html[data-style="admin"] ::selection { background: var(--blue-bg); }

.ad-app { display: grid; grid-template-columns: 236px minmax(0, 1fr); min-height: 100dvh; }

/* ---- 侧栏 ---- */
.ad-side {
  background: var(--panel); border-right: 1px solid var(--line);
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; display: flex; flex-direction: column;
  scrollbar-width: thin;
}
.ad-brand { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ad-brand-mark { width: 28px; height: 28px; border-radius: 6px; background: var(--blue); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 15px; flex: none; }
.ad-brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.ad-brand-text b { font-size: 13px; white-space: nowrap; }
.ad-brand-text small { font-size: 11px; color: var(--sec); }
.ad-nav { padding: 8px 8px 12px; flex: 1; }
.ad-nav-h { margin: 12px 8px 4px; font-size: 11px; color: var(--sec); display: flex; justify-content: space-between; }
.ad-nav-h span { font-family: var(--mono); font-size: 10.5px; }
.ad-nav-i {
  display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 6px;
  text-decoration: none; color: var(--text); min-width: 0; flex: 1;
}
.ad-nav-i span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-nav-i em { font-style: normal; font-family: var(--mono); font-size: 10.5px; color: var(--sec); }
.ad-nav-i:hover { background: var(--bg); }
.ad-nav-i.on { background: var(--blue-bg); color: var(--blue-deep); font-weight: 600; }
.ad-nav-i.on em { color: var(--blue-deep); }
.ad-nav-row { display: flex; align-items: center; }
.ad-tw { width: 22px; height: 22px; flex: none; border: 0; background: none; border-radius: 4px; position: relative; margin-left: 2px; }
.ad-tw::before { content: ""; position: absolute; left: 8px; top: 7px; width: 5px; height: 5px; border-right: 1.5px solid var(--sec); border-bottom: 1.5px solid var(--sec); transform: rotate(-45deg); transition: transform .15s; }
.ad-tw:hover { background: var(--bg); }
.ad-tree.open .ad-tw::before { transform: rotate(45deg); top: 5px; }
.ad-sub { display: none; margin: 1px 0 3px 22px; border-left: 1px solid var(--line); }
.ad-tree.open .ad-sub { display: block; }
.ad-nav-s { display: flex; justify-content: space-between; gap: 8px; padding: 4px 8px 4px 10px; font-size: 12px; color: var(--sec); text-decoration: none; border-radius: 0 6px 6px 0; }
.ad-nav-s em { font-style: normal; font-family: var(--mono); font-size: 10px; }
.ad-nav-s:hover { color: var(--text); background: var(--bg); }
.ad-dot { width: 8px; height: 8px; border-radius: 50%; background: hsl(var(--h) 55% 50%); flex: none; display: inline-block; }
.ad-ic { width: 14px; height: 14px; flex: none; border: 1.5px solid currentColor; border-radius: 3px; opacity: .7; position: relative; }
.ad-ic-home { border-radius: 3px 3px 2px 2px; }
.ad-ic-home::after { content: ""; position: absolute; left: 4px; bottom: -1.5px; width: 3px; height: 5px; border-left: 1.5px solid currentColor; border-right: 1.5px solid currentColor; }
.ad-ic-box::after { content: ""; position: absolute; left: 2px; right: 2px; top: 4px; border-top: 1.5px solid currentColor; }
.ad-ic-doc::after, .ad-ic-doc::before { content: ""; position: absolute; left: 3px; right: 3px; top: 4px; border-top: 1.5px solid currentColor; }
.ad-ic-doc::before { top: 7px; }
.ad-ic-check { border-radius: 50%; }
.ad-ic-check::after { content: ""; position: absolute; left: 4px; top: 2px; width: 3px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); }
.ad-ic-search { border-radius: 50%; width: 12px; height: 12px; opacity: .6; }
.ad-ic-search::after { content: ""; position: absolute; right: -4px; bottom: -3px; width: 5px; border-top: 1.5px solid currentColor; transform: rotate(45deg); }

/* 外观：风格列表，当前项带蓝色指示条 */
.ad-themes { display: flex; flex-direction: column; gap: 1px; }
.ad-theme { display: grid; grid-template-columns: 3px auto 1fr; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 4px 8px 4px 5px; border-radius: 6px; text-decoration: none; color: var(--text); font-size: 12px; }
.ad-theme i { grid-row: span 2; width: 3px; height: 16px; border-radius: 2px; background: transparent; }
.ad-theme b { font-family: var(--mono); font-size: 10.5px; color: var(--sec); font-weight: 500; grid-row: span 2; }
.ad-theme span { line-height: 1.2; }
.ad-theme small { color: var(--sec); font-size: 10.5px; line-height: 1.2; }
.ad-theme:hover { background: var(--bg); }
.ad-theme[aria-current="page"] { background: var(--blue-bg); color: var(--blue-deep); }
.ad-theme[aria-current="page"] i { background: var(--blue); }
.ad-theme[aria-current="page"] b, .ad-theme[aria-current="page"] small { color: var(--blue-deep); }
.ad-side-foot { border-top: 1px solid var(--line); padding: 10px 16px; font-size: 11px; color: var(--sec); display: flex; justify-content: space-between; gap: 8px; }
.ad-side-foot a { color: var(--sec); text-decoration: none; }
.ad-side-foot a:hover { color: var(--blue); }

/* ---- 顶栏 ---- */
.ad-body { min-width: 0; display: flex; flex-direction: column; }
.ad-top {
  position: sticky; top: 0; z-index: 30; height: 52px;
  background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 16px; padding: 0 20px;
}
.ad-burger { display: none; width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); position: relative; }
.ad-burger i, .ad-burger i::before, .ad-burger i::after { content: ""; position: absolute; left: 8px; width: 14px; border-top: 1.5px solid var(--text); }
.ad-burger i { top: 15px; } .ad-burger i::before { top: -6px; left: 0; } .ad-burger i::after { top: 4px; left: 0; }
.ad-crumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sec); flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; }
.ad-crumb a { color: var(--sec); text-decoration: none; }
.ad-crumb a:hover { color: var(--blue); }
.ad-crumb i { font-style: normal; color: var(--line-strong); }
.ad-crumb [aria-current] { color: var(--text); font-weight: 600; }
.ad-search { display: flex; align-items: center; gap: 8px; width: min(360px, 40vw); min-width: 0; height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); }
.ad-search:focus-within { border-color: var(--blue); background: var(--panel); box-shadow: 0 0 0 2px var(--blue-bg); }
.ad-search input { flex: 1; min-width: 0; border: 0; background: none; outline: 0; font-size: 13px; color: var(--text); }
.ad-search input::placeholder { color: var(--sec); }
.ad-search kbd { font-family: var(--mono); font-size: 10.5px; color: var(--sec); border: 1px solid var(--line-strong); border-radius: 4px; padding: 0 5px; line-height: 16px; }
.ad-top-r { display: flex; align-items: center; gap: 10px; }
.ad-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-deep); display: grid; place-items: center; font-size: 11px; font-weight: 700; }

/* ---- 按钮 / 链接 ---- */
.ad-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500;
  transition: background-color .12s, border-color .12s;
}
.ad-btn:hover { background: var(--bg); border-color: var(--sec); }
.ad-btn-pri { background: var(--blue); border-color: var(--blue); color: #fff; }
.ad-btn-pri:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.ad-link { background: none; border: 0; padding: 0; color: var(--blue); text-decoration: none; font-size: 12.5px; white-space: nowrap; }
.ad-link:hover { text-decoration: underline; }

/* ---- 工作区 ---- */
.ad-main { padding: 20px 24px 80px; display: flex; flex-direction: column; gap: 16px; max-width: 1480px; width: 100%; }
.ad-pagehead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.ad-pagehead h1 { margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -.01em; }
.ad-pagehead p { margin: 4px 0 0; color: var(--sec); font-size: 13px; max-width: 72ch; }
.ad-pagehead-act { display: flex; gap: 8px; }
.ad-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ad-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 2px; }
.ad-kpi span { font-size: 12px; color: var(--sec); }
.ad-kpi b { font-size: 26px; font-weight: 600; line-height: 1.15; letter-spacing: -.02em; }
.ad-kpi small { font-size: 11.5px; color: var(--sec); }
.ad-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; }
.ad-panel-h { display: flex; align-items: baseline; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.ad-panel-h h2 { margin: 0; font-size: 14px; font-weight: 600; }
.ad-panel-h span { font-size: 12px; color: var(--sec); margin-left: auto; }
.ad-two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 筛选表单 */
.ad-form { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: flex-end; padding: 12px 16px 14px; }
.ad-form label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--sec); }
.ad-form select { height: 32px; min-width: 150px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 8px; background: var(--panel); color: var(--text); font-size: 13px; }
.ad-form select:hover { border-color: var(--sec); }
.ad-form select:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 2px var(--blue-bg); }
.ad-form-act { margin-left: auto; }

/* ---- 数据表 ---- */
.ad-tablewrap { overflow-x: auto; }
.ad-table { width: 100%; border-collapse: collapse; min-width: 760px; }
/* 不做 sticky 表头：外层 overflow-x 包裹会让 sticky 以包裹层为参照，表头反而压住第一行。 */
.ad-table thead th { text-align: left; font-weight: 600; font-size: 12px; color: var(--sec); padding: 9px 12px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
.ad-th { background: none; border: 0; padding: 0; font: inherit; color: inherit; display: inline-flex; align-items: center; gap: 4px; }
.ad-th:hover { color: var(--text); }
.ad-arrow { width: 0; height: 0; border: 4px solid transparent; border-top: 5px solid var(--line-strong); margin-top: 4px; }
.ad-arrow.up { border-top-color: transparent; border-bottom: 5px solid var(--blue); margin-top: -4px; }
.ad-arrow.down { border-top-color: var(--blue); }
.ad-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; font-size: 12.5px; }
.ad-table tbody tr:hover td { background: #f7f9fc; }
.ad-table tr:last-child td { border-bottom: 0; }
.ad-rowlink { cursor: pointer; }
.ad-rowlink:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.ad-num { font-family: var(--mono); font-size: 12px; color: var(--sec); }
.ad-num b { color: var(--text); font-weight: 600; }
.ad-domname { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.ad-c-desc { color: var(--sec); line-height: 1.45; }
.ad-c-name { display: flex; align-items: center; gap: 10px; }
.ad-c-name > span { display: flex; flex-direction: column; min-width: 0; }
.ad-c-name small { color: var(--sec); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 260px; }
.ad-name { color: var(--text); text-decoration: none; font-weight: 600; }
.ad-name:hover { color: var(--blue); text-decoration: underline; }
.ad-thumb { width: 56px; aspect-ratio: 8/5; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; flex: none; }
.ad-thumb-none { display: block; background: repeating-linear-gradient(135deg, var(--bg) 0 4px, var(--panel) 4px 8px); }
.ad-lang { font-style: normal; font-size: 10.5px; color: var(--sec); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; margin-left: 6px; vertical-align: 1px; }
.ad-group th { text-align: left; padding: 8px 12px; background: var(--bg); border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); font-weight: 500; font-size: 12.5px; position: static; }
.ad-group th b { font-weight: 600; }
.ad-group th span { font-family: var(--mono); font-size: 10.5px; color: var(--sec); margin: 0 10px 0 8px; }
.ad-group th em { font-style: normal; color: var(--sec); font-size: 12px; }
.ad-bar { display: flex; height: 8px; width: calc(var(--w, 1) * 100%); min-width: 24px; border-radius: 2px; overflow: hidden; background: var(--bg); }
.ad-bar i { display: block; height: 100%; }
.ad-bar .S { background: var(--blue); } .ad-bar .A { background: #7aa3ee; } .ad-bar .B { background: var(--line-strong); }
.ad-bar-n { display: block; margin-top: 4px; font-family: var(--mono); font-size: 10.5px; color: var(--sec); }

/* 标签 */
.ad-tag { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 4px; font-size: 11.5px; white-space: nowrap; background: var(--bg); color: var(--text); border: 1px solid var(--line); }
.ad-tag i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ad-tag-S { background: var(--blue-bg); color: var(--blue-deep); border-color: #cdd9f5; font-weight: 600; }
.ad-tag-A { background: var(--green-bg); color: var(--green); border-color: #c9e7d2; }
.ad-tag-B { color: var(--sec); }
.ad-tag-kind { color: var(--sec); }
.ad-tag-acc-free { color: var(--green); background: var(--green-bg); border-color: #c9e7d2; }
.ad-tag-acc-freemium { color: var(--amber); background: #fdf4e3; border-color: #f0dfb8; }
.ad-tag-acc-paid { color: var(--red); background: #fcebea; border-color: #f3cfcd; }
.ad-reach { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--sec); white-space: nowrap; }
.ad-reach i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-strong); }
.ad-reach-static i { background: #2f9e5a; } .ad-reach-js i { background: #e0a100; } .ad-reach-blocked i { background: #d64545; }

/* 分页 / 空态 */
.ad-pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: 12px; color: var(--sec); flex-wrap: wrap; }
.ad-pg-list { display: flex; gap: 4px; align-items: center; }
.ad-pg { min-width: 28px; height: 28px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); font-size: 12.5px; font-family: var(--mono); color: var(--text); }
.ad-pg:hover:not(:disabled) { border-color: var(--blue); color: var(--blue); }
.ad-pg.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.ad-pg:disabled { color: var(--line-strong); cursor: default; }
.ad-pg-gap { padding: 0 4px; }
.ad-empty { padding: 48px 16px; text-align: center; color: var(--sec); }
.ad-empty p { margin: 0 0 12px; }

/* 方案卡 / 说明 / 代码 */
.ad-desc { margin: 0; padding: 4px 16px 8px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 24px; }
.ad-desc > div { display: grid; grid-template-columns: 88px 1fr; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.ad-desc > div:nth-last-child(-n+3) { border-bottom: 0; }
.ad-desc-wide { grid-column: 1 / -1; }
.ad-desc dt { color: var(--sec); font-size: 12.5px; }
.ad-desc dd { margin: 0; }
.ad-warn { color: var(--amber); }
.ad-table-skills code { font-family: var(--mono); font-size: 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.ad-code { margin: 0; padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.7; overflow-x: auto; color: var(--text); }
.ad-prompts { margin: 0; padding: 8px 16px 8px 36px; }
.ad-prompts li { padding: 6px 0; border-bottom: 1px solid var(--line); color: var(--text); }
.ad-prompts li:last-child { border-bottom: 0; }
.ad-foot { font-size: 11.5px; color: var(--sec); padding-top: 8px; }
.ad-foot a { color: var(--sec); }
.ad-scrim { position: fixed; inset: 0; background: rgb(28 33 40 / .4); z-index: 40; }

/* ---- 响应式：侧栏变抽屉 ---- */
@media (max-width: 1000px) {
  .ad-app { grid-template-columns: 1fr; }
  .ad-side { position: fixed; left: 0; top: 0; bottom: 0; width: 264px; z-index: 50; transform: translateX(-100%); transition: transform .2s ease; }
  .ad-side.open { transform: none; box-shadow: 0 0 0 1px var(--line); }
  .ad-burger { display: block; }
  .ad-kpis { grid-template-columns: 1fr 1fr; }
  .ad-two { grid-template-columns: 1fr; }
  .ad-desc { grid-template-columns: 1fr 1fr; }
  .ad-desc > div:nth-last-child(-n+3) { border-bottom: 1px solid var(--line); }
  .ad-desc > div:last-child { border-bottom: 0; }
}
@media (max-width: 640px) {
  .ad-top { padding: 0 12px; gap: 10px; }
  .ad-crumb { display: none; }
  .ad-search { width: auto; flex: 1; }
  .ad-search kbd { display: none; }
  .ad-avatar, .ad-top-r .ad-btn { display: none; }
  .ad-main { padding: 14px 12px 60px; }
  .ad-desc { grid-template-columns: 1fr; }
  .ad-form select { min-width: 120px; }
}
@media (prefers-reduced-motion: reduce) {
  .ad-side, .ad-btn, .ad-tw::before { transition: none; }
}
