:root {
  /* ⚠️ --border 是历史漏定义：多处 var(--border, #d0d7de) 回退到了 GitHub 浅灰，
     在暗色主题上表现为「浅色描边」。补上后统一收口。 */
  --border: #1d3550;
  --accent: #4c9aff;
  --bg: #0a1522;
  --bg-glow: #14304d;
  --surface: #0f1f31;
  --surface-2: #14273c;
  --surface-3: #183049;
  --line: #1d3550;
  --line-soft: #17293e;
  --gold: #d9b95c;
  --gold-dim: #b9973f;
  --navy: #0f2b46;
  --navy-2: #17385a;
  --text: #e8eef5;
  --ink: #e8eef5;
  --muted: #8ba0b6;
  --muted-2: #6c8299;
  --ok: #5ecfa1;
  --ok-bg: rgba(94, 207, 161, .12);
  --bad: #f09181;
  --bad-bg: rgba(240, 145, 129, .12);
  --run: #e8c774;
  --run-bg: rgba(232, 199, 116, .13);
  --idle-bg: rgba(139, 160, 182, .12);
  --shadow: 0 18px 40px -24px rgba(0, 0, 0, .8);
}

* { box-sizing: border-box; }
/* 告诉浏览器「本页面是暗色」：原生控件（下拉箭头、滚动条、
   日期选择器、autofill 背景）才会走深色渲染而不是浅灰默认值。
   这一条是「新增控件白底」类问题的根治点。 */
html { color-scheme: dark; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  background-image: radial-gradient(1100px 620px at 22% -12%, var(--bg-glow) 0%, rgba(20, 48, 77, 0) 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 24px; }

/* Topbar */
.topbar {
  background: linear-gradient(180deg, #10263d 0%, #0c1c2e 100%);
  border-bottom: 1px solid rgba(217, 185, 92, .35);
  box-shadow: 0 1px 0 rgba(217, 185, 92, .12), 0 8px 24px -18px rgba(0, 0, 0, .9);
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-logo {
  width: 46px; height: 40px; border-radius: 8px; object-fit: cover; display: block;
  border: 1px solid rgba(217, 185, 92, .28);
}
.brand-text { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.bar-nav a {
  color: #a9bdd1; text-decoration: none; margin-left: 22px; font-size: 14px;
  padding-bottom: 2px; border-bottom: 1px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.bar-nav a:hover { color: #fff; border-bottom-color: var(--gold); }

/* Layout */
.main { padding: 34px 20px 56px; min-height: 62vh; }

/* Card */
.card {
  position: relative; overflow: hidden;
  background: linear-gradient(180deg, rgba(23, 41, 62, .72) 0%, rgba(15, 31, 49, .72) 100%);
  border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 24px 26px; margin-bottom: 22px;
  box-shadow: var(--shadow);
}
.card::before {
  content: ""; position: absolute; top: 0; left: 20px; right: 20px; height: 1px;
  background: linear-gradient(90deg, rgba(217, 185, 92, .55) 0%, rgba(217, 185, 92, 0) 70%);
}
.card.single { max-width: 440px; margin: 6vh auto 0; padding: 40px 38px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.h1 { font-size: 24px; margin: 0 0 8px; color: #f2f6fa; font-weight: 600; letter-spacing: .5px; }
.h2 { font-size: 16.5px; margin: 0; color: #eef4f9; font-weight: 600; letter-spacing: .6px; }
.card-head .h2::before, .card > .h1::before {
  content: ""; display: inline-block; width: 3px; height: 14px; border-radius: 2px;
  background: var(--gold); margin-right: 10px; vertical-align: -2px;
}
.card > .h1::before { height: 18px; vertical-align: -3px; }
.sub { color: var(--muted); font-size: 13px; margin: 10px 0 0; line-height: 1.75; }
.empty { color: var(--muted-2); padding: 22px 0; text-align: center; margin: 0; }

/* Forms */
.form { margin-top: 18px; }
.field { display: block; margin-bottom: 16px; }
.label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 7px; letter-spacing: .3px; }
.field input, .row-form input, .inline input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14.5px; color: var(--text); background: rgba(10, 22, 36, .75); outline: none;
  font-family: inherit; transition: border-color .15s ease, box-shadow .15s ease;
}
.field input::placeholder, .row-form input::placeholder, .inline input::placeholder { color: var(--muted-2); }
.field input:focus, .row-form input:focus, .inline input:focus {
  border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 185, 92, .14);
}
.row-form { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.input-code { flex: 1 1 320px; }
.input-days { width: 84px !important; text-align: center; }
.unit { color: var(--muted); margin-left: -4px; }

/* 多行输入：与 .field input 同一视觉语言（v9.0 控件统一） */
.input-area {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14.5px; color: var(--text); background: rgba(10, 22, 36, .75); outline: none;
  font-family: inherit; line-height: 1.7; resize: vertical;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.input-area::placeholder { color: var(--muted-2); }
.input-area:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 185, 92, .14); }

/* Buttons */
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(20, 39, 60, .85); color: #d6e3ef; font-size: 14px; cursor: pointer; text-decoration: none;
  font-family: inherit; white-space: nowrap; letter-spacing: .3px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.btn:hover { border-color: #3a5f85; color: #fff; background: var(--surface-3); }
.btn-primary {
  background: linear-gradient(180deg, #e2ca7c 0%, var(--gold) 100%);
  border-color: var(--gold); color: #1c1503; font-weight: 600;
  box-shadow: 0 6px 18px -10px rgba(217, 185, 92, .8);
}
.btn-primary:hover {
  background: linear-gradient(180deg, #e9d58d 0%, #dcbe68 100%);
  border-color: #e6c96e; color: #1c1503;
}
.btn-block { width: 100%; padding: 12px; font-size: 15px; letter-spacing: 4px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-disabled { opacity: .45; cursor: not-allowed; }
.btn-disabled:hover { border-color: var(--line); color: #d6e3ef; background: rgba(20, 39, 60, .85); }
.btn-danger { color: var(--bad); border-color: rgba(240, 145, 129, .35); }
.btn-danger:hover { background: var(--bad-bg); border-color: rgba(240, 145, 129, .6); color: #f7b3a7; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.hint-admin { text-align: center; margin-top: 18px; font-size: 13px; color: var(--muted-2); }
.hint-admin a { color: var(--gold); }

/* Alerts */
.alert {
  padding: 14px 18px; border-radius: 10px; margin-bottom: 20px; font-size: 14px;
  border: 1px solid transparent; backdrop-filter: blur(2px);
}
.alert-err { background: var(--bad-bg); border-color: rgba(240, 145, 129, .28); color: #f5b5ab; }
.alert-ok { background: var(--ok-bg); border-color: rgba(94, 207, 161, .28); color: #9fe0c6; }
.alert b { color: #fff; }
.cred { margin: 10px 0 6px; font-size: 14px; color: #dce6ef; }
.cred code, code.pw {
  background: rgba(10, 22, 36, .8); border: 1px solid rgba(94, 207, 161, .3); padding: 2px 8px; border-radius: 5px;
  font-size: 14px; letter-spacing: .5px; color: #cfe6dc;
}
code.pw { font-weight: 700; color: var(--gold); font-size: 15px; }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 500; font-size: 12.5px; letter-spacing: 1px;
  background: rgba(10, 22, 36, .35); text-transform: none; white-space: nowrap;
}
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .022); }
.tbl tr.row-disabled td { background: rgba(240, 145, 129, .045); }
.right { text-align: right; }
.ops { white-space: nowrap; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
.err-line { color: var(--bad); font-size: 12.5px; margin-top: 4px; }

/* 后台：密码展示 / 额度编辑 / 邮箱链接 */
.pw-line { margin-top: 4px; font-size: 13px; color: var(--muted); }
.pw-missing { margin-top: 4px; font-size: 12.5px; color: var(--run); }
.link-email { color: var(--gold); text-decoration: none; font-weight: 600; }
.link-email:hover { text-decoration: underline; }
.input-quota { width: 78px !important; text-align: center; }
.quota-text { font-weight: 600; color: #e1ebf4; margin-bottom: 6px; }
.quota-edit { margin-left: 0 !important; margin-bottom: 6px; }
.quota-quick { display: inline-flex; gap: 6px; }
.chip-warn { color: #ffe2b0; background: var(--run-bg); border-color: rgba(232, 199, 116, .4); }
.card-head .back { margin-left: auto; }


/* Badges */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12.5px;
  background: var(--idle-bg); color: var(--muted); border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(94, 207, 161, .25); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: rgba(240, 145, 129, .25); }
.badge.run { background: var(--run-bg); color: var(--run); border-color: rgba(232, 199, 116, .25); }
.chip {
  font-size: 12.5px; color: #a9bacb; background: rgba(20, 39, 60, .8);
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--line-soft); letter-spacing: .3px;
}

/* KV list */
.kv { list-style: none; padding: 0; margin: 0; columns: 2; column-gap: 32px; }
.kv li { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--line-soft); font-size: 13.5px; }
.kv li:last-child { border-bottom: none; }
.kv li span { color: var(--muted); }
.kv li b { font-weight: 500; color: #e1ebf4; }

/* Footer */
.foot {
  border-top: 1px solid var(--line-soft); padding: 16px 0;
  color: var(--muted-2); font-size: 12.5px; text-align: center; background: transparent;
}

/* 管理后台登录：居中金色卡片 */
.card.single .h1 { margin-bottom: 6px; }

@media (max-width: 640px) {
  .kv { columns: 1; }
  .ops { text-align: left; }
  .input-code { flex: 1 1 100%; }
  .card { padding: 20px 18px; }
  .wrap { padding: 0 16px; }
}

/* ---- 登录页 · 暗色商务（全屏平铺）---- */
body.page-login {
  display: flex; flex-direction: column; min-height: 100vh;
  background-image: none;
}
.page-login .main { flex: 1; max-width: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.page-login .foot { background: #0a1522; border-top: 1px solid #152a40; }
.login-hero {
  flex: 1; display: grid; grid-template-columns: 1fr 1fr;
  min-height: 0; background: #0a1522;
}
.login-art { position: relative; min-height: 320px; }
.login-art img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 20%;
}
.login-art::after {
  content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 22%;
  background: linear-gradient(90deg, rgba(10, 21, 34, 0) 0%, #0a1522 100%);
  pointer-events: none;
}
.login-quote {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 56px 44px 36px; color: #eef3f8; font-size: 15.5px; line-height: 1.75;
  background: linear-gradient(180deg, rgba(10, 21, 34, 0) 0%, rgba(10, 21, 34, .92) 66%);
}
.login-quote em {
  display: block; font-style: normal; color: #d9b95c; font-size: 13.5px; margin-top: 8px; letter-spacing: 1.5px;
}
.login-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px clamp(32px, 6vw, 96px);
}
.login-eyebrow { color: #d9b95c; font-size: 12px; letter-spacing: 4px; margin: 0 0 12px; font-weight: 500; }
.login-title { color: #f5f8fb; font-size: 28px; margin: 0 0 8px; font-weight: 600; letter-spacing: 1px; }
.login-sub { color: #93a5b8; font-size: 13.5px; margin: 0 0 30px; }
.login-form .label { color: #a9bacb; }
.login-form input {
  width: 100%; padding: 12px 14px; border: 1px solid #27425c; border-radius: 8px;
  background: #122538; color: #eef4f9; font-size: 14.5px; outline: none; font-family: inherit;
}
.login-form input::placeholder { color: #5f7891; }
.login-form input:focus { border-color: #d9b95c; box-shadow: 0 0 0 3px rgba(217, 185, 92, .15); }
.login-btn {
  width: 100%; padding: 13px; margin-top: 8px; border: none; border-radius: 8px;
  cursor: pointer; background: #d9b95c; color: #1c1503;
  font-size: 15.5px; font-weight: 600; letter-spacing: 6px; font-family: inherit;
  transition: background .15s ease;
}
.login-btn:hover { background: #e6c96e; }
.login-hint { text-align: center; color: #7a8ea3; font-size: 13px; margin-top: 24px; }
.page-login .alert { max-width: 640px; margin: 20px auto 0; }
@media (max-width: 880px) {
  .login-hero { grid-template-columns: 1fr; }
  .login-art { min-height: 340px; order: -1; }
  .login-panel { padding: 44px 28px; }
  .login-title { font-size: 23px; }
  .login-quote { padding: 40px 28px 24px; font-size: 14px; }
  .login-art::after {
    top: auto; left: 0; right: 0; bottom: 0; width: auto; height: 18%;
    background: linear-gradient(180deg, rgba(10, 21, 34, 0) 0%, #0a1522 100%);
  }
}

/* ---- 股票搜索选择器（实时下拉）---- */
.search-box { position: relative; flex: 1 1 320px; min-width: 0; }
.search-box .input-code { width: 100%; }
.search-drop {
  position: absolute; top: calc(100% + 5px); left: 0; right: 0; z-index: 40;
  margin: 0; padding: 4px; list-style: none;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 20px 44px -18px rgba(0, 0, 0, .9);
  max-height: 320px; overflow-y: auto;
}
.search-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px;
  border-radius: 6px; cursor: pointer; font-size: 14px; user-select: none;
}
.search-item:hover, .search-item.active { background: rgba(217, 185, 92, .13); }
.search-item.empty { cursor: default; color: var(--muted-2); justify-content: center; font-size: 13px; }
.si-name { color: var(--ink); font-weight: 500; }
.si-code { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.si-market { margin-left: auto; color: var(--muted); font-size: 12px; white-space: nowrap; }
.hint-search {
  flex-basis: 100%; color: var(--bad); font-size: 12.5px;
  min-height: 0; margin-top: 2px;
}
@media (max-width: 640px) {
  .search-box { flex: 1 1 100%; }
}

/* ---- v6.0 大模型管理 ---- */
.stack-form { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.stack-form .row-form { width: 100%; }
.stack-form.mini { margin-top: 8px; padding: 8px; border: 1px dashed var(--line); border-radius: 8px; }
.inline-edit { display: inline-block; vertical-align: middle; }
/* 当前生效模型高亮。用半透明金色叠加而不是实色浅绿——
   实色浅底在暗色主题下会变成一块突兀的亮斑。 */
.row-active { background: rgba(217, 185, 92, .07); }
.btn-danger { background: #e35d5d; color: #fff; }
.btn-danger:hover { background: #c94f4f; }

/* ============================================================
   账号体系（注册三步 / 找回密码 / 修改密码）· v7.2
   复用既有 .login-* 视觉，新增步骤指示器、提示条与文字按钮
   ============================================================ */

/* ---- 步骤指示器 ---- */
.steps { display: flex; align-items: center; gap: 6px; margin: 4px 0 18px; }
.steps .step {
  display: flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--muted-2); white-space: nowrap;
}
.steps .step i {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-3); color: var(--muted);
  font-style: normal; font-size: 11px; font-weight: 600;
  transition: background .15s, color .15s;
}
.steps .step.on { color: var(--ink); font-weight: 600; }
.steps .step.on i { background: var(--accent); color: #fff; }
.steps .step.done i { background: var(--ok); color: #fff; }
.steps .step-line { flex: 1; height: 1px; background: var(--line); min-width: 12px; }

/* ---- 提示条 ---- */
.alert {
  border-radius: 8px; padding: 10px 12px; margin: 0 0 16px;
  font-size: 13px; line-height: 1.7; word-break: break-word;
}
/* ⚠️ 这里曾有一份 GitHub 浅色版的 .alert-error / .alert-ok，
   位于上方暗色定义**之后**，同权重后声明 → 实际生效的是浅色版，
   于是全站成功/错误提示条变成白底，与暗色主题割裂。
   现在只保留一份定义（.alert-sub 属于登录页专属），避免再次覆盖。 */
.alert-error { background: var(--bad-bg); border: 1px solid rgba(240, 145, 129, .28); color: #f5b5ab; }
.alert-sub { font-size: 12px; opacity: .78; }

/* ---- 表单细节 ---- */
.login-form .field input[disabled] { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }
.label-hint { font-size: 11px; color: var(--muted-2); font-weight: 400; margin-top: 4px; }

/* 独立成行的次要操作（不用 <a>：目标路由是 POST-only） */
.inline-form { margin: 12px 0 0; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: 12px; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

/* 登录页底部链接组 */
.login-hint a { color: var(--accent); text-decoration: none; }
.login-hint a:hover { text-decoration: underline; }

/* ---- 邀请码管理页· v7.2 ---- */
.invite-code {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px; font-weight: 600; letter-spacing: 1px;
  color: var(--ink); background: var(--surface-2); padding: 2px 7px;
  border-radius: 4px; border: 1px solid var(--line);
}
/* 表格内的操作按钮组：form 默认是块级，会撑高行高 */
.tbl td.right form.inline { display: inline-block; margin: 0 2px 0 0; }

/* 邀请码页表格列宽：7 列在窄屏会挤爆，「备注」被压成竖排一列字。
   用 col 元素的显式宽度而不是 nth-child —— 后者在 table-layout:fixed 下
   与实际列序错位（PDF 渲染下可见徽章与列标题对不上）。 */
.tbl.invites-table { table-layout: fixed; width: 100%; }
.tbl.invites-table col.c-code  { width: 132px; }
.tbl.invites-table col.c-label { width: auto; }   /* 备注吃掉剩余空间 */
.tbl.invites-table col.c-state { width: 64px; }
.tbl.invites-table col.c-used  { width: 82px; }
.tbl.invites-table col.c-exp   { width: 92px; }
.tbl.invites-table col.c-time  { width: 98px; }
.tbl.invites-table col.c-act   { width: 120px; }
.tbl.invites-table td { word-break: normal; overflow-wrap: anywhere; }
.tbl.invites-table td.col-label { overflow-wrap: break-word; line-height: 1.5; }
.tbl.invites-table td.col-time  { white-space: nowrap; }

/* row-form 在窄容器里会挤，按钮被压扁→ 允许换行并给按钮固定高度 */
.row-form { flex-wrap: wrap; row-gap: 10px; }
.row-form .btn, .row-form button { white-space: nowrap; min-height: 30px; }

/* 状态徽章：inline-block 在 PDF 渲染下会跨列溢出，压到相邻列上。
   改成 table-cell 独占一行宽。 */
.tbl.invites-table td.col-state .badge {
  display: inline-block; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tbl.invites-table td.col-state { white-space: nowrap; }
/* 邀请码不允许在中间断行 */
.tbl.invites-table td.col-code { white-space: nowrap; }

/* ---- 分析师管理页 · v7.3 ---- */
.inp-sm {
  border: 1px solid var(--border); border-radius: 5px;
  padding: 3px 6px; font-size: 12px; background: var(--surface-2); color: inherit;
  max-width: 150px;
}
.tbl td .inline { display: inline-flex; gap: 4px; align-items: center; }
.tbl .chip {
  display: inline-block; margin: 1px 3px 1px 0; padding: 1px 7px;
  border-radius: 9px; background: var(--surface-3); color: var(--muted-2); font-size: 11px;
}

/* ============================================================
   品牌与导航 · v7.4
   ============================================================ */

/* 登录页品牌区：logo + eyebrow 竖排 */
.login-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 4px;
}
.login-brand .login-logo {
  width: 64px; height: 64px; border-radius: 14px;
  /* logo 是浅灰底图形，放在白面板上需要描边才立得住 */
  box-shadow: 0 2px 10px rgba(31, 35, 40, .10);
}
.login-brand .login-eyebrow { margin: 0; }

/* 顶栏 logo 尺寸与对齐 */
.topbar .brand-logo {
  width: 34px; height: 34px; border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .28);
  border: 1px solid rgba(217, 185, 92, .28);
}
.topbar .brand-text { letter-spacing: .2px; }

/* 导航项间距（新增「修改密码」后需要更紧凑些） */
.topbar .bar-nav a { margin-left: 14px; }

/* ---- 修改密码页：不记得旧密码的备用出路 ---- */
.alt-path {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 12px; color: var(--muted-2); font-size: 12px;
}
.alt-path-line { flex: 1; height: 1px; background: var(--line); }
.alt-path-text { white-space: nowrap; }
.alt-path-btn {
  display: block; text-align: center; text-decoration: none;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
}
.alt-path-btn:hover { background: var(--surface-2); border-color: #3a5f85; }

/* ============================================================
   浏览器通知开关 · v7.4
   ============================================================ */
.notify-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none; white-space: nowrap;
  font-size: 13px; color: var(--muted, var(--muted));
}
.notify-toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.notify-toggle-track {
  position: relative; width: 34px; height: 19px; flex: none;
  background: var(--border); border-radius: 19px;
  transition: background .18s ease;
}
.notify-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 15px; height: 15px; border-radius: 50%;
  background: var(--surface-2); box-shadow: 0 1px 3px rgba(0, 0, 0, .22);
  transition: transform .18s ease;
}
.notify-toggle input:checked + .notify-toggle-track { background: var(--accent); }
.notify-toggle input:checked + .notify-toggle-track .notify-toggle-thumb {
  transform: translateX(15px);
}
.notify-toggle input:focus-visible + .notify-toggle-track {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.notify-toggle:hover .notify-toggle-text { color: var(--ink); }
/* 开启后文字加深，给用户明确反馈 */
.notify-toggle input:checked ~ .notify-toggle-text { color: var(--ink); font-weight: 500; }

/* ============================================================
   管理后台左侧栏 · v7.4
   ------------------------------------------------------------
   层级问题的解法：把「功能区」与「页面内的操作」在视觉上分开——
   侧栏放功能区（一级），页面内只放该区内的操作（二级）。
   ============================================================ */

/* 顶栏实测高度 66px（.bar-inner），必须与侧栏的 top 对齐 */
:root { --top-h: 66px; --side-w: 208px; --side-w-collapsed: 56px; }
body.side-collapsed { --side-w: var(--side-w-collapsed); }

/* ⚠️ `.main` 在 `.wrap` 内，而 `.wrap` 有 `max-width:1060px; margin:0 auto`。
   直接给 .main 加 margin-left 会被 wrap 的居中抵消，侧栏一开内容就偏。
   正确做法：把 wrap 的居中改为「左侧预留侧栏宽度 + 右侧仍居中」——
   padding-left 让内容整体右移，max-width 仍保证阅读宽度。 */
.has-sidebar .main {
  margin-left: var(--side-w);
  transition: margin-left .18s ease;
}
/* wrap 的居中要让位给侧栏：改margin 而非 padding，
   否则 wrap 的可用宽度会少一截，右侧出现空白 */
.has-sidebar .wrap { margin-left: var(--side-w); }
@media (max-width: 900px) {
  .has-sidebar .wrap { margin-left: 0; }
}

/* 侧栏本体：贴在顶栏下方的固定条 */
.sidebar {
  position: fixed; top: var(--top-h); left: 0; z-index: 40;
  width: var(--side-w);
  height: calc(100vh - var(--top-h));
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  transition: width .18s ease;
  padding: 12px 8px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  color: var(--muted-2); text-decoration: none;
  font-size: 13.5px; line-height: 1.4; white-space: nowrap;
  transition: background .12s, color .12s;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.on { background: #eef4ff; color: #1f5fbf; font-weight: 600; }
.side-ico {
  flex: none; width: 18px; text-align: center;
  font-size: 15px; line-height: 1;
}
.side-label { overflow: hidden; text-overflow: ellipsis; }
/* 二级子项：缩进 + 小一号字，视觉上归属父项（如「用户管理 → 邀请码」） */
.side-sub { margin: -2px 0 2px 12px; padding: 6px 10px; font-size: 12.5px; }
.side-sub .side-ico { width: 12px; opacity: .7; }
.side-sub.on { background: #eef4ff; color: #1f5fbf; font-weight: 600; }

/* 折叠态：只留图标 */
.side-collapsed .sidebar { width: var(--side-w-collapsed); }
.side-collapsed .side-label { display: none; }
.side-collapsed .side-item { justify-content: center; padding: 9px 0; }

/* 顶栏的折叠按钮 */
.side-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; margin-right: 10px;
  border: 1px solid var(--border); border-radius: 7px;
  background: var(--surface-2); cursor: pointer; color: var(--muted-2);
  font-size: 14px; line-height: 1;
}
.side-toggle:hover { background: var(--surface-2); }

/* 移动端：侧栏变抽屉，默认收起 */
@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease; width: 240px;
    box-shadow: 0 0 24px rgba(0, 0, 0, .12);
  }
  .side-open .sidebar { transform: translateX(0); }
  .side-open .side-label { display: block; }
  .side-open .side-item { justify-content: flex-start; padding: 8px 10px; }
  .side-scrim {
    position: fixed; inset: 0; z-index: 39;
    background: rgba(27, 31, 36, .35);
  }
}

/* ============================================================
   数据中心看板 · v7.4
   ============================================================ */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-title { font-size: 19px; font-weight: 600; margin: 0; }

/* 时间范围切换 */
.range-switch {
  display: inline-flex; border: 1px solid var(--border);
  border-radius: 7px; overflow: hidden; background: var(--surface-2);
}
.range-opt {
  padding: 5px 13px; font-size: 13px; color: var(--muted-2);
  text-decoration: none; border-right: 1px solid #eaecef;
}
.range-opt:last-child { border-right: none; }
.range-opt:hover { background: var(--surface-2); }
.range-opt.on { background: var(--accent); color: #fff; font-weight: 500; }

/* KPI 卡片 */
/* 用 flex 而非 grid：WeasyPrint（生成报告 PDF 时用）对 grid auto-fit
   支持不完整会退化成单列，flex + flex-wrap 在任何渲染器下都正常。
   浏览器里两者视觉无差别。 */
.kpi-grid {
  display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px;
}
.kpi { flex: 1 1 168px; min-width: 168px; }
.kpi {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px 16px;
}
/* flex 模式下 gap 已在容器上，这里不需要 margin */
.kpi-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi-value {
  font-size: 24px; font-weight: 600; color: var(--ink);
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.kpi-unit { font-size: 14px; font-weight: 400; color: var(--muted); margin-left: 2px; }
.kpi-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 6px; line-height: 1.6; }
.kpi-sub .badge { margin-right: 4px; }

/* 两栏布局 */
.two-col {
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: 12px; align-items: start;
}
@media (max-width: 880px) { .two-col { grid-template-columns: 1fr; } }

/* 纯 CSS 柱状图（不引图表库） */
.spark { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding: 8px 0 0; }
.spark-col { flex: 1; display: flex; flex-direction: column;
             align-items: center; justify-content: flex-end; height: 100%; }
.spark-bar {
  width: 100%; max-width: 34px; min-height: 2px;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent) 100%);
  border-radius: 4px 4px 0 0; transition: height .2s;
}
.spark-col:hover .spark-bar { background: linear-gradient(180deg, #6fb0ff, #1f6feb); }
.spark-num { font-size: 11px; color: var(--muted-2); margin: 4px 0 2px;
             font-variant-numeric: tabular-nums; }
.spark-lbl { font-size: 10.5px; color: var(--muted-2); }

/* ---- 报告列表：筛选条 / 下拉菜单 / 分页 ---- */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-count { font-size: 12.5px; color: var(--muted-2); margin-left: auto; }
.filter-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: #eef4ff; color: #1f5fbf; border: 1px solid #cfe0ff;
  border-radius: 20px; padding: 3px 6px 3px 11px; font-size: 12.5px;
}
.filter-clear {
  width: 17px; height: 17px; line-height: 15px; text-align: center;
  border-radius: 50%; background: #1f5fbf; color: #fff;
  text-decoration: none; font-size: 13px;
}
.filter-clear:hover { background: #1a4fa0; }

.reports-tbl td { vertical-align: middle; }
.nowrap { white-space: nowrap; }
.ellipsis { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.err-line {
  font-size: 11.5px; color: var(--bad); max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 单元格里的错误：hover 展开全文（用 title 属性即可，不需 JS） */
.err-line:hover { white-space: normal; }

.ops { display: inline-flex; align-items: center; gap: 5px; }

/* 下拉菜单：用原生 <details>，无 JS 也能用 */
.drop { position: relative; display: inline-block; }
.drop > summary { list-style: none; cursor: pointer; }
.drop > summary::-webkit-details-marker { display: none; }
.drop-menu {
  position: absolute; right: 0; top: calc(100% + 4px); z-index: 30;
  min-width: 152px; padding: 4px;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(31, 35, 40, .16);
  display: flex; flex-direction: column;
}
.drop-menu a, .drop-btn {
  display: block; width: 100%; text-align: left;
  padding: 6px 9px; border: none; background: none;
  border-radius: 5px; font-size: 12.5px; color: var(--ink);
  text-decoration: none; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.drop-menu a:hover, .drop-btn:hover { background: var(--surface-2); }
.drop-dis {
  display: block; padding: 6px 9px; font-size: 12px; color: #a8a29e;
  cursor: not-allowed;
}
.drop-menu form { margin: 0; }

.pager { display: flex; align-items: center; gap: 10px; justify-content: center;
         margin-top: 14px; font-size: 13px; }
.pager-item {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted-2); text-decoration: none; background: var(--surface-2);
}
.pager-item:hover { background: var(--surface-2); }
.pager-cur { color: var(--muted-2); font-variant-numeric: tabular-nums; }

/* ============================================================
   报告列表 · tab 分栏 + 管理员 debug 提示词 · v7.5
   ------------------------------------------------------------
   复用已有的 .search-box / .search-drop / .search-item
   （用户端选标控件同源），此处只补布局与 tab 本身。
   ============================================================ */
.tab-bar {
  display: flex; gap: 4px; margin: 0 0 16px;
  border-bottom: 1px solid var(--line); padding-bottom: 0;
}
.tab-bar .tab {
  padding: 9px 16px; font-size: 14px; color: var(--muted);
  text-decoration: none; border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.tab-bar .tab:hover { color: var(--ink); }
.tab-bar .tab.on { color: var(--gold); border-bottom-color: var(--gold); font-weight: 600; }
.tab-bar .tab .sm { color: var(--muted-2); font-size: 12px; }

/* debug 卡片：提示这是工具而非用户功能，用虚线边与主卡片区分 */
.debug-card {
  border: 1px dashed rgba(217, 185, 92, .38);
  background: rgba(217, 185, 92, .04);
}
.debug-card .row-form { flex-wrap: wrap; }
.debug-card .btn-primary { flex: none; }

/* 筛选栏里的用户搜索框：宽度比用户端的窄，且下拉要压在筛选栏之上 */
.filter-bar .filter-user-box { flex: 0 1 250px; }
.filter-bar .filter-user-box .inp-sm { width: 100%; max-width: none; height: 28px; }
.filter-bar .search-drop { min-width: 260px; }

/* 页面头部右侧操作区（用户管理：搜索框 + 新建按钮） */
.head-ops { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.head-ops .inp-sm { width: auto; height: 30px; }
@media (max-width: 640px) {
  .head-ops { width: 100%; }
  .head-ops .inp-sm { flex: 1 1 auto; width: auto; }
}
