:root {
  color-scheme: dark;
  --bg: #0b0a08;
  --panel: #14110d;
  --panel-2: #1a1610;
  --line: #2a2318;
  --text: #f0eae0;
  --muted: #c2b9ac;
  --accent: #c8956a;
  --accent-2: #e6bc8f;
  --ok: #9ccfa3;
  --warn: #d9c08a;
  --danger: #e0684b;
  --shadow: 0 0.6rem 1.8rem rgba(0, 0, 0, 0.28);
  --radius: 0.85rem;
  --gap: clamp(0.65rem, 1.2vw, 1rem);
  --gap-lg: clamp(0.85rem, 1.6vw, 1.25rem);
  --pad: clamp(0.85rem, 1.5vw, 1.15rem);
  --pad-lg: clamp(1rem, 2vw, 1.4rem);
  --sider-w: clamp(12rem, 16vw, 14.5rem);
  --main-pad-x: clamp(3%, 3.5vw, 2rem);
  --main-pad-y: clamp(1rem, 2vw, 1.5rem);
  --fs-xs: clamp(0.7rem, 0.9vw, 0.75rem);
  --fs-sm: clamp(0.75rem, 1vw, 0.8125rem);
  --fs-md: clamp(0.8125rem, 1.1vw, 0.875rem);
  --fs-lg: clamp(0.95rem, 1.4vw, 1.05rem);
  --fs-xl: clamp(1.15rem, 2vw, 1.45rem);
  --fs-stat: clamp(1.15rem, 2.2vw, 1.5rem);
}

[data-theme="light"] {
  --bg: #f5f0e8;
  --panel: #fdfaf5;
  --panel-2: #f3ebe1;
  --line: #e2d9c9;
  --text: #241c11;
  --muted: #807769;
  --accent: #a87850;
  --accent-2: #8a6238;
  --ok: #4f7d57;
  --warn: #9a7a3c;
  --danger: #b5472f;
  --shadow: 0 0.5rem 1.4rem rgba(15, 34, 58, 0.10);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "IBM Plex Sans", "Noto Sans SC", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(60% 40% at 8% -8%, rgba(200, 149, 106, 0.10) 0%, transparent 55%),
    radial-gradient(45% 35% at 100% 0%, rgba(168, 120, 80, 0.08) 0%, transparent 50%),
    var(--bg);
  -webkit-tap-highlight-color: transparent;
}

html, body, #root { height: 100%; }
html, body { overflow: hidden; }
#root { min-height: 0; overflow: hidden; }
body.has-site-copyright .login-scene {
  height: 96%;
  min-height: 0;
}
body:has(.layout) .site-copyright { left: 16%; }
body.sider-collapsed:has(.layout) .site-copyright { left: 5%; }
.site-copyright {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  height: 4%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
  background: rgba(11, 10, 8, 0.94);
  border-top: 1px solid var(--line);
}
[data-theme="light"] .site-copyright {
  background: rgba(253, 250, 245, 0.96);
}
body.has-site-copyright #global-float-nav { bottom: 52px !important; }
.boot {
  min-height: 100vh; min-height: 100dvh; display: grid; place-items: center;
  color: var(--muted); font-size: var(--fs-md);
}

.layout {
  display: grid;
  grid-template-columns: 16% minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}
.layout > .sider,
.layout > .workarea {
  min-height: 0;
  max-height: 100%;
}
.mobile-topbar,
.nav-backdrop { display: none; }

.sider {
  position: relative;
  top: auto;
  height: 100%;
  min-height: 0;
  width: 100%;
  background: rgba(18, 15, 12, 0.92);
  border-right: 1px solid var(--line);
  padding: var(--pad-lg) clamp(0.6rem, 1vw, 0.9rem);
  padding-bottom: max(var(--pad-lg), env(safe-area-inset-bottom));
  display: flex; flex-direction: column;
  backdrop-filter: blur(8px);
  /* 侧栏整体不滚动：顶栏/底栏固定，仅导航区滚动，避免展开后底部被遮挡 */
  overflow: hidden;
  min-width: 0;
}
.brand {
  font-size: var(--fs-lg); font-weight: 700; letter-spacing: 0.02em;
  margin: 0.25rem 0.5rem 1.25rem;
}
.brand span { color: var(--accent); }
.brand-mark {
  display: flex;
  align-items: center;
  gap: 8%;
  width: 100%;
  margin: 2% 0 6%;
}
.brand-ico-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: linear-gradient(145deg, rgba(200,149,106,0.35), rgba(200,149,106,0.08));
  border: 1px solid rgba(200,149,106,0.4);
  color: var(--accent-2);
  flex: 0 0 auto;
}
.brand-text { min-width: 0; line-height: 1.2; }
.brand-seal {
  width: 22%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, #e6bc8f, #c8956a);
  color: #1c140e;
}
.brand-name {
  display: block;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.12em;
  white-space: nowrap;
}
.workarea {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  height: 52px;
  padding: 0 clamp(14px, 1.6vw, 24px);
  background: rgba(11, 10, 8, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}
[data-theme="light"] .topbar { background: rgba(253, 250, 245, 0.94); }
.tb-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}
.tb-crumb-root {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--muted);
}
.tb-crumb-page { color: var(--text); font-weight: 650; }
.tb-crumb-sep { flex: none; opacity: 0.5; }
.tb-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.tb-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 6px 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--field, #1c1814);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  min-width: 200px;
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.tb-search:hover {
  border-color: rgba(200, 149, 106, 0.45);
  color: var(--text);
}
.tb-search-label { flex: 1; text-align: left; }
.tb-kbd {
  font-family: inherit;
  font-size: 11px;
  line-height: 1;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  color: var(--muted);
}
.tb-icon-btn,
.theme-toggle.tb-icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text-2, var(--text));
  cursor: pointer;
  position: relative;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease;
}
.tb-icon-btn:hover {
  border-color: rgba(200, 149, 106, 0.45);
  background: rgba(200, 149, 106, 0.08);
  color: var(--accent-2);
}
.tb-user {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 3px 12px 3px 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 246, 232, 0.02);
}
[data-theme="light"] .tb-user { background: rgba(36, 28, 17, 0.03); }
.tb-avatar,
.user-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(145deg, #e6bc8f, #c8956a);
  color: #241a10;
  font-size: 12px;
  font-weight: 700;
}
.sider-foot .user-avatar { width: 30px; height: 30px; }
.tb-user-name {
  max-width: 8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  color: var(--text-2, var(--text));
}
.tb-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
  font-weight: 700;
}
.user-card {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 246, 232, 0.02);
}
[data-theme="light"] .user-card { background: rgba(36, 28, 17, 0.03); }
.user-meta { min-width: 0; flex: 1; }
.user-name,
.user-status {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-name { font-size: 13px; font-weight: 650; }
.user-status { font-size: 11px; color: var(--muted); }
.user-logout {
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}
.user-logout:hover {
  color: var(--danger);
  background: rgba(224, 113, 79, 0.12);
}
body.has-site-copyright .main {
  padding-bottom: 6%;
}
.nav-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding-right: 0.15rem;
  scrollbar-gutter: stable;
}
.nav-group::-webkit-scrollbar { width: 6px; }
.nav-group::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: 999px;
}
.nav-btn {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--muted); padding: 0.65rem 0.75rem; border-radius: 0.65rem;
  cursor: pointer; font: inherit; transition: background 0.15s ease, color 0.15s ease;
}
.nav-btn:hover { background: #211c14; color: var(--text); }
.nav-btn.active {
  background: linear-gradient(90deg, rgba(200,149,106,0.22), rgba(200,149,106,0.05));
  color: #fff; box-shadow: inset 0.2rem 0 0 var(--accent);
}
.nav-btn .badge {
  margin-left: auto; min-width: 1.1rem; height: 1.1rem; padding: 0 0.35rem;
  border-radius: 999px; background: var(--danger); color: #fff;
  font-size: var(--fs-xs); line-height: 1.1rem; text-align: center;
}
.nav-tree { display: flex; flex-direction: column; gap: 0.15rem; }
.nav-group-head {
  display: flex; align-items: center; gap: 0.5rem;
  width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--muted); padding: 0.65rem 0.75rem; border-radius: 0.65rem;
  cursor: pointer; font: inherit; font-weight: 600; transition: 0.15s ease;
}
.nav-group-head:hover { background: #221c13; color: var(--text); }
.nav-group-head.open { color: var(--text); }
.nav-chev { font-size: var(--fs-xs); color: var(--muted); width: 0.75rem; text-align: center; flex: 0 0 auto; margin-left: auto; }
.nav-group-label { letter-spacing: 0.02em; flex: 1; min-width: 0; text-align: left; }
.nav-ico-slot {
  width: 1.125rem;
  height: 1.125rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}
.nav-leaf { padding-left: 1.65rem; font-size: var(--fs-sm); color: var(--muted); }
.nav-children {
  display: grid;
  grid-template-rows: 0fr;
  opacity: 0;
  transition: grid-template-rows 0.2s ease, opacity 0.15s ease;
  pointer-events: none;
}
.nav-children-inner {
  overflow: hidden;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.nav-children.open {
  grid-template-rows: 1fr;
  opacity: 1;
  pointer-events: auto;
}
.nav-leaf:hover { background: #221c13; color: var(--text); }
.nav-leaf.active {
  background: linear-gradient(90deg, rgba(200,149,106,0.22), rgba(200,149,106,0.05));
  color: #fff; box-shadow: inset 0.2rem 0 0 var(--accent);
}
.sider-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  flex: 0 0 auto;
}
.sider-top .brand { margin: 0.25rem 0.35rem; flex: 1; min-width: 0; }
.sider-collapse-btn {
  flex: 0 0 auto;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--line);
  border-radius: 0.55rem;
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  line-height: 1;
}
.sider-collapse-btn:hover { color: var(--text); border-color: var(--accent); }

/* 桌面端折叠整个侧栏 */
body.sider-collapsed .layout {
  grid-template-columns: 5% minmax(0, 1fr);
}
body.sider-collapsed .sider {
  padding-left: 0.4rem;
  padding-right: 0.4rem;
  overflow: hidden;
}
body.sider-collapsed .sider .brand-text,
body.sider-collapsed .sider .nav-group-label,
body.sider-collapsed .sider .user,
body.sider-collapsed .sider .lang-switch,
body.sider-collapsed .sider .sider-foot .btn {
  display: none;
}
body.sider-collapsed .sider .brand-mark {
  justify-content: center;
  margin: 0.2rem 0 0.65rem;
}
body.sider-collapsed .sider .nav-children { display: none !important; }
body.sider-collapsed .sider .nav-btn {
  justify-content: center;
  padding: 0.65rem 0.35rem;
}
body.sider-collapsed .sider .nav-chev { margin: 0; }
body.sider-collapsed .sider-top { justify-content: center; }
body.sider-collapsed .sider-collapse-btn { width: 100%; }

.sider-foot {
  margin-top: auto;
  flex: 0 0 auto;
  height: auto;
  padding: 3% 2% 2%;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  background: var(--panel, #14110d);
}
.sider-foot .user { font-size: var(--fs-sm); color: var(--muted); margin-bottom: 0; }

@media (max-width: 980px) {
  body.sider-collapsed .layout { grid-template-columns: 1fr; }
  body.sider-collapsed .sider {
    /* 移动端抽屉不受桌面折叠影响 */
    padding: var(--pad-lg) clamp(0.6rem, 1vw, 0.9rem);
  }
  body.sider-collapsed .sider .brand-text,
  body.sider-collapsed .sider .nav-group-label,
  body.sider-collapsed .sider .user,
  body.sider-collapsed .sider .lang-switch,
  body.sider-collapsed .sider .sider-foot .btn {
    display: initial;
  }
  body.sider-collapsed .sider .nav-children.open { display: grid !important; }
  .sider-collapse-btn { display: none; }
}

.main {
  padding: var(--main-pad-y) var(--main-pad-x);
  padding-bottom: max(var(--main-pad-y), env(safe-area-inset-bottom));
  width: 100%;
  max-width: 100%;
  min-width: 0;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
}
.page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
  width: 100%;
  min-width: 0;
  animation: fadeUp 0.22s ease both;
}
.page-head {
  display: flex; justify-content: space-between; align-items: flex-end;
  gap: var(--gap); margin: 0; flex-wrap: wrap;
  width: 100%;
  position: relative;
  padding-left: 0;
}
.page-head.has-icon::before { display: none; }
.page-head-copy {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  flex: 1;
  min-width: 0;
}
.page-head-icon {
  flex: 0 0 auto;
  width: 2.65rem;
  height: 2.65rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  background: linear-gradient(145deg, rgba(200,149,106,0.28), rgba(200,149,106,0.06));
  border: 1px solid rgba(200,149,106,0.35);
  color: var(--accent-2);
  box-shadow: 0 8px 20px rgba(200,149,106,0.12);
}
.page-head-text { min-width: 0; flex: 1; }
.page-head::before {
  content: '';
  position: absolute; left: 0; top: 0.15rem; bottom: 0.15rem;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(200,149,106,0.25));
}
.page-head:not(.has-icon) { padding-left: 0.85rem; }
.page-head h1 {
  margin: 0; font-size: var(--fs-xl); font-weight: 700;
  font-family: Sora, "IBM Plex Sans", "Noto Sans SC", sans-serif;
  letter-spacing: -0.02em;
}
.page-head p { margin: 0.35rem 0 0; color: var(--muted); font-size: var(--fs-sm); }

.ico {
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -0.2em;
  opacity: 0.92;
}
.nav-btn .ico { opacity: 0.75; }
.nav-btn .nav-label { flex: 1; min-width: 0; text-align: left; }
.nav-btn:hover .ico,
.nav-btn.active .ico { opacity: 1; }
.nav-btn {
  transition: background 0.18s ease, color 0.18s ease, transform 0.15s ease;
}
.nav-btn:active:not(:disabled) { transform: scale(0.985); }
.nav-chev {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1rem; transition: transform 0.2s ease;
}
.nav-group-head.open .nav-chev { transform: rotate(0deg); }
.nav-group-head:not(.open) .nav-chev { transform: rotate(-90deg); }

.btn-has-ico {
  display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-ico { opacity: 0.95; }

button.btn {
  background: var(--accent); color: #fff; border: 0; border-radius: 9px;
  padding: 8px 14px; cursor: pointer; font: inherit; font-weight: 600;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease,
    transform 0.12s ease, box-shadow 0.18s ease, filter 0.18s ease;
}
button.btn:hover { background: var(--accent-2); }
button.btn:active:not(:disabled) { transform: translateY(1px); }
button.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
button.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.btn.ghost:hover { border-color: var(--accent); color: #fff; }
button.btn.danger { background: var(--danger); }
button.btn.sm { padding: 5px 10px; font-size: 12px; }

.stat {
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.28s ease both;
}
.stats .stat:nth-child(1) { animation-delay: 0.02s; }
.stats .stat:nth-child(2) { animation-delay: 0.05s; }
.stats .stat:nth-child(3) { animation-delay: 0.08s; }
.stats .stat:nth-child(4) { animation-delay: 0.11s; }
.stats .stat:nth-child(5) { animation-delay: 0.14s; }
.stats .stat:nth-child(6) { animation-delay: 0.17s; }
.stat:hover {
  border-color: rgba(200,149,106,0.40);
  box-shadow: 0 0.5rem 1.2rem rgba(0,0,0,0.28);
}

.card {
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.table-wrap tbody tr {
  transition: background 0.15s ease;
}
.table-wrap tbody tr:hover td {
  background: rgba(200,149,106,0.08);
}

.empty-rich {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 0.65rem; padding: 2rem 1rem; text-align: center;
}
.empty-rich .empty-ico { opacity: 0.45; color: var(--muted); }
.empty-rich p { margin: 0; color: var(--muted); }

.toast {
  display: flex; align-items: flex-start; gap: 0.5rem;
  pointer-events: auto; min-width: 240px; max-width: 420px;
  background: #1d1812; border: 1px solid var(--line); color: var(--text);
  border-radius: 10px; padding: 10px 12px; box-shadow: var(--shadow);
  font-size: 13px; animation: slide-in 0.2s ease;
}
.toast .ico { margin-top: 0.1rem; flex-shrink: 0; }
.toast.ok { border-color: rgba(62,207,142,0.45); }
.toast.ok .ico { color: var(--ok); }
.toast.err { border-color: rgba(243,18,96,0.45); }
.toast.err .ico { color: var(--danger); }
.toast.warn { border-color: rgba(245,165,36,0.45); }
.toast.warn .ico { color: var(--warn); }

.modal-backdrop,
.modal-panel {
  animation: fadeUp 0.18s ease both;
}

@media (prefers-reduced-motion: reduce) {
  .page-stack,
  .stat,
  .toast,
  .modal-backdrop,
  .modal-panel,
  .loading-bar {
    animation: none !important;
  }
  .nav-btn,
  button.btn,
  .stat,
  .card,
  .nav-chev,
  .table-wrap tbody tr {
    transition: none !important;
  }
  button.btn:active:not(:disabled),
  .nav-btn:active:not(:disabled) {
    transform: none !important;
  }
}

/* 统一流体栅格 */
.u-grid {
  display: grid;
  gap: var(--gap);
  width: 100%;
  align-items: stretch;
}
.u-grid > * { min-width: 0; min-height: 0; }
.u-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.u-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.u-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.u-grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.u-grid-auto {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
  gap: var(--gap);
  margin: 0;
  width: 100%;
  align-items: stretch;
}
.stats.stats-6 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
}
.stat {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad); box-shadow: var(--shadow);
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 0.35rem;
  height: 100%;
  min-width: 0;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  animation: fadeUp 0.28s ease both;
}
.stat.accent {
  background: linear-gradient(145deg, rgba(200,149,106,0.18), rgba(20,17,13,0.95));
  border-color: rgba(200,149,106,0.40);
}
.stat .k { color: var(--muted); font-size: var(--fs-xs); line-height: 1.3; }
.stat .v {
  margin: 0; font-size: var(--fs-stat); font-weight: 700;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  line-height: 1.15; word-break: break-word;
}
.stat .v.warn { color: var(--warn); }
.stat .v.ok { color: var(--ok); }
.stat .v.danger { color: var(--danger); }
.stat-foot {
  margin-top: auto; padding-top: 0.25rem;
  font-size: var(--fs-xs); color: var(--muted); line-height: 1.35;
}

.dash-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--gap-lg);
  align-items: center;
  margin: 0;
  padding: var(--pad-lg);
  border-radius: calc(var(--radius) + 0.15rem);
  border: 1px solid rgba(200,149,106,0.25);
  background:
    linear-gradient(120deg, rgba(200,149,106,0.14), transparent 42%),
    linear-gradient(180deg, #191410, #100d0a);
  box-shadow: var(--shadow);
  width: 100%;
}
.dash-eyebrow {
  font-size: var(--fs-xs); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent-2); font-weight: 600; margin-bottom: 0.35rem;
}
.dash-hero h2 {
  margin: 0; font-family: "Sora", "IBM Plex Sans", sans-serif;
  font-size: clamp(1.25rem, 2.4vw, 1.65rem); font-weight: 700;
}
.dash-hero-copy { min-width: 0; }
.dash-hero-copy p { margin: 0.45rem 0 0; }
.dash-hero-actions {
  display: flex; gap: 0.5rem; flex-wrap: wrap;
  justify-content: flex-end; align-items: center;
}
.dash-hero-actions .btn { flex: 0 1 auto; white-space: nowrap; }

/* 国内/国际/合并站点卡 */
.dash-site-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  width: 100%;
  align-items: stretch;
}
.dash-site-block {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  height: 100%;
  margin: 0 !important;
  min-width: 0;
}
.dash-site-block h2 { margin: 0; flex-wrap: wrap; }
.dash-site-note {
  min-height: 1.35rem;
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--muted);
  line-height: 1.35;
}
.dash-site-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  flex: 1;
  align-content: stretch;
}
.dash-site-metrics .stat {
  box-shadow: none;
  padding: 0.7rem 0.75rem;
  background: var(--panel-2);
}
.dash-site-metrics .stat .v { font-size: clamp(1rem, 1.8vw, 1.25rem); }

.grid-2, .u-grid-2.dash-charts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  width: 100%;
  align-items: stretch;
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--gap);
  width: 100%;
  align-items: stretch;
}
.dash-charts .chart-card {
  margin: 0 !important;
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: clamp(14rem, 28vh, 18rem);
}
.dash-charts .chart-card > :last-child { flex: 1; min-height: 0; }

.chart-row, .type-grid {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  gap: var(--gap);
  align-items: center;
  width: 100%;
}
.donut-wrap {
  position: relative;
  width: 70%;
  max-width: 11rem;
  aspect-ratio: 1;
  margin: 0 auto;
  flex: 0 0 auto;
}
.chart-donut { display: block; width: 100%; height: auto; }
.donut-seg { transition: stroke-dasharray 0.6s ease; }
.donut-center {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
  pointer-events: none;
}
.donut-num {
  font-family: "Sora", sans-serif; font-size: clamp(1.1rem, 2.2vw, 1.5rem);
  font-weight: 700; line-height: 1.1;
}
.donut-label { font-size: var(--fs-xs); color: var(--muted); margin-top: 0.15rem; }
.legend { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; width: 100%; }
.legend-item { display: flex; align-items: center; gap: 0.5rem; font-size: var(--fs-sm); min-width: 0; }
.legend-item span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend-item .dot {
  width: 0.65rem; height: 0.65rem; border-radius: 50%; flex: 0 0 auto;
}

.hbar-chart { display: flex; flex-direction: column; gap: 0.65rem; width: 100%; }
.hbar-row {
  display: grid; grid-template-columns: 22% minmax(0, 1fr) 18%; gap: 0.5rem; align-items: center;
  animation: fadeUp 0.35s ease both; animation-delay: calc(var(--i, 0) * 40ms);
}
.hbar-label {
  font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hbar-track {
  height: 0.55rem; border-radius: 999px; background: var(--field, #1c1814); overflow: hidden;
  border: 1px solid var(--line); width: 100%;
}
.hbar-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, #e6bc8f, #c8956a);
  transition: width 0.55s ease;
}
.hbar-val { font-size: var(--fs-xs); font-weight: 600; text-align: right; font-family: "Sora", sans-serif; }
.hbar-sub { display: none; }

.compare-bars {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: end;
  justify-items: center;
  gap: 4%;
  min-height: clamp(9rem, 22vh, 12rem);
  padding: 0.75rem 2% 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.compare-col {
  display: flex; flex-direction: column; align-items: center; gap: 0.45rem;
  width: 100%; max-width: 5.5rem;
}
.compare-bar-track {
  width: 45%;
  max-width: 3rem;
  height: clamp(6rem, 16vh, 8.5rem);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.compare-bar {
  width: 100%;
  border-radius: 0.75rem 0.75rem 0.35rem 0.35rem;
  transition: height 0.55s ease;
  min-height: 8%;
}
.compare-bar.last {
  background: linear-gradient(180deg, #c2b9ac, #6f6256);
}
.compare-bar.this {
  background: linear-gradient(180deg, #e6bc8f, #c8956a);
  box-shadow: 0 0.5rem 1.2rem rgba(200,149,106,0.28);
}
.compare-amt { font-family: "Sora", sans-serif; font-weight: 700; font-size: var(--fs-sm); text-align: center; }
.compare-name { font-size: var(--fs-xs); color: var(--muted); text-align: center; }
.compare-mid { text-align: center; align-self: center; padding-bottom: 8%; }
.compare-delta { font-family: "Sora", sans-serif; font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 700; }
.compare-delta.up { color: var(--ok); }
.compare-delta.down { color: var(--danger); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(0.4rem); }
  to { opacity: 1; transform: none; }
}

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--pad);
  margin: 0 0 var(--gap);
  box-shadow: var(--shadow);
  width: 100%;
  min-width: 0;
}
.page-stack > .card,
.page-stack > .dash-site-grid,
.page-stack > .stats,
.page-stack > .grid-2,
.page-stack > .grid,
.page-stack > .dash-hero,
.page-stack > .subtabs,
.page-stack > .rebate-body,
.page-stack > .channel-grid,
.page-stack > .callout,
.page-stack > .page-tab-body,
.page-stack > .stack,
.stack > .card,
.dash-site-grid > .card,
.dash-charts > .card {
  margin-bottom: 0;
}
.card h2 {
  margin: 0 0 0.75rem; font-size: var(--fs-md); font-weight: 600;
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.card h2 .hint { color: var(--muted); font-weight: 400; font-size: var(--fs-xs); }

.toolbar {
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
  margin-bottom: 0.75rem;
  width: 100%;
}
.toolbar > input,
.toolbar > select {
  flex: 1 1 30%;
  min-width: 0;
  max-width: 100%;
}
.row {
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
  margin-bottom: 0.6rem;
  width: 100%;
}

input, select, textarea {
  background: var(--field, #1c1814); border: 1px solid var(--line); color: var(--text);
  border-radius: 9px; padding: 9px 11px; min-width: 0; font: inherit;
  max-width: 100%;
}
input:focus, select:focus, textarea:focus {
  outline: 1px solid rgba(200,149,106,0.55); border-color: var(--accent);
}
input[type="search"] { min-width: 0; flex: 1 1 180px; }
textarea { width: 100%; min-height: 88px; resize: vertical; }

.table-wrap {
  overflow: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); min-width: 100%; }
@media (min-width: 721px) {
  table { min-width: min(100%, 36rem); }
}
th, td {
  border-bottom: 1px solid var(--line); padding: 11px 10px;
  text-align: left; vertical-align: top;
}
th {
  color: var(--muted); font-weight: 600; background: var(--panel-2);
  position: sticky; top: 0; z-index: 1;
}
tr:hover td { background: rgba(255,255,255,0.02); }
td .sub { color: var(--muted); font-size: 12px; margin-top: 3px; }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px;
  background: rgba(200,149,106,.10); border:1px solid rgba(200,149,106,.22); color: var(--text-2, var(--muted)); white-space: nowrap;
}
.tag.warn { background: rgba(245,165,36,.15); color: var(--warn); }
.tag.crit { background: rgba(243,18,96,.15); color: var(--danger); }
.tag.ok { background: rgba(62,207,142,.15); color: var(--ok); }

.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); margin-top: 8px; font-size: 13px; }
.empty {
  padding: 28px 12px; text-align: center; color: var(--muted); font-size: 13px;
}

/* —— Login —— */
.login-scene {
  height: 100%;
  min-height: 0;
  position: relative;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 48px;
  isolation: isolate;
}
.login-scene::before,
.login-scene::after {
  content: "";
  position: absolute;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(42% 36% at 18% 22%, rgba(230, 188, 143, 0.16), transparent 70%),
    radial-gradient(38% 34% at 82% 18%, rgba(200, 149, 106, 0.22), transparent 68%),
    radial-gradient(50% 40% at 70% 88%, rgba(96, 165, 250, 0.08), transparent 70%),
    var(--bg);
  animation: login-drift 18s ease-in-out infinite alternate;
}
.login-scene::after {
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(232, 238, 247, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(232, 238, 247, 0.035) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 78%);
  animation: login-grid 28s linear infinite;
  opacity: 0.7;
}
@keyframes login-drift {
  from { transform: translate3d(-1.5%, -1%, 0) scale(1.02); }
  to { transform: translate3d(1.5%, 1.2%, 0) scale(1.06); }
}
@keyframes login-grid {
  from { background-position: 0 0, 0 0; }
  to { background-position: 48px 48px, 48px 48px; }
}

.login-panel {
  width: min(440px, 100%);
  background: rgba(20, 17, 13, 0.78);
  border: 1px solid rgba(42, 35, 24, 0.95);
  border-radius: 20px;
  padding: 28px 26px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(16px);
  animation: login-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes login-rise {
  from { opacity: 0; transform: translateY(18px) scale(0.98); }
  to { opacity: 1; transform: none; }
}

.login-brand {
  font-family: "Sora", "IBM Plex Sans", "Noto Sans SC", sans-serif;
  font-size: clamp(28px, 5vw, 34px);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 6px;
  line-height: 1.1;
}
.login-brand span {
  background: linear-gradient(115deg, #e6bc8f 0%, #c8956a 46%, #ae7c50 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.login-field {
  margin-bottom: 14px;
}
.login-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.login-field .control {
  position: relative;
  display: flex;
  align-items: center;
}
.login-field input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(16, 23, 34, 0.92);
  border: 1px solid var(--line);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.login-field input:focus {
  border-color: rgba(200, 149, 106, 0.7);
  outline: none;
  box-shadow: 0 0 0 3px rgba(200, 149, 106, 0.2);
}
.login-field .toggle-pass {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 8px;
}
.login-field .toggle-pass:hover { color: var(--text); background: rgba(255,255,255,0.04); }

.login-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin: 4px 0 16px;
  font-size: 12px;
  color: var(--muted);
}
.login-meta .caps {
  color: var(--warn);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.login-meta .caps.on { opacity: 1; }

.login-error {
  min-height: 20px;
  margin: 0 0 12px;
  color: var(--danger);
  font-size: 13px;
}
.login-error.warn { color: var(--warn); }

.btn.login-submit {
  width: 100%;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
  background: linear-gradient(120deg, #e6bc8f, #c8956a);
  position: relative;
  overflow: hidden;
}
.btn.login-submit:hover { filter: brightness(1.05); }
.btn.login-submit[disabled] { filter: grayscale(0.2); opacity: 0.7; }
.btn.login-submit .spin {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  display: inline-block;
  vertical-align: -2px;
  margin-right: 8px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-trust {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.login-trust div {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}
.login-trust strong {
  display: block;
  color: #c9d7ec;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 2px;
}

.login-foot {
  margin-top: 14px;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.85;
}

/* PC 登录：左文案、右表单，两列互不覆盖 */
.login-shell {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 60% 34%;
  gap: 6%;
  align-items: center;
  width: 86%;
}
.login-brandpane {
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
}
.login-brandpane-top {
  display: flex;
  align-items: center;
  gap: 12px;
}
.login-seal,
.brand-seal.login-seal {
  width: 12%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 22%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #e6bc8f, #c8956a);
  color: #1c140e;
  flex: none;
}
.brand-seal-char {
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.login-brandpane-name {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.15;
}
.login-brandpane-name strong {
  font-size: 16px;
  font-weight: 700;
}
.login-brandpane-name span {
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--accent-2);
}
.login-brandpane-hero h2 {
  margin: 8px 0 0;
  font-family: "Noto Sans SC", "PingFang SC", sans-serif;
  font-size: clamp(36px, 4vw, 52px);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.02em;
}
.login-brandpane-hero p {
  margin: 16px 0 0;
  max-width: 36em;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.login-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-feature {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}
.login-feature-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--accent-2);
  background: rgba(200, 149, 106, 0.12);
  border: 1px solid rgba(200, 149, 106, 0.28);
}
.login-feature-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.login-feature-copy strong { font-size: 14px; font-weight: 650; }
.login-feature-copy span { color: var(--muted); font-size: 13px; line-height: 1.45; }
.login-brandpane-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.login-dot {
  width: 1.2%;
  height: auto;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
.login-panel { width: 100%; }
.login-eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--accent-2);
  font-weight: 650;
  margin-bottom: 8px;
}

/* 桌面登录不随窗口变窄改成单列；单列只属于手机壳 body.m-ui */

@media (max-width: 520px) {
  .login-panel { padding: 22px 18px 18px; border-radius: 16px; }
  .login-trust { grid-template-columns: 1fr; text-align: left; }
  .login-trust div { text-align: left; }
}

.toast-host {
  position: fixed; right: 16px; top: 16px; z-index: 9999;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
@keyframes slide-in {
  from { transform: translateY(-6px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.loading-bar {
  height: 2px; background: linear-gradient(90deg, transparent, var(--accent), transparent);
  background-size: 200% 100%; animation: shimmer 1s linear infinite;
  margin: -16px -18px 12px; border-radius: 14px 14px 0 0;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.subtabs {
  display: flex; gap: 0.4rem; flex-wrap: nowrap; margin: 0 0 0.85rem;
  padding: 0.35rem;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, rgba(29, 39, 56, 0.55), rgba(16, 23, 34, 0.35));
  border: 1px solid rgba(148, 163, 184, 0.12);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.subtab {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1px solid transparent; background: transparent; color: var(--muted);
  border-radius: 0.7rem; padding: 0.5rem 0.95rem; cursor: pointer; font: inherit; font-size: var(--fs-sm);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.15s ease;
  white-space: nowrap; flex: 0 0 auto;
}
.subtab:hover { color: var(--text); background: rgba(200,149,106,0.08); transform: translateY(-1px); }
.subtab.active {
  background: linear-gradient(135deg, rgba(200,149,106,0.28), rgba(200,149,106,0.1));
  color: #fff; border-color: rgba(200,149,106,0.55);
  box-shadow: 0 6px 18px rgba(200,149,106,0.12);
}
.subtab .ico { opacity: 0.85; }
.page-tab-body {
  min-height: 12rem;
  animation: page-tab-in 0.28s ease both;
}
@keyframes page-tab-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.callout {
  display: flex; gap: 0.75rem; align-items: flex-start;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  border: 1px solid var(--line);
  background: rgba(29, 39, 56, 0.45);
  margin: 0 0 0.85rem;
}
.callout.warn {
  border-color: rgba(245, 165, 36, 0.45);
  background: linear-gradient(135deg, rgba(245,165,36,0.12), rgba(29,39,56,0.35));
}
.callout.err {
  border-color: rgba(243, 18, 96, 0.4);
  background: linear-gradient(135deg, rgba(243,18,96,0.12), rgba(29,39,56,0.35));
}
.callout.ok {
  border-color: rgba(62, 207, 142, 0.35);
  background: linear-gradient(135deg, rgba(62,207,142,0.1), rgba(29,39,56,0.35));
}
.callout-body { flex: 1; min-width: 0; }
.callout-title { font-weight: 600; margin-bottom: 0.25rem; }
.callout-desc { color: var(--muted); font-size: var(--fs-sm); line-height: 1.5; }
.callout-steps {
  margin: 0.45rem 0 0 1.15rem;
  padding: 0;
  color: var(--text, #e8eef8);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 0.85rem;
}
.channel-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem 1.05rem;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(200,149,106,0.14), transparent 55%),
    rgba(16, 23, 34, 0.72);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}
.channel-card.is-error {
  border-color: rgba(243, 18, 96, 0.45);
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(243,18,96,0.16), transparent 55%),
    rgba(16, 23, 34, 0.72);
}
.channel-card:hover {
  transform: translateY(-2px);
  border-color: rgba(200,149,106,0.4);
  box-shadow: 0 12px 28px rgba(0,0,0,0.28);
}
.channel-card.is-error:hover {
  border-color: rgba(243, 18, 96, 0.65);
}
.channel-card .channel-title {
  display: flex; align-items: center; gap: 0.55rem; flex-wrap: wrap;
  font-weight: 650; margin-bottom: 0.55rem;
}
.channel-meta { display: grid; gap: 0.35rem; font-size: var(--fs-sm); color: var(--muted); }
.channel-error-body { margin-top: 0.7rem; }
.channel-error-body .callout { margin: 0; }
.channel-ip-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.4rem;
  margin-top: 0.55rem;
}
.channel-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.85rem; }
.alert-list { margin: 0.4rem 0 0; padding-left: 1.1rem; }
.alert-list li { margin: 0.35rem 0; }
.setting-field {
  display: grid; gap: 0.35rem; margin-bottom: 0.75rem;
}
.setting-field label { font-size: var(--fs-sm); color: var(--muted); }
.setting-field input, .setting-field textarea, .setting-field select {
  width: 100%;
}
.setting-copy-row {
  display: flex;
  gap: 0.4rem;
  align-items: stretch;
}
.setting-copy-row input {
  flex: 1;
  min-width: 0;
  font-family: var(--mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: var(--fs-sm);
}
.setting-warn {
  margin: 0.35rem 0 0;
  font-size: var(--fs-sm);
  color: var(--warn, #d97706);
}
.tabs {
  display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px;
}
.tab-chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 6px 12px; cursor: pointer; font: inherit; font-size: 12px;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.tab-chip.active { background: rgba(200,149,106,0.18); color: #fff; border-color: var(--accent); }

.grid-2 {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap);
}
.grid.two {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--gap-lg);
  width: 100%; min-width: 0;
}
.grid-3 {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--gap);
}
.stats.compact {
  gap: 0.55rem; margin: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.stats.compact .stat .v { font-size: clamp(1rem, 1.8vw, 1.25rem); }

/* 国际页等使用的统计栅格 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: var(--gap);
  margin: 0;
  width: 100%;
  align-items: stretch;
}
.list-item {
  padding: var(--pad);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel-2);
  margin: 0;
  width: 100%;
}

/* —— 平板 / 手机布局 —— */
@media (max-width: 980px) {
  body.m-ui .layout {
    grid-template-columns: 1fr;
    padding-top: 8%;
  }

  body:not(.m-ui) .layout {
    grid-template-columns: 16% minmax(0, 1fr);
    padding-top: 0;
  }
  body:not(.m-ui) .topbar { display: flex; }
  body:not(.m-ui) .mobile-topbar,
  body:not(.m-ui) .nav-backdrop { display: none; }
  body:not(.m-ui) .sider {
    position: relative;
    top: auto;
    left: auto;
    bottom: auto;
    width: 100%;
    height: 100%;
    min-height: 0;
    max-height: 100%;
    transform: none;
  }
  body:not(.m-ui) .workarea,
  body:not(.m-ui) .main {
    min-height: 0;
    max-height: 100%;
  }
  body:not(.m-ui) .main { overflow-y: auto; }
  .mobile-topbar {
    display: flex;
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 50;
    height: 8%;
    padding: env(safe-area-inset-top) 12px 0;
    align-items: center;
    gap: 10px;
    background: rgba(18, 15, 12, 0.94);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(10px);
  }
  .mobile-topbar .brand {
    margin: 0;
    font-size: 16px;
    flex: 1;
    min-width: 0;
  }
  .menu-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--panel-2);
    color: var(--text);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
    display: inline-grid;
    place-items: center;
  }
  .menu-toggle:active { background: #221c13; }

  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 55;
    background: rgba(4, 8, 16, 0.55);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }
  body.nav-open .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }

  .sider {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(280px, 86vw);
    height: 100vh;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    border-right: 1px solid var(--line);
    box-shadow: none;
    overflow: hidden;
    z-index: 60;
    padding-top: max(18px, env(safe-area-inset-top));
  }
  body.nav-open .sider {
    transform: translateX(0);
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.45);
  }
  body.nav-open {
    overflow: hidden;
  }

  .nav-btn {
    min-height: 44px;
    padding: 12px 14px;
  }

  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats.stats-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .u-grid-2, .dash-charts, .grid.two { grid-template-columns: 1fr; }
  .grid-3, .u-grid-3, .dash-site-grid { grid-template-columns: 1fr; }
  .dash-hero { grid-template-columns: 1fr; }
  .dash-hero-actions { justify-content: flex-start; }
  .chart-row, .type-grid { grid-template-columns: 1fr; justify-items: center; }

  .main {
    padding: 3.5% 4%;
    padding-left: max(4%, env(safe-area-inset-left));
    padding-right: max(4%, env(safe-area-inset-right));
  }

  .page-head h1 { font-size: clamp(1.1rem, 5vw, 1.35rem); }
  .dash-hero { padding: 4%; }
  .stat .v { font-size: clamp(1.1rem, 5vw, 1.35rem); }

  .toolbar input[type="text"],
  .toolbar input:not([type]),
  .toolbar input[type="number"],
  .toolbar input[type="month"],
  .toolbar input[type="search"],
  .toolbar select,
  .row input,
  .row select {
    min-width: 0;
    flex: 1 1 45%;
    width: auto;
    max-width: 100%;
  }
  .toolbar select { min-width: 0; }

  button.btn {
    min-height: 2.5rem;
    padding: 0.6rem 0.9rem;
  }

  .modal-backdrop {
    padding: 0;
    align-items: stretch;
    place-items: stretch;
  }
  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 100%;
    min-height: 100%;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }
  .modal-head {
    padding-top: max(14px, env(safe-area-inset-top));
    position: sticky;
    top: 0;
    background: var(--panel);
    z-index: 2;
  }
  .modal-foot {
    padding-bottom: max(16px, env(safe-area-inset-bottom));
    position: sticky;
    bottom: 0;
    background: var(--panel);
  }

  .detail-grid { grid-template-columns: 1fr; }
  .toast-host {
    left: 12px;
    right: 12px;
    top: calc(60px + env(safe-area-inset-top));
    max-width: none;
  }
  .toast-host .toast {
    max-width: none;
    min-width: 0;
    width: 100%;
  }

  .compare-bar {
    gap: 16px;
  }
  .donut-wrap {
    margin: 0 auto;
  }
}

@media (max-width: 560px) {
  .stats { grid-template-columns: 1fr; }
  .stats.stats-6 { grid-template-columns: 1fr; }
  .dash-site-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbar-row { grid-template-columns: 28% minmax(0, 1fr) 22%; gap: 0.35rem; }
  .page-head { align-items: flex-start; }
  .card { padding: 4.5%; border-radius: 0.75rem; }
  .login-scene { padding: 5%; padding-bottom: max(5%, env(safe-area-inset-bottom)); }
  .login-card { width: min(100%, 26rem); padding: 6%; }
  .login-trust { grid-template-columns: 1fr; text-align: left; }
  .subtabs, .tabs { gap: 0.5rem; }
  .subtab, .tab-chip { min-height: 2.25rem; }
}

@media (max-width: 1100px) and (min-width: 981px) {
  .dash-site-grid { grid-template-columns: 1fr; }
  .u-grid-5, .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.cron-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  background: var(--field, #1c1814);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--accent-2);
}
.detail-pre {
  margin: 0; padding: 12px; max-height: 360px; overflow: auto;
  background: var(--field, #1c1814); border: 1px solid var(--line); border-radius: 10px;
  font-size: 12px; color: var(--muted); white-space: pre-wrap;
}
.modal-backdrop {
  position: fixed; inset: 0; z-index: 8000;
  background: rgba(4, 8, 16, 0.62);
  display: grid; place-items: center; padding: clamp(12px, 3vw, 24px);
  backdrop-filter: blur(4px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.modal {
  width: min(720px, 100%);
  max-height: min(88vh, 920px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  animation: fadeUp 0.2s ease both;
}
.modal-lg { width: min(880px, 100%); }
.modal-xl { width: min(1080px, 100%); }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
  gap: 12px;
}
.modal-head h3 {
  margin: 0; font-size: 16px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  min-width: 0;
}
.modal-body {
  padding: 16px;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.modal-foot {
  display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end;
  padding: 12px 16px 16px; border-top: 1px solid var(--line);
  flex: 0 0 auto;
}
a.btn {
  display: inline-flex; align-items: center; text-decoration: none;
}

/* 纵向内容栈 / 按钮行（国际页、工作流等） */
.stack {
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
  min-width: 0;
  width: 100%;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  width: 100%;
}
.btn-row > input[type="file"],
.btn-row > input[type="month"],
.btn-row > input[type="text"],
.btn-row > select {
  min-width: 0;
  flex: 1 1 30%;
  max-width: 100%;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.toolbar input[type="text"],
.toolbar input:not([type]),
.toolbar input[type="number"],
.toolbar input[type="month"],
.toolbar input[type="search"],
.toolbar select {
  background: var(--field, #1c1814); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit;
  min-width: 0; flex: 1 1 140px; max-width: 100%;
}
.toolbar select { min-width: 120px; cursor: pointer; flex: 0 1 200px; }
.btn.sm { padding: 4px 10px; font-size: 12px; min-height: 32px; }
.check-label {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--muted); font-size: 13px; cursor: pointer;
  user-select: none;
}
.stat-row {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin: 12px 0 18px;
}
.stat-row .stat {
  background: var(--field, #1c1814);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 4.5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}
.stat-row .stat strong {
  display: block;
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  font-weight: 700;
  line-height: 1.2;
}
.stat-row .stat span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}
.stack > h3,
.stack > h4,
.portal-section-head h4 {
  margin: 0.75rem 0 0.5rem;
  font-size: var(--fs-md);
  font-weight: 600;
  letter-spacing: 0.01em;
}
.portal-section-head h4 { margin: 0; }
.card {
  border-radius: 12px;
}
.table-wrap table th {
  text-align: left;
  white-space: nowrap;
}
.table-wrap table td {
  vertical-align: middle;
}
.subtab-label { line-height: 1.2; }
/* 紧凑统计块（勿覆盖 .stats .stat） */
.stat-mini {
  background: var(--field, #1c1814); border: 1px solid var(--line); border-radius: 12px;
  padding: 12px 14px;
}
.stat-mini strong { display: block; font-size: 18px; margin-bottom: 4px; }
.stat-mini span { color: var(--muted); font-size: 12px; }
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px;
}
.detail-grid .muted { font-size: 12px; }
.form-stack {
  display: flex; flex-direction: column; gap: 10px;
  min-width: 0;
}
.form-stack input,
.form-stack select,
.form-stack textarea {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  background: var(--field, #1c1814); border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; padding: 8px 10px; font: inherit;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; word-break: break-all; }
.actions { display: flex; flex-wrap: wrap; gap: 4px; }
tr.row-active td { background: rgba(200,149,106,0.08); }
.bind-list {
  max-height: min(240px, 40vh); overflow: auto;
  display: flex; flex-direction: column; gap: 4px;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px;
  background: var(--field, #1c1814);
  -webkit-overflow-scrolling: touch;
}
.bind-pick {
  justify-content: flex-start; text-align: left; width: 100%;
  white-space: normal; line-height: 1.35;
}

/* 二代详情分区 */
.agent-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.agent-section h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
}
.agent-section > .muted { margin: 0 0 10px; }
.agent-bind-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  margin-top: 0.5rem;
  width: 100%;
}
.agent-bind-panel {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--pad);
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.agent-bind-panel h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.agent-bind-panel .table-wrap { margin-top: 8px; }
.agent-bind-panel table { min-width: 0; }

.page-enter {
  animation: fadeUp 0.28s ease both;
}

button.linkish {
  border: 0;
  background: transparent;
  color: var(--accent-2);
  font: inherit;
  padding: 0;
  cursor: pointer;
  text-align: left;
}
button.linkish:hover { text-decoration: underline; color: #fff; }

.agent-modal-body { display: flex; flex-direction: column; gap: 1rem; min-width: 0; }
.agent-modal-summary { display: flex; flex-direction: column; gap: 0.35rem; }
.agent-modal-title { font-size: var(--fs-lg); font-weight: 650; }
.agent-modal-actions { margin: 0; }

.agent-section h3 {
  margin: 0 0 0.5rem;
  font-size: var(--fs-md);
}
.agent-section { margin-top: 0.25rem; }

.portal-section { padding: 14px 16px; }
.portal-section-head h4 { margin: 0 0 4px; }
.portal-section-head p { margin: 0 0 10px; font-size: 12px; }
.portal-hero { padding: 16px 18px; background: linear-gradient(135deg, rgba(200,149,106,.16), rgba(200,149,106,.04)); }
.portal-hero h3 { margin: 0 0 6px; }
.portal-nba-item { padding: 8px 0; border-bottom: 1px solid var(--line, #e8eaed); }
.portal-nba-item:last-child { border-bottom: none; }

.lang-switch {
  width: 100%;
  margin: 8px 0;
  background: var(--field, #1c1814);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}
.login-lang {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 14px 0 4px;
}
.login-lang-select {
  width: auto;
  min-width: 140px;
  margin: 0;
}
.login-lang .btn.active {
  border-color: var(--accent);
  color: var(--accent-2);
}

@media (max-width: 1100px) {
  .dash-site-grid { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .agent-bind-grid { grid-template-columns: 1fr; }
  table { min-width: 100%; }
  .agent-bind-panel table { min-width: 100%; }
  .hbar-row { animation: none; }
  .compare-col { max-width: 40%; }
}

@media (max-width: 560px) {
  .btn-row .btn,
  .toolbar .btn {
    flex: 1 1 46%;
    justify-content: center;
  }
  .page-head .btn { flex: 1 1 auto; }
}

/* 减弱动画（系统偏好 / 无障碍） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .login-scene::before,
  .login-scene::after { animation: none; }
  .page-enter { animation: none; }
}

/* ============================================================
   Design System Polish Layer — 全局质感升级（级联覆盖层）
   主按钮光泽 · stat 高光 · 卡片景深 · 表格精修 · 导航指示条
   ============================================================ */

:root {
  --grad-accent: linear-gradient(115deg, #e6bc8f 0%, #c8956a 48%, #a87850 100%);
  --grad-accent-soft: linear-gradient(135deg, rgba(230,188,143,.14), rgba(200,149,106,.06));
  --shadow-sm: 0 1px 2px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.12);
  --shadow-md: 0 4px 14px rgba(0,0,0,.22), 0 1px 3px rgba(0,0,0,.16);
  --shadow-glow: 0 4px 18px rgba(200,149,106,.28);
}

/* 主按钮：品牌渐变 + 悬浮光晕 */
button.btn:not(.ghost):not(.danger) {
  background: var(--grad-accent);
  box-shadow: 0 1px 3px rgba(47,91,203,.35);
}
button.btn:not(.ghost):not(.danger):hover {
  filter: brightness(1.12);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}
button.btn.danger {
  background: linear-gradient(135deg, #f31260, #d90e54);
  box-shadow: 0 1px 3px rgba(243,18,96,.3);
}
button.btn.danger:hover { filter: brightness(1.12); transform: translateY(-1px); }
button.btn.ghost:hover {
  background: rgba(200,149,106,.08);
  border-color: var(--accent);
  color: var(--accent-2);
}
button.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(200,149,106,.55);
  outline-offset: 1px;
}

/* stat 卡片：顶部光带 + 数字渐变 */
.stat {
  position: relative;
  overflow: hidden;
  border-radius: calc(var(--radius) + 2px);
  background:
    linear-gradient(180deg, rgba(255,255,255,.03), transparent 42%),
    var(--panel);
  box-shadow: var(--shadow-sm);
}
.stat::before {
  content: '';
  position: absolute; inset: 0 0 auto 0; height: 2px;
  background: var(--grad-accent);
  opacity: .75;
}
.stat > strong {
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  background: linear-gradient(120deg, var(--text) 55%, var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat:hover { box-shadow: var(--shadow-md); }

/* 卡片景深与描边 */
.card {
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-md); }
.card.error {
  border-color: rgba(243,18,96,.45);
  background: linear-gradient(180deg, rgba(243,18,96,.06), transparent 60%);
}

/* 表格精修：表头底纹 + 吸顶 + 行悬浮 + 数值对齐 */
.table-wrap {
  border-radius: calc(var(--radius) - 2px);
  overflow: auto;
  box-shadow: inset 0 0 0 1px var(--line);
}
.table-wrap thead th {
  background: linear-gradient(180deg, rgba(255,255,255,.04), transparent);
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
.table-wrap tbody td { vertical-align: middle; }
.mono { font-variant-numeric: tabular-nums; }

/* 徽章/标签语义色 */
.tag.ok, .badge.ok { color: var(--ok); border-color: rgba(62,207,142,.45); background: rgba(62,207,142,.1); }
.tag.warn, .badge.warn { color: var(--warn); border-color: rgba(245,165,36,.45); background: rgba(245,165,36,.1); }
.tag.crit, .badge.crit { color: var(--danger); border-color: rgba(243,18,96,.45); background: rgba(243,18,96,.1); }

/* 侧栏导航：激活项渐变指示条 */
.sider nav a.active,
.sider nav .nav-item.active {
  position: relative;
  background: var(--grad-accent-soft);
}
.sider nav a.active::before,
.sider nav .nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 15%; bottom: 15%;
  width: 3px; border-radius: 2px;
  background: var(--grad-accent);
}

/* 页头标题区：底部渐变分隔 */
.page-head {
  padding-bottom: var(--gap);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(200,149,106,.05), transparent 70%);
  margin-bottom: var(--gap);
  border-radius: 0 0 var(--radius) var(--radius);
}
.page-head h1, .page-head h2 {
  letter-spacing: -0.015em;
}

/* 子页签：激活态胶囊 */
.page-tabs .active, .sub-tabs .active {
  background: var(--grad-accent-soft);
  border-color: rgba(200,149,106,.5) !important;
  color: var(--accent-2);
  box-shadow: inset 0 0 0 1px rgba(200,149,106,.30);
}

/* 登录面板：玻璃拟态 */
.login-panel {
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 1.4rem 3.4rem rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.06);
}

/* 弹窗浮层 */
.modal-panel {
  box-shadow: 0 1.2rem 3rem rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.05);
  border-radius: var(--radius);
}

/* 滚动条 */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: rgba(139,155,180,.35);
  border-radius: 5px;
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(139,155,180,.6); }

.muted:only-child, p.muted { line-height: 1.65; }

/* ============================================================
   Process Workbench — 审批中心闭环体验层
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}
.kpi-grid .kpi {
  text-align: left;
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-grid .kpi:hover { transform: translateY(-2px); border-color: rgba(200,149,106,.55); }
.kpi-grid .kpi.warn strong { color: var(--warn); }
.kpi-grid .kpi.ok strong { color: var(--ok); }
.kpi-grid .kpi.crit strong { color: var(--danger); }
.kpi-grid span { color: var(--muted); font-size: 12px; }

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-bar input,
.filter-bar select {
  min-width: 160px;
  max-width: min(320px, 100%);
}
.task-card {
  margin: 0;
  overflow: hidden;
}
.task-card header {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.task-card header strong {
  flex: 1;
  min-width: 180px;
  font-size: 14px;
  line-height: 1.4;
}
.task-meta {
  display: flex;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin: 8px 0 10px;
  flex-wrap: wrap;
}
.task-card footer {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.quick-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 12px;
  align-items: start;
}
.panel-card { padding: 14px; }
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.panel-head h3 { margin: 0; font-size: 15px; }
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.chip {
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 12px;
  cursor: pointer;
  transition: all .16s ease;
}
.chip:hover {
  border-color: rgba(200,149,106,.6);
  background: rgba(200,149,106,.1);
  color: var(--accent-2);
}
.recent-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.recent-row:last-child { border-bottom: 0; }
.recent-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
  font-size: 13px;
}
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
}
.template-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 13px;
}
.toolbar.between { justify-content: space-between; }
.progress-flow {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.flow-step {
  min-width: 92px;
  padding: 8px;
  border-radius: 9px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 5px;
  align-items: center;
}
.flow-step small {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}
.flow-step .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.flow-step.running { border-color: rgba(245,165,36,.55); }
.flow-step.running .dot { background: var(--warn); box-shadow: 0 0 0 3px rgba(245,165,36,.14); }
.flow-step.approved { border-color: rgba(62,207,142,.45); }
.flow-step.approved .dot { background: var(--ok); }
.flow-step.rejected, .flow-step.error, .flow-step.timeout { border-color: rgba(243,18,96,.45); }
.flow-step.rejected .dot, .flow-step.error .dot, .flow-step.timeout .dot { background: var(--danger); }
.timeline {
  position: relative;
  padding-left: 18px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--line);
}
.timeline-item {
  position: relative;
  padding: 7px 0;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(200,149,106,.12);
}
.timeline-item strong { font-size: 13px; }
.timeline-item p { margin: 2px 0 0; font-size: 12px; }
.kv-row {
  display: grid;
  grid-template-columns: minmax(90px, 32%) minmax(0, 1fr);
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
  word-break: break-word;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.empty-state {
  text-align: center;
  padding: 28px 16px;
}
.empty-ico {
  width: 34px;
  height: 34px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(62,207,142,.12);
  color: var(--ok);
  border: 1px solid rgba(62,207,142,.35);
}
@media (max-width: 900px) {
  .quick-section { grid-template-columns: 1fr; }
  .filter-bar input, .filter-bar select { min-width: calc(50% - 8px); }
  .task-card footer .btn:nth-child(n + 5) { display: none; }
}
@media (max-width: 600px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .task-meta { grid-template-columns: 1fr; display: block; line-height: 1.7; }
  .recent-row { grid-template-columns: auto minmax(0, 1fr); }
  .recent-row .mono, .recent-row .btn { display: none; }
}

/* ============================================================
   UI 强化层（2026-09）：动效 / 图表 / 图标芯片 / 趋势徽章
   原则：CSS-only 动画、尊重 prefers-reduced-motion、不改既有类语义
   ============================================================ */

/* 数字表盘感：等宽数字 */
.stat .v,
.chart-val,
.chart-hbar-val,
.trend-badge,
td.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

/* —— 页面级入场：卡片/统计卡 stagger 浮现（DOM 每次 render 重建，自动重放） —— */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.card,
.stat,
.chart-card,
.dash-hero {
  animation: cardIn 0.42s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}
.card:nth-child(1), .stat:nth-child(1) { animation-delay: 0.02s; }
.card:nth-child(2), .stat:nth-child(2) { animation-delay: 0.06s; }
.card:nth-child(3), .stat:nth-child(3) { animation-delay: 0.1s; }
.card:nth-child(4), .stat:nth-child(4) { animation-delay: 0.14s; }
.card:nth-child(5), .stat:nth-child(5) { animation-delay: 0.18s; }
.card:nth-child(n + 6), .stat:nth-child(n + 6) { animation-delay: 0.22s; }

/* —— 卡片交互：边框亮化 + 数据卡 hover 抬升 —— */
.card {
  transition: border-color 0.2s ease, box-shadow 0.25s ease, transform 0.25s ease;
}
.stat:hover,
.chart-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.9rem 2.2rem rgba(0, 0, 0, 0.36), 0 0 0 1px rgba(200,149,106, 0.18);
}
.stat.accent { border-color: rgba(200,149,106, 0.45); }

/* —— 图标芯片（stat 卡头部 / 面板标题） —— */
.stat-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  flex: none;
  background: linear-gradient(135deg, rgba(200,149,106, 0.22), rgba(200,149,106, 0.08));
  border: 1px solid rgba(200,149,106, 0.3);
  color: var(--accent-2);
}
.stat-chip.ok { background: linear-gradient(135deg, rgba(62, 207, 142, 0.2), rgba(62, 207, 142, 0.05)); border-color: rgba(62, 207, 142, 0.32); color: var(--ok); }
.stat-chip.warn { background: linear-gradient(135deg, rgba(245, 165, 36, 0.2), rgba(245, 165, 36, 0.05)); border-color: rgba(245, 165, 36, 0.32); color: var(--warn); }
.stat-chip.danger { background: linear-gradient(135deg, rgba(243, 18, 96, 0.2), rgba(243, 18, 96, 0.05)); border-color: rgba(243, 18, 96, 0.32); color: var(--danger); }
.stat-head {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.3rem;
}
.stat-head .k { margin: 0; }

/* —— 环比趋势徽章 —— */
.trend-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
  font-size: var(--fs-xs);
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}
.trend-badge.good { color: var(--ok); background: rgba(62, 207, 142, 0.12); border-color: rgba(62, 207, 142, 0.3); }
.trend-badge.bad { color: var(--danger); background: rgba(243, 18, 96, 0.12); border-color: rgba(243, 18, 96, 0.3); }
.trend-badge.flat { color: var(--muted); background: rgba(139, 155, 180, 0.1); border-color: rgba(139, 155, 180, 0.25); }
.stat-foot .trend-badge { margin-right: 0.35rem; }

/* —— 图表通用 —— */
.chart { display: block; width: 100%; height: auto; }
.chart text { user-select: none; }

/* 折线描绘动画（polyline pathLength=100） */
@keyframes chartDraw {
  from { stroke-dashoffset: 100; }
  to { stroke-dashoffset: 0; }
}
.chart-draw {
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: chartDraw 1.1s cubic-bezier(0.4, 0, 0.2, 1) 0.15s forwards;
}
@keyframes dotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}
.chart-dot { animation: dotPulse 2.2s ease-in-out 1.2s infinite; }

/* 纵向柱：自底向上生长 */
@keyframes barGrow {
  from { opacity: 0; transform: scaleY(0); }
  to { opacity: 1; transform: scaleY(1); }
}
.chart-bar-col {
  transform-origin: bottom;
  transform-box: fill-box;
  animation: barGrow 0.55s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}

/* 横向排行条 */
.chart-hbars { display: grid; gap: 0.5rem; }
.chart-hbar-row {
  display: grid;
  grid-template-columns: minmax(4.5rem, 8rem) minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  animation: cardIn 0.4s ease both;
}
.chart-hbar-label {
  font-size: var(--fs-xs);
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.chart-hbar-track {
  height: 0.55rem;
  border-radius: 999px;
  background: rgba(42, 53, 72, 0.6);
  overflow: hidden;
}
.chart-hbar-bar {
  display: block;
  height: 100%;
  border-radius: 999px;
  transform-origin: left;
  animation: hbarGrow 0.6s cubic-bezier(0.22, 0.8, 0.36, 1) both;
}
@keyframes hbarGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
.chart-hbar-val {
  font-size: var(--fs-xs);
  color: var(--muted);
  white-space: nowrap;
}

/* 进度环：绘制入场（from 单帧动画，结束态取内联 dasharray） */
@keyframes ringIn {
  from { stroke-dasharray: 0 100; }
}
.chart-ring-arc { animation: ringIn 0.9s cubic-bezier(0.4, 0, 0.2, 1) both; }
.chart-ring { max-width: 7rem; }

/* —— 面板标题图标对齐 —— */
.card h2, .card h3 { display: flex; align-items: center; gap: 0.45rem; }
.card h2 .ico, .card h3 .ico { color: var(--accent-2); flex: none; }
.card h2 .hint, .card h3 .hint { margin-left: auto; }

/* —— 焦点可见性统一 —— */
.btn:focus-visible,
.subtab:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid rgba(200,149,106, 0.55);
  outline-offset: 2px;
}

/* —— 动效降级：减少动画偏好下全部关闭 —— */
@media (prefers-reduced-motion: reduce) {
  .card, .stat, .chart-card, .dash-hero,
  .chart-bar-col, .chart-hbar-row, .chart-hbar-bar,
  .chart-draw, .chart-dot, .chart-ring-arc {
    animation: none !important;
  }
  .chart-draw { stroke-dasharray: none; stroke-dashoffset: 0; }
  .stat:hover, .chart-card:hover { transform: none; }
  .card { transition: none; }
}

/* 图例内嵌进度环（仪表盘欠费率） */
.legend-item.ring-item { gap: 0.45rem; }
.legend-item.ring-item .chart-ring { max-width: 3.4rem; }

/* —— AI 网关页（/aiGateway）区块化排版 —— */
.gw-section > h2 { margin-top: 0.1rem; }
.gw-status { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }
.gw-grid {
  display: grid;
  grid-template-columns: minmax(8rem, 1.2fr) minmax(14rem, 2.2fr) minmax(10rem, 1.4fr) 5.5rem;
  gap: 0.45rem;
}
.gw-provider-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.55rem;
  background: rgba(27, 36, 51, 0.45);
  display: grid;
  gap: 0.45rem;
  animation: cardIn 0.4s cubic-bezier(0.22, 0.8, 0.36, 1) both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gw-provider-row:hover { border-color: rgba(200,149,106, 0.4); }
.gw-persona {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.6rem 0.7rem;
  background: rgba(27, 36, 51, 0.45);
  display: grid;
  gap: 0.1rem;
  animation: cardIn 0.4s cubic-bezier(0.22, 0.8, 0.36, 1) both;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.gw-persona:hover { border-color: rgba(200,149,106, 0.4); }
.gw-route-row {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) minmax(10rem, 1fr) minmax(9rem, 14rem);
  gap: 0.55rem;
  align-items: center;
  padding: 0.3rem 0;
  border-bottom: 1px dashed rgba(42, 53, 72, 0.6);
}
.gw-route-row:last-child { border-bottom: none; }
.gw-route-name { display: flex; flex-direction: column; gap: 0.05rem; }
@media (max-width: 900px) {
  .gw-grid { grid-template-columns: 1fr 1fr; }
  .gw-route-row { grid-template-columns: 1fr; }
}

/* ============ UI 升级：表格行入场动画 / 按钮 active 态 / 悬浮导航（2026-08-26 审计轮） ============ */
.fade-in-row {
  animation: rowFadeIn 0.28s ease both;
}
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 逐行错峰入场（同级行依次延迟，最多 12 行） */
.fade-in-row:nth-child(1) { animation-delay: 0.02s; }
.fade-in-row:nth-child(2) { animation-delay: 0.04s; }
.fade-in-row:nth-child(3) { animation-delay: 0.06s; }
.fade-in-row:nth-child(4) { animation-delay: 0.08s; }
.fade-in-row:nth-child(5) { animation-delay: 0.10s; }
.fade-in-row:nth-child(6) { animation-delay: 0.12s; }
.fade-in-row:nth-child(7) { animation-delay: 0.14s; }
.fade-in-row:nth-child(8) { animation-delay: 0.16s; }
.fade-in-row:nth-child(9) { animation-delay: 0.18s; }
.fade-in-row:nth-child(10) { animation-delay: 0.20s; }
.fade-in-row:nth-child(11) { animation-delay: 0.22s; }
.fade-in-row:nth-child(12) { animation-delay: 0.24s; }

/* 筛选 chips / 分页按钮 active 态 */
.btn.active {
  background: var(--accent, #c8956a);
  border-color: var(--accent, #c8956a);
  color: #fff;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn { transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease; }
.btn:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0,0,0,0.10); }
.btn:not(:disabled):active { transform: translateY(0); box-shadow: none; }

/* 数据表行悬停高亮 */
.table-wrap tbody tr { transition: background 0.15s ease; }
.table-wrap tbody tr:hover { background: rgba(200, 149, 106, 0.07); }

/* 动画弱化偏好 */
@media (prefers-reduced-motion: reduce) {
  .fade-in-row { animation: none !important; }
  .btn, .table-wrap tbody tr { transition: none !important; }
}

/* 跨域关系图：力导向画布、聚焦淡出、缩放平移、动效弱化 */
.graph-wrap { position: relative; min-height: 340px; overflow: hidden; border-radius: 10px; background: var(--bg, #f6f8fb); touch-action: none; }
.graph-svg { width: 100%; height: auto; min-height: 340px; display: block; cursor: grab; }
.graph-svg:active { cursor: grabbing; }

.gn { cursor: pointer; transition: opacity 0.22s ease; }
.gn .gn-dot { stroke: var(--card, #fff); stroke-width: 2; transition: r 0.18s ease; }
.gn .gn-halo { fill: none; stroke: #c8956a; stroke-opacity: 0.28; stroke-width: 2; transform-box: fill-box; transform-origin: center; animation: gn-halo 2.6s ease-out infinite; }
.gn .gn-label {
  font-size: 11px; fill: var(--text, #1f2937); text-anchor: middle;
  paint-order: stroke; stroke: var(--card, #fff); stroke-width: 3px; stroke-linejoin: round;
  pointer-events: none;
}
.gn .gn-hover-label { opacity: 0; transition: opacity 0.18s ease; }
.gn:hover .gn-hover-label, .gn:focus-visible .gn-hover-label, .gn.gn-active .gn-hover-label { opacity: 1; }
.gn:hover .gn-dot, .gn:focus-visible .gn-dot { filter: brightness(1.15) drop-shadow(0 0 4px rgba(200, 149, 106, 0.45)); }
.gn:focus-visible .gn-dot { stroke: #c8956a; stroke-width: 3; }
.gn.dimmed { opacity: 0.13; pointer-events: none; }
@keyframes gn-halo {
  0% { transform: scale(1); stroke-opacity: 0.30; }
  70% { transform: scale(1.5); stroke-opacity: 0.04; }
  100% { transform: scale(1.5); stroke-opacity: 0; }
}

.gedge { stroke: #94a3b8; stroke-width: 1.3; stroke-opacity: 0.34; transition: stroke-opacity 0.22s ease, stroke 0.22s ease, stroke-width 0.22s ease; }
.gedge.lit { stroke: #c8956a; stroke-width: 2.2; stroke-opacity: 0.9; }
.gedge.dimmed { stroke-opacity: 0.05; }

.graph-legend { flex-wrap: wrap; margin-bottom: 8px; }
.graph-chip { cursor: pointer; background: var(--card, #fff); transition: opacity 0.18s ease, filter 0.18s ease; }
.graph-chip.off { opacity: 0.35; filter: grayscale(0.9); text-decoration: line-through; }

.graph-detail {
  position: absolute; top: 12px; right: 12px; width: min(300px, 78%);
  padding: 12px 14px; z-index: 5;
  opacity: 0; transform: translateY(-6px) scale(0.98); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.16);
}
.graph-detail.open { opacity: 1; transform: none; pointer-events: auto; }
.graph-neighbors { display: flex; flex-wrap: wrap; gap: 6px; }
.graph-neighbor { cursor: pointer; }

@media (max-width: 760px) {
  .graph-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
  .graph-detail { position: static; width: 100%; margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .gn, .gn .gn-dot, .gn .gn-hover-label, .gedge, .graph-detail, .graph-chip { transition: none !important; }
  .gn .gn-halo { animation: none !important; }
}

/* ============ UI Kit：语义令牌、骨架屏、通用表格、主题切换（R9） ============ */
.theme-toggle {
  display: inline-grid; place-items: center;
  width: 1.85rem; height: 1.85rem;
  border: 1px solid var(--line); border-radius: 0.65rem;
  background: var(--panel-2); color: var(--text);
  cursor: pointer; font-size: 0.9rem; line-height: 1;
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ui-table table { width: 100%; border-collapse: collapse; }
.ui-table tbody tr { animation: rowFadeIn 0.24s ease both; animation-delay: calc(var(--i, 0) * 0.015s); }
.ui-table tbody td { vertical-align: middle; }

.ui-skeleton { display: grid; gap: 0.55rem; }
.ui-skeleton-row {
  height: 2.4rem; border-radius: 0.65rem;
  background: linear-gradient(90deg, var(--panel-2) 25%, var(--line) 45%, var(--panel-2) 65%);
  background-size: 250% 100%; animation: uiShimmer 1.2s linear infinite;
}
.skeleton-line { height: 0.8rem; border-radius: 999px; background: var(--panel-2); }
.skeleton-line.title { width: min(18rem, 45%); height: 1.2rem; background: var(--line); }
.skeleton-line.strong { width: min(5rem, 45%); height: 1.4rem; background: var(--line); }
.skeleton-line.muted { width: min(9rem, 65%); }
.skeleton-page-head { display: grid; gap: 0.45rem; margin-bottom: 0.7rem; }
@keyframes uiShimmer { from { background-position: 125% 0; } to { background-position: -125% 0; } }

.ui-empty {
  min-height: 8rem; display: grid; place-content: center; justify-items: center; gap: 0.35rem;
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel-2);
  padding: var(--pad); text-align: center;
}
.ui-empty-icon { font-size: 1.6rem; color: var(--muted); }

/* Light theme correction for historically hard-coded dark surfaces. */
[data-theme="light"] body {
  background:
    radial-gradient(60% 40% at 8% -8%, rgba(200, 149, 106, 0.12) 0%, transparent 55%),
    radial-gradient(45% 35% at 100% 0%, rgba(168, 120, 80, 0.10) 0%, transparent 50%),
    var(--bg);
}
[data-theme="light"] .sider,
[data-theme="light"] .modal-panel,
[data-theme="light"] .modal,
[data-theme="light"] .card,
[data-theme="light"] input,
[data-theme="light"] select,
[data-theme="light"] textarea { background: var(--panel); color: var(--text); }
[data-theme="light"] .nav-btn:hover,
[data-theme="light"] .nav-group-head:hover,
[data-theme="light"] .nav-leaf:hover { background: var(--panel-2); }
[data-theme="light"] .nav-btn.active,
[data-theme="light"] .subtab.active,
[data-theme="light"] .btn.active { color: #fff; }
[data-theme="light"] .mobile-topbar,
[data-theme="light"] .menu-toggle:active { background: var(--panel-2); }

/* Accessible mobile baseline at 640px. */
@media (max-width: 640px) {
  :root { --main-pad-x: 4%; --main-pad-y: 0.8rem; --sider-w: min(82vw, 17rem); }
  .stat-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.55rem; }
  .page-head { align-items: flex-start; }
  .page-head-actions { width: 100%; }
  .toolbar { gap: 0.45rem; }
  .btn { width: 100%; min-height: 2.4rem; }
  .toolbar .btn { width: auto; flex: 1 1 auto; }
  .table-wrap { margin-inline: calc(-1 * var(--main-pad-x) / 2); }
  .table-wrap table { min-width: 44rem; }
  .modal-panel { max-height: min(92dvh, 100%); }
  .theme-toggle { width: 2.2rem; height: 2.2rem; font-size: 1rem; }
}

@media (prefers-contrast: more) {
  .card, .modal-panel, input, select, textarea { border-color: var(--text); }
  .muted { color: var(--text); }
  .ui-skeleton-row, .skeleton-line { background: var(--line); animation: none; }
}

/* ============ 风鸟企业背调：名片头部 / 头像缩略 / 持股条形图 / 风险彩签（R23） ============ */
.fn-hero {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel-2);
}
.fn-logo, .fn-logo-fallback {
  width: 56px; height: 56px; border-radius: 12px; flex: none;
  object-fit: cover; background: var(--panel);
}
.fn-logo-fallback {
  display: grid; place-items: center;
  font-size: 24px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--accent), #a87850);
}
.fn-thumb, .fn-thumb-fallback {
  width: 40px; height: 40px; border-radius: 8px; vertical-align: middle;
  object-fit: cover; background: var(--panel-2);
}
.fn-thumb-fallback { display: inline-grid; place-items: center; font-size: 14px; color: var(--muted); }
.fn-hero-name { font-size: var(--fs-lg); font-weight: 700; line-height: 1.35; word-break: break-all; }
.fn-hero-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; align-items: center; }
.fn-mono { font-variant-numeric: tabular-nums; font-size: var(--fs-xs); color: var(--muted); }
.fn-unknown { font-style: italic; }
.fn-bars { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.fn-bar {
  display: grid; grid-template-columns: minmax(88px, 180px) 1fr 64px;
  gap: 8px; align-items: center; font-size: var(--fs-xs);
}
.fn-bar-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-bar-track { display: block; height: 8px; border-radius: 6px; background: var(--panel); overflow: hidden; }
.fn-bar-fill {
  display: block; height: 100%; width: 0; border-radius: 6px;
  background: linear-gradient(90deg, var(--accent), #a87850);
  transition: width 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
}
.fn-bar-pct { text-align: right; font-variant-numeric: tabular-nums; }
.fn-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fn-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: default;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--panel-2); color: var(--text); font-size: var(--fs-xs);
}
.fn-chip .n { font-variant-numeric: tabular-nums; font-weight: 700; }
.fn-chip.warn { border-color: rgba(245, 165, 36, 0.45); background: rgba(245, 165, 36, 0.12); color: var(--warn); }
.fn-chip.crit { border-color: rgba(243, 18, 96, 0.45); background: rgba(243, 18, 96, 0.12); color: var(--danger); }
.fn-chip.muted { color: var(--muted); }
.fn-pill {
  display: inline-block; margin-left: 5px; padding: 0 6px; min-width: 16px;
  border-radius: 8px; font-size: 11px; line-height: 17px; font-weight: 700;
}
.fn-pill.warn { background: rgba(245, 165, 36, 0.18); color: var(--warn); }
.fn-pill.crit { background: rgba(243, 18, 96, 0.18); color: var(--danger); }
@media (max-width: 760px) {
  .fn-bar { grid-template-columns: minmax(72px, 110px) 1fr 52px; }
  .fn-logo, .fn-logo-fallback { width: 44px; height: 44px; border-radius: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .fn-bar-fill { transition: none; }
}

/* ============ 员工管理邀请链接：彩色按钮组 / 邀请弹窗（R24） ============ */
.btn.crit { border-color: rgba(243, 18, 96, 0.45); background: rgba(243, 18, 96, 0.12); color: var(--danger); }
.btn.crit:hover { background: rgba(243, 18, 96, 0.2); }
.inv-group { flex-wrap: wrap; gap: 4px; }
.inv-btn { border-left: 3px solid var(--line); }
.inv-btn.inv-agent { border-left-color: var(--accent); }
.inv-btn.inv-proc { border-left-color: var(--ok); }
.inv-btn.inv-act { border-left-color: #d9c08a; }
.inv-link-row { display: flex; gap: 6px; align-items: center; }
.inv-body { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.inv-qr {
  flex: none; padding: 8px; border: 1px solid var(--line);
  border-radius: var(--radius); background: #fff; line-height: 0;
}
.inv-qr svg { display: block; width: 232px; height: 232px; }
.inv-step { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); }
.inv-step-n {
  flex: none; display: inline-grid; place-items: center;
  width: 18px; height: 18px; margin-top: 1px;
  border-radius: 50%; background: var(--accent); color: #fff;
  font-size: 11px; font-weight: 700;
}
@media (max-width: 760px) {
  .inv-qr svg { width: 180px; height: 180px; }
}

/* ============ 代理商详情标签页（能力/二代管理/佣金费率/客户费率/收款账户） ============ */
.tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  border-bottom: 1px solid var(--line, #2a3548);
  padding-bottom: 8px;
}
.tab-btn {
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted, #8b9bb4);
  padding: 6px 12px;
  font-size: 13px;
  cursor: pointer;
}
.tab-btn:hover { color: var(--text, #e8eef7); background: var(--panel-2, #1b2433); }
.tab-btn.active {
  color: #fff;
  background: var(--accent, #c8956a);
  font-weight: 600;
}

/* ============ 代理商详情 · 能力页渐变卡片 + 动效 ============ */
.cap-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 12px;
}
.cap-card {
  position: relative;
  overflow: hidden;
  border-radius: 14px;
  padding: 16px 18px;
  color: #fff;
  animation: capIn .35s ease both;
  transition: transform .18s ease, box-shadow .18s ease;
}
.cap-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15,23,42,.18); }
.cap-card::after {
  content: '';
  position: absolute;
  right: -24px; top: -24px;
  width: 96px; height: 96px;
  border-radius: 50%;
  background: rgba(255,255,255,.14);
}
.cap-blue { background: linear-gradient(135deg, #8f6440, #c8956a); }
.cap-cyan { background: linear-gradient(135deg, #c8956a, #e6bc8f); }
.cap-violet { background: linear-gradient(135deg, #a87850, #d3ab7e); }
.cap-green { background: linear-gradient(135deg, #5d8a63, #9ccfa3); }
.cap-red { background: linear-gradient(135deg, #c0532f, #e08a5f); }
.cap-plain { background: var(--panel, #151c28); color: var(--text, #e8eef7); border: 1px solid var(--line, #2a3548); }
.cap-num { font-size: 22px; font-weight: 800; letter-spacing: .01em; }
.cap-label { font-size: 13px; opacity: .92; margin-top: 2px; }
.cap-sub { font-size: 11px; opacity: .75; margin-top: 4px; }
.cap-block h4 { margin: 12px 0 8px; }
.cap-table td, .cap-table th { padding: 7px 10px; }
.cap-row-danger { background: rgba(239, 68, 68, .06); }
@keyframes capIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: capIn .35s ease both; }

/* 客户费率行内编辑 */
.row-overridden { background: rgba(200, 149, 106, .08); }

/* ================================================================
   Design System v2 · 精密运营台（2026-10 全站视觉升级，后置覆盖层）
   概念：深空导航台 —— 蓝青双色调 + 氛围光 + 工程网格 + 分级海拔
   ================================================================ */
:root {
  --grad-accent: linear-gradient(115deg, #e6bc8f 0%, #c8956a 46%, #ae7c50 100%);
  --grad-accent-soft: linear-gradient(135deg, rgba(230,188,143,.16), rgba(200,149,106,.10));
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px;
  --sh-1: 0 1px 2px rgba(2,6,16,.35), 0 2px 8px rgba(2,6,16,.22);
  --sh-2: 0 2px 6px rgba(2,6,16,.40), 0 10px 28px rgba(2,6,16,.30);
  --sh-3: 0 4px 12px rgba(2,6,16,.45), 0 20px 48px rgba(2,6,16,.38);
  --ease: cubic-bezier(.22,.9,.36,1);
  --dur: .22s;
}

/* ---- 背景氛围 v2：三层光 + 极淡工程网格（fixed 附着，滚动不动） ---- */
body {
  background:
    radial-gradient(52% 38% at 12% -6%, rgba(230,188,143,.13) 0%, transparent 55%),
    radial-gradient(40% 30% at 96% 2%, rgba(200,149,106,.10) 0%, transparent 52%),
    radial-gradient(46% 40% at 50% 108%, rgba(168,120,80,.09) 0%, transparent 55%),
    repeating-linear-gradient(0deg, rgba(237,231,222,.024) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(237,231,222,.024) 0 1px, transparent 1px 44px),
    var(--bg);
  background-attachment: fixed;
}
[data-theme="light"] body {
  background:
    radial-gradient(52% 38% at 12% -6%, rgba(200,149,106,.14) 0%, transparent 55%),
    radial-gradient(40% 30% at 96% 2%, rgba(168,120,80,.10) 0%, transparent 52%),
    repeating-linear-gradient(0deg, rgba(36,28,17,.022) 0 1px, transparent 1px 44px),
    repeating-linear-gradient(90deg, rgba(36,28,17,.022) 0 1px, transparent 1px 44px),
    var(--bg);
  background-attachment: fixed;
}

/* ---- 侧栏：品牌强调条 + 活动指示 ---- */
.sider { box-shadow: 1px 0 0 var(--line), 4px 0 24px rgba(2,6,16,.25); }
.sider::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: var(--grad-accent);
  opacity: .9;
}
.nav-btn { border-radius: 10px; }
.nav-btn.active {
  background: var(--grad-accent-soft);
  box-shadow: inset 0 0 0 1px rgba(200,149,106,.30), 0 4px 14px rgba(168,120,80,.20);
}
.nav-btn.active::before {
  content: '';
  position: absolute; left: 0; top: 22%; bottom: 22%; width: 3px;
  border-radius: 3px;
  background: var(--grad-accent);
  box-shadow: 0 0 10px rgba(230,188,143,.75);
}
.nav-btn { position: relative; }
.nav-group-label {
  letter-spacing: .14em;
  text-transform: uppercase;
  font-size: 10.5px;
  opacity: .8;
}

/* ---- 卡片：分级海拔 + 顶部 hairline ---- */
.card {
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  position: relative;
}
.card::before {
  content: '';
  position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(230,188,143,.30), transparent);
  pointer-events: none;
}
.card:hover { box-shadow: var(--sh-2); }

/* ---- 汇总条（筛选联动 stats）---- */
.filter-stats { margin-bottom: 10px; }
.stat strong { font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stat.stat-accent strong { color: var(--accent-2); }
.stat.stat-accent { border-bottom: 2px solid transparent; border-image: linear-gradient(90deg, var(--accent-2), var(--accent)) 1; border-image-slice: 0 0 2 0; }
.stat.stat-ok strong { color: var(--ok); }
.stat.stat-danger strong { color: var(--danger); }

/* ---- 按钮：主操作渐变 + 焦点圈 ---- */
.btn.primary, .btn:not(.ghost):not(.crit):not(.linkish) {
  background-image: var(--grad-accent);
  border: 1px solid rgba(230,188,143,.38);
  box-shadow: 0 2px 10px rgba(168,120,80,.30), inset 0 1px 0 rgba(255,244,228,.18);
}
.btn:not(.ghost):not(.crit):not(.linkish):hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(168,120,80,.38), inset 0 1px 0 rgba(255,244,228,.22);
}
.btn:not(.ghost):not(.crit):not(.linkish):active:not(:disabled) { transform: translateY(0) scale(.985); }
.btn:focus-visible, .m-icon-btn:focus-visible, .tab-btn:focus-visible, .m-tab:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px rgba(200,149,106,.60);
}

/* ---- 分段器：胶囊控件（subtabs / tab-bar）---- */
.subtabs {
  background: rgba(11,10,8,.55);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
}
.subtab { border-radius: 999px; transition: all var(--dur) var(--ease); }
.subtab.active {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 2px 10px rgba(168,120,80,.38);
}
[data-theme="light"] .subtabs { background: rgba(36,28,17,.05); }
.tab-bar {
  background: rgba(11,10,8,.45);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
  border-bottom: 0;
}
[data-theme="light"] .tab-bar { background: rgba(36,28,17,.05); }
.tab-btn { border-radius: 999px; transition: all var(--dur) var(--ease); }

/* ---- 表格：吸顶表头 + 渐变底线 ---- */
.table-wrap { border-radius: var(--r-md); }
.table-wrap thead th {
  position: sticky; top: 0; z-index: 1;
  background: linear-gradient(180deg, var(--panel-2), var(--panel-2));
  box-shadow: 0 1px 0 var(--line);
  text-transform: none;
  letter-spacing: .04em;
  font-size: 12px;
}
.table-wrap tbody tr:nth-child(even) td { background: rgba(237,231,222,.022); }

/* ---- 弹窗：模糊背板 + 弹入 ---- */
.modal-backdrop { backdrop-filter: blur(6px) saturate(1.1); -webkit-backdrop-filter: blur(6px) saturate(1.1); }
.modal {
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: modalPop .26s var(--ease);
}
@keyframes modalPop {
  from { transform: scale(.965) translateY(10px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}

/* ---- Toast：彩条 + 图标圆片 ---- */
.toast {
  border-radius: var(--r-md);
  border-left-width: 3px;
  box-shadow: var(--sh-2);
  animation: toastIn .28s var(--ease);
}
@keyframes toastIn {
  from { transform: translateY(14px) scale(.97); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}
.toast .ico {
  background: rgba(237,231,222,.08);
  border-radius: 999px;
  padding: 3px;
}

/* ---- 输入焦点光圈 ---- */
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: rgba(200,149,106,.55);
  box-shadow: 0 0 0 3px rgba(200,149,106,.18);
}

/* ---- 页头图标 chip ---- */
.page-head-copy .page-ico, .page-head .ico {
  background: var(--grad-accent-soft);
  border-radius: var(--r-md);
  padding: 8px;
  box-shadow: inset 0 0 0 1px rgba(200,149,106,.30);
}

/* ---- 滚动条 ---- */
* { scrollbar-width: thin; scrollbar-color: rgba(176,164,148,.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb {
  background: rgba(176,164,148,.30);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(176,164,148,.5); }
*::-webkit-scrollbar-track { background: transparent; }

/* ---- 动效可关闭（无障碍）---- */
@media (prefers-reduced-motion: reduce) {
  .card, .btn, .subtab, .tab-btn, .modal, .toast, .stat { animation: none !important; transition: none !important; }
}

/* ============ 欠费账龄分布条 + 分级标签 ============ */
.age-dist { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 4px; }
.age-seg { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.age-bar { height: 8px; border-radius: 4px; min-width: 2px; transition: width .4s var(--ease, ease); }
.age-bar.s1 { background: #d9c08a; }
.age-bar.s2 { background: #c8873f; }
.age-bar.s3 { background: #c0532f; }
.age-bar.s4 { background: #b91c1c; }
.age-lab { color: var(--muted); white-space: nowrap; }
.s-tag { margin-left: 6px; }
.s-tag.s1 { border-color: #d9c08a; color: #d9c08a; }
.s-tag.s2 { border-color: #c8873f; color: #e0a35f; }
.s-tag.s3 { border-color: #c0532f; color: #e08a5f; }
.s-tag.s4 { border-color: #b91c1c; color: #ef6a5a; }

/* ================================================================
   交互与图表统一（墨色 / 青铜）
   表单、图表、卡片、页面切换跟随同一套令牌，亮色不再落回冷蓝底。
   ================================================================ */
:root { --field: #1c1814; }
[data-theme="light"] { --field: #fffdf8; }

.sider { background: rgba(18, 15, 12, 0.94); }
[data-theme="light"] .sider { background: rgba(253, 250, 245, 0.96); }

input, select, textarea,
.login-field input,
.toolbar input,
.toolbar input[type="text"],
.toolbar input[type="password"],
.toolbar input[type="number"],
.toolbar input[type="month"],
.toolbar input[type="search"],
.toolbar select,
.form-stack input,
.form-stack select,
.form-stack textarea,
.cron-code,
.detail-pre,
.bind-list,
.hbar-track {
  background: var(--field);
  color: var(--text);
}
.channel-card {
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(200, 149, 106, 0.16), transparent 55%),
    var(--panel);
}
.lang-switch,
.login-lang-select {
  background: var(--field);
  color: var(--text);
}
.toast { background: var(--panel); color: var(--text); }

.btn.login-submit { background: var(--grad-accent); color: #1c140e; }
.compare-bar.last { background: linear-gradient(180deg, #c2b9ac, #6f6256); }
.compare-bar.this {
  background: linear-gradient(180deg, #e6bc8f, #c8956a);
  box-shadow: 0 0.55rem 1.2rem rgba(200, 149, 106, 0.32);
}

.page-stack-in { animation: pageRise 0.38s cubic-bezier(0.22, 0.8, 0.36, 1) both; }
@keyframes pageRise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.stat-chip, .card h2 .ico, .nav-btn .ico { transition: transform 0.22s ease, color 0.22s ease; }
.stat:hover .stat-chip { transform: translateY(-1px) scale(1.06); }
.card:hover > h2 .ico { color: var(--accent); transform: scale(1.08); }
.ui-empty-icon {
  width: 3rem; height: 3rem; margin: 0 auto 0.35rem;
  display: grid; place-items: center;
  border-radius: 0.9rem;
  background: rgba(200, 149, 106, 0.12);
  border: 1px solid rgba(200, 149, 106, 0.28);
  color: var(--accent-2);
}

.hbar-row {
  padding: 0.28rem 0.35rem;
  border-radius: 10px;
  transition: background 0.18s ease;
}
.hbar-row:hover { background: rgba(200, 149, 106, 0.1); }
.hbar-fill { transition: width 0.55s cubic-bezier(0.22, 0.8, 0.36, 1), filter 0.18s ease; }
.hbar-row:hover .hbar-fill { filter: brightness(1.12); }
.hbar-sub {
  display: none;
  grid-column: 1 / -1;
  font-size: 11px;
  color: var(--warn);
}
.hbar-row:hover .hbar-sub { display: block; }

.chart-bar-col { cursor: pointer; }
.chart-bar-col rect { transition: filter 0.18s ease; }
.chart-bar-col:hover rect { filter: brightness(1.16); }
.donut-seg { cursor: pointer; transition: opacity 0.18s ease, filter 0.18s ease; }
.donut-wrap:hover .donut-seg { opacity: 0.42; }
.donut-wrap .donut-seg:hover { opacity: 1; filter: brightness(1.12); }

.meter {
  height: 8px;
  border-radius: 999px;
  background: var(--field);
  border: 1px solid var(--line);
  overflow: hidden;
}
.meter-fill {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transform-origin: left center;
  animation: hbarGrow 0.55s cubic-bezier(0.22, 0.8, 0.36, 1) both;
  transition: width 0.45s cubic-bezier(0.22, 0.8, 0.36, 1);
}
.meter-fill.ok { background: linear-gradient(90deg, #c5e0c8, var(--ok)); }
.meter-fill.muted { background: linear-gradient(90deg, #d9d0c4, var(--muted)); }

@media (prefers-reduced-motion: reduce) {
  .page-stack-in,
  .meter-fill,
  .stat-chip,
  .chart-bar-col rect,
  .donut-seg,
  .hbar-fill { animation: none !important; transition: none !important; }
}

/* ================================================================
   Design System v3 · 收尾层（2026-10-24）
   品牌副标 / 页眉 eyebrow / 命令面板 / 工作台站点卡精修
   ================================================================ */

/* —— 品牌锁形：印章 + 双行字 —— */
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-sub {
  display: block;
  margin-top: 2px;
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.26em;
  color: var(--accent);
  white-space: nowrap;
}
body.sider-collapsed .brand-text { display: none; }

/* —— 页眉 eyebrow（分组标签）+ 标题分隔线 —— */
.page-eyebrow {
  margin-bottom: 0.3rem;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}
.page-head {
  padding-bottom: 0.9rem;
  margin-bottom: 0.4rem;
  border-bottom: 1px solid var(--line);
  background: none;
  border-radius: 0;
}
.page-head::before { display: none; }
.page-head:not(.has-icon) { padding-left: 0; }
.page-head h1 {
  font-size: clamp(1.2rem, 1.8vw, 1.45rem);
  letter-spacing: -0.015em;
}
.page-head-icon {
  width: 2.8rem;
  height: 2.8rem;
  border-radius: 14px;
  background: var(--grad-accent-soft);
  border: 1px solid rgba(200, 149, 106, 0.32);
  box-shadow: inset 0 1px 0 rgba(255, 244, 228, 0.08), 0 10px 24px rgba(168, 120, 80, 0.16);
}

/* —— 命令面板（⌘K 全站搜索） —— */
.cmd-overlay {
  position: fixed;
  inset: 0;
  z-index: 130;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 11vh 16px 0;
  background: rgba(5, 4, 3, 0.62);
  backdrop-filter: blur(6px) saturate(1.05);
  -webkit-backdrop-filter: blur(6px) saturate(1.05);
  animation: fadeUp 0.16s ease both;
}
[data-theme="light"] .cmd-overlay { background: rgba(36, 28, 17, 0.28); }
.cmd-panel {
  width: min(34rem, 100%);
  background: var(--panel);
  border: 1px solid rgba(200, 149, 106, 0.28);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3), 0 0 0 1px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  animation: modalPop 0.22s var(--ease) both;
}
.cmd-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--accent-2);
}
.cmd-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 14.5px;
}
.cmd-input:focus { border: 0; box-shadow: none; outline: none; }
.cmd-list { max-height: 46vh; overflow: auto; padding: 6px; }
.cmd-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-2, var(--text));
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.cmd-item .ico { color: var(--muted); flex: none; }
.cmd-item.active {
  background: var(--grad-accent-soft);
  color: var(--text);
  box-shadow: inset 0 0 0 1px rgba(200, 149, 106, 0.28);
}
.cmd-item.active .ico { color: var(--accent-2); }
.cmd-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmd-item-group { flex: none; font-size: 11px; color: var(--muted); }
.cmd-empty { padding: 22px; text-align: center; color: var(--muted); font-size: 13px; }
.cmd-foot {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}
.cmd-foot span { display: inline-flex; align-items: center; gap: 5px; }

/* —— 工作台站点卡：隐藏占位 note、统一 tile 高度 —— */
.dash-site-note { display: none; }
.dash-site-block h2 { margin-bottom: 0.55rem; }
.dash-site-metrics { gap: 0.6rem; }
.dash-site-metrics .stat { min-height: 6.4rem; }
.dash-hero {
  background:
    radial-gradient(80% 130% at 0% 0%, rgba(232, 194, 148, 0.13), transparent 55%),
    radial-gradient(60% 110% at 100% 0%, rgba(168, 120, 80, 0.13), transparent 60%),
    linear-gradient(120deg, #191410, #100d0a);
}
[data-theme="light"] .dash-hero {
  background:
    radial-gradient(80% 130% at 0% 0%, rgba(200, 149, 106, 0.16), transparent 55%),
    linear-gradient(120deg, #fdf6ec, #f6ecdf);
}
[data-theme="light"] .stat.accent {
  background: linear-gradient(145deg, rgba(200, 149, 106, 0.18), rgba(253, 250, 245, 0.95));
  border-color: rgba(168, 120, 80, 0.40);
}
[data-theme="light"] .nav-btn.active { color: var(--text); }
[data-theme="light"] .nav-btn.active::before { box-shadow: none; }
[data-theme="light"] .brand-seal { color: #241a10; }

/* ═══ 全局交互一致性（2026-10-29） ═══ */
.card { transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease; }
.card:hover { border-color: rgba(200,149,106,.28); }
.nav-btn, .btn, .tag, .table tbody tr { transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease; }
.table tbody tr:hover { background: rgba(200,149,106,.045); }
.page > .card, .page > .stack > .card { animation: fadeUp .24s ease both; }
.btn:active:not(:disabled), .nav-btn:active:not(:disabled) { transform: translateY(1px); }
@media (prefers-reduced-motion: reduce) {
  .card, .nav-btn, .btn, .tag, .table tbody tr, .page > .card, .page > .stack > .card { animation: none !important; transition: none !important; }
}
