/* ==========================================================================
   华社 API · 淡灰色主题
   由华途 工作室提供技术支持与服务运营
   设计口径：浅灰底 + 白卡面 + 石墨色主按钮，低对比、长阅读不刺眼。
   ========================================================================== */

:root {
  /* 底色层 */
  --bg: #f2f3f5;
  --bg-soft: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --surface-3: #f4f5f7;

  /* 描边 */
  --line: #e5e7eb;
  --line-strong: #d7dae0;

  /* 文字 */
  --text: #23262d;
  --text-2: #5b6270;
  --text-3: #8b919d;
  --text-4: #a8adb8;

  /* 主色（石墨灰） */
  --ink: #2c313a;
  --ink-hover: #3a404b;
  --ink-soft: #4a5160;

  /* 状态色（低饱和） */
  --ok: #2f7d5d;
  --ok-bg: #eaf4ef;
  --warn: #9a6b1f;
  --warn-bg: #fbf3e6;
  --danger: #a63d3d;
  --danger-bg: #faeeee;
  --info: #3c5a78;
  --info-bg: #eef2f7;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(18, 22, 30, 0.04);
  --shadow: 0 4px 16px rgba(18, 22, 30, 0.06);
  --shadow-lg: 0 18px 48px rgba(18, 22, 30, 0.12);

  --sidebar-w: 236px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans CN", sans-serif;
  --mono: "SFMono-Regular", "JetBrains Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--ink); text-decoration: none; }
a:hover { color: var(--ink-soft); }

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }

::selection { background: #dfe3ea; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5d8de; border-radius: 8px; border: 3px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #c3c7cf; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------------------------------------------- 骨架 */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(150deg, #3a404b, #23262d);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0;
  box-shadow: var(--shadow-sm);
  flex: none;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-name { font-size: 15px; font-weight: 700; letter-spacing: 0.2px; }
.brand-sub { font-size: 11px; color: var(--text-3); letter-spacing: 0.6px; text-transform: uppercase; }

.nav {
  flex: 1;
  overflow-y: auto;
  padding: 6px 12px 16px;
}

.nav-group-title {
  font-size: 11px;
  color: var(--text-4);
  letter-spacing: 0.8px;
  padding: 16px 10px 6px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  margin-bottom: 2px;
  user-select: none;
}

.nav-item:hover { background: var(--surface-3); color: var(--text); }
.nav-item.active { background: #eceef2; color: var(--text); font-weight: 600; }
.nav-item .ico { width: 17px; height: 17px; flex: none; opacity: 0.75; }
.nav-item.active .ico { opacity: 1; }

.sidebar-foot {
  padding: 14px 18px 18px;
  border-top: 1px solid var(--line);
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

.main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 60px;
  flex: none;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 15;
}

.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.page-title { font-size: 15px; font-weight: 600; }
.page-desc { font-size: 12px; color: var(--text-3); margin-top: -2px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: #e9ebef; color: var(--ink);
  display: grid; place-items: center;
  font-weight: 700; font-size: 13px; cursor: pointer;
  border: 1px solid var(--line-strong);
}

.content {
  padding: 24px 26px 36px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

.page-footer {
  padding: 16px 26px 26px;
  text-align: center;
  color: var(--text-3);
  font-size: 12px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* ---------------------------------------------------------------- 卡片 / 布局 */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.card-title { font-size: 14px; font-weight: 600; }
.card-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.card-body { padding: 18px 20px; }
.card-body.tight { padding: 12px 14px; }
.card-body.flush { padding: 0; }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stack { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

/* ---------------------------------------------------------------- 统计卡 */
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-label { font-size: 12px; color: var(--text-3); letter-spacing: 0.3px; }
.stat-value { font-size: 24px; font-weight: 650; margin-top: 6px; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: 13px; font-weight: 500; color: var(--text-3); margin-left: 3px; }
.stat-foot { font-size: 12px; color: var(--text-3); margin-top: 6px; }
.stat-accent { position: absolute; top: 0; left: 0; width: 3px; height: 100%; background: #cfd4db; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.btn:hover { background: var(--surface-2); border-color: #c9cdd5; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-hover); border-color: var(--ink-hover); }

.btn-soft { background: var(--surface-3); border-color: transparent; color: var(--text); }
.btn-soft:hover { background: #eceef2; border-color: transparent; }

.btn-danger { background: var(--surface); border-color: #e3c7c7; color: var(--danger); }
.btn-danger:hover { background: var(--danger-bg); }

.btn-ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-lg { height: 42px; padding: 0 20px; font-size: 14px; border-radius: 10px; }
.btn-icon { width: 32px; padding: 0; }

/* ---------------------------------------------------------------- 表单 */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.hint { font-size: 11.5px; color: var(--text-3); }

.input, .select, .textarea {
  width: 100%;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.textarea { height: auto; min-height: 84px; padding: 9px 11px; resize: vertical; line-height: 1.6; font-family: var(--mono); font-size: 12.5px; }

.input:focus, .select:focus, .textarea:focus {
  border-color: #9aa1ad;
  box-shadow: 0 0 0 3px rgba(58, 64, 75, 0.08);
}

.input::placeholder, .textarea::placeholder { color: var(--text-4); }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b919d' stroke-width='2'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.form-grid .full { grid-column: 1 / -1; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: 13px; color: var(--text-2); }
.switch input { display: none; }
.switch .track { width: 38px; height: 22px; border-radius: 99px; background: #d9dde3; position: relative; transition: background 0.18s ease; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,0.15); transition: transform 0.18s ease; }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* ---------------------------------------------------------------- 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left;
  font-weight: 500;
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 11px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--line); color: var(--text-2); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: #fbfcfd; }
.table td.strong { color: var(--text); font-weight: 500; }
.table .mono { font-family: var(--mono); font-size: 12px; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; }

/* ---------------------------------------------------------------- 徽标 / 标签 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--surface-3);
  color: var(--text-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-danger { background: var(--danger-bg); color: var(--danger); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.85; }

.tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 5px; font-size: 11px; background: var(--surface-3); color: var(--text-2); font-family: var(--mono); }

/* ---------------------------------------------------------------- 分段 / 标签页 */
.tabs { display: inline-flex; padding: 3px; background: var(--surface-3); border-radius: 9px; gap: 2px; }
.tab { padding: 6px 14px; font-size: 12.5px; border-radius: 7px; color: var(--text-2); cursor: pointer; font-weight: 500; }
.tab.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* ---------------------------------------------------------------- 空态 / 加载 */
.empty { padding: 48px 20px; text-align: center; color: var(--text-3); }
.empty-title { font-size: 14px; color: var(--text-2); margin-bottom: 4px; font-weight: 500; }
.empty-desc { font-size: 12.5px; }

.skeleton { background: linear-gradient(90deg, #eef0f3 25%, #f6f7f9 50%, #eef0f3 75%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 6px; height: 14px; }
@keyframes sk { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ---------------------------------------------------------------- 图表 */
.chart { width: 100%; height: 210px; display: block; }
.chart-axis { font-size: 10px; fill: var(--text-4); font-family: var(--font); }
.chart-line { fill: none; stroke: #3a404b; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart-area { fill: url(#areaGrad); }
.chart-bar { fill: #d9dde3; }
.chart-bar:hover { fill: #c6cbd3; }
.chart-grid { stroke: #eceef2; stroke-width: 1; }

/* ---------------------------------------------------------------- 弹窗 */
.backdrop {
  position: fixed; inset: 0; background: rgba(28, 32, 38, 0.32);
  backdrop-filter: blur(2px); display: grid; place-items: center; z-index: 100;
  padding: 20px; animation: fadeIn 0.15s ease;
}
.modal {
  width: 100%; max-width: 560px; max-height: 88vh; overflow: auto;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  animation: pop 0.18s cubic-bezier(0.2, 0.9, 0.3, 1.2);
}
.modal.wide { max-width: 720px; }
.modal-head { padding: 18px 22px 4px; font-size: 16px; font-weight: 600; }
.modal-sub { font-size: 12.5px; color: var(--text-3); padding: 2px 22px 0; }
.modal-body { padding: 16px 22px; }
.modal-foot { padding: 14px 22px 20px; display: flex; justify-content: flex-end; gap: 8px; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- Toast */
#toast-root { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: #2c313a; color: #fff; font-size: 13px; padding: 9px 16px; border-radius: 9px;
  box-shadow: var(--shadow-lg); animation: toastIn 0.2s ease; max-width: 80vw;
}
.toast.ok { background: #2f6b52; }
.toast.err { background: #8f3b3b; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------- 登录页 */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr; background: var(--bg);
}
.auth-side {
  background: linear-gradient(160deg, #eceef1 0%, #f5f6f8 48%, #e8eaee 100%);
  border-right: 1px solid var(--line); padding: 56px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.auth-side::after {
  content: ""; position: absolute; width: 520px; height: 520px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.9), rgba(255,255,255,0) 62%);
  right: -160px; bottom: -160px;
}
.auth-side h1 { font-size: 30px; line-height: 1.35; letter-spacing: -0.02em; }
.auth-side p { color: var(--text-2); margin-top: 14px; max-width: 420px; }
.auth-points { display: flex; flex-direction: column; gap: 12px; margin-top: 30px; }
.auth-point { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--text-2); }
.auth-point i { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 1px solid var(--line-strong); display: grid; place-items: center; font-style: normal; font-size: 10px; color: var(--text-2); flex: none; margin-top: 2px; }
.auth-main { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card .brand { padding: 0 0 22px; }
.auth-title { font-size: 22px; font-weight: 650; letter-spacing: -0.01em; }
.auth-sub { color: var(--text-3); font-size: 13px; margin-top: 6px; margin-bottom: 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-foot { margin-top: 26px; font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.7; }

/* ---------------------------------------------------------------- 代码块 */
.code {
  background: #f7f8fa; border: 1px solid var(--line); border-radius: 9px;
  padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.75;
  color: #333944; overflow-x: auto; white-space: pre; position: relative;
}
.code .copy { position: absolute; top: 8px; right: 8px; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 12px; color: var(--text-3); background: var(--surface-2); border-radius: 9px 9px 0 0; }
.code-body { padding: 14px 16px; font-family: var(--mono); font-size: 12.5px; line-height: 1.8; color: #333944; overflow-x: auto; white-space: pre; }
.code-block { border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: #fbfbfc; }
.k { color: #6b5b8f; } .s { color: #2f6b52; } .c { color: #9aa1ad; }

/* ---------------------------------------------------------------- 文档 */
.doc-section { margin-bottom: 28px; }
.doc-h { font-size: 17px; font-weight: 650; margin-bottom: 10px; }
.doc-p { color: var(--text-2); font-size: 13.5px; margin-bottom: 12px; }
.endpoint { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); margin-bottom: 8px; }
.method { font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; background: #e9ebef; color: #3f4756; }
.method.post { background: #e8efe9; color: #2f6b52; }
.method.get { background: #e9edf4; color: #3c5a78; }

/* ---------------------------------------------------------------- 工具类 */
.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: var(--mono); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.center { text-align: center; }
.right { text-align: right; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; } .mt-16 { margin-top: 16px; } .mt-24 { margin-top: 24px; }
.mb-8 { margin-bottom: 8px; } .mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; } .gap-16 { gap: 16px; }
.hidden { display: none !important; }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--text-3); }

.copy-btn { cursor: pointer; color: var(--text-3); font-size: 11.5px; border: 1px solid var(--line); background: var(--surface); padding: 2px 8px; border-radius: 6px; }
.copy-btn:hover { color: var(--text); border-color: var(--line-strong); }

/* ---------------------------------------------------------------- 响应式 */
@media (max-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-side { display: none; }
}

@media (max-width: 720px) {
  .shell { flex-direction: column; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform 0.2s ease; box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .content { padding: 16px 14px 28px; }
  .topbar { padding: 0 14px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .page-desc { display: none; }
  .table th, .table td { padding: 10px; }
}

/* ==========================================================================
   v1.1 新增组件
   ========================================================================== */

/* 顶部路由进度条 */
#routebar {
  position: fixed; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, #8b93a1, #3a404b);
  z-index: 300; opacity: 0; transition: width 0.25s ease, opacity 0.3s ease;
}
#routebar.on { opacity: 1; }

/* 公告条 */
.notice {
  display: flex; align-items: flex-start; gap: 10px;
  background: #eef2f7; border: 1px solid #dde4ee; border-radius: 10px;
  padding: 10px 14px; font-size: 12.5px; color: #3c4a5a; line-height: 1.7;
  margin-bottom: 16px;
}
.notice-ico { flex: none; opacity: 0.8; margin-top: 1px; }
.notice-close {
  margin-left: auto; cursor: pointer; color: #8b919d; border: 0; background: transparent;
  font-size: 16px; line-height: 1; padding: 0 2px;
}
.notice-close:hover { color: var(--text); }

/* 余额胶囊 */
.balance-pill {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  white-space: nowrap; flex: 0 0 auto;
  border-radius: 99px; background: var(--surface-3); border: 1px solid var(--line);
  font-size: 12.5px; font-variant-numeric: tabular-nums; cursor: pointer; color: var(--text-2);
}
.balance-pill:hover { background: #eceef2; color: var(--text); }
.balance-pill b { color: var(--text); font-weight: 600; }

/* 头像与下拉菜单 */
.menu-wrap { position: relative; }
.menu {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 196px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow-lg); padding: 6px; display: none; z-index: 60;
}
.menu.open { display: block; animation: pop 0.14s ease; }
.menu-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.menu-name { font-weight: 600; font-size: 13px; }
.menu-sub { font-size: 11.5px; color: var(--text-3); }
.menu-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px; border-radius: 8px;
  font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
}
.menu-item:hover { background: var(--surface-3); color: var(--text); }
.menu-item.danger:hover { background: var(--danger-bg); color: var(--danger); }
.menu-sep { height: 1px; background: var(--line); margin: 5px 6px; }

/* 折叠侧栏 */
.shell.collapsed .sidebar { width: 68px; flex-basis: 68px; }
.shell.collapsed .brand-text,
.shell.collapsed .nav-item span,
.shell.collapsed .nav-group-title,
.shell.collapsed .sidebar-foot { display: none; }
.shell.collapsed .nav { padding: 4px 8px 14px; }
.shell.collapsed .nav-item { justify-content: center; padding: 11px 0; }
.shell.collapsed .brand { justify-content: center; padding: 16px 0 10px; }
.shell.collapsed .brand-mark { width: 30px; height: 30px; }

/* 移动端遮罩 */
.sb-mask {
  position: fixed; inset: 0; background: rgba(28, 32, 38, 0.3);
  z-index: 19; display: none; backdrop-filter: blur(1px);
}
.sb-mask.show { display: block; }

/* 详情键值对 */
.kv { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 18px; }
.kv-item { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.kv-k { font-size: 11.5px; color: var(--text-3); }
.kv-v { font-size: 13px; color: var(--text); word-break: break-all; }
.kv-v.mono { font-family: var(--mono); font-size: 12px; }

/* 进度条 */
.meter { height: 6px; background: var(--surface-3); border-radius: 99px; overflow: hidden; }
.meter > i { display: block; height: 100%; background: #a9b0bb; border-radius: 99px; transition: width 0.3s ease; }
.meter.dark > i { background: var(--ink); }

/* 分段控制器 */
.seg { display: inline-flex; background: var(--surface-3); border-radius: 9px; padding: 3px; gap: 2px; }
.seg button {
  border: 0; background: transparent; padding: 5px 13px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-2); cursor: pointer; font-family: inherit;
}
.seg button.active { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); font-weight: 600; }

/* 图表图例 */
.legend { display: flex; gap: 14px; align-items: center; font-size: 12px; color: var(--text-3); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* 404 */
.err-page { display: grid; place-items: center; min-height: 58vh; text-align: center; padding: 30px; }
.err-code { font-size: 64px; font-weight: 700; letter-spacing: -0.04em; color: #d2d7df; line-height: 1; }
.err-title { font-size: 16px; font-weight: 600; margin-top: 12px; }
.err-desc { font-size: 13px; color: var(--text-3); margin: 6px 0 18px; }

/* 内联提示 */
.alert { display: flex; gap: 10px; padding: 11px 14px; border-radius: 10px; font-size: 12.5px; line-height: 1.7; }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-danger { background: var(--danger-bg); color: var(--danger); }

/* 表格操作区 */
.actions { display: flex; gap: 2px; justify-content: flex-end; }
.actions .btn { padding: 0 8px; }

/* 迷你 KPI */
.kpi-row { display: flex; gap: 18px; flex-wrap: wrap; }
.kpi { display: flex; flex-direction: column; gap: 2px; }
.kpi-k { font-size: 11.5px; color: var(--text-3); }
.kpi-v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* 列表项 */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }

/* 窄屏：折叠态自动失效 */
@media (max-width: 900px) {
  .shell.collapsed .sidebar { width: var(--sidebar-w); flex-basis: var(--sidebar-w); }
  .shell.collapsed .brand-text,
  .shell.collapsed .nav-item span,
  .shell.collapsed .nav-group-title,
  .shell.collapsed .sidebar-foot { display: block; }
  .shell.collapsed .nav-item { justify-content: flex-start; padding: 9px 10px; }
  .balance-pill span { display: none; }
}
