/* ============================================================
   EasyData · 极简设计系统 v2
   浅色暖色系（默认）/ 暖调深色可切换
   图表组件：柱状图 / 横向占比条（结构复刻参考站）
   ============================================================ */

/* ============ 1. Design Tokens ============ */
:root {
  --font-sans: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;

  --radius-s: 6px;
  --radius-m: 8px;
  --radius-l: 12px;

  --space-1: 4px; --space-2: 8px; --space-3: 12px;
  --space-4: 16px; --space-5: 20px; --space-6: 24px;

  --sidebar-w: 232px;
  --topbar-h: 52px;
}

/* 浅色（默认）· 暖色系 */
:root, html[data-theme="light"] {
  color-scheme: light;
  --bg: #faf8f5;
  --panel: #ffffff;
  --panel-hover: #f6f1e9;
  --border: #eae5dd;
  --border-strong: #d9d2c6;
  --text: #292524;
  --text-2: #57534e;
  --text-muted: #a8a29e;
  --accent: #d97706;
  --accent-strong: #b45309;
  --accent-weak: rgba(217, 119, 6, 0.10);
  --accent-text: #b45309;
  --accent-contrast: #ffffff;
  --good: #16a34a;
  --good-weak: rgba(22, 163, 74, 0.10);
  --warn: #d97706;
  --warn-weak: rgba(217, 119, 6, 0.12);
  --bad: #dc2626;
  --bad-weak: rgba(220, 38, 38, 0.08);
  --neutral: #78716c;
  --neutral-weak: rgba(120, 113, 108, 0.12);
  --row-hover: #f7f3ec;
  --shadow: 0 8px 24px rgba(87, 60, 20, 0.08);
  --chart-1: #d97706;
  --chart-1-fill: rgba(217, 119, 6, 0.26);
  --chart-2: #7c2d12;
  --chart-2-fill: rgba(124, 45, 18, 0.30);
  --grid-line: rgba(120, 113, 108, 0.16);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1917;
  --panel: #26211c;
  --panel-hover: #2e2822;
  --border: rgba(231, 213, 188, 0.13);
  --border-strong: rgba(231, 213, 188, 0.26);
  --text: #e7e5e4;
  --text-2: #c9c2b8;
  --text-muted: #8f8880;
  --accent: #fbbf24;
  --accent-strong: #f59e0b;
  --accent-weak: rgba(251, 191, 36, 0.12);
  --accent-text: #fcd34d;
  --accent-contrast: #201a05;
  --good: #34d399;
  --good-weak: rgba(52, 211, 153, 0.12);
  --warn: #fbbf24;
  --warn-weak: rgba(251, 191, 36, 0.12);
  --bad: #f87171;
  --bad-weak: rgba(248, 113, 113, 0.12);
  --neutral: #a8a29e;
  --neutral-weak: rgba(168, 162, 158, 0.14);
  --row-hover: rgba(231, 213, 188, 0.05);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  --chart-1: #fbbf24;
  --chart-1-fill: rgba(251, 191, 36, 0.28);
  --chart-2: #fb923c;
  --chart-2-fill: rgba(251, 146, 60, 0.30);
  --grid-line: rgba(231, 213, 188, 0.12);
}

/* ============ 2. Base ============ */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
svg { display: block; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--text-muted); }
.num { font-variant-numeric: tabular-nums; font-family: var(--font-mono); }

/* ============ 3. 布局：侧栏 / 顶栏 / 内容 ============ */
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 10;
}
.brand {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.brand-logo {
  width: 32px; height: 32px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-m);
  background: var(--accent-weak);
  color: var(--accent-text);
  font-weight: 700; font-size: 16px;
  position: relative; overflow: hidden;
}
.login-logo {
  width: 44px; height: 44px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-m);
  background: var(--accent-weak);
  color: var(--accent-text);
  font-weight: 700; font-size: 22px;
  position: relative; overflow: hidden;
}

/* ---- 品牌 SVG 动画 Logo（数据柱 + 趋势线） ---- */
/* ---- 品牌 SVG 动画 Logo（数据柱 + 趋势线 · 无限循环） ---- */
.ed-logo { display: block; width: 100%; height: 100%; overflow: visible; }
.ed-logo .lg-bar {
  fill: var(--accent); opacity: .85;
  transform-origin: center bottom;
  animation: lgBarCycle 6s ease-in-out infinite;
}
.ed-logo .lg-bar.b2 { animation-delay: .12s; }
.ed-logo .lg-bar.b3 { animation-delay: .24s; }
.ed-logo .lg-trend {
  stroke: var(--accent-strong, var(--accent));
  stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; fill: none;
  stroke-dasharray: 42; stroke-dashoffset: 42;
  animation: lgTrendCycle 6s ease-in-out .25s infinite;
}
.ed-logo .lg-dot {
  fill: var(--accent-strong, var(--accent));
  transform-origin: center; transform-box: fill-box;
  animation: lgDotCycle 6s ease-in-out .5s infinite;
}
@keyframes lgBarCycle {
  0%   { transform: scaleY(0); opacity: 0; }
  10%  { transform: scaleY(1); opacity: .85; }
  80%  { transform: scaleY(1); opacity: .85; }
  94%  { transform: scaleY(0); opacity: 0; }
  100% { transform: scaleY(0); opacity: 0; }
}
@keyframes lgTrendCycle {
  0%   { stroke-dashoffset: 42; opacity: 0; }
  12%  { stroke-dashoffset: 0; opacity: 1; }
  78%  { stroke-dashoffset: 0; opacity: 1; }
  92%  { stroke-dashoffset: 42; opacity: 0; }
  100% { stroke-dashoffset: 42; opacity: 0; }
}
@keyframes lgDotCycle {
  0%   { transform: scale(0); opacity: 0; }
  12%  { transform: scale(1); opacity: 1; }
  78%  { transform: scale(1); opacity: 1; }
  92%  { transform: scale(0); opacity: 0; }
  100% { transform: scale(0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .ed-logo .lg-bar, .ed-logo .lg-trend, .ed-logo .lg-dot { animation: none !important; opacity: .85 !important; transform: none !important; }
  .ed-logo .lg-trend { stroke-dashoffset: 0 !important; opacity: 1 !important; }
}

.brand-name { font-weight: 600; font-size: 14.5px; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--text-muted); }

.nav { flex: 1; padding: var(--space-3); display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-group-label {
  margin: var(--space-4) var(--space-2) var(--space-1);
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.5px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 6px;
}
.nav-group-label:first-child { margin-top: 0; }
.nav-group-label .en { font-size: 10px; opacity: .8; }
.nav-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-2);
  padding: 8px var(--space-3);
  border-radius: var(--radius-s);
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
}
.nav-item:hover { background: var(--panel-hover); color: var(--text); }
.nav-item.active { background: var(--accent-weak); color: var(--accent-text); }
.nav-main { display: flex; align-items: center; gap: 10px; }
.nav-item .en { font-size: 10.5px; color: var(--text-muted); }
.nav-item.active .en { color: var(--accent-text); opacity: .75; }

.sidebar-foot {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}
.ed-version { width: 100%; font-size: 11px; color: var(--text-muted); border-top: 1px dashed var(--border); padding-top: 6px; margin-top: 2px; }
.avatar {
  width: 30px; height: 30px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--accent-weak);
  color: var(--accent-text);
  font-weight: 600; font-size: 13px;
}
.user-meta { flex: 1; min-width: 0; }
.user-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-role { font-size: 11px; color: var(--text-muted); }

.main { margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--space-3);
  padding: 0 var(--space-6);
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 9;
}
.topbar-spacer { flex: 1; }
.crumb { color: var(--text-muted); font-size: 13px; }
.crumb b { color: var(--text); font-weight: 500; }
.content { padding: var(--space-4) var(--space-5); flex: 1; }

/* ============ 4. 页头 ============ */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.page-title { font-size: 19px; font-weight: 600; letter-spacing: 0.2px; }
.page-title .en { font-size: 12.5px; font-weight: 400; color: var(--text-muted); margin-left: 8px; }
.page-desc { font-size: 12.5px; color: var(--text-muted); margin-top: 2px; }
.page-head-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ============ 5. 面板 / 指标卡 ============ */
.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  overflow: hidden;
}
.panel + .panel { margin-top: var(--space-3); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); align-items: start; }
@media (max-width: 1100px) { .grid-2 { grid-template-columns: 1fr; } }
.grid-2 .panel + .panel { margin-top: 0; }
.tabpanel[hidden] { display: none; }
/* 宽表格横向滚动容器：面板圆角裁剪(overflow:hidden)不再吞掉右侧列，操作列始终可达 */
.table-scroll { overflow-x: auto; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.panel-title { font-size: 13.5px; font-weight: 600; }
.panel-title .en { font-size: 11.5px; color: var(--text-muted); font-weight: 400; margin-left: 10px; }
.panel-title .note { font-size: 12px; color: var(--text-muted); font-weight: 400; margin-left: 8px; }
.panel-body { padding: var(--space-4); }

.stat-grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-grid.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-grid.cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
/* 窄屏降列：汇总卡保持可读宽度，防整行撑破页面 */
@media (max-width: 1250px) {
  .stat-grid.cols-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1280px) {
  .stat-grid.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat-grid.cols-7 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .stat-grid, .stat-grid.cols-3, .stat-grid.cols-5, .stat-grid.cols-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: var(--space-2) var(--space-4);
  display: flex; flex-direction: column; gap: 2px;
  min-height: 58px;
}
.stat-num { font-size: 20px; font-weight: 600; line-height: 1.3; }
.stat-label { font-size: 11.5px; color: var(--text-muted); display: flex; justify-content: space-between; align-items: baseline; gap: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 防标签换行导致卡片增高 */
.stat-label .en { font-size: 10.5px; white-space: nowrap; }
.stat-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.stat-delta { font-size: 11px; }
.stat-delta.up { color: var(--good); }
.stat-delta.down { color: var(--bad); }

/* ============ 6. 柱状图（结构复刻参考站 barchart） ============ */
.barchart { display: flex; align-items: flex-start; padding: var(--space-2) var(--space-4) 0; }
.barchart-yaxis { position: relative; flex: none; width: 44px; height: 140px; margin-right: 6px; }
.barchart-yaxis span {
  position: absolute; right: 0; transform: translateY(-50%);
  font-size: 10.5px; line-height: 1; color: var(--text-muted);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.barchart-plot { flex: 1 1 auto; min-width: 0; }
.barchart-grid {
  position: relative; height: 140px;
  background-image: repeating-linear-gradient(
    to top, transparent 0, transparent calc(50% - 1px), var(--grid-line) calc(50% - 1px), var(--grid-line) 50%);
  border-bottom: 1px solid var(--border);
}
.barchart-bars { position: absolute; inset: 0; display: flex; align-items: flex-end; gap: 2px; padding: 0 2px; }
.bbar-group { flex: 1; min-width: 4px; height: 100%; display: flex; align-items: flex-end; justify-content: center; gap: 2px; }
.bbar {
  width: 46%; max-width: 18px; min-width: 3px;
  background: var(--chart-1-fill);
  border-top: 2px solid var(--chart-1);
  border-radius: 2px 2px 0 0;
}
.bbar.s2 { background: var(--chart-2-fill); border-top-color: var(--chart-2); }
.bbar.zero { background: transparent; border-top-color: var(--border); }
.barchart-xaxis { display: flex; gap: 2px; margin-top: 4px; padding: 0 2px; }
.barchart-xaxis span {
  flex: 1; min-width: 4px; text-align: center;
  font-size: 10px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  overflow: hidden; white-space: nowrap;
}
.chart-legend { display: flex; align-items: center; gap: var(--space-4); font-size: 11.5px; color: var(--text-2); }
.chart-legend i {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  margin-right: 5px; vertical-align: -1px;
  background: var(--chart-1-fill); border-top: 2px solid var(--chart-1);
}
.chart-legend i.s2 { background: var(--chart-2-fill); border-top-color: var(--chart-2); }

/* 横向占比条（构成对比） */
.dsload-row { display: flex; align-items: center; gap: var(--space-3); padding: 6px 0; }
.dsload-name { width: 30%; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--text-2); }
.dsload-bar { flex: 1; height: 8px; border-radius: 4px; background: var(--neutral-weak); overflow: hidden; }
.dsload-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.dsload-bar i.s2 { background: var(--chart-2); }
.dsload-value { width: 96px; flex: none; text-align: right; font-size: 12px; color: var(--text-muted); }

/* ============ 7. 表格 ============ */
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  text-align: left; font-weight: 500;
  color: var(--text-muted); font-size: 11.5px;
  padding: 8px var(--space-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
tbody td { padding: 8px var(--space-4); border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: var(--row-hover); }
.td-ops, .th-ops { text-align: right; white-space: nowrap; }
.td-ops .btn + .btn { margin-left: 6px; }
.td-user { font-weight: 500; }
.cell-ellipsis { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 可排序表头 */
.th-sort { cursor: pointer; user-select: none; }
.th-sort:hover { color: var(--text-2); }
.th-sort .sort-ind { margin-left: 3px; font-size: 8.5px; opacity: .55; }
.th-sort.sorted .sort-ind { opacity: 1; color: var(--accent-text); }

/* ============ 8. 标签 / 徽标 / 关键字 ============ */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  white-space: nowrap;
}
.tag + .tag { margin-left: 4px; }
.tag-good { background: var(--good-weak); color: var(--good); }
.tag-bad { background: var(--bad-weak); color: var(--bad); }
.tag-warn { background: var(--warn-weak); color: var(--warn); }
.tag-accent { background: var(--accent-weak); color: var(--accent-text); }
.tag-neutral { background: var(--neutral-weak); color: var(--neutral); }

.plat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; color: var(--text-2); white-space: nowrap;
}
.plat i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.plat.meta i { background: #0866ff; }
.plat.tiktok i { background: #111; box-shadow: inset 0 0 0 1px rgba(255,255,255,.35); }
html[data-theme="dark"] .plat.tiktok i { background: #eee; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--accent-weak); color: var(--accent-text);
  border-radius: 999px; padding: 1px 4px 1px 9px;
  font-size: 11.5px; white-space: nowrap;
}
.chip button {
  border: none; background: transparent; color: inherit;
  cursor: pointer; font-size: 13px; line-height: 1; padding: 1px 5px; border-radius: 50%;
  font-family: inherit;
}
.chip button:hover { background: rgba(0,0,0,.08); }
.chip + .chip { margin-left: 4px; }

/* ============ 9. 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-m);
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--panel-hover); border-color: var(--border-strong); color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); font-weight: 500; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--accent-contrast); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; font-weight: 500; }
.btn-danger:hover { filter: brightness(1.08); background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger-text { background: transparent; border-color: transparent; color: var(--bad); }
.btn-danger-text:hover { background: var(--bad-weak); border-color: transparent; color: var(--bad); }
.btn-sm { padding: 3px 10px; font-size: 12px; border-radius: var(--radius-s); }
.btn-block { width: 100%; padding: 9px 0; font-size: 13.5px; }
.btn[disabled] { opacity: .4; cursor: not-allowed; pointer-events: none; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: transparent; color: var(--text-2);
  cursor: pointer; font-size: 14px; font-family: inherit;
}
.icon-btn:hover { background: var(--panel-hover); color: var(--text); }

/* ============ 10. 表单 ============ */
.input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--text-muted); }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.input[disabled] { opacity: .6; cursor: not-allowed; }
select.input { cursor: pointer; }
.input-search { width: 200px; }
.input-inline { width: auto; }
.input-row { display: flex; gap: var(--space-2); }
.input-row .btn { flex: none; }

.field { margin-bottom: var(--space-4); }
.field > label { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px; }
.field-error { font-size: 12px; color: var(--bad); margin-top: 4px; min-height: 18px; } /* 预留空间：出现时不位移 */
.hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; cursor: pointer; }
.checkbox-row input { width: 14px; height: 14px; accent-color: var(--accent); cursor: pointer; }
.checkbox-row[disabled], .checkbox-row input[disabled] { cursor: not-allowed; opacity: .6; }

.chips-box {
  display: flex; flex-wrap: wrap; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--bg); padding: 6px 8px; min-height: 34px;
}
.chips-box .chip { background: var(--accent-weak); }
.chips-box .chips-placeholder { color: var(--text-muted); font-size: 12px; align-self: center; }

/* 筛选栏 · 统一规范 v2
   结构：<div class="filter-bar" data-visible="N">（第 N 项之后自动折叠，由 EDUI.initFilterBars 处理）
   顺序：基础搜索(.f-search) → 高频维度 → 低频维度（折叠） → 行尾主操作按钮 */
.filter-bar { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; margin-bottom: var(--space-3); }
.filter-bar:last-child { margin-bottom: 0; }
.filter-bar > label { font-size: 12px; color: var(--text-muted); white-space: nowrap; flex: none; }
.filter-bar > .input { width: 150px; }               /* 下拉 / 日期统一宽度 */
.filter-bar > .input.w-lg { width: 190px; }          /* 长文本维度（账户 / 线路） */
.filter-bar > .input.w-sm { width: 110px; }
/* 基础搜索框：全列表页必备，placeholder 统一「搜索 A / B / C」 */
.filter-bar > .f-search {
  width: 240px; padding-left: 28px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23a8a29e' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.3-4.3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 9px center;
}
/* 折叠区与切换按钮（EDUI.initFilterBars 注入） */
.filter-bar > .f-extra { display: contents; }
.filter-bar > .f-extra[hidden] { display: none; }
.filter-bar > .f-more {
  flex: none; border: 1px solid var(--border); border-radius: var(--radius-s);
  background: var(--panel); color: var(--text-2);
  font-size: 12px; font-family: inherit; padding: 6px 10px; cursor: pointer;
}
.filter-bar > .f-more:hover { background: var(--panel-hover); color: var(--text); }
.filter-bar > .btn, .filter-bar > .seg { flex: none; }
.filter-bar .f-spacer { flex: 1 1 auto; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-m); overflow: hidden; }
.seg button {
  border: none; background: var(--panel); color: var(--text-2);
  font-size: 12px; padding: 6px 12px; cursor: pointer; font-family: inherit;
  border-right: 1px solid var(--border);
}
.seg button:last-child { border-right: none; }
.seg button:hover { background: var(--panel-hover); }
.seg button.on { background: var(--accent-weak); color: var(--accent-text); font-weight: 500; }

/* ============ 11. 弹窗 ============ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(41, 37, 36, .45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .12s ease;
}
.modal {
  width: 440px; max-width: 92vw; max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow);
  animation: popIn .14s ease;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 14.5px; font-weight: 600; }
.modal-x { border: none; background: transparent; color: var(--text-muted); font-size: 18px; cursor: pointer; line-height: 1; padding: 2px 6px; }
.modal-x:hover { color: var(--text); }
.modal-body { padding: var(--space-4); overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border-top: 1px solid var(--border);
}
.confirm-text { font-size: 13px; color: var(--text-2); }

/* 同步日志 */
.sync-log {
  font-family: var(--font-mono); font-size: 12px; line-height: 1.8;
  background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-m);
  padding: 10px 12px; height: 200px; overflow-y: auto; /* 固定高度常驻：日志出现不位移 */
  white-space: normal; word-break: break-all;
}
.sync-log:empty::before { content: "日志将在此显示"; color: var(--text-muted); }
.sync-log .ok { color: var(--good); }
.sync-log .err { color: var(--bad); }
.sync-log .dim { color: var(--text-muted); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: scale(1); } }

/* ============ 12. Toast / 空状态 / 加载 ============ */
.toast-root {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2);
}
.toast {
  padding: 8px 16px;
  background: var(--panel);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  color: var(--text);
  animation: toastIn .18s ease;
  max-width: 80vw;
}
.toast-success { border-color: var(--good); color: var(--good); }
.toast-error { border-color: var(--bad); color: var(--bad); }
.toast-out { opacity: 0; transition: opacity .25s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-6) 0; color: var(--text-muted); font-size: 12.5px; }
.loading { display: flex; align-items: center; justify-content: center; gap: var(--space-2); padding: var(--space-6); color: var(--text-muted); font-size: 12.5px; }
.loading::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid var(--border-strong); border-top-color: var(--accent);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 占比条（表格内） */
.share-bar { display: flex; align-items: center; gap: 8px; min-width: 120px; }
.share-bar .track { flex: 1; height: 4px; border-radius: 2px; background: var(--neutral-weak); overflow: hidden; }
.share-bar .track i { display: block; height: 100%; background: var(--accent); border-radius: 2px; }
.share-bar .pct { font-size: 11.5px; color: var(--text-muted); width: 44px; text-align: right; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 分页器 ---------- */
.pager { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); flex-wrap: wrap; }
.pager-btns { display: flex; gap: 4px; align-items: center; }
.pager-btns button { min-width: 28px; height: 26px; padding: 0 6px; border: 1px solid var(--border); background: var(--panel); border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text); }
.pager-btns button:hover:not(:disabled):not(.on) { border-color: var(--accent); color: var(--accent-text); }
.pager-btns button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }
.pager-btns button:disabled { opacity: .4; cursor: default; }
.pager-gap { padding: 0 2px; }

/* ---------- 帮助中心抽屉 ---------- */
.help-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 890; }
.help-drawer { position: fixed; top: 0; right: 0; height: 100vh; width: min(640px, 94vw); background: var(--panel); z-index: 900; box-shadow: -8px 0 28px rgba(0,0,0,.18); display: flex; flex-direction: column; }
.help-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.help-title { font-size: 15px; font-weight: 700; }
.help-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }
.help-wrap { flex: 1; display: flex; min-height: 0; }
.help-catalog { width: 190px; flex: none; border-right: 1px solid var(--border); overflow-y: auto; padding: 10px 8px; }
.help-group { font-size: 11px; color: var(--text-muted); padding: 8px 8px 4px; letter-spacing: .5px; }
.help-item { display: block; width: 100%; text-align: left; border: 0; background: transparent; padding: 7px 10px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13px; }
.help-item b { display: block; font-weight: 600; }
.help-item i { display: block; font-style: normal; font-size: 11.5px; color: var(--text-muted); margin-top: 1px; }
.help-item:hover { background: var(--panel-hover); }
.help-item.on { background: var(--accent-weak); color: var(--accent-text); }
.help-content { flex: 1; overflow-y: auto; padding: 16px 20px; font-size: 13px; line-height: 1.75; color: var(--text); }
.help-content h3 { font-size: 16px; margin: 4px 0 12px; }
.help-content h4 { font-size: 13.5px; margin: 14px 0 6px; color: var(--accent-text); }
.help-content ul { margin: 4px 0 10px; padding-left: 18px; }
.help-content li { margin: 3px 0; }
.help-foot { margin-top: 18px; padding-top: 8px; border-top: 1px dashed var(--border); font-size: 11.5px; color: var(--text-muted); }
.help-none { color: var(--text-muted); padding: 30px 10px; text-align: center; }
