/* ============================================================================
 * 瓜子音源站（em.guazi.fun）页面样式
 *
 * 手写、无框架、无外部字体：这个页面大多是手机上打开的，第一屏越快越好。
 * 与 lx-user / lx-admin 的约定一致（那两处也是手写 CSS、无构建）。
 *
 * 组织方式：
 *   1. 设计令牌（深浅色只换令牌，组件不动）
 *   2. 基础与排版
 *   3. 通用组件（按钮 / 标签 / 卡片 / 表单 / 表格 / 模态框 / 轻提示）
 *   4. 页面结构（顶栏 / 落地页 / 商品卡 / 登录卡 / 已登录各卡片）
 *   5. 响应式
 * ==========================================================================*/

/* ── 1. 设计令牌 ─────────────────────────────────────────────────────────── */
:root {
  --c-bg: #f5f6f8;
  --c-surface: #ffffff;
  --c-surface-2: #fafbfc;
  --c-surface-3: #f1f3f7;
  --c-border: #e5e8ee;
  --c-border-strong: #d3d8e2;
  --c-text: #0f172a;
  --c-text-2: #4a5567;
  --c-text-3: #8a93a5;

  /* 主题色用紫色：与 lx-user（蓝）、lx-admin（青）区分开，用户一眼知道
     「这是音源站」而不是赞助用户页 —— 两站的账号体系是分开的 */
  --c-primary: #6d4aff;
  --c-primary-hover: #5a35f0;
  --c-primary-soft: #f0ecff;
  --c-primary-ring: rgba(109, 74, 255, .18);

  --c-ok: #0b7a4b;
  --c-ok-bg: #e7f6ee;
  --c-ok-border: #bfe6d2;
  --c-warn: #9a5b00;
  --c-warn-bg: #fff5e6;
  --c-warn-border: #f5dcb0;
  --c-danger: #c92a1d;
  --c-danger-bg: #fdecea;
  --c-danger-border: #f6c9c4;
  --c-danger-solid: #d92d20;
  --c-danger-solid-hover: #b42318;

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-full: 999px;

  --shadow-1: 0 1px 2px rgba(15, 23, 42, .04), 0 1px 3px rgba(15, 23, 42, .06);
  --shadow-2: 0 2px 6px rgba(15, 23, 42, .05), 0 10px 24px -12px rgba(15, 23, 42, .18);
  --shadow-3: 0 24px 60px -20px rgba(15, 23, 42, .35);

  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-base: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 26px;

  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* 1240：登录后的仪表盘要放下「左侧栏 + 内容区」；落地页的 hero 自己限宽 720，
     所以放宽它不会让落地页被拉得难看 */
  --page-max: 1240px;
  --gap: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --c-bg: #0d1117;
    --c-surface: #161b22;
    --c-surface-2: #1b212a;
    --c-surface-3: #202836;
    --c-border: #2a323d;
    --c-border-strong: #3a4451;
    --c-text: #e8edf4;
    --c-text-2: #a7b1c0;
    --c-text-3: #7b8698;

    --c-primary: #8f74ff;
    --c-primary-hover: #a08aff;
    --c-primary-soft: #221c3d;
    --c-primary-ring: rgba(143, 116, 255, .25);

    --c-ok: #4ad295;
    --c-ok-bg: #10281f;
    --c-ok-border: #1e4636;
    --c-warn: #e8b661;
    --c-warn-bg: #2b2113;
    --c-warn-border: #4a3a1d;
    --c-danger: #ff7066;
    --c-danger-bg: #2d1717;
    --c-danger-border: #4d2622;
    --c-danger-solid: #d92d20;
    --c-danger-solid-hover: #b42318;

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 10px 24px -12px rgba(0, 0, 0, .6);
    --shadow-3: 0 24px 60px -20px rgba(0, 0, 0, .8);
  }
}

/* ── 2. 基础与排版 ───────────────────────────────────────────────────────── */
* { box-sizing: border-box; }

/* **`[hidden]` 必须压过组件自己的 display**，否则这个属性等于没有。
 *
 * 浏览器默认样式里确实有 `[hidden] { display: none }`，但它的权重只有
 * 「属性选择器」那一级 —— 本文件里大量 `.modal { display: flex }`、
 * `.auth-form { display: flex }` 这样的类选择器会把它**盖掉**。
 * 表现是：页面一打开，三个模态框和两个没选中的登录表单**全都显示出来**
 * （2026-09-20 用无头浏览器实测抓到：`getComputedStyle(el).display` 在
 * hidden="true" 的元素上仍然是 "flex"）。这个 bug 靠接口自检抓不到，
 * 因为它完全在 CSS 层。
 *
 * 加 `!important` 是这里唯一稳妥的写法：这条规则要保证的是「hidden 就必须不可见」，
 * 那是 HTML 语义，不该被任何组件的排版需要推翻。 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

body { min-height: 100vh; }

.sprite { display: none; }

h1, h2, h3 { margin: 0; font-weight: 650; line-height: 1.35; letter-spacing: -.01em; }
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-lg); }
h3 { font-size: var(--fs-base); }
p { margin: 0; }

svg { width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8;
      stroke-linecap: round; stroke-linejoin: round; }

.mono { font-family: var(--mono); font-size: var(--fs-md); }

/* ── 3. 通用组件 ─────────────────────────────────────────────────────────── */
/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px; border: 1px solid transparent; border-radius: var(--r-sm);
  background: var(--c-surface-3); color: var(--c-text);
  font: inherit; font-size: var(--fs-md); font-weight: 550;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, box-shadow .15s;
}
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:hover { background: var(--c-border); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.btn-primary { background: var(--c-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--c-primary-hover); }

.btn-ghost { background: transparent; border-color: var(--c-border-strong); color: var(--c-text-2); }
.btn-ghost:hover:not(:disabled) { background: var(--c-surface-3); color: var(--c-text); }

.btn-danger { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger-border); }
.btn-danger:hover:not(:disabled) { background: var(--c-danger-solid); color: #fff; border-color: var(--c-danger-solid); }

.btn-sm { padding: 6px 10px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--c-primary); cursor: pointer;
            font: inherit; font-size: var(--fs-sm); padding: 0; }
.btn-link:hover { text-decoration: underline; }

.link-btn {
  background: none; border: none; padding: 4px 0; margin-top: 4px;
  color: var(--c-primary); font: inherit; font-size: var(--fs-sm);
  cursor: pointer; align-self: flex-start;
}
.link-btn:hover { text-decoration: underline; }

/* 标签 */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: var(--r-full);
  font-size: var(--fs-xs); font-weight: 600; white-space: nowrap;
  background: var(--c-surface-3); color: var(--c-text-2);
  border: 1px solid var(--c-border);
}
.badge-ok { background: var(--c-ok-bg); color: var(--c-ok); border-color: var(--c-ok-border); }
.badge-warn { background: var(--c-warn-bg); color: var(--c-warn); border-color: var(--c-warn-border); }
.badge-danger { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger-border); }
.badge-primary { background: var(--c-primary-soft); color: var(--c-primary); border-color: var(--c-primary-ring); }

/* 卡片 */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
  padding: 20px; margin-bottom: var(--gap);
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px; flex-wrap: wrap;
}
.card-head h2 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-lg); }
.card-head h2 svg { width: 18px; height: 18px; color: var(--c-primary); }
/* 仪表盘里卡片标题用 h3（h2 留给区块标题），样式与 h2 一致 */
.card-head h3 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); }
.card-head h3 svg { width: 16px; height: 16px; color: var(--c-primary); }

/* 表单 */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field-label { font-size: var(--fs-sm); font-weight: 550; color: var(--c-text-2); }
input[type="text"], input[type="password"], input[type="email"] {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--c-border-strong); border-radius: var(--r-sm);
  background: var(--c-surface-2); color: var(--c-text);
  font: inherit; font-size: var(--fs-md);
  transition: border-color .15s, box-shadow .15s;
}
input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-ring); }
input::placeholder { color: var(--c-text-3); }
input.mono { font-family: var(--mono); font-size: var(--fs-sm); }

.inline-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.inline-form .field { flex: 1 1 180px; margin-bottom: 0; }

/* 提示 */
.hint { font-size: var(--fs-xs); color: var(--c-text-3); line-height: 1.65; margin-top: 8px; }
.hint-inline { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 12px; }
.hint-inline svg { width: 14px; height: 14px; flex: none; margin-top: 2px; }

.alert {
  display: flex; gap: 8px; align-items: flex-start;
  padding: 11px 14px; border-radius: var(--r-md); border: 1px solid;
  font-size: var(--fs-sm); line-height: 1.6; margin-bottom: 12px;
}
.alert-warn { background: var(--c-warn-bg); color: var(--c-warn); border-color: var(--c-warn-border); }
.alert-danger { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger-border); }

/* 空态 */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 16px; text-align: center; color: var(--c-text-3);
}
.empty svg { width: 32px; height: 32px; opacity: .5; }
.empty p { font-size: var(--fs-md); }
.empty-inline { display: none; text-align: center; color: var(--c-text-3);
                font-size: var(--fs-md); padding: 20px 0; }

/* 键值行 */
.kv { display: flex; flex-direction: column; gap: 1px; margin-bottom: 14px; }
.kv-row {
  display: flex; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px solid var(--c-border); font-size: var(--fs-md);
}
.kv-row:last-child { border-bottom: none; }
.kv-key { color: var(--c-text-3); flex: none; }
.kv-val { text-align: right; word-break: break-all; }

/* 表格 */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: var(--fs-md); }
.table th, .table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--c-border); }
.table th { font-size: var(--fs-xs); font-weight: 600; color: var(--c-text-3);
            text-transform: uppercase; letter-spacing: .04em; }
.table tbody tr:last-child td { border-bottom: none; }
.table td.mono { font-family: var(--mono); font-size: var(--fs-xs); }

/* 提示条（自动消失） */
.toast-stack {
  position: fixed; top: 68px; left: 50%; transform: translateX(-50%);
  z-index: 90; display: flex; flex-direction: column; gap: 8px;
  width: min(560px, calc(100vw - 24px)); pointer-events: none;
}
.toast {
  padding: 11px 15px; border-radius: var(--r-md); border: 1px solid;
  background: var(--c-surface); box-shadow: var(--shadow-2);
  font-size: var(--fs-md); line-height: 1.55;
  animation: toast-in .22s ease-out;
}
.toast-ok { border-color: var(--c-ok-border); background: var(--c-ok-bg); color: var(--c-ok); }
.toast-error { border-color: var(--c-danger-border); background: var(--c-danger-bg); color: var(--c-danger); }
.toast-info { border-color: var(--c-border-strong); color: var(--c-text-2); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* 模态框 */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px);
}
.modal-card {
  width: min(460px, 100%); max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--c-surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3); border: 1px solid var(--c-border);
}
.modal-card-sm { width: min(380px, 100%); }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--c-border);
}
.modal-body { padding: 18px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }
.confirm-text { font-size: var(--fs-md); color: var(--c-text-2); line-height: 1.7; }
.qr-box { display: flex; justify-content: center; padding: 8px 0; }
.qr-box svg { width: 100%; height: auto; max-width: 240px; stroke: none; fill: var(--c-text); }

/* ── 4. 页面结构 ─────────────────────────────────────────────────────────── */
.appbar {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--c-surface) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--c-border);
}
.appbar-inner {
  max-width: var(--page-max); margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; flex: none;
  border-radius: 10px; background: var(--c-primary); color: #fff;
}
.logo svg { width: 20px; height: 20px; fill: currentColor; stroke: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: var(--fs-md); font-weight: 650; }
.brand-text small { font-size: var(--fs-xs); color: var(--c-text-3); }

.appbar-actions { display: flex; align-items: center; gap: 8px; }
.user-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: var(--r-full);
  background: var(--c-surface-3); font-size: var(--fs-sm); color: var(--c-text-2);
  max-width: 180px;
}
.user-chip svg { width: 15px; height: 15px; flex: none; }
.user-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.page { max-width: var(--page-max); margin: 0 auto; padding: var(--gap) 16px 56px; }

/* 落地页 hero */
.hero { margin: 8px 0 20px; }
.hero-main { max-width: 720px; }
.hero h1 { font-size: clamp(24px, 4.5vw, 34px); margin-bottom: 12px; }
.hero .accent { color: var(--c-primary); }
.hero-sub { color: var(--c-text-2); font-size: var(--fs-base); line-height: 1.75; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.fact {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-full);
  background: var(--c-surface); border: 1px solid var(--c-border);
  font-size: var(--fs-sm); color: var(--c-text-2); box-shadow: var(--shadow-1);
}
.fact svg { width: 14px; height: 14px; color: var(--c-primary); }

.grid { display: grid; gap: var(--gap); }
.grid-auth { grid-template-columns: 1fr; }

/* 商品卡 */
.plan-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.plan {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 20px; border-radius: var(--r-lg);
  background: var(--c-surface); border: 1px solid var(--c-border);
  box-shadow: var(--shadow-1); transition: box-shadow .18s, transform .18s;
}
.plan:hover { box-shadow: var(--shadow-2); transform: translateY(-2px); }
.plan.is-featured { border-color: var(--c-primary); box-shadow: 0 0 0 1px var(--c-primary), var(--shadow-2); }
.plan-flag {
  position: absolute; top: -10px; left: 18px;
  padding: 2px 10px; border-radius: var(--r-full);
  background: var(--c-primary); color: #fff; font-size: var(--fs-xs); font-weight: 600;
}
.plan-name { font-size: var(--fs-lg); font-weight: 650; }
.plan-price { display: flex; align-items: baseline; gap: 4px; }
.plan-price .cur { font-size: var(--fs-md); color: var(--c-text-2); }
.plan-price .num { font-size: 30px; font-weight: 700; letter-spacing: -.02em; }
.plan-price .unit { font-size: var(--fs-sm); color: var(--c-text-3); }
.plan-desc { font-size: var(--fs-sm); color: var(--c-text-2); flex: 1; }
.plan-state { font-size: var(--fs-xs); color: var(--c-text-3); }

/* 登录卡 */
.auth-card { align-self: start; }
.tabs {
  display: flex; gap: 4px; padding: 4px; margin-bottom: 18px;
  background: var(--c-surface-3); border-radius: var(--r-md);
}
.tab {
  flex: 1; padding: 8px 6px; border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--c-text-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 550;
  cursor: pointer; transition: background .15s, color .15s;
}
.tab:hover { color: var(--c-text); }
.tab.is-active { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow-1); }
.auth-form { display: flex; flex-direction: column; }
.auth-error {
  margin-top: 12px; padding: 10px 13px; border-radius: var(--r-md);
  background: var(--c-danger-bg); color: var(--c-danger);
  border: 1px solid var(--c-danger-border); font-size: var(--fs-sm); line-height: 1.6;
}

/* 已登录：权益摘要 */
.ent-summary { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
               margin-bottom: 18px; }
.ent-cell {
  padding: 12px 14px; border-radius: var(--r-md);
  background: var(--c-surface-2); border: 1px solid var(--c-border);
}
.ent-cell .k { font-size: var(--fs-xs); color: var(--c-text-3); margin-bottom: 4px; }
.ent-cell .v { font-size: var(--fs-lg); font-weight: 650; }
.ent-cell .v.ok { color: var(--c-ok); }
.ent-cell .v.warn { color: var(--c-warn); }
.ent-cell .v.muted { color: var(--c-text-3); }

/* 已登录：Key */
.keyfield { margin-bottom: 14px; }
.keyrow { display: flex; gap: 8px; align-items: center; }
.keyrow input { flex: 1; min-width: 0; }

.usage { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
         margin: 16px 0; padding: 14px; border-radius: var(--r-md);
         background: var(--c-surface-2); border: 1px solid var(--c-border); }
.usage-cell .k { font-size: var(--fs-xs); color: var(--c-text-3); }
.usage-cell .v { font-size: var(--fs-lg); font-weight: 650; font-variant-numeric: tabular-nums; }
.usage-cell .lim { font-size: var(--fs-xs); color: var(--c-text-3); }

.actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

/* 已登录：购买与激活 */
.steps { list-style: none; margin: 0 0 18px; padding: 0; display: flex;
         flex-direction: column; gap: 10px; }
.steps li { display: flex; gap: 10px; align-items: flex-start;
            font-size: var(--fs-md); color: var(--c-text-2); }
.step-no {
  display: grid; place-items: center; width: 22px; height: 22px; flex: none;
  border-radius: var(--r-full); background: var(--c-primary-soft);
  color: var(--c-primary); font-size: var(--fs-xs); font-weight: 700;
}
.buy-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
            margin-bottom: 20px; }
.buy-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px; border-radius: var(--r-md);
  background: var(--c-surface-2); border: 1px solid var(--c-border);
}
.buy-item .nm { font-weight: 600; font-size: var(--fs-md); }
.buy-item .pr { font-size: var(--fs-xl); font-weight: 700; }
.buy-item .pr .cur { font-size: var(--fs-sm); font-weight: 500; color: var(--c-text-2); }
.buy-item .un { font-size: var(--fs-xs); color: var(--c-text-3); }

.activate-form { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.activate-form .field { flex: 1 1 260px; margin-bottom: 0; }

/* ── 5. 响应式 ───────────────────────────────────────────────────────────── */
@media (min-width: 860px) {
  .grid-auth { grid-template-columns: minmax(0, 1.35fr) minmax(320px, 1fr); align-items: start; }
  .plan-grid { grid-template-columns: 1fr; }
}

@media (max-width: 620px) {
  .card { padding: 16px; border-radius: var(--r-md); }
  .page { padding: 12px 12px 44px; }
  .brand-text small { display: none; }
  .user-chip { max-width: 120px; }
  .btn span { display: none; }        /* 顶栏按钮只留图标 */
  .btn { padding: 9px 12px; }
  .appbar-actions .btn span { display: none; }
  .toast-stack { top: 60px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}


/* ============================================================================
 * 6. 登录后的仪表盘（左侧栏 + 内容区）
 *
 * 这一段是后加的，整段自成体系：上面的组件（btn/card/badge/kv/table/usage…）
 * 原样复用，这里只补「布局 + 新区块」需要的类。不要为了复用而回头改上面的
 * 组件 —— 那些类同时被未登录的落地页用着。
 * ==========================================================================*/

.layout {
  display: grid;
  grid-template-columns: 238px minmax(0, 1fr);
  gap: var(--gap);
  align-items: start;
}

/* ── 左侧栏 ─────────────────────────────────────────────────────────────── */
.sidebar {
  /* 顶栏是 sticky 的（高约 54px），侧栏跟着它，滚动时导航不消失 */
  position: sticky;
  top: 70px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  max-height: calc(100vh - 86px);
  overflow-y: auto;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--c-border);
}
.side-avatar {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: var(--r-full);
  background: var(--c-primary-soft);
  color: var(--c-primary);
}
.side-avatar svg { width: 18px; height: 18px; fill: currentColor; stroke: none; }
.side-user-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.side-user-text strong {
  font-size: var(--fs-md); font-weight: 650;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.side-user-text small { font-size: var(--fs-xs); color: var(--c-text-3); }

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 9px;
  width: 100%; padding: 9px 11px;
  border: none; border-radius: var(--r-sm);
  background: transparent; color: var(--c-text-2);
  font: inherit; font-size: var(--fs-md); text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 16px; height: 16px; flex: none; }
.nav-item:hover { background: var(--c-surface-3); color: var(--c-text); }
.nav-item.is-active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }

.side-foot { padding-top: 10px; border-top: 1px solid var(--c-border); }

/* ── 内容区 ─────────────────────────────────────────────────────────────── */
.content { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }
.panel { display: flex; flex-direction: column; gap: var(--gap); }
/* .card 自带 margin-bottom（给落地页那叠卡片用的），面板里用 gap 排，去掉它 */
.panel .card { margin-bottom: 0; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
}
.panel-head h2 { font-size: var(--fs-xl); }

/* ── 平台状态 ───────────────────────────────────────────────────────────── */
.pl-mini { display: flex; flex-direction: column; gap: 9px; }
.pl-mini-row { display: flex; align-items: center; gap: 10px; font-size: var(--fs-md); }
.pl-mini-row .nm { flex: 1; color: var(--c-text-2); }
.pl-mini-row .rate { font-variant-numeric: tabular-nums; font-weight: 600; }

.pl-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.pl-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 15px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.pl-card .pl-name { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pl-card .pl-name strong { font-size: var(--fs-md); font-weight: 650; }
.pl-card .pl-rate { font-size: 26px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.pl-card .pl-rate.is-ok { color: var(--c-ok); }
.pl-card .pl-rate.is-warn { color: var(--c-warn); }
.pl-card .pl-rate.is-muted { color: var(--c-text-3); font-size: 18px; }
.pl-card .pl-sub { font-size: var(--fs-xs); color: var(--c-text-3); }
/* 进度条**不能**写成 `.pl-card .pl-bar`：总览里的紧凑列表（`.pl-mini-row`）
   也用同一个类，加了 .pl-card 前缀的话那里就完全没样式 —— 表现是「名字和百分比之间
   空一块、条不可见」，而两处都用同一段 JS 渲染，很难一眼看出是 CSS 作用域的问题。
   （2026-09-20 浏览器实拍时抓到。） */
.pl-bar { height: 6px; border-radius: 3px; background: var(--c-surface-3); overflow: hidden; }
.pl-bar i { display: block; height: 100%; border-radius: 3px; background: var(--c-ok); }
.pl-bar.is-warn i { background: var(--c-warn); }
.pl-bar.is-bad i { background: var(--c-danger); }

/* ── 额度进度 ───────────────────────────────────────────────────────────── */
.quotas { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.quota-row { font-size: var(--fs-sm); }
.quota-line { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 5px; color: var(--c-text-2); }
.quota-track { height: 7px; border-radius: 4px; background: var(--c-surface-3); overflow: hidden; }
.quota-track i { display: block; height: 100%; border-radius: 4px; background: var(--c-primary); }
.quota-track.is-warn i { background: var(--c-warn); }
.quota-track.is-bad i { background: var(--c-danger); }

/* ── 连通性检测 ─────────────────────────────────────────────────────────── */
.diag-summary {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 11px 13px;
  border-radius: var(--r-md); border: 1px solid;
  font-size: var(--fs-md); font-weight: 600;
}
.diag-summary svg { width: 17px; height: 17px; flex: none; }
.diag-summary.is-ok { background: var(--c-ok-bg); color: var(--c-ok); border-color: var(--c-ok-border); }
.diag-summary.is-bad { background: var(--c-danger-bg); color: var(--c-danger); border-color: var(--c-danger-border); }

.diag-list { list-style: none; margin: 10px 0 0; padding: 0; }
.diag-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 0; border-bottom: 1px solid var(--c-border);
}
.diag-item:last-child { border-bottom: none; }
.diag-item > svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.diag-item.ok > svg { color: var(--c-ok); }
.diag-item.fail > svg { color: var(--c-danger); }
.diag-item .dt { flex: 1; font-size: var(--fs-md); }
.diag-item .dd { font-size: var(--fs-xs); color: var(--c-text-3); margin-top: 2px; word-break: break-all; }

/* ── 窄屏：侧栏折叠成顶部一条横向导航 ───────────────────────────────────── */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    max-height: none;
    padding: 11px;
  }
  /* 导航横向滚动：8 个区块在手机上排不下，但也不该藏起来 */
  .side-nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 3px;
    -webkit-overflow-scrolling: touch;
  }
  .nav-item { width: auto; white-space: nowrap; padding: 8px 12px; }
  .side-foot { display: none; }
}
