/* ============================================================================
 * ztncui · 2026 双主题设计系统
 * ----------------------------------------------------------------------------
 * 两套风格，一套组件，右上角一键切换（不刷新）：
 *   [data-theme="aurora"]  极光玻璃 · 轻盈通透（默认）
 *   [data-theme="ivory"]   米白编辑部 · 杂志感、发丝线、衬线数字
 *
 * 说明：
 *  · 仍然跑在现有 Bootstrap 3 的 DOM 上，但 **外壳（顶栏/侧栏/首页/登录）已重写**，
 *    不再依赖 Bootstrap 的 navbar / panel 外观。
 *  · 全部尺寸/颜色走变量，切换主题只换变量，不动结构。
 *  · 旧页面里的内联 <style> 由第 9 节的覆盖层统一压住，逐页迁移后删掉覆盖。
 * ========================================================================== */

/* ── 1. 主题变量 ───────────────────────────────────────────────────────── */
:root[data-theme="aurora"], :root:not([data-theme]) {
  color-scheme: light;

  --page: #f6f7fb;
  --surface: rgba(255, 255, 255, .78);
  --surface-solid: #ffffff;
  --surface-2: rgba(255, 255, 255, .58);
  --surface-3: #f1f3f9;
  --overlay: rgba(255, 255, 255, .82);

  --line: rgba(17, 24, 39, .07);
  --line-2: rgba(17, 24, 39, .12);

  --ink: #0e1424;
  --ink-2: #4a5568;
  --ink-3: #646f83; /* AA: 在 #f6f7fb 上约 4.6:1 */

  --primary: #4f46e5;
  --primary-2: #7c3aed;
  --primary-weak: rgba(79, 70, 229, .1);
  --primary-grad: linear-gradient(115deg, #4338ca 0%, #6d28d9 48%, #7e22ce 100%);

  --ok: #10b981;  --ok-weak: rgba(16, 185, 129, .12);
  --warn: #f59e0b; --warn-weak: rgba(245, 158, 11, .13);
  --bad: #f43f5e;  --bad-weak: rgba(244, 63, 94, .1);
  --info: #0ea5e9; --info-weak: rgba(14, 165, 233, .12);

  --r-xl: 24px; --r-lg: 18px; --r-md: 13px; --r-sm: 10px;
  --shadow-1: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
  --shadow-2: 0 8px 24px -8px rgba(24, 39, 75, .16), 0 2px 6px rgba(24, 39, 75, .06);
  --shadow-3: 0 28px 60px -24px rgba(24, 39, 75, .28), 0 8px 20px -12px rgba(24, 39, 75, .14);
  --card-border: 1px solid rgba(255, 255, 255, .9);
  --card-bg: var(--surface);
  --card-hover: var(--surface); /* 覆盖旧主题的深色悬浮值 */
  --card-blur: blur(18px) saturate(140%);
  --hero-text: #fff;
  --font-ui: Manrope, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-display: Manrope, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --nav-active-bg: #fff;
  --nav-active-fg: var(--primary);
  --nav-active-shadow: var(--shadow-2), inset 0 1px 0 #fff;
  --num-font: var(--font-ui);
  --num-weight: 800;
  --num-letter: -.035em;
  --table-hover: rgba(99, 102, 241, .045);
  --pill-radius: 999px;
  --btn-radius: 11px;
}

:root[data-theme="ivory"] {
  color-scheme: light;

  --page: #faf7f2;
  --surface: #ffffff;
  --surface-solid: #ffffff;
  --surface-2: #f5f1e9;
  --surface-3: #efe9de;
  --overlay: rgba(250, 247, 242, .9);

  --line: #e3ded4;
  --line-2: #cfc8ba;

  --ink: #17181c;
  --ink-2: #5a5d66;
  --ink-3: #74747d; /* AA: 在 #faf7f2 上约 4.6:1 */

  --primary: #1f5e4f;          /* 墨绿 */
  --primary-2: #b23a2e;        /* 朱红（强调） */
  --primary-weak: rgba(31, 94, 79, .08);
  --primary-grad: linear-gradient(120deg, #1f5e4f 0%, #2f7d69 100%);

  --ok: #1f5e4f;  --ok-weak: rgba(31, 94, 79, .08);
  --warn: #b08a3e; --warn-weak: rgba(176, 138, 62, .1);
  --bad: #b23a2e;  --bad-weak: rgba(178, 58, 46, .08);
  --info: #3f5b6b; --info-weak: rgba(63, 91, 107, .08);

  --r-xl: 4px; --r-lg: 3px; --r-md: 2px; --r-sm: 2px;
  --shadow-1: none;
  --shadow-2: none;
  --shadow-3: 0 20px 40px -30px rgba(23, 24, 28, .4);
  --card-border: 1px solid var(--line);
  --card-bg: #fff;
  --card-hover: #ffffff; /* 覆盖旧主题的深色悬浮值 */
  --card-blur: none;
  --hero-text: #17181c;
  --font-ui: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  /* 中文标题用无衬线：Windows 未安装 Songti/Noto Serif SC，回退到宋体后
     font-weight 600/700 会触发合成粗体，渲染成"双描边重影"。
     编辑感靠字号/字距/发丝线维持，数字仍走 Georgia 衬线（--num-font）。 */
  --font-display: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --nav-active-bg: transparent;
  --nav-active-fg: var(--ink);
  --nav-active-shadow: none;
  --num-font: Georgia, "Times New Roman", "Songti SC", serif;
  --num-weight: 400;
  --num-letter: -.02em;
  --table-hover: rgba(23, 24, 28, .022);
  --pill-radius: 2px;
  --btn-radius: 2px;
}

/* ── 2. 基础 ───────────────────────────────────────────────────────────── */
* { box-sizing: border-box; }
/* 禁用合成粗体：假粗体在中文衬线/部分字体上会渲染成"双描边重影" */
html { font-synthesis: none; }

html, body { margin: 0; padding: 0; height: 100%; }
html { background: var(--page); }
body {
  background: var(--page);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 14px;
  letter-spacing: .005em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
/* 极光底 */
:root[data-theme="aurora"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(760px 760px at 2% -16%, rgba(125, 211, 252, .72), transparent 60%),
    radial-gradient(820px 820px at 98% -12%, rgba(196, 181, 253, .78), transparent 62%),
    radial-gradient(680px 680px at 46% 122%, rgba(110, 231, 183, .60), transparent 64%);
  filter: blur(2px);
}
:root[data-theme="ivory"] body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, .7), transparent 28%);
}
.bg-grain {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: .3; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)' opacity='.14'/%3E%3C/svg%3E");
}
:root[data-theme="ivory"] .bg-grain { opacity: .12; }

a { color: var(--primary); text-decoration: none; transition: color .16s; }
a:hover, a:focus { color: var(--primary-2); text-decoration: none; }
h1, h2, h3, h4, h5, h6 {
  color: var(--ink) !important;
  background: none !important;
  -webkit-background-clip: border-box !important; background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
  text-shadow: none !important;
  font-weight: 700;
}
a, a:hover, a:focus { text-shadow: none !important; }
code { background: var(--surface-3) !important; color: var(--ink-2) !important; border-radius: 6px; }
hr { border-color: var(--line); }
::selection { background: var(--primary-weak); }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(120, 130, 150, .3); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(120, 130, 150, .5); background-clip: content-box; }

/* ── 3. 外壳：顶栏 ─────────────────────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; height: 68px; z-index: 1030;
  display: flex; align-items: center; gap: 18px; padding: 0 22px;
  background: var(--overlay);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
}
:root[data-theme="ivory"] .topbar { border-bottom: 1.5px solid var(--ink); background: rgba(250, 247, 242, .94); }

.tb-brand { display: flex; align-items: center; gap: 11px; min-width: 214px; }
.tb-mark {
  width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; flex: 0 0 auto;
  background: conic-gradient(from 210deg, var(--primary), var(--primary-2), #22d3ee, var(--primary));
  box-shadow: 0 8px 18px -6px rgba(79, 70, 229, .55), inset 0 1px 0 rgba(255, 255, 255, .55);
}
.tb-mark svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 1.8; }
:root[data-theme="ivory"] .tb-mark {
  background: none; border: 1.4px solid var(--ink); border-radius: 50%; box-shadow: none;
}
:root[data-theme="ivory"] .tb-mark svg { stroke: var(--ink); }
.tb-brand b { font-size: 15px; font-weight: 800; letter-spacing: -.02em; display: block; font-family: var(--font-display); }
.tb-brand span { display: block; font-size: 9.5px; color: var(--ink-3); letter-spacing: .2em; font-weight: 600; margin-top: 1px; text-transform: uppercase; }

.tb-nav { display: flex; align-items: center; gap: 2px; }
.tb-nav a {
  height: 38px; padding: 0 14px; border-radius: 999px; display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 600; color: var(--ink-2); transition: .18s;
}
.tb-nav a:hover { background: var(--surface-3); color: var(--ink); }
.tb-nav a.active { background: var(--primary-weak); color: var(--primary); }
:root[data-theme="ivory"] .tb-nav a { border-radius: 0; height: 40px; border-bottom: 2px solid transparent; }
:root[data-theme="ivory"] .tb-nav a.active { background: none; border-bottom-color: var(--primary-2); color: var(--ink); }

.tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-icon {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: var(--surface); border: var(--card-border); box-shadow: var(--shadow-1);
  position: relative; transition: .16s;
}
:root[data-theme="ivory"] .tb-icon { background: transparent; border-color: var(--line); border-radius: 2px; }
.tb-icon:hover { border-color: var(--line-2); transform: translateY(-1px); }
.tb-icon svg { width: 17px; height: 17px; stroke: var(--ink-2); fill: none; stroke-width: 1.8; }
.tb-icon .dot { position: absolute; top: 9px; right: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--bad); box-shadow: 0 0 0 2px var(--surface-solid); }

/* 风格切换：极光 / 米白 */
.style-switch {
  display: flex; align-items: center; height: 38px; padding: 3px; border-radius: 999px;
  background: var(--surface); border: var(--card-border); box-shadow: var(--shadow-1);
}
:root[data-theme="ivory"] .style-switch { background: transparent; border-radius: 2px; border-color: var(--line); box-shadow: none; }
.style-switch button {
  height: 30px; padding: 0 13px; border: 0; border-radius: 999px; cursor: pointer; background: transparent;
  font-size: 12px; font-weight: 700; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px;
  transition: .18s; font-family: inherit;
}
:root[data-theme="ivory"] .style-switch button { border-radius: 2px; }
.style-switch button i { width: 8px; height: 8px; border-radius: 50%; display: block; }
.style-switch button[data-style="aurora"] i { background: linear-gradient(135deg, #6366f1, #a855f7); }
.style-switch button[data-style="ivory"] i { background: linear-gradient(135deg, #1f5e4f, #b23a2e); }
:root[data-theme="aurora"] .style-switch button[data-style="aurora"] { background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow-1); }
:root[data-theme="ivory"] .style-switch button[data-style="ivory"] { background: var(--ink); color: #faf7f2; box-shadow: none; }
:root[data-theme="ivory"] .style-switch button[data-style="aurora"] { background: transparent; color: var(--ink-3); box-shadow: none; }
:root[data-theme="ivory"] .style-switch button.on { background: var(--ink); color: #faf7f2; }

.tb-user {
  display: flex; align-items: center; gap: 9px; height: 38px; padding: 0 12px 0 5px; border-radius: 999px; cursor: pointer;
  background: var(--surface); border: var(--card-border); box-shadow: var(--shadow-1);
}
:root[data-theme="ivory"] .tb-user { background: transparent; border-radius: 2px; border-color: var(--line); box-shadow: none; }
.tb-avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 11.5px; font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #a855f7); color: #fff;
}
:root[data-theme="ivory"] .tb-avatar { background: var(--ink); }
.tb-user small { font-size: 12.5px; font-weight: 600; color: var(--ink-2); }

/* ── 4. 外壳：布局与侧栏 ───────────────────────────────────────────────── */
/* 注意：这里不能给 z-index —— 一旦形成层叠上下文，页面内的 Bootstrap 弹窗
   （.modal z-index 1050）就永远盖不过 z-index 1030 的顶栏，表现为"弹窗被顶栏遮住、
   里面的按钮点不到"。整页底色的层级改由 body::before 的 -1 保证。 */
.shell { position: relative; display: grid; grid-template-columns: 236px minmax(0, 1fr); padding-top: 68px; min-height: 100vh; }
.shell.no-side { grid-template-columns: minmax(0, 1fr); }
:root[data-theme="ivory"] .shell { grid-template-columns: 250px minmax(0, 1fr); }

.side { position: sticky; top: 68px; align-self: start; height: calc(100vh - 68px); overflow-y: auto; padding: 18px 14px 22px 22px; }
.side::-webkit-scrollbar { width: 0; }
:root[data-theme="ivory"] .side { border-right: 1px solid var(--line); padding: 30px 24px 22px 26px; counter-reset: sec; }

.side-group { font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 18px 0 8px 12px; }
.side-group:first-child { margin-top: 0; }
:root[data-theme="ivory"] .side-group { font-size: 10px; letter-spacing: .2em; margin: 22px 0 10px 0; }

.side-item {
  display: flex; align-items: center; gap: 11px; height: 42px; padding: 0 12px; border-radius: 12px;
  color: var(--ink-2); font-size: 13.5px; font-weight: 600; cursor: pointer; position: relative; transition: .18s;
}
.side-item svg { width: 17px; height: 17px; stroke: currentColor; fill: none; stroke-width: 1.7; opacity: .78; flex: 0 0 auto; stroke-linecap: round; stroke-linejoin: round; }
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.on { background: var(--nav-active-bg); color: var(--nav-active-fg); box-shadow: var(--nav-active-shadow); }
.side-item.on svg { opacity: 1; }
.side-item.on::before {
  content: ""; position: absolute; left: -8px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
}
.side-item .cnt { margin-left: auto; font-size: 10px; font-weight: 800; color: #fff; background: var(--bad); padding: 2px 7px; border-radius: 999px; }
:root[data-theme="ivory"] .side-item { border-radius: 0; height: 38px; padding: 0; gap: 8px; font-size: 13.5px; counter-increment: sec; }
:root[data-theme="ivory"] .side-item.on::before { display: none; }
:root[data-theme="ivory"] .side-item::before {
  content: counter(sec, decimal-leading-zero); position: static; width: 16px; height: auto; background: none; border-radius: 0;
  font-family: Georgia, serif; font-size: 10.5px; color: var(--ink-3); font-weight: 400;
}
:root[data-theme="ivory"] .side-item.on::after {
  content: ""; position: absolute; right: 0; top: 11px; width: 14px; height: 2px; background: var(--primary-2);
}
:root[data-theme="ivory"] .side-item.on { font-weight: 700; }

.main { min-width: 0; padding: 26px 28px 44px; }
:root[data-theme="ivory"] .main { padding: 34px 46px 46px; }

/* 页面报头 */
.page-head { display: flex; align-items: flex-end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head .l { flex: 1; min-width: 240px; }
.eyebrow { font-size: 10.5px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--primary); }
:root[data-theme="ivory"] .eyebrow { color: var(--primary-2); letter-spacing: .24em; }
.page-title {
  font-family: var(--font-display); font-size: 30px; font-weight: 800; letter-spacing: -.03em;
  line-height: 1.15; margin: 10px 0 0;
}
:root[data-theme="ivory"] .page-title { font-size: 42px; font-weight: 600; letter-spacing: -.015em; }
:root[data-theme="ivory"] .page-head { border-bottom: 2px solid var(--ink); padding-bottom: 18px; margin-bottom: 26px; }
.page-sub { color: var(--ink-2); font-size: 13px; margin-top: 8px; }
.head-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ── 5. 组件：卡片 / 数字 / 徽标 / 表格 / 按钮 ─────────────────────────── */
.card {
  background: var(--card-bg); border: var(--card-border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); backdrop-filter: var(--card-blur);
  position: relative; overflow: hidden;
}
:root[data-theme="ivory"] .card { box-shadow: none; }
.card-pad { padding: 18px 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 12px; gap: 12px; }
:root[data-theme="ivory"] .card-head { padding: 16px 20px 12px; border-bottom: 1px solid var(--line); }
.card-head h3 { font-size: 13.5px; font-weight: 800; letter-spacing: -.01em; margin: 0; }
:root[data-theme="ivory"] .card-head h3 { font-family: var(--font-display); font-size: 17px; font-weight: 600; }
.card-head .sub { font-size: 11px; color: var(--ink-3); font-weight: 600; margin-top: 3px; }
.card-more { font-size: 11.5px; font-weight: 700; color: var(--primary); cursor: pointer; display: inline-flex; align-items: center; gap: 4px; }
:root[data-theme="ivory"] .card-more { color: var(--primary-2); letter-spacing: .12em; text-transform: uppercase; font-size: 10.5px; }

.kpi { padding: 18px; }
.kpi .k-top { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.kpi .tile { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; }
:root[data-theme="ivory"] .kpi .tile { background: none !important; border: 1px solid var(--line); border-radius: 2px; }
.kpi .tile svg { width: 16px; height: 16px; stroke: #fff; fill: none; stroke-width: 1.9; }
:root[data-theme="ivory"] .kpi .tile svg { stroke: var(--ink-2); }
.t-indigo { background: linear-gradient(135deg, #6366f1, #4338ca); }
.t-mint { background: linear-gradient(135deg, #34d399, #059669); }
.t-sky { background: linear-gradient(135deg, #38bdf8, #0284c7); }
.t-rose { background: linear-gradient(135deg, #fb7185, #e11d48); }
.kpi .k-lbl { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; color: var(--ink-3); text-transform: uppercase; }
:root[data-theme="ivory"] .kpi .k-lbl { letter-spacing: .2em; font-weight: 600; }
.kpi .k-val { font-family: var(--num-font); font-size: 27px; font-weight: var(--num-weight); letter-spacing: var(--num-letter); line-height: 1.05; font-variant-numeric: tabular-nums; }
.kpi .k-val em { font-style: normal; font-size: 12px; color: var(--ink-3); margin-left: 2px; font-family: var(--font-ui); }
.kpi .k-foot { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 11.5px; font-weight: 700; color: var(--ink-3); }
.kpi .k-foot.up { color: var(--ok); }
.kpi .k-foot.dn { color: var(--bad); }
.spark { display: block; width: 100%; height: 34px; margin-top: 10px; }

/* 表格 */
.ds-table { width: 100%; border-collapse: collapse; }
.ds-table th {
  font-size: 10.5px; font-weight: 800; letter-spacing: .1em; color: var(--ink-3); text-transform: uppercase;
  text-align: left; padding: 10px 20px; border-bottom: 1px solid var(--line);
}
:root[data-theme="ivory"] .ds-table th { font-size: 9.5px; letter-spacing: .18em; padding: 11px 20px; }
.ds-table td { padding: 13px 20px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--ink-2); }
:root[data-theme="ivory"] .ds-table td { padding: 15px 20px; font-weight: 500; }
.ds-table tr:last-child td { border-bottom: 0; }
.ds-table tbody tr:hover td { background: var(--table-hover); }
.ds-table .nm { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 700; }
.ds-table .nm svg { flex: 0 0 auto; }
:root[data-theme="ivory"] .ds-table .nm { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; }
.ds-table td.r { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--ink); }
:root[data-theme="ivory"] .ds-table td.r { font-family: Georgia, serif; font-weight: 400; }

.pill {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px; border-radius: var(--pill-radius);
  font-size: 11px; font-weight: 800; letter-spacing: .01em; white-space: nowrap;
}
.pill i { width: 5px; height: 5px; border-radius: 50%; display: block; background: currentColor; }
.pill.ok { background: var(--ok-weak); color: var(--ok); }
.pill.warn { background: var(--warn-weak); color: var(--warn); }
.pill.bad { background: var(--bad-weak); color: var(--bad); }
.pill.info { background: var(--info-weak); color: var(--info); }
.pill.mute { background: var(--surface-3); color: var(--ink-3); }
:root[data-theme="ivory"] .pill { border: 1px solid currentColor; background: transparent !important; height: 20px; padding: 0 7px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }

.bar { width: 74px; height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; display: inline-block; vertical-align: middle; }
.bar s { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #818cf8, #4f46e5); text-decoration: none; }
.bar s.warn { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
:root[data-theme="ivory"] .bar { height: 2px; border-radius: 0; background: var(--line-2); width: 70px; }
:root[data-theme="ivory"] .bar s { border-radius: 0; background: var(--ink); }

/* 按钮 */
.btn {
  height: 38px; padding: 0 16px; border-radius: var(--btn-radius); display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; cursor: pointer; border: 1px solid transparent; transition: .18s; font-family: inherit;
}
.btn svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2; }
.btn-primary {
  background: var(--primary) !important; border: 1px solid var(--primary) !important;
  color: #fff !important; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, .55) !important;
}
.btn-primary:hover, .btn-primary:focus {
  background: var(--primary) !important; filter: brightness(1.06); color: #fff !important;
  transform: translateY(-1px);
}
:root[data-theme="ivory"] .btn-primary { background: var(--ink); box-shadow: none; }
.btn-ghost { background: var(--surface); border-color: var(--line-2); color: var(--ink-2); box-shadow: var(--shadow-1); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
:root[data-theme="ivory"] .btn-ghost { background: transparent; box-shadow: none; border-color: var(--line-2); }
.btn-hero { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .38); color: #fff; backdrop-filter: blur(6px); }
.btn-hero:hover { background: rgba(255, 255, 255, .24); color: #fff; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12px; border-radius: var(--r-sm); }

/* 输入 */
.form-control, input[type="text"], input[type="password"], input[type="email"], input[type="number"], select, textarea {
  background: var(--surface-solid) !important; color: var(--ink) !important;
  border: 1px solid var(--line-2) !important; border-radius: var(--r-sm) !important;
  box-shadow: none !important; font-family: inherit;
}
.form-control { height: 40px; padding: 9px 13px; font-size: 13.5px; }
:root[data-theme="ivory"] .form-control { border-radius: 0 !important; border-width: 0 0 1px 0 !important; padding-left: 0; background: transparent !important; }
.form-control:focus, input:focus, select:focus, textarea:focus, .form-control:focus {
  border-color: var(--primary) !important; outline: 0 !important;
  box-shadow: 0 0 0 3px var(--primary-weak) !important;
}
:root[data-theme="ivory"] .form-control:focus { box-shadow: none !important; border-bottom-width: 2px !important; }
label, .control-label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.help-block, .text-muted, small { color: var(--ink-3) !important; }

/* 提示条 / 弹窗 / 分页 等（沿用 Bootstrap 类名） */
.alert { border-radius: var(--r-md); border: 1px solid var(--line); padding: 13px 16px; font-size: 13.5px; box-shadow: var(--shadow-1); }
.alert-success { background: var(--ok-weak); border-color: color-mix(in srgb, var(--ok) 28%, transparent); color: var(--ok); }
.alert-info { background: var(--info-weak); border-color: color-mix(in srgb, var(--info) 26%, transparent); color: var(--info); }
.alert-warning { background: var(--warn-weak); border-color: color-mix(in srgb, var(--warn) 28%, transparent); color: var(--warn); }
.alert-danger { background: var(--bad-weak); border-color: color-mix(in srgb, var(--bad) 28%, transparent); color: var(--bad); }
.panel { background: var(--card-bg) !important; border: var(--card-border) !important; border-radius: var(--r-lg) !important; box-shadow: var(--shadow-2); }
.panel-heading { background: transparent !important; border-bottom: 1px solid var(--line) !important; color: var(--ink) !important; font-weight: 700; }
.panel-body { padding: 18px; }
.modal-content { background: var(--surface-solid) !important; border: 1px solid var(--line) !important; border-radius: var(--r-lg) !important; box-shadow: var(--shadow-3) !important; }
.modal-header, .modal-footer { border-color: var(--line) !important; }
.pagination > li > a, .pagination > li > span { color: var(--ink-2); background: var(--surface-solid); border-color: var(--line); }
.pagination > .active > a { background: var(--primary) !important; border-color: var(--primary) !important; color: #fff !important; }
.nav-tabs { border-bottom: 1px solid var(--line); }
.nav-tabs > li > a { border: 0 !important; color: var(--ink-2); border-bottom: 2px solid transparent !important; background: transparent !important; font-weight: 600; }
.nav-tabs > li.active > a { color: var(--primary) !important; border-bottom-color: var(--primary) !important; background: transparent !important; }
.label, .badge { border-radius: var(--pill-radius) !important; font-weight: 700 !important; font-size: 11px !important; padding: 3px 9px !important; }
.table > thead > tr > th { color: var(--ink-3); background: transparent; border-bottom: 1px solid var(--line) !important; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; }
.table > tbody > tr > td { border-top: 1px solid var(--line) !important; color: var(--ink-2); vertical-align: middle; }
.table > tbody > tr:hover > td { background: var(--table-hover) !important; }


/* 5.8 旧页面的 .btn-* 语义色（Bootstrap 3 类名，全站大量使用）
   统一成"浅底 + 描边 + 语义色文字"，避免整排高饱和色块；悬停时才加深。 */
.btn-default {
  background: var(--surface) !important; border: 1px solid var(--line-2) !important;
  color: var(--ink-2) !important; box-shadow: var(--shadow-1) !important;
}
.btn-default:hover, .btn-default:focus {
  background: var(--surface-2) !important; border-color: var(--primary) !important; color: var(--primary) !important;
}
.btn-info {
  background: var(--info-weak) !important; border: 1px solid color-mix(in srgb, var(--info) 32%, transparent) !important;
  color: var(--info) !important; box-shadow: none !important;
}
.btn-info:hover, .btn-info:focus { filter: brightness(.97); color: var(--info) !important; }
.btn-success {
  background: var(--ok-weak) !important; border: 1px solid color-mix(in srgb, var(--ok) 32%, transparent) !important;
  color: var(--ok) !important; box-shadow: none !important;
}
.btn-success:hover { filter: brightness(.97); color: var(--ok) !important; }
.btn-warning {
  background: var(--warn-weak) !important; border: 1px solid color-mix(in srgb, var(--warn) 34%, transparent) !important;
  color: var(--warn) !important; box-shadow: none !important;
}
.btn-warning:hover { filter: brightness(.97); color: var(--warn) !important; }
.btn-danger {
  background: var(--bad-weak) !important; border: 1px solid color-mix(in srgb, var(--bad) 32%, transparent) !important;
  color: var(--bad) !important; box-shadow: none !important;
}
.btn-danger:hover { filter: brightness(.97); color: var(--bad) !important; }
/* 页头/卡片头里的操作按钮不要贴边到看不清 */
.header-top .btn, .network-header .btn, .page-head .btn { white-space: nowrap; }

/* 5.9 兼容：还没迁到新外壳的页面（admin_layout 等）仍然用 .container / .container-fluid，
   这里补上固定顶栏的占位高度，避免标题被顶栏压住。逐页迁移后可以删掉。 */
body > .container, body > .container-fluid { padding-top: 92px; max-width: 1440px; margin-left: auto; margin-right: auto; }
@media (max-width: 900px) { body > .container, body > .container-fluid { padding-top: 84px; } }

/* ── 6. 首页专用 ───────────────────────────────────────────────────────── */
.hero {
  position: relative; border-radius: var(--r-xl); padding: 28px 32px; overflow: hidden;
  background: var(--primary-grad); color: #fff;
  box-shadow: 0 30px 60px -28px rgba(76, 29, 149, .65), inset 0 1px 0 rgba(255, 255, 255, .22);
}
.hero::before {
  content: ""; position: absolute; width: 520px; height: 520px; right: -120px; top: -260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, .26), transparent 62%);
}
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(120% 80% at 8% 0%, rgba(34, 211, 238, .3), transparent 55%);
}
.hero > * { position: relative; z-index: 1; }
.hero-row { display: flex; align-items: flex-end; gap: 30px; flex-wrap: wrap; }
.hero h1 { font-size: 26px; font-weight: 800; letter-spacing: -.03em; font-family: var(--font-display); color: #fff !important; margin: 0; }
.hero p { color: rgba(255, 255, 255, .82) !important; font-size: 13px; margin-top: 8px; font-weight: 500; }
.hero-stats { display: flex; margin-left: auto; }
.hero-stat { padding: 0 24px; border-left: 1px solid rgba(255, 255, 255, .22); }
.hero-stat:first-child { border-left: 0; }
.hero-stat b { display: block; font-family: var(--num-font); font-size: 30px; font-weight: 800; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; color: #fff; }
.hero-stat span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .08em; color: rgba(255, 255, 255, .74) !important; margin-top: 7px; }
.hero-cta { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

/* 米白主题：首页不走大色块，改成"报头 + 数字带" */
:root[data-theme="ivory"] .hero {
  background: transparent; box-shadow: none; border-radius: 0; padding: 0 0 22px;
  border-bottom: 1px solid var(--line); color: var(--ink);
}
:root[data-theme="ivory"] .hero::before, :root[data-theme="ivory"] .hero::after { display: none; }
:root[data-theme="ivory"] .hero h1 { color: var(--ink) !important; font-size: 42px; font-weight: 600; }
:root[data-theme="ivory"] .hero p { color: var(--ink-2) !important; }
:root[data-theme="ivory"] .hero-stat b { color: var(--ink); }
:root[data-theme="ivory"] .hero-stat span { color: var(--ink-3) !important; }
:root[data-theme="ivory"] .hero-stat { border-left-color: var(--line); }
:root[data-theme="ivory"] .btn-hero { background: transparent; border-color: var(--line-2); color: var(--ink-2); backdrop-filter: none; }
:root[data-theme="ivory"] .btn-hero:hover { background: var(--surface-2); color: var(--ink); }

.grid-kpi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-top: 18px; }
:root[data-theme="ivory"] .grid-kpi { gap: 0; border-bottom: 1px solid var(--line); }
:root[data-theme="ivory"] .grid-kpi .card { background: transparent; border: 0; border-left: 1px solid var(--line); border-radius: 0; }
:root[data-theme="ivory"] .grid-kpi .card:first-child { border-left: 0; }
:root[data-theme="ivory"] .grid-kpi .kpi { padding: 22px 0 20px 26px; }
:root[data-theme="ivory"] .grid-kpi .card:first-child .kpi { padding-left: 0; }

.grid-2 { display: grid; grid-template-columns: 1.6fr minmax(0, 1fr); gap: 16px; margin-top: 16px; }
:root[data-theme="ivory"] .grid-2 { gap: 44px; margin-top: 30px; }

.tl { padding: 4px 20px 16px; }
:root[data-theme="ivory"] .tl { padding: 4px 20px 16px; }
.tl-item { display: flex; gap: 12px; padding: 11px 0; position: relative; }
.tl-item:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 34px; bottom: -2px; width: 1px; background: var(--line-2); }
:root[data-theme="ivory"] .tl-item { border-bottom: 1px solid var(--line); }
:root[data-theme="ivory"] .tl-item:not(:last-child)::after, :root[data-theme="ivory"] .tl-item .ic { display: none; }
.tl-item .ic { width: 27px; height: 27px; border-radius: 9px; flex: 0 0 auto; display: grid; place-items: center; background: var(--surface-solid); border: 1px solid var(--line-2); box-shadow: var(--shadow-1); z-index: 1; }
.tl-item .ic svg { width: 13px; height: 13px; stroke: currentColor; fill: none; stroke-width: 2; }
.tl-item .tx { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.5; }
.tl-item .tx b { color: var(--ink); font-weight: 800; }
.tl-item .tm { font-size: 10.5px; color: var(--ink-3); font-weight: 700; margin-top: 2px; }

.quick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 2px 20px 18px; }
:root[data-theme="ivory"] .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; padding: 0 20px 8px; }
.q { display: flex; flex-direction: column; align-items: flex-start; gap: 9px; padding: 13px 13px 12px; border-radius: var(--r-md); cursor: pointer; background: var(--surface-2); border: var(--card-border); transition: .18s; min-width: 0; }
.q:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); border-color: var(--primary); }
:root[data-theme="ivory"] .q { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 14px 0; }
:root[data-theme="ivory"] .q:hover { transform: none; box-shadow: none; }
.q .tile { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; }
.q .tile svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="ivory"] .q .tile { display: none; }
.q b { font-size: 12.5px; font-weight: 700; display: block; color: var(--ink); white-space: nowrap; }
.q span { font-size: 10.5px; color: var(--ink-3); font-weight: 600; }

.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; padding: 2px 20px 18px; }
:root[data-theme="ivory"] .dl { padding: 0 20px 18px; gap: 0; grid-template-columns: 1fr; }
.d { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: var(--r-sm); background: var(--surface-2); border: var(--card-border); cursor: pointer; transition: .16s; }
.d:hover { border-color: var(--primary); transform: translateY(-1px); }
:root[data-theme="ivory"] .d { background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 12px 0; }
:root[data-theme="ivory"] .d:hover { transform: none; }
.d i { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-weak); }
.d b { font-size: 12px; font-weight: 700; color: var(--ink); }
.d span { margin-left: auto; font-size: 10.5px; color: var(--ink-3); font-weight: 700; }

/* 空态 */
.empty { text-align: center; padding: 44px 20px; color: var(--ink-3); }
.empty .e-ic { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--ink-3); }
.empty .e-t { font-size: 14px; font-weight: 700; color: var(--ink-2); }

/* ── 7. 登录页 ─────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 40px 20px; position: relative; z-index: 2; }
.auth-card {
  width: 100%; max-width: 420px; background: var(--surface); border: var(--card-border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); backdrop-filter: var(--card-blur); padding: 34px 34px 26px;
}
:root[data-theme="ivory"] .auth-card { background: #fff; border-radius: 0; border: 1px solid var(--line); box-shadow: none; border-top: 2px solid var(--ink); max-width: 400px; }
.auth-card h1 { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
:root[data-theme="ivory"] .auth-card h1 { font-size: 30px; font-weight: 600; }
.auth-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 7px; }
.auth-field { margin-top: 16px; }
.auth-field label { display: block; margin-bottom: 7px; }
.auth-actions { margin-top: 22px; display: grid; gap: 10px; }
.auth-actions .btn { width: 100%; justify-content: center; height: 42px; }
.auth-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; gap: 14px; justify-content: center; font-size: 12px; flex-wrap: wrap; }
.auth-foot a { color: var(--ink-2); font-weight: 600; }
.auth-foot a:hover { color: var(--primary); }
.auth-badge { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 18px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--primary); }
:root[data-theme="ivory"] .auth-badge { color: var(--primary-2); letter-spacing: .2em; }

/* ── 8. 响应式 ─────────────────────────────────────────────────────────── */
@media (max-width: 1180px) {
  .grid-kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .shell, :root[data-theme="ivory"] .shell { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .tb-brand { min-width: 0; }
  .tb-brand span { display: none; }
  .tb-nav { display: none; }
  .main, :root[data-theme="ivory"] .main { padding: 18px 16px 36px; }
  .hero, :root[data-theme="ivory"] .hero { padding: 22px 20px; }
  .hero-stats { width: 100%; margin: 18px 0 0; }
  .hero-stat { flex: 1; padding: 0 12px; }
  .hero-stat b { font-size: 22px; }
  .quick { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 配置磁贴图标：emoji 换 SVG 后统一尺寸与颜色 */
.config-icon { display: inline-flex; align-items: center; justify-content: center; }
.config-icon svg { width: 18px; height: 18px; display: block; }
.config-header .config-icon svg { width: 17px; height: 17px; color: var(--primary); }
.config-btn:hover .config-icon svg { color: var(--primary); }

/* 设备选择器 / 网络图标 / 成员标题图标：emoji 换 SVG 后的统一尺寸 */
.device-option svg { width: 15px; height: 15px; display: block; }
.network-icon svg { width: 30px; height: 30px; display: block; color: var(--primary); }
.members-title .icon svg { width: 17px; height: 17px; display: block; color: var(--primary); }
.members-title span.icon { display: inline-flex; align-items: center; }

/* 认证族页面（注册/找回/激活/错误页）仍用 Bootstrap 栅格：
   1) 给 .auth-shell 一个居中容器宽度，否则 .row/.col 会横贯整个视口；
   2) 把最外层 .row 变成卡片，省去逐页改模板。 */
.auth-shell { max-width: 980px; margin: 0 auto; padding: 40px 22px 64px; position: relative; z-index: 2; }
.auth-shell > .row {
  background: var(--surface); border: var(--card-border); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); backdrop-filter: var(--card-blur);
  padding: 28px 30px; margin: 0;
}
:root[data-theme="ivory"] .auth-shell > .row {
  background: #fff; border-radius: 0; border: 1px solid var(--line);
  border-top: 2px solid var(--ink); box-shadow: none;
}
.auth-shell h2, .auth-shell h3, .auth-shell .page-title { font-family: var(--font-display); }
.auth-shell .row .row { padding: 0; }
@media (max-width: 700px) {
  .auth-shell > .row { padding: 20px 18px; }
}

/* 旧 style.css 的悬浮反馈是"赛博主题"遗留：.card:hover 用 --card-hover 换成深色，
   而 --card-hover 只在它自己的 [data-theme="light"] 下改成白色；我们用 aurora/ivory，
   取到的就是深色值 rgba(30,35,50,.95) —— 表现为"鼠标一放上去整块卡片变黑看不清"。
   这里把 --card-hover 纳入本设计系统，并双重兜底。 */
.card:hover,
.panel:hover {
  background: var(--card-bg) !important;
  border-color: var(--line-2) !important;
}
/* 旧 .table-hover 行悬浮是青色底 + 4px 内阴影强调线，与新版表格冲突 */
.table-hover > tbody > tr:hover {
  background: transparent !important;
  box-shadow: none !important;
}
.table-hover > tbody > tr:hover > td {
  background: var(--table-hover) !important;
}

/* 旧 style.css 给 .card / .panel 加了一层「青→紫渐变」装饰伪元素：
   默认 opacity:0，但 .card:hover::before 会置 1 —— 鼠标停在卡片上就浮出一层彩色，
   在米白主题下尤其突兀（看着像整块区域被蓝色蒙住）。新设计不需要这层装饰，直接移除。 */
.card::before,
.card::after,
.panel::before,
.panel::after {
  content: none !important;
  opacity: 0 !important;
  background: none !important;
}
/* 顶栏账号菜单：与主题一致的卡片外观 + 可点击光标 + 键盘可达 */
.tb-user { cursor: pointer; user-select: none; }
.tb-user:focus-visible { outline: 0; box-shadow: 0 0 0 3px var(--primary-weak); }
.tb-user .dropdown-menu { min-width: 168px; }

/* 顶栏账号菜单（自管下拉）：Bootstrap 的 .open 父节点规则在这里不适用 */
.tb-user { position: relative; }
.tb-user > .dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  left: auto;
  z-index: 1040;
}
.tb-user.open > .dropdown-menu { display: block; }

/* 极光底色只属于极光主题。
   原先这段径向渐变直接写在 body 上，切到米白主题后页面仍带淡紫/淡粉底，
   看起来像"部分区域颜色不对"。这里收回到 [data-theme="aurora"] 作用域。 */
:root[data-theme="aurora"] body {
  background:
    radial-gradient(900px 620px at 8% -8%, rgba(199, 210, 254, .55), transparent 62%),
    radial-gradient(860px 600px at 92% -6%, rgba(233, 213, 255, .6), transparent 64%),
    radial-gradient(760px 560px at 50% 108%, rgba(209, 250, 229, .5), transparent 66%),
    var(--page);
}

/* 旧 style.css 的两个整页装饰层：
   · body::before = 青/紫/粉三色光斑 + 15s 呼吸动画（新版主题各自定义了自己的 ::before）
   · body::after  = 50px 青色网格（新版完全不需要）
   米白主题下这两层会让页面透出淡紫底和淡青网格，看着"部分区域颜色不对"。 */
body::after { content: none !important; }
body::before { animation: none !important; }


/* ── logo：优先显示后台「系统设置」里上传的 /logo.png，失败回退内置 SVG ── */
.tb-mark { background: transparent !important; box-shadow: none !important; overflow: hidden; }
.tb-mark .tb-logo { width: 100%; height: 100%; object-fit: contain; display: block; border-radius: inherit; }
:root[data-theme="aurora"] .tb-mark { box-shadow: 0 6px 16px -8px rgba(15, 23, 42, .35) !important; }
:root[data-theme="ivory"] .tb-mark { border: 1px solid var(--line); border-radius: 6px; }
.auth-badge .auth-logo { width: 20px; height: 20px; object-fit: contain; border-radius: 5px; }
.hp-hero-logo { display: flex; justify-content: center; margin-bottom: 22px; }
.hp-hero-logo img {
  width: 64px; height: 64px; object-fit: contain; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--line);
  padding: 6px; box-shadow: var(--shadow-2);
}
:root[data-theme="ivory"] .hp-hero-logo img { border-radius: 4px; box-shadow: none; padding: 4px; }


/* 背景装饰层沉到内容之下（配合 .shell 取消 z-index 的弹窗修复） */
body::before { z-index: -1 !important; }
html { position: relative; }
/* 弹窗与遮罩层级：确保盖住顶栏（1030） */
.modal { z-index: 1055 !important; }
.modal-backdrop { z-index: 1050 !important; }
/* 弹窗内的输入框在窄屏也能完整显示 */
#linuxInstallModal .input-group { display: flex; }
#linuxInstallModal .input-group .form-control { flex: 1 1 auto; min-width: 0; }
#linuxInstallModal .input-group-btn { width: auto; }
/* ============================================================================
 * 控制台首页 v2（2×2 行对齐网格）
 * ==========================================================================*/
.home-cols {
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(0, 1fr);
    gap: 18px;
    margin-top: 20px;
    align-items: stretch;
}
:root[data-theme="ivory"] .home-cols { gap: 26px; margin-top: 26px; }

/* 卡片作为网格项：撑满行高、内容不许被裁 */
.home-cols > .card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible;
}
.home-cols > .card > .card-head { flex: 0 0 auto; }

/* 行高由内容较高者决定；短内容用 flex 撑开，避免"上重下空" */
.home-cols .table-wrap,
.home-cols .quick,
.home-cols .dl,
.home-cols .tl { flex: 1 1 auto; min-height: 0; }

/* ── 我的网络：表格行高统一 ───────────────────────────────────────────── */
.hc-list .table-wrap { padding-top: 2px; }
.home-cols .ds-table th,
.home-cols .ds-table td { padding: 12px 20px; }
.home-cols .ds-table tbody tr { height: 52px; }

/* ── 快捷操作：单列菜单，用满右列 ────────────────────────────────────── */
.hc-quick .quick {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    padding: 8px 20px 16px;
}
.hc-quick .q {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    gap: 12px;
    padding: 14px 2px;
    border-radius: 10px;
    border-top: 0;
}
.hc-quick .q:not(:last-child) { border-bottom: 1px solid var(--line); }
.hc-quick .q > div { min-width: 0; text-align: left; }
.hc-quick .q .tile { flex: 0 0 auto; }
/* 米白原本隐藏图标（紧凑双列用），这里菜单样式恢复图标 */
:root[data-theme="ivory"] .hc-quick .q .tile { display: grid; }
.hc-quick .q b { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.hc-quick .q span { display: block; margin-top: 3px; font-size: 11.5px; color: var(--ink-3); line-height: 1.4; }
:root[data-theme="ivory"] .hc-quick .q { border-radius: 0; padding: 13px 0; }
:root[data-theme="ivory"] .hc-quick .quick { padding: 2px 20px 14px; }

/* ── 让设备上线：行高统一 ────────────────────────────────────────────── */
.hc-dl .dl {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 8px 20px 14px;
}
.hc-dl .d {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 2px;
    border-top: 0;
}
.hc-dl .d:not(:last-child) { border-bottom: 1px solid var(--line); }
.hc-dl .d b { font-size: 13px; font-weight: 700; color: var(--ink); }
.hc-dl .d span { margin-left: auto; font-size: 12px; color: var(--ink-3); font-weight: 600; }
:root[data-theme="ivory"] .hc-dl .d { padding: 15px 0; }

/* ── 下一步：撑满第二行 ──────────────────────────────────────────────── */
.hc-steps .tl {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 8px 20px 16px;
}
.hc-steps .tl-item { padding: 12px 0; border-top: 0; }
.hc-steps .tl-item:not(:last-child) { border-bottom: 1px solid var(--line); }

/* ── 数字：成套 + 基线对齐 ───────────────────────────────────────────── */
.hero-row { align-items: center; }
.hero-stat b {
    font-size: 34px;
    line-height: 1;
    font-variant-numeric: tabular-nums lining-nums;
}
.hero-stat span {
    display: block;
    margin-top: 7px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: .16em;
    line-height: 1;
}
:root[data-theme="ivory"] .hero-stat b { font-size: 32px; }
:root[data-theme="ivory"] .hero-stat span { letter-spacing: .18em; }

.kpi { display: flex; flex-direction: column; min-height: 132px; }
.kpi .k-top { margin-bottom: 10px; }
.kpi .k-val {
    font-size: 30px;
    line-height: 1.05;
    font-variant-numeric: tabular-nums lining-nums;
    margin: 0;
}
.kpi .k-val em {
    font-size: 15px;
    font-weight: 500;
    margin-left: 2px;
    color: var(--ink-3);
    font-variant-numeric: tabular-nums;
}
.kpi .k-val-text { font-size: 22px; font-weight: 700; letter-spacing: .02em; }
:root[data-theme="ivory"] .kpi .k-val { font-size: 30px; font-weight: 400; }
:root[data-theme="ivory"] .kpi .k-val-text { font-size: 22px; font-weight: 600; font-family: var(--font-display); }
.kpi .k-foot { margin-top: 10px; padding-top: 0; }
:root[data-theme="ivory"] .kpi .k-foot { color: var(--ink-3); }

/* ── 卡片头与间距统一 ────────────────────────────────────────────────── */
.home-cols .card-head h3 { font-size: 15px; }
:root[data-theme="ivory"] .home-cols .card-head h3 { font-size: 16px; }
.home-cols .card-head .sub { margin-top: 2px; }

/* ── 窄屏：单列（快捷操作恢复到 2 列，省高度）────────────────────────── */
@media (max-width: 1200px) {
    .home-cols { grid-template-columns: minmax(0, 1fr); }
    .hc-quick .quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
}
