:root {
  /* ============================================================
     LT 设计基线 v3（2026-11-02）
     一个主色：白。语义色只标状态，品牌双色只做点缀。
     四层面 / 四档线 / 三档字 —— 页面里不许再出现裸 hex。
     ============================================================ */
  /* ---- 面 ---- */
  --bg: #000000;
  --bg-glow: #0a0a0c;
  --panel: #08080a;
  --surface: #08080a;
  --surface-2: #0d0d10;
  --surface-3: #141418;
  --field: #0b0b0e;
  --hover: #111114;
  /* ---- 线 ---- */
  --line: #1c1c20;
  --line-soft: #141418;
  --line-2: #2a2a30;
  --line-3: #3a3a42;
  --border: #1c1c20;
  /* ---- 字 ---- */
  /* ---- 字（三档，2026-11-03 v5 基线提亮） ---- */
  --tx: #fbfbfd;        /* 原 #f4f4f6：正文、标题、数字、表格主值 */
  --tx-2: #b6b6c0;      /* 原 #a2a2ab：次要说明、表格次列、副标题 */
  --tx-3: #7e7e88;      /* 原 #6a6a73：辅助小字、时间戳、单位、禁用态 */
  /* 别名必须同步，否则会出现「同一页两种灰」 */
  --text: var(--tx);
  --ink: var(--tx);
  --text-soft: var(--tx-2);
  --muted: var(--tx-2);
  --muted-2: var(--tx-3);
  /* ---- 字号九档 ----
     token 名保留**旧像素值**，值换成新像素值。这样 230 处 font-size: Npx
     可以机械替换成 var(--fs-N)，一处改值全站生效，且不用重新判断
     "这个类原本想多大"。
     小数归并名单（写在这里备查）：
       9.5 / 10 / 10.5 / 11 → --fs-11（旧 11 档）
       11.5 / 12 / 12.5     → --fs-12
       13                   → --fs-13
       13.5 / 14 / 14.5     → --fs-14
       15 / 15.5            → --fs-15
       16 / 17 / 17.5       → --fs-16
       19 / 20              → --fs-20
       22 / 23 / 24         → --fs-24
       28                   → --fs-28
     归并只按「档名数值就近」，不改语义：原本是脚注的仍是脚注。 */
  --fs-11: 12px;
  --fs-12: 13px;
  --fs-13: 14px;
  --fs-14: 15px;
  --fs-15: 16px;
  --fs-16: 17px;
  --fs-20: 21px;
  --fs-24: 25px;
  --fs-28: 29px;
  --fs-body: var(--fs-14);
  /* ---- 语义（只用于状态点与小字，不做背景块） ---- */
  --ok: #88dfb2;
  --ok-bg: rgba(136, 223, 178, .07);
  --bad: #f0857b;
  --bad-bg: rgba(240, 133, 123, .07);
  --warn: #e3bf7c;
  --run: #e3bf7c;
  --run-bg: rgba(227, 191, 124, .07);
  --idle-bg: rgba(255, 255, 255, .04);
  /* ---- 品牌双色（取自 logo）：只出现在品牌标 / 选中态 / 最高等级 / 图表 ---- */
  --blue: #00609c;
  --blue-lt: #4890b4;
  --blue-soft: rgba(72, 144, 180, .13);
  --blue-line: rgba(72, 144, 180, .42);
  --red: #fc6c6c;
  --red-soft: rgba(252, 108, 108, .12);
  --red-line: rgba(252, 108, 108, .40);
  /* 非灰阶的两个字色：反色字（实心色块上的深字）与 V1 等级标识色。
     它们不属于「三档层级」，所以单列，而不是塞进 --tx-* 里。 */
  --on-strong: #0b0b0e;   /* 实心语义色块上的反色字 */
  --on-light: #000;       /* 白底主按钮上的字 */
  --lv-1: #9dc6da;
  --grad-brand: linear-gradient(90deg, var(--blue-lt) 0%, var(--red) 100%);
  --grad-mark: linear-gradient(135deg, var(--blue) 0%, var(--blue-lt) 52%, var(--red) 100%);
  /* ---- 尺寸 ---- */
  --r-sm: 8px;
  --r-md: 10px;
  --r-pill: 999px;
  --h: 34px;
  --h-sm: 28px;
  --shadow: 0 24px 60px -24px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 255, 255, .04);
  /* ---- 兼容别名：老规则里的金色/深蓝一律改指新 token，
          这样 297 个既有类的规则不用逐条重写就能跟着变色 ---- */
  --gold: #4890b4;
  --gold-dim: #3a708f;
  --accent: #4890b4;
  --navy: #0d0d10;
  --navy-2: #141418;
}

* { box-sizing: border-box; }

/* ≤640px：只在 token 上覆盖三档，不逐类改。
   逐类改一定会漏，漏掉的那几处就是"这页字大那页字小"的来源。
   其余档（11/15/16/20/24/28）移动端不动 —— 它们已经够大。 */
@media (max-width: 640px) {
  :root { --fs-12: 14px; --fs-13: 15px; --fs-14: 16px; }

  /* 可点区域不小于 44px。手指不是鼠标 —— 按不中时用户的判断是
     "点了没反应"，而不是"按钮太小"。这条只管移动端，桌面 34 不变。 */
  .btn, .btn-sm { min-height: 44px; }
  .inp, .inp-sm, .sel, .stepper, textarea.ta { min-height: 44px; }
  .stepper .step-btn { width: 44px; height: 44px; }
  .acc-h { min-height: 48px; }
  .icon-btn, .icon-btn-sm { min-width: 40px; min-height: 40px; }
  /* 额度格在窄屏改两行：说明另起一行，否则「随会员到期失效」会把日期挤成两截 */
  .quota { grid-template-columns: 60px 1fr; padding: 13px 14px 11px; }
  .q-n { grid-column: 1 / -1; padding: 0 0 7px; }
}

/* [hidden] 必须能压住组件自己的 display。
   浏览器默认的 [hidden]{display:none} 来自 UA 样式表，**任何作者样式里的
   display 都会盖掉它**。频道详情页曾因此出事：`.msg-img-wrap{display:block}`
   让带 hidden 的图片块照常显示，`<img>` 没有 src 就渲染出 alt 文字
   「图片消息」，兜底文案「图片已失效」也一起露了出来。
   这条放在所有组件之前，且用 !important——它是兜底规则，不是可选项。 */
[hidden] { display: none !important; }

/* 告诉浏览器「本页面是暗色」：原生控件（下拉箭头、滚动条、
   日期选择器、autofill 背景）才会走深色渲染而不是浅灰默认值。
   这一条是「新增控件白底」类问题的根治点。 */
html { color-scheme: dark; }
html, body { margin: 0; padding: 0; }
body {
  /* 纯色底，没有径向发光 —— 新基线靠 1px 线与留白分层，不靠光晕 */
  background: var(--bg);
  color: var(--tx);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont,
               "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: var(--fs-14);
  line-height: 1.7;
  letter-spacing: -.004em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 数字一律等宽，避免「23 次」和「128 天」列宽跳动 */
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-12); letter-spacing: 0; }

.wrap { max-width: 880px; margin: 0 auto; padding: 0 22px; }

/* 后台内容区比用户端宽：批次表 9 列、用户表 6 列，880px 会挤到换行。
   设计基线给的是 1080px。只在有侧栏（= 后台）时放宽，用户端保持 880 的阅读宽度。 */
.has-sidebar .wrap { max-width: 1080px; }

/* ============================================================
   Topbar · 用户端 56px
   ------------------------------------------------------------
   旧版是 66px + 金色渐变底 + 金色下边框。新基线：纯黑、1px 细线、
   选中态用「品牌双色 2px 下划线」，hover 走浅蓝，不再用金色。
   ============================================================ */
.topbar {
  background: #000000;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--tx); text-decoration: none; }
.brand-logo {
  /* logo 图片保留（多分辨率资产已在 static/img/logo），尺寸收到新基线的 18px */
  width: 20px; height: 20px; object-fit: contain; display: block;
}
.brand-text { font-size: var(--fs-13); font-weight: 600; letter-spacing: .01em; }
.bar-nav a {
  position: relative; display: inline-block;
  color: var(--tx-3); text-decoration: none; margin-left: 2px; padding: 6px 10px;
  font-size: var(--fs-12); border-radius: 6px;
  transition: color .14s ease;
}
.bar-nav a:hover { color: var(--blue-lt); }
.bar-nav a.on { color: var(--tx); }
.bar-nav a.on::after {
  content: ""; position: absolute; left: 10px; right: 10px; bottom: -2px;
  height: 2px; border-radius: 2px; background: var(--grad-brand);
}

/* Layout */
/* min-height 让短页面（首页、积分记录）的页脚也贴到视口底部，
   而不是在内容结束处就停住、下面留一大块空白。
   长页面（报告列表）内容自然撑开，不受影响。 */
.main { padding: 30px 22px 60px; min-height: calc(100vh - var(--top-h) - 56px); }

/* ============================================================
   Card · 1px 线 + 纯色面，没有渐变、没有左侧金条、没有投影
   ============================================================ */
.card {
  position: relative; overflow: visible;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 20px 22px; margin-bottom: 14px;
  box-shadow: none;
}
.card.single { max-width: 440px; margin: 6vh auto 0; padding: 32px 30px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.h1 { font-size: var(--fs-20); margin: 0 0 8px; color: var(--tx); font-weight: 600; letter-spacing: -.02em; }
.h2 { font-size: var(--fs-14); margin: 0; color: var(--tx); font-weight: 600; letter-spacing: -.005em; }
/* 旧版每张卡标题前有一根金色竖条。新基线取消装饰条 ——
   层级靠字号与留白表达，不靠色块 */
.card-head .h2::before, .card > .h1::before { content: none; }
.sub { color: var(--tx-3); font-size: var(--fs-12); margin: 8px 0 0; line-height: 1.7; }
.empty { color: var(--tx-3); padding: 22px 0; text-align: center; margin: 0; font-size: var(--fs-12); }

/* Forms */
.form { margin-top: 18px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.label { display: block; font-size: var(--fs-11); color: var(--tx-3); margin-bottom: 7px; letter-spacing: .1em; text-transform: uppercase; }
.field input, .row-form input, .inline input {
  width: 100%; padding: 0 12px; height: var(--ctl-h); border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--ctl-font); color: var(--tx); background: var(--field); outline: none;
  font-family: inherit; transition: border-color .14s ease, box-shadow .14s ease;
}
.field input::placeholder, .row-form input::placeholder, .inline input::placeholder { color: var(--tx-3); }
.field input:focus, .row-form input:focus, .inline input:focus {
  border-color: var(--blue-line); box-shadow: 0 0 0 3px var(--blue-soft);
}
.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(--tx-3); margin-left: -4px; }

/* ============================================================
   表单控件统一规范
   ------------------------------------------------------------
   全站 input / select / textarea 共用同一套视觉 token：
   - 高度 34px（紧凑 .inp-sm/.sel-sm 28px）、字号 12.5px
   - 面 #0b0b0e、边 #2a2a30，焦点走浅蓝（品牌色唯一的交互态用法）
   - select 自绘箭头（appearance:none + 内嵌 SVG），摆脱原生控件差异
   ============================================================ */
:root {
  --ctl-h: 34px;            /* 标准控件高度 */
  --ctl-h-sm: 28px;         /* 紧凑控件高度（筛选条/表格外） */
  --ctl-bg: #0b0b0e;
  --ctl-font: 12.5px;
  --ctl-font-sm: 12px;
}

/* 统一文本输入（新写法；旧类 .input-code 等继续兼容） */
.inp {
  height: var(--ctl-h); padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--ctl-font); color: var(--tx); background: var(--ctl-bg);
  outline: none; font-family: inherit; width: 100%;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.inp::placeholder { color: var(--tx-3); }
.inp:focus { border-color: var(--blue-line); box-shadow: 0 0 0 3px var(--blue-soft); }

/* 统一原生下拉：自绘箭头，尺寸/字体与 .inp 一致 */
.sel {
  height: var(--ctl-h); padding: 0 26px 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--ctl-font); color: var(--tx); background: var(--ctl-bg);
  outline: none; font-family: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%236a6a73' stroke-width='1.3'%3E%3Cpath d='M3 4.6 6 7.6 9 4.6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center; background-size: 11px;
  transition: border-color .14s ease, box-shadow .14s ease;
  max-width: none;
}
.sel:hover { border-color: var(--line-3); }
.sel:focus { border-color: var(--blue-line); box-shadow: 0 0 0 3px var(--blue-soft); }
.sel option { background: var(--surface-2); color: var(--tx); }

/* 紧凑变体：筛选条、表格内 */
.inp-sm, .sel-sm {
  height: var(--ctl-h-sm); padding: 0 10px;
  font-size: var(--ctl-font-sm); border-radius: 7px;
}
.sel-sm { padding-right: 26px; background-position: right 8px center; }

.inp-sm {
  border: 1px solid var(--line-2); background: var(--ctl-bg); color: var(--tx);
  max-width: none; padding: 0 10px;
}
/* 表格内联编辑（额度/排序这类纯数字小框）单独收窄 */
.tbl .inp-sm { max-width: 150px; }

/* 多行输入：与 .field input 同一视觉语言 */
.input-area {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--ctl-font); color: var(--tx); background: var(--ctl-bg); outline: none;
  font-family: inherit; line-height: 1.7; resize: vertical;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.input-area::placeholder { color: var(--tx-3); }
.input-area:focus { border-color: var(--blue-line); box-shadow: 0 0 0 3px var(--blue-soft); }

/* ============================================================
   Buttons
   ------------------------------------------------------------
   白是唯一的主操作色。金/蓝全部退场 —— 它们只在选中态与品牌标出现。
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--h); padding: 0 14px; cursor: pointer; text-decoration: none;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: transparent; color: var(--tx);
  font-size: var(--fs-12); font-weight: 500; font-family: inherit; white-space: nowrap;
  transition: background .14s ease, border-color .14s ease, color .14s ease, opacity .14s ease;
}
.btn:hover { background: rgba(255, 255, 255, .05); border-color: var(--line-3); color: var(--tx); }
.btn-primary { background: #fff; border-color: #fff; color: var(--on-light); font-weight: 600; }
.btn-primary:hover { background: #e4e4e9; border-color: #e4e4e9; color: var(--on-light); }
.btn-block { width: 100%; }
.btn-sm { height: var(--h-sm); padding: 0 10px; font-size: var(--fs-12); border-radius: 7px; }
.btn-ghost { border-color: transparent; color: var(--tx-2); padding: 0 8px; }
.btn-ghost:hover { color: var(--tx); background: rgba(255, 255, 255, .05); border-color: transparent; }
.btn-danger { color: var(--bad); border-color: rgba(240, 133, 123, .35); }
.btn-danger:hover { background: var(--bad-bg); border-color: rgba(240, 133, 123, .6); color: var(--bad); }
.btn-view { color: var(--ok); border-color: rgba(136, 223, 178, .35); }
.btn-view:hover { background: var(--ok-bg); border-color: rgba(136, 223, 178, .6); color: var(--ok); }
.btn-disabled, .btn[disabled] { opacity: .34; cursor: not-allowed; pointer-events: none; }
.btn-disabled:hover { border-color: var(--line-2); color: var(--tx); background: transparent; }
.inline { display: inline-flex; gap: 6px; align-items: center; margin-left: 6px; }
.hint-admin { text-align: center; margin-top: 18px; font-size: var(--fs-12); color: var(--tx-3); }
.hint-admin a { color: var(--blue-lt); }

/* Alerts */
.alert {
  padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; font-size: var(--fs-12);
  border: 1px solid transparent; line-height: 1.7;
}
.alert-err { background: var(--bad-bg); border-color: rgba(240,133,123,.28); color: var(--bad); }
.alert-ok { background: var(--ok-bg); border-color: rgba(136,223,178,.28); color: var(--ok); }
.alert b { color: var(--tx); font-weight: 600; }
.cred { margin: 10px 0 6px; font-size: var(--fs-12); color: var(--tx); }
/* 后台表格里的缩略图（卡片模板的默认配图）。
   尺寸写进类而不写成行内样式：同一个组件在列表与编辑区各出现一次，
   行内样式重复两遍就开始漂。 */
.tpl-thumb {
  display: block; width: 38px; height: 38px;
  object-fit: cover; border-radius: 6px;
  border: 1px solid var(--line); background: var(--surface-2);
}
.tpl-thumb-none {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 6px;
  border: 1px dashed var(--line); color: var(--muted-2);
  font-size: var(--fs-11);
}
/* 后台「整段可复制」的代码块（如卡片推送的 curl 示例）。
   与 .cred 分工：那个是行内展示一个 Token，这个是整段多行脚本。 */
.codeblock {
  margin: 0; padding: 12px 14px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px;
  font-size: var(--fs-12); line-height: 1.7; color: var(--tx-2);
  white-space: pre-wrap; word-break: break-all;
}
.cred code, code.pw {
  background: var(--field); border: 1px solid rgba(136,223,178,.3); padding: 2px 8px; border-radius: 5px;
  font-size: var(--fs-12); letter-spacing: .05em; color: var(--ok);
}
code.pw { font-weight: 700; color: var(--ok); font-size: var(--fs-13); }

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: var(--fs-12); }
/* 带 colgroup 的表格用固定布局：auto 布局下 <col style="width:…"> 只是"建议"，
   浏览器会按内容重新分配 —— 表现为「时间」列吃掉一大片、后面几列挤成一团。
   只有显式声明列宽的表格才加这个类，其余表格保持 auto（内容自适应更好）。 */
.tbl.fixed { table-layout: fixed; }

.tbl th {
  text-align: left; padding: 0 12px 9px; border-bottom: 1px solid var(--line);
  color: var(--tx-3); font-weight: 500; font-size: var(--fs-11); letter-spacing: .09em;
  background: transparent; text-transform: uppercase; white-space: nowrap;
}
.tbl td { padding: 11px 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: var(--hover); }
.tbl tr.row-disabled td { background: rgba(240,133,123,.045); }
.tbl .r { text-align: right; }
.right { text-align: right; }
.ops { white-space: nowrap; }
.muted { color: var(--tx-3); }
.sm { font-size: var(--fs-12); }
.dim { color: var(--tx-3); }
.strong { font-weight: 600; color: var(--tx); }
/* 生成进度小字（后台报告列表操作列）：窄列内允许换行，与下方「⋯」保持间距 */
.stage-line { line-height: 1.35; margin-bottom: 2px; }
.err-line { color: var(--bad); font-size: var(--fs-12); margin-top: 4px; }

/* 后台：密码展示 / 额度编辑 / 邮箱链接 */
.pw-line { margin-top: 4px; font-size: var(--fs-12); color: var(--tx-3); }
.pw-missing { margin-top: 4px; font-size: var(--fs-12); color: var(--run); }
.link-email { color: var(--tx); text-decoration: none; font-weight: 500; }
.link-email:hover { color: var(--blue-lt); text-decoration: underline; }
.input-quota { width: 78px !important; text-align: center; }
.quota-text { font-weight: 600; color: var(--tx); margin-bottom: 6px; }
.quota-edit { margin-left: 0 !important; margin-bottom: 6px; }
.quota-quick { display: inline-flex; gap: 6px; }
.chip-warn { color: var(--tx); background: var(--run-bg); border-color: rgba(227,191,124,.4); }
.card-head .back { margin-left: auto; }


/* ============================================================
   状态与分类
   ------------------------------------------------------------
   新基线把「状态」与「分类」分成两个组件：
   - .st    = 状态（圆点 + 文字），承载好/坏/提醒语义
   - .badge = 分类（胶囊），承载等级、类型，不带语义色
   旧模板只有 .badge，两者都保留并给一致外观，避免存量页面错乱。
   ============================================================ */
.st {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); border: 1px solid var(--line-2);
  font-size: var(--fs-11); color: var(--tx-2); white-space: nowrap; letter-spacing: 0;
}
.st i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex: none; }
.st.ok { color: var(--ok); border-color: rgba(136,223,178,.26); background: rgba(136,223,178,.07); }
.st.warn { color: var(--warn); border-color: rgba(227,191,124,.26); background: rgba(227,191,124,.07); }
.st.bad { color: var(--bad); border-color: rgba(240,133,123,.26); background: rgba(240,133,123,.07); }
.st.plain { background: rgba(255,255,255,.04); }
/* 等级：V1 浅蓝 / V2 蓝 / V3 红（最高级用品牌红，和 logo 呼应） */
.st.v1 { color: var(--lv-1); border-color: rgba(72,144,180,.28); background: rgba(72,144,180,.07); }
.st.v2 { color: var(--blue-lt); border-color: rgba(72,144,180,.44); background: rgba(72,144,180,.13); }
.st.v3 { color: var(--red); border-color: var(--red-line); background: var(--red-soft); }

.badge {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 9px;
  border-radius: var(--r-pill); font-size: var(--fs-11);
  background: rgba(255,255,255,.04); color: var(--tx-2); border: 1px solid var(--line-2);
  /* 徽章是「一个词」，不是一段可折行的文字。不加这两条，
     在窄表格单元格里「继承」会被挤成上下两行。 */
  white-space: nowrap; flex: none;
}
.badge.ok { background: rgba(136,223,178,.07); color: var(--ok); border-color: rgba(136,223,178,.26); }
.badge.bad { background: rgba(240,133,123,.07); color: var(--bad); border-color: rgba(240,133,123,.26); }
.badge.run { background: rgba(227,191,124,.07); color: var(--warn); border-color: rgba(227,191,124,.26); }
.badge.lv { color: var(--blue-lt); border-color: rgba(72,144,180,.44); background: rgba(72,144,180,.13); }
/* 师傅徽章（报告列表分类：巴菲特/红杯子/LT老技师） */
.m-badge {
  display: inline-block; padding: 1px 9px; margin-right: 8px;
  border-radius: var(--r-pill); font-size: var(--fs-11); font-weight: 500; vertical-align: 1px;
}
.m-badge.lv { color: var(--blue-lt); border: 1px solid rgba(72,144,180,.45); background: rgba(72,144,180,.10); }
.m-badge.t { color: var(--ok); border: 1px solid rgba(136,223,178,.45); background: rgba(136,223,178,.10); }
.m-badge.bf { color: var(--blue-lt); border: 1px solid rgba(72,144,180,.45); background: rgba(72,144,180,.10); }
.chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 11px;
  font-size: var(--fs-12); color: var(--tx-2); background: var(--field);
  border-radius: 7px; border: 1px solid var(--line-2); letter-spacing: 0;
}
.chip.on { background: var(--blue-soft); border-color: var(--blue-line); color: var(--tx); }
/* 卡片右上角的 chip 组（可含按钮）。此前只有 dashboard 内联定义，
   masters 页加「我的报告」按钮后需要：按钮和 chip 同一行、间距一致。 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chips .btn { text-decoration: none; }

/* 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: var(--fs-12); }
.kv li:last-child { border-bottom: none; }
.kv li span { color: var(--tx-3); }
.kv li b { font-weight: 600; color: var(--tx); }

/* Footer */
.foot {
  border-top: 1px solid var(--line); padding: 16px 0;
  color: var(--tx-3); font-size: var(--fs-11); 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: 16px 16px; }
  .wrap { padding: 0 16px; }
  .main { padding: 22px 16px 48px; }
}

/* ---- 登录页 · 暗色商务（全屏平铺）---- */
body.page-login {
  display: flex; flex-direction: column; min-height: 100vh;
  background-image: none;
}

/* ============================================================
   身份页外壳 · v20261105
   登录 / 注册 / 找回改密三页共用。
   品牌在这三页只出现一处：锁定组合 —— 顶栏在身份页整条不渲染。
   理由：未登录的顶栏只有品牌、没有导航，留着就是第二处 logo。
   页脚那行免责声明仍在其余所有页面，这里只是不显示。
   ============================================================ */
.page-login .topbar,
.page-login .foot { display: none; }

body.page-login .main {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; max-width: none; margin: 0;
  min-height: 100dvh; padding: 48px 24px;
}

.auth { width: 380px; max-width: 100%; }
.auth-panel { position: relative; display: flex; flex-direction: column; align-items: center; }

/* 品牌背后的冷光：7s 一呼一吸，只改不透明度，不接任何交互 */
.auth-panel::before {
  content: ""; position: absolute; left: 50%; top: -190px;
  width: 520px; height: 520px; transform: translateX(-50%);
  background: radial-gradient(closest-side,
    rgba(72,144,180,.20), rgba(72,144,180,.07) 42%, rgba(72,144,180,0) 100%);
  pointer-events: none;
  animation: auth-breathe 7s ease-in-out infinite alternate;
}
@keyframes auth-breathe { from { opacity: .35 } to { opacity: 1 } }

/* ---- 品牌锁定组合 ---- */
.auth-lockup { display: flex; align-items: center; gap: 12px; }
.auth-mark { display: block; width: 46px; height: 46px; border-radius: var(--r-md); }
.auth-word { color: var(--tx); font-size: var(--fs-24); font-weight: 600; letter-spacing: -.8px; }

/* ---- 胶囊：登录 / 用邀请码注册 同级 ---- */
.auth-tabs {
  position: relative; display: flex; width: 100%; height: 44px;
  margin-top: 46px; padding: 4px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--bg-glow);
}
.auth-pill {
  position: absolute; top: 4px; left: 4px;
  width: calc((100% - 8px) / 2); height: calc(100% - 8px);
  border-radius: var(--r-sm); background: var(--surface-3);
  /* 1px 内高光没有对应 token，且只在暗底上用 */
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .07);
  /* 同页切换：只改父级 is-register，指示块连续滑到位，不再播入场动画 */
  transition: transform 420ms cubic-bezier(.22, 1, .36, 1);
}
.auth-tabs.is-register .auth-pill { transform: translateX(100%); }

.auth-tab {
  position: relative; z-index: 1; flex: 1 1 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--tx-3); font-size: var(--fs-12); letter-spacing: .5px;
  text-decoration: none;
  transition: color 240ms cubic-bezier(.16, .84, .28, 1);
}
.auth-tab:hover { color: var(--tx-2); }
.auth-tab.is-on { color: var(--tx); }

/* .auth-panel 是 align-items:center 的纵向 flex，
   子元素默认会缩到内容宽度（输入框就被压成半宽），所以整列显式拉满 */
.auth-panel > .form,
.auth-panel > .steps,
.auth-panel > .login-sub,
.auth-panel > .login-gift,
.auth-panel > .login-hint,
.auth-panel > .alt-path,
.auth-panel > .login-btn,
.auth-panel > .alt-path-btn,
.auth-panel > .auth-panes,
.auth-pane > .form,
.auth-pane > .steps,
.auth-pane > .login-sub,
.auth-pane > .login-gift,
.auth-pane > .login-hint { width: 100%; }

/* 用 <a> 冒充按钮的两处（重置完成 / 备用出路）：块级 <a> 不会自己垂直居中 */
.auth-panel > a.login-btn,
.auth-panel > .alt-path-btn { line-height: 44px; }

/* ---- 表单区：入场只做淡入 + 8px 上浮，一次性，不循环 ----
   间距只补在胶囊与面板容器之间；面板内部靠各自 margin 接住，
   否则赠礼块 / 步骤条 / 小标题会叠出两份间距。 */
.auth-tabs + .auth-panes { margin-top: 30px; }

/* ---- 双面板叠放：只在脚本接管后（is-switched）生效 ----
   没有脚本时 hidden 由服务端给出，两个 <a href> 照常整页跳转。
   叠放后容器不再被内容撑开，高度由 auth-switch.js 显式给出并做过渡。 */
.auth-panes { width: 100%; }
.auth-panes.is-switched {
  position: relative;
  transition: height 320ms cubic-bezier(.22, 1, .36, 1);
}
.auth-panes.is-switched .auth-pane {
  position: absolute; top: 0; left: 0; width: 100%;
  opacity: 0; visibility: hidden; transform: translateY(8px);
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease, visibility 0s 200ms;
}
.auth-panes.is-switched .auth-pane.is-active {
  opacity: 1; visibility: visible; transform: none;
  pointer-events: auto;
  transition: opacity 260ms ease 60ms, transform 260ms ease 60ms, visibility 0s 0s;
}

.steps + .login-sub { margin-top: 12px; }
.steps + .auth-form,
.login-sub + .auth-form { margin-top: 0; }
.auth-panel > .steps { margin: 0 0 18px; }
.auth-panel .login-title { font-size: var(--fs-20); margin: 30px 0 8px; text-align: center; }
/* 说明文字与标题同为居中列，两行时不会一边齐一边不齐 */
.auth-panel > .login-sub { text-align: center; }

.auth-lockup { animation: auth-rise 640ms cubic-bezier(.22, 1, .36, 1) both; }
.auth-word   { animation: auth-rise 640ms cubic-bezier(.22, 1, .36, 1) 80ms both; }
.auth-tabs   { animation: auth-rise 640ms cubic-bezier(.22, 1, .36, 1) 170ms both; }
.auth-form   { animation: auth-rise 640ms cubic-bezier(.22, 1, .36, 1) 250ms both; }
@keyframes auth-rise { from { opacity: 0; transform: translateY(8px) } }

/* 提示条：base.html 把它渲染在 block content 之前，
   在新布局里它是 main 的第一个子项，必须与面板同宽居中 */
.page-login .alert { width: 380px; max-width: 100%; margin: 0 0 16px; }

@media (prefers-reduced-motion: reduce) {
  .auth-panel::before { animation: none; }
  .auth-lockup, .auth-word, .auth-tabs, .auth-form { animation: none; }
  .auth-pill, .auth-panes, .auth-pane { transition: none; }
}

/* ---- 身份页的表单控件：比站内标准控件大一档 ----
   站内 --ctl-h 是 34px（表格筛选那一档），登录是单任务页，
   输入与按钮都放大到 46px；窄屏再抬到 48px 见 640 断点。 */
.login-title { color: var(--tx); font-size: var(--fs-24); margin: 0 0 8px; font-weight: 600; letter-spacing: -.02em; }
.login-sub { color: var(--tx-3); font-size: var(--fs-12); margin: 0 0 28px; }
.login-form .label { color: var(--tx-3); }
/* 密码行：左边标签、右边「忘记密码？」，两者同基线 */
.login-form .label-split { display: flex; align-items: center; justify-content: space-between; }
.login-form .label-split a { color: var(--blue-lt); text-decoration: none; letter-spacing: .4px; }
.login-form .label-split a:hover { text-decoration: underline; }
.login-form input {
  width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line);
  border-radius: var(--r-md); background: var(--field); color: var(--tx);
  font-size: var(--fs-13); outline: none; font-family: inherit;
  transition: border-color .14s ease, box-shadow .14s ease;
}
.login-form input::placeholder { color: var(--tx-3); }
.login-form input:focus { border-color: var(--blue-line); box-shadow: 0 0 0 3px var(--blue-soft); }
.login-btn {
  width: 100%; height: 46px; margin-top: 0; border: 0; border-radius: var(--r-md);
  cursor: pointer; background: var(--tx); color: var(--on-light);
  font-size: var(--fs-14); font-weight: 500; letter-spacing: 2px; font-family: inherit;
  transition: background .14s ease;
}
.login-btn:hover { background: #e4e4e9; }
/* 身份页帮助入口：紧贴主按钮下方，视觉上次于登录 / 注册主操作。
   只调间距，颜色沿用 .btn 现有 token，禁止写死色值。 */
.help-entry { margin-top: 10px; }
.login-hint { text-align: center; color: var(--tx-3); font-size: var(--fs-12); margin-top: 22px; }

/* ---- 股票搜索选择器（实时下拉）---- */
.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: var(--fs-14); user-select: none;
}
.search-item:hover, .search-item.active { background: rgba(72,144,180,.13); }
.search-item.empty { cursor: default; color: var(--muted-2); justify-content: center; font-size: var(--fs-13); }
.si-name { color: var(--ink); font-weight: 500; }
.si-code { color: var(--gold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: var(--fs-13); }
.si-market { margin-left: auto; color: var(--muted); font-size: var(--fs-12); white-space: nowrap; }
.hint-search {
  flex-basis: 100%; color: var(--bad); font-size: var(--fs-12);
  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(72,144,180,.07); }
.btn-danger { background: #f0857b; color: var(--tx); }
.btn-danger:hover { background: #f0857b; }

/* ============================================================
   账号体系（注册三步 / 找回密码 / 修改密码）· 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: var(--fs-12); 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: var(--fs-11); 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: var(--tx); }
.steps .step.done i { background: var(--ok); color: var(--tx); }
.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: var(--fs-13); line-height: 1.7; word-break: break-word;
}
/* 提示色三档：.alert-err（红）/ .alert-ok（绿）/ .alert-warn（黄，定义见文件末尾）。
   `.alert-error`（2026-11-03 删除）与 `.alert-err` 是同一个东西，
   两套名字并存的唯一后果是"同一页两种红"。 */
.alert-sub { font-size: var(--fs-12); opacity: .78; }

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

/* ---- 邀请码生成表单 · v20261011 ----
   原先用 .row-form（flex + align-items:center）时，「可用次数」下方多一行
   .label-hint 会让该列比相邻列高，居中对齐后输入框上下错位。
   改成 grid + align-items:start 后，每格的输入框紧跟在一个等高的 label 之后，
   自然落在同一水平线上，不再需要给「没有提示文字」的字段补等高空位。
   2026-11-14：删掉写死的 `input{height:42px}` / `.btn{height:42px}` 与“没有提示文字
   就补等高空位”那条补丁 —— 控件高度统一交给 .inp / .sel 的 `--ctl-h`（桌面 34px）
   与 ≤640px 的 44px 兜底；补丁原用 `has()` 选择器，旧版 iOS 不支持。 */
.invite-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px 16px;
  align-items: start;
}
.invite-form .field { margin-bottom: 0; }
.invite-form .label { min-height: 18px; }
.invite-form .label-hint { display: block; line-height: 15px; }
.invite-form .btn { align-self: end; padding: 0 22px; }
.invite-form .form-actions {
  grid-column: 1 / -1; display: flex; justify-content: flex-end;
}

/* 窄屏：邀请码表单退化为单列 */
@media (max-width: 640px) {
  .invite-form { grid-template-columns: 1fr; }
}

/* 独立成行的次要操作（不用 <a>：目标路由是 POST-only） */
.inline-form { margin: 12px 0 0; }
.link-btn {
  background: none; border: none; padding: 0; cursor: pointer;
  color: var(--accent); font-size: var(--fs-12); 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: var(--fs-13); 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; }   /* 备注吃掉剩余空间 */
/* 状态列 2026-11-14 从 64px 放宽到 80px：本期新增的「已使用」是三个字，
   12px 字号下连内边距需要 54px，而 64px 的列留不出这么多（td 左右各 10px），
   徽章会被 ellipsis 截成「已…」。旧的四档里「已用尽 / 已停用 / 已过期」
   其实一直有同样的截断，只是没人报。多出来的 16px 由「备注」列（auto）让出。 */
.tbl.invites-table col.c-state { width: 80px; }
.tbl.invites-table col.c-used  { width: 82px; }
.tbl.invites-table col.c-grant { width: 88px; }  /* v20261011 新增：注册赠送报告数 */
.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; }
.tbl.invites-table td.col-grant { 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; }

/* ---- 邀请码页·操作列与批次行的折叠表单（2026-11-14）----
   「改赠礼」「导出」「作废」都改用 details.mini 内联展开，不再用内联 onclick。
   .mini-box 是绝对定位，必须有一个定位祖先，否则会跑到表格外面；
   三件套竖排，td 的列宽（120px）装不下，按 208px 浮层向右对齐。 */
.tbl.invites-table td.col-act,
.tbl.invites-batch td { position: relative; }
/* 批次号是一整串，窄屏卡片重排后不该折成两行（B20261114- / 0001 读起来像两个数） */
.tbl.invites-batch .invite-code { white-space: nowrap; }
.tbl.invites-table td.col-act .mini-box,
.tbl.invites-batch td .mini-box {
  right: 0; width: 208px; flex-direction: column; align-items: stretch;
  justify-content: flex-start; gap: 8px; text-align: left;
}
.tbl.invites-table td.col-act .mini-box .field,
.tbl.invites-batch td .mini-box .field { margin-bottom: 0; gap: 3px; }
.tbl.invites-table td.col-act .mini-box .label,
.tbl.invites-batch td .mini-box .label { min-height: 0; margin-bottom: 0; }

/* ---- 邀请码页·批次展开（2026-11-14）----
   点批次号在当前页展开这一批的码。片段按需加载（默认前 50 张），
   展开区**不套八列表格** —— 同一批的三件套、有效期、创建时间全一样，
   八列里有五列是重复信息，500 行重复内容既占版面也占内存。 */
.bc-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--tx); font: inherit; text-align: left;
}
.bc-toggle:hover .invite-code { color: var(--blue-lt); }
/* 三角用边框画，不引图标字体 */
.bc-caret {
  width: 0; height: 0; flex: 0 0 auto;
  border-left: 5px solid var(--tx-3);
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform .12s ease;
}
.bc-toggle.is-open .bc-caret { transform: rotate(90deg); }

/* 展开行本身不占位，撑开它的是里面的片段 */
.tbl.invites-batch tr.bc-host > td {
  padding: 0; border-top: 1px solid var(--line-2); background: var(--surface-2);
}
/* 卡片化时 base.html 的脚本会给 td 抄一个 data-label，这一格没有列名，要清掉 */
.tbl.invites-batch tr.bc-host > td::before { content: none; }

.bc-wrap { padding: 12px 4px 14px; }
.bc-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.bc-sum { font-size: var(--fs-12); color: var(--muted-2); }
.bc-list { list-style: none; margin: 0; padding: 0; }
.bc-row {
  position: relative;                    /* .mini-box 的定位祖先 */
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 6px 0; border-bottom: 1px dashed var(--line);
}
.bc-row:last-child { border-bottom: 0; }
.bc-used {
  font-size: var(--fs-12); color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.bc-act { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.bc-loading { padding: 10px 0; }
.bc-foot { margin-top: 10px; }

/* 防重复提交时的按钮临时态：只降透明度，**不禁用** ——
   disabled 会连带阻止按钮的默认提交行为，点了没反应比点两次更糟。 */
.btn.is-busy { opacity: .55; cursor: default; }

/* 卡片模式下展开行要跨满整张卡，否则只占左半格 */
@media (max-width: 640px) {
  .tbl.invites-batch tr.bc-host > td { grid-column: 1 / -1; }
  .bc-row { gap: 8px; }
  .bc-act { margin-left: 0; width: 100%; }
}

/* ---- 分析师管理页 · v7.3 ---- */
/* .inp-sm 已上收到「表单控件统一规范」（v9.2）：紧凑 token、13px。
   这里只保留表格内的上下文微调。 */
.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: var(--fs-11);
}

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

/* 顶栏 logo 尺寸与对齐 */
.topbar .brand-logo {
  width: 34px; height: 34px;
  /* 顶栏是深蓝渐变底，logo 为透明底彩色笔画，直接放行、不加描边，
     否则金色边框会在深底上切出一个突兀的方框。 */
  object-fit: contain;
}
.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: var(--fs-12);
}
.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: #3a3a42; }

/* ============================================================
   浏览器通知开关 · v7.4
   ============================================================ */
.notify-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  cursor: pointer; user-select: none; white-space: nowrap;
  font-size: var(--fs-13); 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: 56px; --side-w: 236px; --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; }
}

/* 侧栏本体：贴在顶栏下方的固定条。底色比页面底更深一档（#050506），
   靠右侧 1px 线与内容区分开 —— 不用投影，也不用渐变。 */
.sidebar {
  position: fixed; top: var(--top-h); left: 0; z-index: 40;
  width: var(--side-w);
  height: calc(100vh - var(--top-h));
  background: #050506;
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  transition: width .18s ease;
  padding: 14px 10px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }

/* 分组标题（v20261103）：运营 / 内容 / 配置。
   10 项平铺时运营找不到"配置在哪"，分组标题是唯一的层级线索。
   折叠态不留文字，改成一条细横线，既不占宽度也仍能看出分组。 */
.side-group {
  padding: 12px 9px 4px;
  font-size: var(--fs-11); color: var(--tx-3);
  letter-spacing: .12em; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.side-group:first-child { padding-top: 2px; }

/* 侧栏头部行：折叠开关靠右 */
.side-head { display: flex; justify-content: flex-end; padding: 2px 4px 8px; }

.side-item {
  display: flex; align-items: center; gap: 9px;
  height: 32px; padding: 0 9px; border-radius: 7px;
  color: var(--tx-2); text-decoration: none;
  font-size: var(--fs-12); line-height: 1.4; white-space: nowrap;
  transition: background .12s, color .12s;
}
.side-item:hover { background: rgba(255, 255, 255, .04); color: var(--tx); }
/* 选中态：低透明度浅蓝底 + 左侧 2px 竖线。不用实色块，
   否则整条侧栏最亮的一格会压过页面标题。 */
.side-item.on {
  background: var(--blue-soft);
  color: var(--tx);
  font-weight: 500;
  box-shadow: inset 2px 0 0 var(--blue-lt);
}
.side-ico {
  flex: none; width: 16px; height: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--fs-15); line-height: 1;
  color: var(--tx-3);
}
.side-item.on .side-ico { color: var(--blue-lt); }
/* Lucide 内联 SVG：随文字色走（currentColor），悬停/选中自动变色 */
.side-ico svg { width: 15px; height: 15px; display: block; }
.side-label { overflow: hidden; text-overflow: ellipsis; }
/* 二级子项：缩进 + 小一号字，视觉上归属父项（如「用户管理 → 邀请码」） */
.side-sub { margin: -2px 0 2px 12px; padding: 6px 10px; font-size: var(--fs-12); height: auto; }
.side-sub .side-ico { width: 12px; opacity: .7; }
.side-sub.on { background: var(--blue-soft); color: var(--tx); font-weight: 500; box-shadow: none; }

/* 折叠态：只留图标 */
.side-collapsed .sidebar { width: var(--side-w-collapsed); }
.side-collapsed .side-label { display: none; }
/* 折叠后分组标题失去文字，改为一条分隔线，仍能看出层次。
   ⚠️ 不要靠"把字号设成 0"来隐藏文字：全站有一条硬检查
   `grep -c "font-size: *[0-9]" static/style.css` 必须为 0（字号只能走 token），
   注释里出现这个写法同样会命中。用 line-height: 0 + 透明色达到同样效果。 */
.side-collapsed .side-group {
  padding: 8px 12px 0; height: 1px; overflow: hidden;
  line-height: 0; color: transparent;
  border-top: 1px solid var(--line-soft);
}
.side-collapsed .side-group:first-child { border-top: none; padding-top: 0; }
.side-collapsed .side-item { justify-content: center; padding: 0; }
.side-collapsed .side-head { justify-content: center; padding: 2px 0 8px; }

/* 折叠开关按钮：图标化，折叠态箭头翻转为向右（表示「展开」） */
.side-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px;
  border: 1px solid var(--line); border-radius: 6px;
  background: transparent; cursor: pointer; color: var(--tx-3);
  padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.side-toggle svg { width: 13px; height: 13px; transition: transform .18s ease; }
.side-toggle:hover { background: rgba(255,255,255,.05); color: var(--tx); border-color: var(--line-3); }
.side-collapsed .side-toggle svg { transform: rotate(180deg); }

/* 移动端顶栏汉堡：仅 <900px 显示（桌面用侧栏内的折叠按钮） */
.side-toggle-m { display: none; margin-right: 12px; }
@media (max-width: 900px) {
  .side-toggle-m { display: inline-flex; }
}

/* 移动端：侧栏变抽屉，默认收起 */
@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
   ============================================================ */
/* 页头：与 .ph 同一套尺寸。存量 12 个模板用的都是 .page-head，
   所以改这里等于一次性把它们的页头对齐到新基线，不必逐个改 HTML。 */
.page-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 18px;
}
.page-title { font-size: var(--fs-20); font-weight: 600; margin: 0; letter-spacing: -.02em; }

/* 时间范围切换：与 .seg 同一视觉（同一个控制，不该有第二种长相） */
.range-switch {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--field);
}
.range-opt {
  height: 26px; padding: 0 11px; border: none; border-radius: 6px; background: none;
  font-size: var(--fs-12); color: var(--tx-3); cursor: pointer; font-family: inherit;
  text-decoration: none; border-right: 1px solid var(--line);
}
.range-opt:last-child { border-right: none; }
.range-opt:hover { background: var(--surface-2); }
.range-opt.on { background: var(--accent); color: var(--tx); 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: var(--fs-12); color: var(--muted); margin-bottom: 6px; }
.kpi-value {
  font-size: var(--fs-24); font-weight: 600; color: var(--ink);
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.kpi-unit { font-size: var(--fs-14); font-weight: 400; color: var(--muted); margin-left: 2px; }
.kpi-sub { font-size: var(--fs-12); 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, #4890b4, #00609c); }
.spark-num { font-size: var(--fs-11); color: var(--muted-2); margin: 4px 0 2px;
             font-variant-numeric: tabular-nums; }
.spark-lbl { font-size: var(--fs-11); color: var(--muted-2); }

/* ---- 报告列表：筛选条 / 下拉菜单 / 分页 ---- */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-count { font-size: var(--fs-12); color: var(--muted-2); margin-left: auto; }
/* 右上角「用户：xxx」重复标签已移除（v9.2）——筛选框内直接回显邮箱 */

.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: var(--fs-12); 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: var(--fs-12); 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: var(--fs-12); color: var(--tx-2);
  cursor: not-allowed;
}
.drop-menu form { margin: 0; }

/* 智能翻转：下方空间不足时，浮层向上展开（由各页面脚本加 .up 类） */
.drop-menu.up { top: auto; bottom: calc(100% + 4px); }
.search-drop.up { top: auto; bottom: calc(100% + 5px); }

/* 含弹出层的卡片放开裁剪：全局 .card 的 overflow:hidden 会切掉探出卡片的
   下拉/搜索浮层（报告列表最下方「⋯」被盒沿切掉就这么来的）。只给确实带
   浮层的卡片加此修饰类，不动全局 .card 定义，零波及其他卡片。 */
.card--pop { overflow: visible; }

.pager { display: flex; align-items: center; gap: 10px; justify-content: center;
         margin-top: 14px; font-size: var(--fs-13); }
.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: var(--fs-14); 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: var(--fs-12); }

/* debug 生成入口已收成按钮 + 独立页（v9.2），原 debug-card 样式随卡片移除 */

/* 筛选栏里的用户搜索框：宽度比用户端的窄，且下拉要压在筛选栏之上 */
.filter-bar .filter-user-box { flex: 0 1 250px; }
.filter-bar .filter-user-box .inp-sm { width: 100%; max-width: none; }
.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; }
@media (max-width: 640px) {
  .head-ops { width: 100%; }
  .head-ops .inp-sm { flex: 1 1 auto; width: auto; }
}

/* ============================================================
   用户端移动端适配 · v9.3
   ------------------------------------------------------------
   目标机型：iPhone Pro / Pro Max（390~430px），兼容 320px（SE）。
   原则：只动样式与显隐，不改任何功能逻辑。
   ============================================================ */

/* ---- 刘海屏安全区：viewport-fit=cover 后由 env() 补内边距 ---- */
.topbar { padding-top: env(safe-area-inset-top); }
.foot { padding-bottom: calc(16px + env(safe-area-inset-bottom)); }

/* ---- 顶栏汉堡菜单（≤640px）：桌面端 display:none 零影响 ---- */
.nav-burger {
  display: none;
  position: relative;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; flex: none;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--tx-2);
  cursor: pointer; padding: 0;
}
.nav-burger svg { width: 20px; height: 20px; }
.nav-burger:hover { color: var(--tx); border-color: #3a3a42; }
/* 面板锚定在顶栏上：topbar 必须是定位上下文 */
.topbar { position: relative; }

/* v20261107（稿 S15）：顶栏折叠从 640 提前到 880。
   641–880 这段（平板竖屏 / 横屏手机）5 个导航链接已经挤成两行、字距被打散。
   ⚠️ 用户端与后台共用这份样式，这条同时作用于两套壳的顶栏。
   下面 640 那一档只留「iOS 输入框字号」和「触控目标」——
   它们按手指尺寸算，按屏幕宽度提前会误伤平板。 */
@media (max-width: 880px) {
  .nav-burger { display: inline-flex; }

  /* 链接收进下拉面板：绝对定位盖在内容上，不挤压顶栏高度 */
  .bar-nav {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 60;
    flex-direction: column; gap: 0;
    background: #050506;
    border-bottom: 1px solid rgba(72,144,180,.35);
    box-shadow: 0 18px 32px -20px rgba(0, 0, 0, .9);
    padding: 6px 16px 10px;
  }
  body.nav-open .bar-nav { display: flex; }
  .bar-nav a {
    margin: 0; padding: 13px 8px; font-size: var(--fs-15);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
  }
  .bar-nav a:last-child { border-bottom: none; }
  /* 汉堡变 ✕（用两条伪元素画，不换 SVG） */
  body.nav-open .nav-burger svg { display: none; }
  body.nav-open .nav-burger::before,
  body.nav-open .nav-burger::after {
    content: ""; position: absolute; width: 18px; height: 2px;
    background: currentColor; border-radius: 1px;
  }
  body.nav-open .nav-burger::before { transform: translateY(-1px) rotate(45deg); }
  body.nav-open .nav-burger::after { transform: translateY(-1px) rotate(-45deg); }
}

@media (max-width: 640px) {
  /* ---- iOS 聚焦缩放根治：输入框字号 <16px 时 Safari 聚焦自动放大页面 ---- */
  input, textarea { font-size: var(--fs-16) !important; }

  /* ---- 触控目标：主按钮高度不在这里定义。
     上方「可点区域不小于 44px」那条已经给了 .btn 44px，此处再写一次只会把它覆盖掉 ——
     2026-11-17 删除原先的 `.btn { min-height: 40px }`，就是为了消除这处自相矛盾：
     两条同权重规则并存时后者生效，实际落地高度成了 40px，低于视觉基线的 44px。
     这里只保留小按钮这一档例外。 ---- */
  .btn-sm { min-height: 36px; padding: 6px 14px; }
}

/* ---- 登录/注册/改密页（page-login）：手机上再放大一档，首屏见表单 ---- */
@media (max-width: 640px) {
  body.page-login .main { padding: 24px; }
  .auth { width: 100%; }
  .auth-panel::before { width: 420px; height: 420px; top: -165px; }
  .auth-mark { width: 40px; height: 40px; border-radius: var(--r-sm); }
  .auth-word { font-size: var(--fs-20); letter-spacing: -.6px; }
  .auth-lockup { gap: 10px; }
  .auth-tabs { margin-top: 38px; height: 46px; }
  .login-form input, .login-btn { height: 48px; }
  .login-sub { font-size: var(--fs-13); margin-bottom: 22px; }
  .page-login .alert { margin: 0 0 14px; }
}

/* ============================================================
   频道消息（v20261026）
   与站点既有卡片同源：surface 底、line 描边、radius 12、金色点缀。
   详情页刻意做成「单侧公告流」而非左右气泡——发送者统一显示
   display_sender_name，右侧永远没有人说话，气泡会变成空转。
   ============================================================ */
.ch-list { display: flex; flex-direction: column; gap: 12px; }
.ch-item {
  display: flex; align-items: center; gap: 14px; padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: inherit;
  transition: border-color .15s ease, background .15s ease;
}
.ch-item:hover { border-color: var(--gold-dim); background: var(--surface-2); }
.ch-ico {
  width: 40px; height: 40px; border-radius: 10px; flex: none;
  background: rgba(72,144,180,.14); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-15); font-weight: 600;
  overflow: hidden;            /* 头像图要按 10px 圆角裁掉四角 */
}
/* 频道头像 / 消息头像：统一圆角方形（宇辰 2026-10-26 选型 C）。
   用 object-fit: cover —— 非正方形图会被居中裁切，既不变形也不留白条。 */
.ch-ico img, .msg-avatar img, .ch-head-av img, .ch-switch-ico img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.ch-head-av {
  width: 40px; height: 40px; border-radius: 10px; flex: none; overflow: hidden;
  background: rgba(72,144,180,.14);
  display: flex; align-items: center; justify-content: center;
}
.ch-main { flex: 1; min-width: 0; }
.ch-name { font-size: var(--fs-15); font-weight: 600; color: var(--text); }
.ch-meta { font-size: var(--fs-12); color: var(--muted); margin-top: 3px; }
.ch-right { display: flex; align-items: center; gap: 10px; flex: none; }
.ch-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  background: var(--bad); color: var(--on-strong);
  font-size: var(--fs-12); font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-lock { color: var(--muted-2); font-size: var(--fs-12); display: inline-flex; align-items: center; gap: 5px; }
.ch-arrow { color: var(--muted-2); font-size: var(--fs-15); }

/* ---- 详情页 ---- */
.ch-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.ch-back {
  display: inline-flex; align-items: center; gap: 4px; flex: none;
  font-size: var(--fs-13); color: var(--muted); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px;
}
.ch-back:hover { color: var(--text); border-color: var(--gold-dim); }
.ch-stream { display: flex; flex-direction: column; gap: 12px; min-height: 180px; }
.msg-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 13px 16px; }
.msg-head { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; }
.msg-avatar {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  background: rgba(72,144,180,.16); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-12); font-weight: 600;
  overflow: hidden;            /* 与频道头像同款圆角方形，不再用正圆 */
}
.msg-name { font-size: var(--fs-13); font-weight: 600; color: var(--text); }
.msg-time { margin-left: auto; font-size: var(--fs-12); color: var(--muted-2); }
.msg-text { font-size: var(--fs-14); line-height: 1.75; color: var(--text-soft); white-space: pre-wrap; word-break: break-word; }
.msg-img-wrap { display: block; margin-top: 9px; }
.msg-img { display: block; max-width: 100%; height: auto; border-radius: 8px; border: 1px solid var(--line); }
.msg-img-bad {
  display: block; padding: 22px 14px; text-align: center;
  font-size: var(--fs-12); color: var(--muted-2);
  border: 1px dashed var(--line); border-radius: 8px;
}
.msg-link {
  display: block; margin-top: 9px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px;
  text-decoration: none; transition: border-color .15s ease, background .15s ease;
}
.msg-link:hover { border-color: var(--gold-dim); background: var(--surface-2); }
.msg-link-title { display: block; font-size: var(--fs-14); color: var(--text); line-height: 1.5; }
.msg-link-url { display: block; font-size: var(--fs-12); color: var(--accent); word-break: break-all; margin-top: 3px; }
/* ---------- 卡片消息（v20261104）----------
   一条消息里带 1~8 张图文卡，竖排堆叠。
   形态：**大图在上、标题与描述在下**，整块一个圆角。
   不做成「左小图 + 右文字」的横排 —— 那种适合密集列表（订阅号消息流），
   而这里是每天几条的重点推送，大图才撑得住信息重量。

   ⚠️ 类名**不能**叫 .msg-card：那是「一条消息的外层容器」（见上面 1198 行），
   同名会把整个消息列表的框改成卡片列表，两类元素必须分开命名。 */
.msg-brief { display: flex; flex-direction: column; gap: 10px; margin-top: 9px; }
.msg-brief-item {
  display: flex; flex-direction: column;
  /* 面：外层 .msg-card 是 --surface，卡片本体上两档到 --surface-3，
     文字区靠这个底色与黑色页面拉开层次，不用画分隔线。 */
  background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 12px;
  /* overflow:hidden 是让大图四角跟着卡片走的关键 ——
     图片本身不设圆角，靠父级裁切，图与文字之间才不会出现一圈漏底色。 */
  overflow: hidden;
  text-decoration: none; color: inherit;
  /* 480 是「宽度上限」不是固定宽：窄屏下卡片跟着容器走。
     从 640 收到 480，原因有两个：① 640 宽时一条卡片横跨大半个消息流，
     图片面积显得"一大块"；② 4:3 图在 640 宽下高 480px，手机上要占掉整屏。
     480 宽下 4:3 图正好 360px，配 130px 文字区，比例协调。

     `margin: 0 auto` 让它在大屏上居中：消息流容器 880，卡片 480，
     靠左会留下 400px 空白、整列重心偏到左边。窄屏下卡片本来就占满，auto 不生效。 */
  max-width: 480px;
  margin: 0 auto;
  transition: border-color .15s ease;
}
.msg-brief-item:hover { border-color: var(--gold-dim); }
/* 大图：**固定 3:2**，铺满卡片宽度。
   为什么是 3:2 而不是按原图比例：推送方的图以 1:1 和 4:3 为主（1:1 最多），
   混排时如果各按各的比例，一列卡片高度参差，翻起来很乱。
   3:2 让 4:3 源图只裁上下各 5.5%（几乎无损）、1:1 裁上下各 16.7%（裁的是边、
   主体通常居中）、16:9 裁左右各 8%。三种比例都能看，且图片不会占据卡片主体。

   为什么不是 4:3：4:3 在 480 宽下是 360px 高，加上头部与文字区整条消息约 550px，
   手机上一条就占掉三分之二屏。3:2 是 320px，整条约 510px，观感更接近「一条消息」
   而不是「一张海报 + 一行字」。

   不写 max-height：3:2 + 卡片 480 已经等于 320px，再加 max-height 会在窄屏
   触发二次压缩，把图片压成横条（比例失效，object-fit 开始硬裁）。 */
.msg-brief-thumb {
  display: block; width: 100%; height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: var(--surface-2);
}
/* 文字区：图片下方，留白比卡片内边距略大，读起来更松 */
.msg-brief-main {
  display: flex; flex-direction: column; gap: 10px;
  padding: 16px 16px 18px;
  min-width: 0;
}
/* 标题：卡片里最大的一档字，字重走 700。
   这是与「链接消息」最明显的区别 —— 链接块是附属信息，卡片是内容主体，
   字号和字重都要拉开，否则一整条消息推出来像是附了一条备注。 */
.msg-brief-title {
  font-size: var(--fs-16); color: var(--text);
  font-weight: 700; line-height: 1.45;
  word-break: break-word;
}
.msg-brief-desc {
  font-size: var(--fs-13); color: var(--text-soft); line-height: 1.7;
  /* 三行截断：推送方的描述常带换行和「｜」，两行会切掉关键提示
     （如密码、有效期），三行基本能兜住。 */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; white-space: pre-line;
  word-break: break-word;
}
/* 窄屏：只是收紧留白，形态不变（仍然图上文下）。
   手机上 560px 上限本来就够不着，真正起作用的是 padding。 */
@media (max-width: 400px) {
  .msg-brief-main { padding: 12px 13px 14px; gap: 6px; }
  .msg-brief-title { font-size: var(--fs-15); }
}
.ch-hint { text-align: center; font-size: var(--fs-12); color: var(--muted-2); padding: 10px 0 2px; }
.ch-newbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 26px; z-index: 60;
  padding: 9px 18px; border-radius: 999px; border: none; cursor: pointer;
  background: var(--gold); color: var(--on-strong); font-size: var(--fs-13); font-weight: 600;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .95);
  font-family: inherit;
}
.ch-newbar[hidden] { display: none; }
.ch-lockbox {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  padding: 54px 24px; text-align: center;
}
.ch-lockbox .lock-ico {
  width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 14px;
  background: rgba(72,144,180,.12); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.ch-lockbox h3 { margin: 0 0 8px; font-size: var(--fs-16); font-weight: 600; color: var(--text); }
.ch-lockbox p { margin: 0; font-size: var(--fs-13); color: var(--muted); line-height: 1.7; }

@media (max-width: 640px) {
  .ch-item { padding: 14px; gap: 11px; }
  .ch-ico { width: 36px; height: 36px; }
  .msg-card { padding: 12px 13px; }
}

/* ============================================================
   双层吸顶 + 频道快速切换 · v20261027
   ------------------------------------------------------------
   第一层：全站用户端顶栏吸顶。
   第二层：频道详情页 .ch-head 紧接其下吸顶。
   切换入口只放在详情页工具栏内（频道名变「频道名 ▾」），不新增横条。
   ============================================================ */

/* ---- 第一层：顶栏吸顶（**只限用户端**）----
   为什么排除 has-sidebar：管理后台侧栏是 position:fixed; top:var(--top-h)，
   移动端抽屉遮罩 .side-scrim 只有 z-index:39。顶栏一旦 sticky 并抬到 50，
   抽屉就压不住它了——后台的层级会被这行改动整个搅乱。
   为什么排除 page-login：登录/注册/改密是全屏 flex 布局（body 撑满 100vh），
   本身不滚动，吸顶没有意义，还会跟 min-height:100vh 打架。
   特异性 (0,3,1) 高于后面 :919 的 .topbar{position:relative}，
   所以不需要删原规则，管理后台仍走 relative。 */
body:not(.has-sidebar):not(.page-login) .topbar {
  position: sticky; top: 0; z-index: 50;
}

/* ---- 第二层：频道详情工具栏吸顶 ----
   top 必须把刘海安全区算进去，否则 iPhone 上会钻到顶栏底下。
   env() 写 0px 兜底：不认 env() 的浏览器里整条 calc 会失效，
   兜底值能让它退化成 var(--top-h)，而不是整行作废。
   background 这里**刻意复刻 body 的两层背景**（纯色 + 同一条 radial-glow +
   fixed 附着）而不是只铺 var(--bg)：吸顶条正好停在 glow 还比较亮的区间，
   只铺纯色会跟周围差出一块暗色，接缝肉眼可见。
   ⚠️ 绝不能改半透明：消息卡片会从底下透上来。 */
.ch-head {
  position: sticky;
  top: calc(var(--top-h) + env(safe-area-inset-top, 0px));
  z-index: 45;                       /* 必须低于顶栏的 50，顶栏才能盖住它 */
  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;
  margin: 0 -20px 16px;              /* 抵掉 .main 的 20px 左右内边距，做成通栏 */
  padding: 10px 20px;
  border-bottom: 1px solid var(--line-soft);
}

/* ---- 频道切换：触发器 ----
   .ch-switch 是触发器 + 面板的共同壳，桌面端靠它做定位参照。
   ⚠️ flex 写成 `1 1 0%` 而不是 `1 1 auto`：.ch-head 是 flex-wrap:wrap，
   换行判定用的是各项的**基准尺寸**，不看 flex-shrink。基准给 auto 时，
   超长频道名会先把工具栏顶成三行（返回 / 频道名 / 刷新），吸顶条从 57px
   涨到 152px。基准给 0 后它只占剩余空间，靠 ellipsis 收尾，永远是单行。 */
.ch-switch { position: relative; flex: 1 1 0%; min-width: 0; }
.ch-switch-h { margin: 0; min-width: 0; }
.ch-switch-btn {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; min-width: 0;
  margin-left: -9px;                 /* 抵掉内边距，视觉上仍与原来的标题左对齐 */
  padding: 3px 8px 3px 9px;
  border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text); cursor: pointer;
  font-family: inherit; font-size: var(--fs-20); font-weight: 600; line-height: 1.45;
  text-align: left;
  transition: background .12s ease, border-color .12s ease;
}
.ch-switch-btn:hover { background: var(--surface-2); border-color: var(--line); }
.ch-switch-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ch-switch-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-switch-caret { flex: none; color: var(--muted); transition: transform .15s ease; }
.ch-switch-btn[aria-expanded="true"] .ch-switch-caret { transform: rotate(180deg); }

/* ---- 频道切换：面板 ----
   用 flex 排「左箭头 / 滚动区 / 右箭头」，不用绝对定位压在内容上——
   绝对定位的箭头会盖住首尾频道项，滚动时还得做渐隐遮罩才不难看。
   箭头靠 hidden 属性显隐（全局 [hidden]{display:none!important} 能压住这里的
   display:inline-flex，见文件开头那条兜底规则）。 */
.ch-switch-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 5;
  display: flex; align-items: center; gap: 2px;
  padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow);
}
.ch-switch-scroll {
  display: flex; align-items: center; gap: 4px;
  max-width: min(70vw, 620px);
  padding: 1px;                      /* 给 focus 描边留一点余量，别被 overflow 裁掉 */
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;             /* Firefox */
  scroll-behavior: smooth;
}
.ch-switch-scroll::-webkit-scrollbar { display: none; }   /* Chrome / Safari */
.ch-switch-nav {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; padding: 0;
  border: none; border-radius: 7px; background: none;
  color: var(--muted); cursor: pointer; font-family: inherit;
  transition: background .12s ease, color .12s ease;
}
.ch-switch-nav:hover { background: var(--surface-3); color: var(--text); }
.ch-switch-nav:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }

.ch-switch-item {
  display: flex; align-items: center; gap: 8px; flex: none;
  padding: 6px 10px; border: 1px solid transparent; border-radius: 8px;
  text-decoration: none; color: var(--text-soft);
  font-size: var(--fs-14); white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.ch-switch-item:hover { background: var(--surface-2); color: var(--text); }
.ch-switch-item.on {
  background: rgba(72,144,180,.12); color: var(--gold);
  border-color: rgba(72,144,180,.35); font-weight: 600;
}
.ch-switch-ico {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: rgba(72,144,180,.14); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-12); font-weight: 600;
  overflow: hidden;
}
/* 下拉项里的徽标比列表页小一号：一屏要塞下多个频道，20px 会显得笨重 */
.ch-switch-item .ch-badge { min-width: 18px; height: 18px; padding: 0 5px; font-size: var(--fs-11); }

/* ---- ≤640px：纵向列表 ----
   .ch-switch 改 static，面板的包含块落到 .ch-head（sticky 即定位元素），
   于是 left/right:0 就是「贴着工具栏整宽展开」——避免面板以频道名为左边界
   向右溢出屏幕（iPhone 390 上必然溢出）。 */
@media (max-width: 640px) {
  .ch-switch { position: static; }
  .ch-switch-menu {
    top: calc(100% + 6px); left: 0; right: 0;
    align-items: stretch;
  }
  .ch-switch-scroll {
    flex-direction: column; align-items: stretch; gap: 2px;
    max-width: none; max-height: 60vh;
    overflow-x: hidden; overflow-y: auto;
  }
  .ch-switch-nav { display: none !important; }    /* 纵向列表不需要左右箭头 */
  .ch-switch-item { padding: 9px 10px; font-size: var(--fs-14); }
  /* ⚠️ ≤640px 时 .main 的左右内边距是 16px（style.css 的 .wrap 移动端规则
     抢在 .main 后面生效，把 20px 覆盖掉了）。负边距必须跟着变成 -16px，
     否则 toolbar 会比视口宽 8px，横向溢出、面板右边缘被切掉。 */
  .ch-head { margin: 0 -16px 16px; padding: 10px 16px; }
}

/* ============================================================
   v20261030 会员权益体系
   ============================================================ */

/* 原生单选/复选统一到主题金。暗色主题下浏览器默认蓝在这种深底上非常刺眼，
   而且和 .btn-primary 的金色强调完全不是一套语言。 */
input[type="radio"], input[type="checkbox"] { accent-color: var(--gold); cursor: pointer; }

/* 权益配置页的矩阵表：格子里放单选，必须居中；表头也跟着居中，否则
   四列标题会和下面的圆点错位，看起来像没对齐。 */
.ent-cell { text-align: center; }
.ent-th { text-align: center; }
.ent-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ent-actions { display: flex; justify-content: flex-end; margin-top: 16px; }
.ent-matrix td { vertical-align: middle; }

/* ---------------- 全局弹窗 ----------------
   原本只在 dashboard.html 里以内联 <style> 存在，且用的是本站没定义的
   var(--surface-1, #141418) / var(--border, #2a2a30) —— 实际一直回退到
   GitHub 的旧色值，跟现在的主题不是一套。抽到这里统一收口，后续所有
   确认框都用这一套，不许再写 confirm() 弹原生框。 */
.modal-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 16px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; max-width: 440px; width: 100%; padding: 22px 24px;
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 14px; font-size: var(--fs-16); color: var(--text); font-weight: 500; }
.modal-body { font-size: var(--fs-14); color: var(--text-soft); line-height: 1.8; }
.modal ol, .modal-body ol { margin: 0 0 14px; padding-left: 20px; line-height: 1.9; font-size: var(--fs-14); color: var(--text-soft); }
.modal-body ol { margin-bottom: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.modal-preview {
  margin-top: 10px; padding: 10px 12px; border-radius: 8px;
  background: var(--surface-3); border: 1px solid var(--line-soft);
  font-size: var(--fs-13); color: var(--text-soft);
}
.modal-preview b { color: var(--gold); font-weight: 500; }

/* 会员状态小卡（导航右侧 / 会员页头部） */
.member-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--line);
  font-size: var(--fs-12); color: var(--text-soft);
}
.member-pill b { color: var(--gold); font-weight: 500; }

/* 会员页的额度两行：必须分开显示 ——
   次数跟会员期失效、赠送当天作废，合成一个数字用户会以为都能留到明天。 */
.credit-row { display: flex; align-items: baseline; gap: 10px; padding: 9px 0;
              border-bottom: 1px solid var(--line-soft); }
.credit-row:last-child { border-bottom: none; }
.credit-row .k { width: 92px; flex: none; color: var(--muted); font-size: var(--fs-13); }
.credit-row .v { color: var(--text); font-size: var(--fs-14); }
.credit-row .n { color: var(--muted-2); font-size: var(--fs-12); }

/* 权益一览：一级一行一个功能点，二级（各频道）缩进挂在「频道」下面 */
.ent-list { margin: 6px 0 0; padding: 0; list-style: none; }
.ent-list li { display: flex; align-items: center; gap: 10px;
               padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-14); }
.ent-list li:last-child { border-bottom: none; }
.ent-list .nm { flex: 1; color: var(--text-soft); }
.ent-list .st-on { color: var(--ok); }
.ent-list .st-off { color: var(--muted-2); }

/* 一级项要装下二级列表，所以自身退回块级，行内布局交给 .ent-row */
.ent-list li.ent-main { display: block; }
.ent-row { display: flex; align-items: center; gap: 10px; }

/* 二级：左侧竖线 + 缩进 + 字号降一档，父子关系一眼能看出来。
   不用浅色块填充 —— 暗色主题下叠两层底色会糊成一团。 */
.ent-sub-list {
  margin: 0 0 4px 16px; padding: 0 0 0 12px; list-style: none;
  border-left: 2px solid var(--line);
}
.ent-list .ent-sub-list li {
  padding: 7px 0; font-size: var(--fs-12);
  border-bottom: 1px dashed var(--line-soft);
}
.ent-list .ent-sub-list li:last-child { border-bottom: none; }
.ent-list .ent-sub-list .nm { color: var(--muted); }
.ent-list .ent-sub-list .st-on,
.ent-list .ent-sub-list .st-off { font-size: var(--fs-12); }

/* 锁定态卡片（首页三入口 / 工作台 / 简报） */
.card.locked { opacity: .72; }
.card.locked .lock-note { color: var(--run); font-size: var(--fs-13); }

/* 导航项上的小徽章（「需升级」/「V3 · 12天」）。
   紧贴链接文字，不能撑高顶栏 —— 顶栏高度在 ≤640px 有汉堡按钮对齐问题。 */
.nav-badge {
  display: inline-block; margin-left: 5px; padding: 1px 6px;
  border-radius: 999px; font-size: var(--fs-11); line-height: 1.5;
  /* 等级徽章走品牌蓝：它是「分类」，不是「出错了」，
     所以不能用金色/红色这类语义色去暗示状态 */
  background: var(--blue-soft); color: var(--blue-lt);
  border: 1px solid var(--blue-line);
  vertical-align: middle; white-space: nowrap;
}
.nav-badge.ok {
  background: var(--ok-bg); color: var(--ok);
  border-color: rgba(136,223,178,.25);
}

/* 改期限弹窗里的两组输入 */
.expire-field { margin-top: 14px; }
.expire-label { display: block; font-size: var(--fs-13); color: var(--text-soft); margin-bottom: 6px; }
.expire-input { display: flex; align-items: center; gap: 8px; }
.expire-input .unit { color: var(--muted); font-size: var(--fs-13); }

/* 注册页的赠礼说明：介于标题与步骤条之间，一屏内要读得清 */
.login-gift {
  margin: 0 0 16px; font-size: var(--fs-13); line-height: 1.75;
  color: var(--text-soft); padding: 10px 12px;
  background: var(--surface-3); border: 1px solid var(--line-soft);
  border-radius: 8px;
}
.login-gift b { color: var(--gold); font-weight: 500; }

/* ============================================================
   用户端移动端适配 · v20261030c 逐页复查补丁
   ------------------------------------------------------------
   v9.3 已经处理：汉堡菜单、刘海安全区、按钮≥40px、iOS 输入缩放、
   师傅卡纵向；v20261027 已经处理：双层吸顶。本次只补实测找出的三个坑：
     1) 分析报告页卡片头部：标题被挤成三行、额度标签夹在中间
     2) 会员页额度行：三列在窄屏压成一团，「每日剩余 1 次」被拆成两行
     3) 若干触控目标不足 36px（logo、频道返回、周报返回、登录页文字链）
   仍然只动样式与显隐，不改任何功能逻辑。
   ============================================================ */
@media (max-width: 640px) {

  /* ---- 1. 卡片头部两行布局（只在显式标了 card-head-stack 的头部生效）----
     不全局改 .card-head：大部分卡头只有一个标题 + 一个小按钮，
     强行换行会让它们凭空多出一行。 */
  .card-head-stack { flex-wrap: wrap; align-items: flex-start; row-gap: 10px; }
  .card-head-stack > .h2 { flex: 1 1 100%; min-width: 0; line-height: 1.5; }
  .card-head-stack > .chips { flex: 1 1 100%; justify-content: flex-start; }
  /* 两个额度标签在 390px 下并排放得下（约 318px），按钮单独一行。
     字号收到 12px 是唯一手段——标签文字是后端拼的，前端拆不开。 */
  .card-head-stack .chip { font-size: var(--fs-12); padding: 3px 10px; }

  /* ---- 2. 会员额度行：标签 + 数值一行，说明另起一行铺满 ----
     原来 92px 固定标签 + 数值 + 说明三列硬挤，390px 下说明被压成
     两三个字一行，「每日剩余 1 次」这种短句都会被折开。 */
  .credit-row { flex-wrap: wrap; row-gap: 3px; padding: 10px 0; }
  .credit-row .k { width: auto; flex: none; }
  .credit-row .v { flex: 1 1 auto; }
  .credit-row .n { flex: 1 1 100%; font-size: var(--fs-12); line-height: 1.6; }

  /* ---- 3. 触控目标补齐 ----
     iOS 人机指南建议 44px，Material 建议 48px；这里取 40px 作为下限，
     与 v9.3 的按钮规范一致。纯文字链只加内边距，不改字号。 */
  .brand { min-height: 40px; }
  .ch-back { min-height: 40px; padding: 8px 14px; }
  .login-hint a { display: inline-block; padding: 9px 2px; }
  .alt-path-btn { min-height: 44px; display: flex; align-items: center; justify-content: center; }
  /* 「报告准备好通知我」是 19px 高的开关，手指很难点准。只抬点击区，
     不动开关本身的尺寸——放大滑道会跟同一行的按钮比例失衡。 */
  .notify-toggle { min-height: 40px; }
  /* 频道名下拉触发器同理：36px 差一点点，补齐到 40 */
  .ch-switch-btn { min-height: 40px; }

  /* ---- 4. 频道详情吸顶条与页面左右边距对齐 ----
     .ch-head 的负边距是按桌面 .main 的 20px 写的，手机上 .wrap 只有 16px，
     结果吸顶条两侧各探出 4px。这里按 16px 重算，内容位置不变。 */
  .ch-head { margin-left: -16px; margin-right: -16px; padding-left: 16px; padding-right: 16px; }
}

/* 触控设备去掉 300ms 点击高亮的蓝色闪块，换成品牌金 */
@media (hover: none) {
  html { -webkit-tap-highlight-color: rgba(72,144,180,.16); }
}

/* 首页卡片标题：字号从模板内联样式上收到这里，320px 下才有得改。
   原来 19px 的内联样式在 iPhone SE 上会把「LightTower·分析报告」
   挤成「…分析报 / 告」这种单字孤行。 */
.hc-title { font-size: var(--fs-20); }
@media (max-width: 360px) {
  .hc-title { font-size: var(--fs-16); }
}

/* iOS Safari 的地址栏会伸缩：100vh 取的是"地址栏收起后"的高度，
   page-login 这类撑满全屏的页面底部会被顶出可视区。dvh 跟着实际视口走，
   不支持的浏览器（老 Safari / 老安卓）继续用上面的 100vh，不会更差。 */
@supports (height: 100dvh) {
  body.page-login { min-height: 100dvh; }
}

/* iPhone 底部小黑条：悬浮的「有新消息」按钮要让开安全区，
   否则会压在 Home 指示条上，怎么点都没反应。 */
.ch-newbar { bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }

/* ============================================================
   频道设置页 · v20261101 重排
   ------------------------------------------------------------
   这一版把原来「一张卡塞 10 个控件 + 大段说明」的频道设置页拆成
   接入 → 运行信息 → 推送 → 过滤 → 头像 → 消息 五段，并新增：
   .icon-btn/.icon-btn-sm（信息图标入口）、.ftag（字段适用性标签）、
   .cfg-form（双列表单栅格）、.ro-box（只读值）、.run-info（折叠条）、
   .url-row（接收地址条）、.danger-row（危险操作行）、
   .md-*（说明弹窗）、.cw-*（仿真代码窗）。
   全部命名加前缀，避免与既有类冲突（旧 .invite-form / .kv 未改动）。
   ============================================================ */

/* ---- 信息图标入口 ---- */
.icon-btn {
  width: 34px; height: 34px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; cursor: pointer; font-family: inherit;
  border: 1px solid rgba(72,144,180,.4);
  background: rgba(72,144,180,.1); color: var(--blue-lt);
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn:hover { background: rgba(72,144,180,.18); border-color: rgba(72,144,180,.65); color: var(--blue-lt); }

/* 字段级：贴在 label 文字右边，不占行 */
.icon-btn-sm {
  width: 20px; height: 20px; padding: 0; margin-left: 5px; vertical-align: -4px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; font-family: inherit;
  color: var(--blue-lt); opacity: .85; transition: opacity .15s ease, color .15s ease;
}
.icon-btn-sm svg { width: 14px; height: 14px; }
.icon-btn-sm:hover { opacity: 1; color: var(--blue-lt); }

/* ---- 字段适用性标签 ----
   含义约定写在卡片脚注里：有标签 = 只对标注的场景生效，无标签 = 所有推送方式一致。 */
.ftag {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  font-size: var(--fs-11); font-weight: 400; line-height: 18px; letter-spacing: 0;
  border-radius: 4px; vertical-align: 1px;
  background: rgba(72,144,180,.12); color: var(--blue-lt);
}

/* ---- 接收地址条 ---- */
.url-row {
  display: flex; align-items: center; gap: 10px;
  height: 42px; padding: 0 12px; margin-bottom: 16px;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(10, 22, 36, .85);
}
.url-method {
  flex: none; padding: 0 7px; height: 20px; line-height: 20px; border-radius: 5px;
  background: var(--ok-bg); color: var(--ok);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-11); font-weight: 600; letter-spacing: .6px;
}
.url-text {
  flex: 1; min-width: 0; overflow-x: auto; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-13); color: var(--text-soft);
  scrollbar-width: thin;
}

/* 两列 kv（频道页专用；.kv 本身已是 2 列，这里只在大屏锁死、窄屏回单列） */
.kv.kv-2 { columns: 2; }
/* 键值靠左排，不铺满整列：space-between 会让「鉴权方式」和它的值隔出半屏空白，
   读起来像四列。固定一个 92px 的键列，值紧跟其后。 */
.kv.kv-2 li { justify-content: flex-start; gap: 14px; }
.kv.kv-2 li > span { flex: none; min-width: 92px; }
@media (max-width: 720px) { .kv.kv-2 { columns: 1; } }

/* ---- 危险操作行 ---- */
.danger-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
}
.danger-note { margin: 0; font-size: var(--fs-12); line-height: 1.6; color: var(--muted); }
@media (max-width: 640px) {
  .danger-row { flex-direction: column; align-items: stretch; gap: 10px; }
}

/* ---- 运行信息折叠条 ---- */
.run-info {
  margin-bottom: 14px; padding: 0 16px;
  background: var(--panel);
  border: 1px solid var(--line); border-radius: var(--r-md);
}
.run-info summary {
  display: flex; align-items: center; gap: 10px; height: 44px;
  cursor: pointer; list-style: none;
}
.run-info summary::-webkit-details-marker { display: none; }
.run-info summary:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
.ri-chev { width: 13px; height: 13px; flex: none; color: var(--muted); transition: transform .15s ease; }
.run-info[open] .ri-chev { transform: rotate(90deg); }
.ri-title { font-size: var(--fs-13); font-weight: 500; color: var(--text-soft); flex: none; }
.ri-meta {
  flex: 1; min-width: 0; font-size: var(--fs-12); color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ri-body { padding-bottom: 12px; }
.ri-body .kv { margin-top: 2px; }

/* ---- 双列表单栅格 ----
   比 .invite-form 的 auto-fit 更稳定：两列固定等宽，控件高度统一 34px，
   不再出现「有 hint 的字段比旁边矮/高半行」的错位。 */
.cfg-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px 16px;
  align-items: start;
}
.cfg-form .field { margin-bottom: 0; min-width: 0; }
.cfg-form .full { grid-column: 1 / -1; }
.cfg-form .label { min-height: 18px; line-height: 18px; }
.cfg-form input,
.cfg-form select {
  height: var(--ctl-h); padding: 0 12px; font-size: var(--ctl-font);
  width: 100%;   /* .field input 是 100%，.sel 不是——不补这条，下拉框会缩成内容宽 */
}
.cfg-form select { padding-right: 30px; }
.cfg-form .label-hint { display: block; line-height: 15px; margin-top: 5px; }
.cfg-form .input-area { font-size: var(--fs-13); line-height: 1.7; padding: 9px 12px; }
.sub + .cfg-form { margin-top: 16px; }   /* 说明段之后紧跟表单时补一口气 */
/* align-self: end —— 保存按钮所在格没有 label，不贴底会比左边的控件高出一行 */
.cfg-save { display: flex; justify-content: flex-end; align-items: flex-end; align-self: end; }
@media (max-width: 720px) {
  .cfg-form { grid-template-columns: 1fr; }
}

/* ---- 只读值（解锁等级） ---- */
.ro-box {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  height: var(--ctl-h); padding: 0 12px;
  border: 1px solid var(--line-soft); border-radius: 8px;
  background: rgba(10, 22, 36, .45);
}
.ro-val { font-size: var(--fs-14); font-weight: 500; color: var(--run); }
.ro-link { font-size: var(--fs-12); color: var(--accent); text-decoration: none; flex: none; }
.ro-link:hover { text-decoration: underline; }

/* ---- 飞书群级过滤（只读子块） ---- */
.sub-block {
  margin-top: 18px; padding: 14px 16px;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: rgba(10, 22, 36, .55);
}
.sub-block-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; margin-bottom: 8px;
}
.sub-block-title {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: var(--fs-13); font-weight: 500; color: var(--text-soft);
}
.sub-block-title svg { width: 14px; height: 14px; color: var(--run); flex: none; }
.sub-block-desc { margin: 0 0 10px; font-size: var(--fs-12); color: var(--muted-2); line-height: 1.7; }
.sub-block .kv { columns: 2; }
.sub-block .kv li { border-bottom: none; padding: 5px 0; }
.sub-block .sub { margin: 6px 0 0; font-size: var(--fs-12); }
@media (max-width: 720px) { .sub-block .kv { columns: 1; } }

/* ---- 头像块 ---- */
.av-grid { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 14px; }
.av-box {
  flex: 1 1 250px; min-width: 230px; padding: 16px;
  border: 1px solid var(--line); border-radius: 10px;
}
.av-box .label { margin-bottom: 12px; }
.av-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.av-letter { color: var(--gold); font-size: var(--fs-15); font-weight: 600; }
.av-file { display: block; margin-bottom: 10px; font-size: var(--fs-12); color: var(--muted); max-width: 100%; }
/* 原生 file 控件在暗色页上是一块浅灰按钮，与整套控件完全脱节。
   ::file-selector-button 是唯一能改它的钩子——不改的话这里永远是白灰块。 */
.av-file::file-selector-button {
  margin-right: 10px; height: 28px; padding: 0 12px; border-radius: 7px;
  border: 1px solid var(--line-2); background: transparent; color: var(--tx);
  font-family: inherit; font-size: var(--fs-12); cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.av-file::file-selector-button:hover { border-color: var(--line-3); background: rgba(255,255,255,.05); color: var(--tx); }
/* 替换 / 移除 并排：两个独立 form 用 form="id" 关联，去掉垂直堆叠 */
.av-btns { display: flex; gap: 8px; align-items: center; }

/* ============================================================
   说明弹窗（.md-*） + 仿真代码窗（.cw-*）
   ============================================================ */
body.md-open { overflow: hidden; }

.md-wrap {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: rgba(4, 9, 15, .74);
  backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
  overflow-y: auto;
}
.md {
  width: min(880px, 100%); max-height: calc(100vh - 48px);
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: 14px;
  background: linear-gradient(180deg, #08080a 0%, #0d0d10 100%);
  box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .9);
  overflow: hidden;
}
.md-sm { width: min(680px, 100%); }
/* 打开弹窗时焦点落在卡片容器上（而不是关闭按钮），容器本身不该画出焦点框 */
.md:focus, .md:focus-visible { outline: none; }
.md-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 22px 22px 0 24px;
}
.md-title { margin: 0 0 5px; font-size: var(--fs-16); font-weight: 600; color: var(--tx); letter-spacing: .4px; }
.md-sub { margin: 0; font-size: var(--fs-12); line-height: 1.7; color: var(--muted); }
.md-x {
  flex: none; padding: 4px; line-height: 0; cursor: pointer;
  background: none; border: none; color: var(--muted); border-radius: 6px;
}
.md-x svg { width: 16px; height: 16px; }
.md-x:hover { color: var(--tx); background: rgba(255, 255, 255, .06); }

.md-tabs { display: flex; gap: 24px; padding: 0 24px; margin-top: 16px; border-bottom: 1px solid var(--line-soft); }
.md-tab {
  padding: 10px 0 9px; font-size: var(--fs-14); font-family: inherit; cursor: pointer;
  background: none; border: none; border-bottom: 2px solid transparent;
  color: var(--muted); margin-bottom: -1px; white-space: nowrap;
}
.md-tab:hover { color: var(--text-soft); }
.md-tab.on { color: var(--run); font-weight: 600; border-bottom-color: var(--gold); }

.md-body { padding: 18px 24px 22px; overflow-y: auto; }
.md-pane { display: none; }
.md-pane.on { display: block; }
.md-lead { margin: 0 0 12px; font-size: var(--fs-13); line-height: 1.75; color: var(--text-soft); }
.md-note { margin: 12px 0 0; font-size: var(--fs-12); line-height: 1.7; color: var(--muted-2); }
.md-note code, .md-list code, .md-lead code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .95em; color: var(--run);
  background: rgba(227,191,124,.1); padding: 1px 4px; border-radius: 4px;
}
.md-h4 {
  margin: 20px 0 8px; font-size: var(--fs-13); font-weight: 600;
  color: var(--text-soft); letter-spacing: .3px;
}
.md-h4:first-child { margin-top: 0; }
.md-list { margin: 0 0 4px; padding-left: 18px; font-size: var(--fs-12); line-height: 1.85; color: var(--muted); }
.md-list b { color: var(--text-soft); font-weight: 600; }

/* 匹配示例小表 */
.md-table { margin: 4px 0 0; border: 1px solid var(--line-soft); border-radius: 8px; overflow: hidden; }
.md-tr {
  display: grid; grid-template-columns: 150px 1fr 190px; gap: 10px;
  padding: 9px 12px; font-size: var(--fs-12); color: var(--muted);
  border-bottom: 1px solid var(--line-soft);
}
.md-tr:last-child { border-bottom: none; }
.md-tr.md-th { background: rgba(255,255,255,.03); color: var(--tx-3); font-size: var(--fs-11); }
.md-tr .ok { color: var(--ok); }
.md-tr code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-12); color: var(--run);
}
@media (max-width: 640px) {
  .md-tr { grid-template-columns: 1fr; gap: 2px; }
  .md-tr.md-th { display: none; }
}

/* ---- 仿真代码窗 ---- */
.cw { border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.cw-bar {
  display: flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 13px; background: #0d0d10;
}
.cw-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.cw-dot.d1 { background: rgba(240,133,123,.7); }
.cw-dot.d2 { background: rgba(227,191,124,.7); }
.cw-dot.d3 { background: rgba(136,223,178,.7); }
.cw-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-12); color: var(--muted-2);
}
.cw-copy {
  height: 24px; padding: 0 9px; border-radius: 6px; cursor: pointer;
  font-family: inherit; font-size: var(--fs-12);
  border: 1px solid var(--line); background: rgba(28,28,32,.6); color: var(--text-soft);
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.cw-copy:hover { background: var(--surface-3); color: var(--tx); }
.cw-copy.done { color: var(--ok); border-color: rgba(136,223,178,.45); }
.cw-code {
  margin: 0; padding: 14px 16px; background: #0b0b0e;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-12); line-height: 20px; color: var(--text-soft);
  overflow-x: auto; white-space: pre;
}
.c-method { color: var(--blue-lt); font-weight: 500; }
.c-key { color: var(--blue-lt); }
.c-str { color: var(--gold); }
.c-com { color: var(--muted-2); }

@media (max-width: 640px) {
  .md-wrap { padding: 10px; }
  .md { max-height: calc(100dvh - 20px); border-radius: 12px; }
  .md-head { padding: 18px 16px 0; }
  .md-tabs { padding: 0 16px; gap: 16px; overflow-x: auto; }
  .md-body { padding: 16px 16px 18px; }
  .cw-code { font-size: var(--fs-12); }
}

/* ============================================================
   用户管理页 · v20261101 重排
   ------------------------------------------------------------
   这一版把原来「7 列 + 每行一组输入框 + 五行说明」的用户表压成
   5 列，并新增：
   .ct-group（标题 + ⓘ 信息标）、.tbl-tools/.seg（表头工具条与筛选分段）、
   .utbl 的五列宽度、.u-*/（邮箱列）、.lv/.left-*（权益与剩余天数着色）、
   .rep-link（报告数的大热区）、.row-menu（行内「⋯」菜单）、
   .pager（分页）、.q-*（调权益弹窗表单）、.md-actions（弹窗底部按钮行）。
   全部加前缀，避开既有 .tbl/.btn/.badge 的通用样式。
   ============================================================ */

/* ---- 页头搜索（form 直出，回车即查） ---- */
.head-search { display: inline-flex; }
.head-search .inp-sm { width: 240px; }

/* ---- 标题 + ⓘ：图标与标题垂直居中对齐 ---- */
.ct-group { display: inline-flex; align-items: center; gap: 10px; }
/* 卡片标题旁的说明入口比字段级的大一号：它是这一页唯一的解释入口，
   20px 的时候容易被当成装饰点。 */
.ct-group .icon-btn-sm { width: 22px; height: 22px; margin-left: 0; }
.ct-group .icon-btn-sm svg { width: 15px; height: 15px; }

/* ---- 表头工具条 ---- */
.tbl-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-bottom: 6px; flex-wrap: wrap;
}
.tbl-tip { font-size: var(--fs-12); color: var(--muted-2); }

/* 筛选分段：只是链接，不需要 JS 参与，页码/搜索参数由服务端回填 */
.seg {
  display: inline-flex; gap: 2px; padding: 3px;
  border: 1px solid var(--line-soft); border-radius: 9px;
  background: #060608;
}
.seg-item {
  padding: 4px 11px; border-radius: 6px; text-decoration: none;
  font-size: var(--fs-12); color: var(--muted); white-space: nowrap;
  transition: background .14s ease, color .14s ease;
}
.seg-item:hover { color: var(--text-soft); background: rgba(255, 255, 255, .04); }
.seg-item.on { background: var(--surface-2); color: var(--text); font-weight: 500; }

/* ---- 用户表五列 ---- */
.tbl.utbl { table-layout: fixed; }
.tbl.utbl col.c-user { width: auto; }
.tbl.utbl col.c-quota { width: 104px; }
/* v20261107：等级从「权益」列拆出来单独一列（稿 S2），原 c-quota 186px 二分为 104 + 82 */
.tbl.utbl col.c-level { width: 82px; }
/* 三期：LT 积分列。窄一点就够 —— 它只是一个数字，
   但必须等宽（.num）并右对齐，否则和「会员剩余」挤在一起读不出层次。 */
.tbl.utbl col.c-points { width: 96px; }
.tbl.utbl col.c-left { width: 116px; }
.tbl.utbl col.c-reports { width: 88px; }
.tbl.utbl col.c-ops { width: 268px; }
.c-points .num { font-variant-numeric: tabular-nums; font-weight: 600; }
.tbl.utbl td { padding: 12px; }
.tbl.utbl th { white-space: nowrap; }

/* 邮箱列：状态收成一个圆点，停用/过期的行仍然整行淡红 */
.u-line { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.u-dot { width: 6px; height: 6px; border-radius: 50%; flex: none; }
.u-dot.is-ok { background: var(--ok); }
.u-dot.is-bad { background: var(--bad); }
.u-mail { font-size: var(--fs-14); color: var(--text); font-weight: 500; letter-spacing: .1px; }
.tbl.utbl .pw-missing { color: var(--bad); font-size: var(--fs-12); margin-top: 3px; }

/* 权益列：次数 + 等级胶囊 */
.c-quota .q-num { font-size: var(--fs-14); font-weight: 600; color: var(--text); margin-right: 8px; }
.c-quota .q-num.muted { color: var(--muted); }
.lv {
  display: inline-block; padding: 0 7px; line-height: 20px; border-radius: 6px;
  font-size: var(--fs-11); border: 1px solid transparent; vertical-align: 1px;
}
.lv-ok, .lv-run { color: var(--run); background: rgba(227,191,124,.12); border-color: rgba(227,191,124,.3); }
.lv-bad { color: var(--bad); background: var(--bad-bg); border-color: rgba(240,133,123,.25); }
.lv-none, .lv-vnone { color: var(--muted); background: var(--idle-bg); border-color: rgba(255,255,255,.22); }
/* 等级是分类，用品牌色（与 .st.v1/.v2/.v3 同一套）：
   V1 浅蓝 → V2 蓝 → V3 红。不让它跟着「剩几天」变红变黄，
   那是右边「会员剩余」列的职责，两列各说一件事。 */
.lv-v1 { color: var(--lv-1); background: rgba(72,144,180,.08); border-color: rgba(72,144,180,.28); }
.lv-v2 { color: var(--blue-lt); background: var(--blue-soft); border-color: var(--blue-line); }
.lv-v3 { color: var(--red); background: var(--red-soft); border-color: var(--red-line); }

/* 会员剩余：只有一个数字，绝对日期不再上列表 */
.left-ok { color: var(--ok); }
.left-run { color: var(--run); font-weight: 500; }
.left-bad { color: var(--bad); }
.left-none { color: var(--muted-2); }

/* 报告数：热区从数字本身放大成 54×28 胶囊 */
.rep-link {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 54px; height: 28px; border-radius: 7px;
  background: rgba(72,144,180,.1); text-decoration: none;
  font-size: var(--fs-13); font-weight: 600; color: var(--blue-lt);
  transition: background .14s ease, color .14s ease;
}
.rep-link:hover { background: rgba(72,144,180,.2); color: var(--blue-lt); }

/* ---- 操作列 ----
   ⚠️ 不要给 td 设 display:flex —— 会把表格单元格变成块级盒子，
   后面几列会错位。按钮本身 inline-block + 左右 margin 就够了。 */
.tbl.utbl .ops { white-space: nowrap; }
.tbl.utbl .ops > * { vertical-align: middle; margin-left: 8px; }
.tbl.utbl .ops .row-menu { display: inline-block; }

/* 行内「⋯」菜单：details/summary 实现，不用 JS 也不用绝对定位的遮罩 */
.row-menu { position: relative; }
.row-menu > summary {
  list-style: none; cursor: pointer; padding: 6px 9px;
  display: inline-flex; align-items: center;
}
.row-menu > summary::-webkit-details-marker { display: none; }
.row-menu > summary svg { width: 15px; height: 15px; }
.row-menu[open] > summary { border-color: #3a3a42; color: var(--tx); background: var(--surface-3); }
.row-menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30;
  min-width: 132px; padding: 5px;
  border: 1px solid #2a2a30; border-radius: 10px;
  background: var(--surface-3); box-shadow: 0 18px 36px -18px rgba(0, 0, 0, .85);
}
.row-menu-pop form { margin: 0; }
.menu-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 7px 10px; border: none; border-radius: 7px; background: none;
  font-family: inherit; font-size: var(--fs-13); color: var(--text-soft);
}
.menu-item:hover { background: rgba(255, 255, 255, .06); color: var(--tx); }
.menu-item.danger { color: var(--bad); }
.menu-item.danger:hover { background: var(--bad-bg); }

/* ---- 分页 ---- */
.pager {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line-soft); flex-wrap: wrap;
}
.pg-info { font-size: var(--fs-12); color: var(--muted-2); }
.pg-btns { display: inline-flex; align-items: center; gap: 6px; }
.pg-btns .btn { text-decoration: none; min-width: 32px; text-align: center; }
.pg-on {
  background: var(--run-bg); border-color: rgba(227,191,124,.45);
  color: var(--run); font-weight: 600; cursor: default;
}
.pg-gap { color: var(--muted-2); padding: 0 2px; }

/* ---- 调权益弹窗表单 ---- */
.md-xs { width: min(520px, 100%); }
.md-actions {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 0 24px 22px;
}
.q-body { display: flex; flex-direction: column; gap: 18px; }

/* 等级：单选按钮画成分段控件，默认停在「保持不变」 */
.lv-opts { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px;
  border: 1px solid var(--line-soft); background: #060608; align-self: flex-start; }
.lv-opt { position: relative; }
.lv-opt input { position: absolute; opacity: 0; pointer-events: none; }
.lv-opt span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; height: 32px; padding: 0 12px; border-radius: 6px;
  font-size: var(--fs-12); color: var(--muted); cursor: pointer;
  transition: background .14s ease, color .14s ease;
}
.lv-opt span:hover { color: var(--text-soft); background: rgba(255, 255, 255, .04); }
.lv-opt input:checked + span {
  background: #2a2a30; color: var(--tx-2); font-weight: 500;
  box-shadow: inset 0 0 0 1px #3a3a42;
}

/* 旧的行式表单（输入框 + 快捷芯片）已随 v20261103 重排删除：
   现在每节一行、数字走 stepper，.q-chip / .q-rowname / .q-row(flex) 都不再使用。
   `.q-row` 只剩「三合一额度格」里的 display:contents 一条，且已带 .quota 作用域。 */
.q-unit { font-size: var(--fs-12); color: var(--muted); }

.q-warn { margin: 0; font-size: var(--fs-12); line-height: 1.65; color: var(--bad); }
.q-note { margin: 0; font-size: var(--fs-12); line-height: 1.65; color: var(--run); }

/* ---- v20261103 调权益弹窗重排 ----
   原形态是 5 组字段 × (标签 + em 说明 + 两个输入 + 快捷档 + 提示段)，
   一屏装不下还要滚。这里不缩字号，只做三件事：现状收成一条、
   每节压成一行、把「改后会变成什么」做成清单。
   控件尺寸按视觉基线 §3：桌面 34px，移动 44px。 */
.q-now { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 14px 0 0;
  padding: 11px 14px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface-2); }
.q-now span { font-size: var(--fs-12); color: var(--tx-3); }
.q-now b { color: var(--tx); font-weight: 600; }

/* 一节一行：字段名 / 控件 / 现值。现值右对齐，扫一眼就知道和上面差多少 */
.q-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 10px;
  align-items: center; min-height: 40px; }
.q-line > .q-name { font-size: var(--fs-12); color: var(--tx-2); }
.q-line > .q-cur { font-size: var(--fs-12); color: var(--tx-3); white-space: nowrap; }
/* grid 子项默认 stretch，会把分段控件与 stepper 拉成整列宽 —— 显式靠左 */
.q-line > .q-seg, .q-line > .stepper, .q-line > .lv-opts { justify-self: start; }
.q-line-sep { height: 1px; background: var(--line-soft); margin: 2px 0; }

/* 二选一的口径切换（期限：设为剩余 / 在原到期日上加） */
.q-seg { display: inline-flex; gap: 2px; padding: 3px; border-radius: 9px;
  border: 1px solid var(--line-soft); background: #060608; }
.q-seg button { height: 28px; padding: 0 10px; border: 0; border-radius: 6px;
  background: none; color: var(--tx-3); font-family: inherit; font-size: var(--fs-12);
  cursor: pointer; }
.q-seg button:hover { color: var(--tx-2); background: rgba(255, 255, 255, .04); }
.q-seg button.on { background: #2a2a30; color: var(--tx-2); font-weight: 500;
  box-shadow: inset 0 0 0 1px #3a3a42; }

/* 变更清单：字段 旧值 → 新值。比原来用 · 连起来的一句长话好读 */
.q-diff { display: flex; flex-direction: column; gap: 3px; font-size: var(--fs-12);
  line-height: 1.6; }
.q-diff .cap { color: var(--tx-3); }
.q-diff .row { color: var(--tx-2); }
.q-diff .row i { font-style: normal; color: var(--tx-3); }
.q-diff .row b { color: var(--tx); font-weight: 600; }
.q-diff .none { color: var(--tx-3); }
/* 底栏左侧放清单、右侧放按钮：.md-actions 默认右对齐，这里只在这一个弹窗里改 */
.md-actions.split { justify-content: space-between; align-items: flex-end; }
/* 一行一节的间距比 q-field 小一半：18px 会把五行撑成一屏半 */
.q-body.q-rows { gap: 10px; }
.q-res { font-size: var(--fs-12); color: var(--tx-3); white-space: nowrap; }
.q-res b { color: var(--tx); font-weight: 600; }

@media (max-width: 640px) {
  .q-line { grid-template-columns: 1fr auto; row-gap: 8px; min-height: 0;
    padding: 8px 0; }
  .q-line > .q-name { grid-column: 1 / -1; }
  .q-line .stepper { height: 44px; }
  .q-line .q-seg button { height: 32px; }
  .q-now { gap: 4px 10px; }
  .q-diff { font-size: var(--fs-11); }
}

/* ---- 删除确认 ---- */
.del-label { display: block; margin: 14px 0 7px; font-size: var(--fs-12); color: var(--muted); }
.del-label em { font-style: normal; color: var(--run); font-weight: 600; }

@media (max-width: 720px) {
  .head-search .inp-sm { width: 160px; }
  .tbl.utbl { table-layout: auto; }
  .tbl.utbl col.c-ops { width: auto; }
  .md-actions { padding: 0 16px 18px; }
}

/* ============================================================
   三期组件与后台看板（2026-11-02）
   ------------------------------------------------------------
   下半部分全部是设计图新增的组件。命名与既有页面不冲突：
   .card-t / .lbl / .hint / .seg / .st / .tip 是新的原子类，
   .q* 是会员兑换区，.rec* 是积分流水，.kpi* 是数据看板。
   ============================================================ */

/* ---- 原子类 ---- */
.lbl { font-size: var(--fs-11); color: var(--tx-3); letter-spacing: .1em; text-transform: uppercase; }
.hint { font-size: var(--fs-12); color: var(--tx-3); line-height: 1.7; }
.tip { font-size: var(--fs-11); color: var(--tx-3); line-height: 1.7; }
.rule { height: 1px; background: var(--line); margin: 16px 0; }
.card-t { font-size: var(--fs-14); font-weight: 600; letter-spacing: -.005em; }
.card-sub { font-size: var(--fs-12); color: var(--tx-3); line-height: 1.7; margin: -6px 0 14px; }
.ico { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.c { text-align: center; }

/* ---- 页面头 ---- */
.ph { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ph h1 { font-size: var(--fs-20); font-weight: 600; letter-spacing: -.02em; margin: 0; }
.ph .em { font-size: var(--fs-12); color: var(--tx-3); margin-top: 3px; }

/* ---- 分段控件 ---- */
.seg { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 9px; background: var(--field); }
.seg-i {
  height: 26px; padding: 0 11px; border: none; border-radius: 6px; background: none; cursor: pointer;
  font-size: var(--fs-12); color: var(--tx-3); white-space: nowrap; font-family: inherit;
  transition: background .14s, color .14s;
}
.seg-i:hover { color: var(--tx-2); }
.seg-i.on { background: var(--blue-soft); color: var(--tx); box-shadow: inset 0 0 0 1px var(--blue-line); }

/* ---- 表单项 ---- */
.frow { display: flex; gap: 12px; flex-wrap: wrap; }
.frow > .field { flex: 1 1 180px; margin-bottom: 0; }
.form-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.tools { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 6px; }
.tools .l { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ---- 分页 ---- */
.pager-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
}
.pager-row .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.pager-row .btn.pg-on { background: #1d1d22; border-color: var(--line-3); color: var(--tx); }

/* ---- 汇总条 ---- */
.sum { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; margin-bottom: 14px; }
.sum > div { padding: 14px 16px; border-right: 1px solid var(--line); }
.sum > div:last-child { border-right: none; }
.sum .k { font-size: var(--fs-11); color: var(--tx-3); letter-spacing: .08em; text-transform: uppercase; }
.sum .v { font-size: var(--fs-20); font-weight: 600; letter-spacing: -.02em; margin-top: 3px; font-variant-numeric: tabular-nums; }
/* 汇总栏的来源副行（仅在存在后台补偿/扣减时出现） */
.sum .s { font-size: var(--fs-11); color: var(--tx-3); margin-top: 4px; line-height: 1.5; }

/* ---- 键值网格（会员状态三格） ---- */
.kv3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.kv3 > div { background: var(--panel); padding: 14px 16px; }
.kv3 .k { font-size: var(--fs-11); color: var(--tx-3); letter-spacing: .08em; text-transform: uppercase; }
.kv3 .v { font-size: var(--fs-15); font-weight: 600; margin-top: 5px; font-variant-numeric: tabular-nums; }
.kv3 .n { font-size: var(--fs-11); color: var(--tx-3); margin-top: 3px; }
.kv3 .v .u { font-size: var(--fs-11); font-weight: 400; color: var(--tx-3); margin-left: 2px; }

/* ---- LT 积分卡 ---- */
.pcard-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.pnum { display: flex; align-items: baseline; gap: 7px; margin-top: 2px; }
.pnum .num { font-size: var(--fs-28); font-weight: 600; letter-spacing: -.035em; line-height: 1.15; }
.pnum em { font-style: normal; font-size: var(--fs-12); color: var(--tx-3); }
.pops { display: flex; gap: 8px; flex-wrap: wrap; }
.lbl-brand { display: inline-flex; align-items: center; gap: 6px; color: var(--blue-lt); }
.lbl-brand::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--red); flex: none; }
.lnk { color: var(--tx-2); text-decoration: none; border-bottom: 1px solid var(--line-2); }
.lnk:hover { color: var(--blue-lt); border-bottom-color: var(--blue-line); }

/* ---- 兑换区：左控件 / 右报价 ---- */
.qwrap { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }
.qctl { display: flex; flex-direction: column; gap: 14px; }
.qctl .row { display: flex; gap: 10px; flex-wrap: wrap; }
.qctl .row > .field { flex: 1 1 150px; min-width: 130px; }
.qcur { display: flex; align-items: center; gap: 8px; font-size: var(--fs-12); color: var(--tx-2); flex-wrap: wrap; }
.qcur b { font-weight: 600; color: var(--tx); }
.qper { font-size: var(--fs-12); color: var(--tx-3); line-height: 1.75; }
.qper b { color: var(--tx-2); font-weight: 500; }

.qquote {
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: rgba(255,255,255,.012); padding: 14px 15px;
  display: flex; flex-direction: column; gap: 9px;
}
.qrow { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: var(--fs-12); }
.qrow .qk { color: var(--tx-3); flex: none; }
.qrow .qv { color: var(--tx-2); text-align: right; font-variant-numeric: tabular-nums; }
.qrow .qv b { color: var(--tx); font-weight: 600; }
.qrow .qv em { font-style: normal; color: var(--tx-3); font-size: var(--fs-11); margin-left: 5px; }
.qgo { border-top: 1px solid var(--line); padding-top: 12px; margin-top: 2px; }
.qgo .amt { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.qgo .amt b { font-size: var(--fs-20); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.qgo .amt em { font-style: normal; font-size: var(--fs-11); color: var(--tx-3); margin-left: 1px; }
.qgo .amt .qk { font-size: var(--fs-11); color: var(--tx-3); letter-spacing: .06em; }
.qmiss { font-size: var(--fs-11); color: var(--bad); line-height: 1.7; margin-top: 8px; }
.qmiss a { color: var(--bad); text-decoration: underline; text-underline-offset: 2px; }
.qfine { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr 1fr; gap: 4px 22px; }
.qfine p { font-size: var(--fs-11); color: var(--tx-3); line-height: 1.75; margin: 0; }

/* ---- 权益清单 ---- */
.ents { margin: 0; padding: 0; list-style: none; }
.ent { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-12); }
.ent:last-child { border-bottom: none; }
.ent .nm { color: var(--tx); }
.ent .ok { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-12); color: var(--tx-3); }
.ent .ok svg { width: 13px; height: 13px; stroke: var(--ok); fill: none; stroke-width: 2; }
.ent .no { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-12); color: var(--tx-3); }
.ent .no svg { width: 12px; height: 12px; stroke: #4a4a52; fill: none; stroke-width: 1.6; }
.ent.sub { padding-left: 16px; border-bottom: 1px dashed var(--line-soft); }
.ent.sub .nm { color: var(--tx-2); font-size: var(--fs-12); }
.ent-sub-list { list-style: none; margin: 0; padding: 0; }

/* ============================================================
   v20261103 我的页：三合一额度格 / stepper / 折叠卡 / 等级 tab / 确认弹窗
   这一段的字号与字色随后由视觉基线 token 接管（见文件头部 :root）。
   ============================================================ */

/* ---- 三合一额度格：一格三行，不是三格 ----
   三格会让「1 次 / 30 次 / 12 次」各占一块，用户读不出它们其实是
   同一件事的三个来源。用 display:contents 让每行共享同一套列宽，
   右侧说明列才对得齐。 */
.quota {
  /* 名称 / 数字 / 说明。**说明列必须是 1fr**：写成 auto 的话它只拿内容宽度，
     剩余空间全给中间的数字列，结果「每天 0 点刷新，不累计」在桌面也被挤成两行。 */
  display: grid; grid-template-columns: auto auto 1fr;
  column-gap: 12px; row-gap: 1px;
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: 14px 16px 12px;
}
.q-title { grid-column: 1 / -1; font-size: var(--fs-13); color: var(--tx-3); letter-spacing: .06em; margin-bottom: 4px; }
/* **必须带 .quota 前缀**：这条原本写成全局 `.q-row`，而 2050 行附近
   给调权益弹窗也写过一个 `.q-row{display:flex}`。同权重、后声明者赢 ——
   于是弹窗里每一行（行名/输入框/单位/快捷档）都被拆成竖着堆的四项。
   它只服务于这个额度格，就只在这个格子里生效。 */
.quota .q-row { display: contents; }
.q-k { font-size: var(--fs-14); color: var(--tx-2); padding: 5px 0; }
/* 数字列右对齐并等宽：三行小数点不对齐会显得很随机 */
.q-v { font-size: var(--fs-15); font-weight: 600; color: var(--tx); text-align: right; justify-self: end; padding: 5px 0; white-space: nowrap; }
.q-v i { font-style: normal; font-size: var(--fs-13); font-weight: 400; color: var(--tx-3); margin-left: 3px; }
.q-n { font-size: var(--fs-13); color: var(--tx-3); padding: 5px 0 5px 10px; }
.q-sep { grid-column: 1 / -1; height: 1px; background: var(--line-soft); margin: 8px 0 4px; }

/* ---- Stepper：两种形态，不要合并 ----
   A 形（会员时长）只有 −/值/+，值用 span 渲染，不可键入；
   B 形（兑换次数）中间是 input，可键入。 */
.stepper {
  display: flex; align-items: center; gap: 2px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--field); height: 34px; padding: 0 3px;
}
.step-btn {
  width: 30px; height: 28px; border: none; background: none; color: var(--tx);
  font-size: var(--fs-16); line-height: 1; cursor: pointer; border-radius: 5px; font-family: inherit;
}
.step-btn:hover { background: rgba(255, 255, 255, .06); }
.step-btn[disabled] { opacity: .28; cursor: not-allowed; background: none; }
.step-val { min-width: 62px; text-align: center; font-size: var(--fs-14); color: var(--tx-2); }
.step-val b { font-size: var(--fs-15); color: var(--tx); font-weight: 600; margin-right: 2px; }
/* B 形：input 去掉浏览器自带的数字框与边框，视觉上与 A 形一致 */
.stepper-input input.step-val {
  border: none; background: none; padding: 0; width: 62px;
  font-weight: 600; color: var(--tx); font-family: inherit; text-align: center;
  -moz-appearance: textfield; appearance: textfield;
}
.stepper-input input.step-val::-webkit-outer-spin-button,
.stepper-input input.step-val::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-input input.step-val:focus { outline: none; }

/* ---- 折叠卡 ----
   整行可点，最小高度 40px（移动 48）；展开态不持久化。 */
.acc-h {
  display: flex; align-items: center; gap: 12px; width: 100%;
  min-height: 40px; padding: 0; background: none; border: none;
  color: var(--tx); font-family: inherit; cursor: pointer; text-align: left;
}
.acc-h .t { font-size: var(--fs-16); font-weight: 600; letter-spacing: -.01em; }
.acc-h .p { margin-left: auto; font-size: var(--fs-13); color: var(--tx-3); white-space: nowrap; }
.acc-h .p b { color: var(--tx-2); font-weight: 600; }
.acc-h .arw { color: var(--tx-3); transition: transform .16s ease; flex: none; }
.acc-h[aria-expanded="true"] .arw { transform: rotate(180deg); }
.acc-b { padding-top: 14px; }
/* 折叠头所在卡片：内容收回后别留一大段空白 */
.card > .acc-h:only-child { min-height: 48px; }

/* ---- 等级 tab ---- */
.tabs {
  display: flex; gap: 4px; width: max-content; max-width: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-pill); padding: 4px; margin-bottom: 6px;
  overflow-x: auto;
}
.tab {
  height: 30px; padding: 0 16px; border: none; background: none;
  border-radius: var(--r-pill); color: var(--tx-3); font-size: var(--fs-14);
  font-family: inherit; cursor: pointer; display: inline-flex;
  align-items: center; gap: 6px; white-space: nowrap;
}
.tab:hover { color: var(--tx-2); }
.tab.on { background: var(--surface-3); color: var(--tx); box-shadow: 0 0 0 1px var(--line-2); }
.tab .cur {
  font-size: var(--fs-11); color: var(--blue-lt); border: 1px solid var(--blue-line);
  background: var(--blue-soft); border-radius: var(--r-pill);
  padding: 0 5px; line-height: 15px; letter-spacing: 0;
}
/* 胶囊内的档位价：比等级名弱一档，是补充信息不是主标题 */
.tab .p { font-size: var(--fs-11); color: var(--tx-3); font-weight: 500; }
.tab.on .p { color: var(--tx-2); }

/* tab 下的单位说明：比 .hint 再小一号，不抢间距 */
.tab-note { margin: 0 0 12px; font-size: var(--fs-11); color: var(--tx-3); }
.tier-panel[hidden] { display: none; }

@media (max-width: 640px) {
  /* 390px 下三胶囊加上价格放不下（可用约 314px，价格版约 280px，再带「当前」
     徽标的 42px 就溢出）。两条兜底：padding 省 12px，隐藏徽标省 42px。
     徽标的信息没有丢 —— 卡片头已写「你当前是 X」，选中胶囊也有高亮底。 */
  .tab { padding: 0 14px; }
  .tab .cur { display: none; }
}

/* ---- 权益一览的 ✓ / — ----
   .no 已有（配锁 icon），这里只补 .yes 与「不含」的纯文字形态。
   不用锁：锁会被读成"我被锁住了"，而这表说的是"这一级不含"。 */
.ent .yes { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-13); color: var(--ok); }
.ent-plain { list-style: none; border: none; }

/* ---- 二次确认弹窗内的分行 ---- */
.md-row { display: flex; justify-content: space-between; gap: 12px; font-size: var(--fs-14); padding: 6px 0; }
.md-row .k { color: var(--tx-3); }
.md-row .v { color: var(--tx); font-weight: 500; text-align: right; }
.md-total {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--line-soft);
}
.md-total .k { font-size: var(--fs-13); color: var(--tx-3); }
.md-total .v { font-size: var(--fs-20); font-weight: 600; letter-spacing: -.02em; }
.md-total .v em { font-style: normal; font-size: var(--fs-13); font-weight: 400; color: var(--tx-3); margin-left: 3px; }

/* ---- 弹窗里的余额大数字 ----
   原先是模板内联的 30px 字号，v5 基线禁止新增内联字号，改为类。 */
.md-amount { font-size: var(--fs-28); font-weight: 600; letter-spacing: -.035em; line-height: 1.2; }

/* ---- 积分卡：数值右侧的「积分记录 →」弱化链接 ---- */
.pnum .rec {
  font-size: var(--fs-13); color: var(--tx-3); text-decoration: none;
  margin-left: 6px; border-bottom: 1px solid var(--line-2); padding-bottom: 1px;
  /* 不换行：「积分记录」和「→」被拆到两行时，箭头会孤零零挂在下面 */
  white-space: nowrap;
}
.pnum .rec:hover { color: var(--blue-lt); border-bottom-color: var(--blue-line); }

@media (max-width: 640px) {
  /* 积分卡在窄屏改上下排：数字与记录链接一行，两个按钮下一行各占一半。
     横排时按钮组会把「积分记录 →」挤到第二行，看起来像排版坏了。 */
  .pcard-top { flex-direction: column; align-items: stretch; gap: 12px; }
  .pcard-top .pops { width: 100%; }
  .pcard-top .pops .btn { flex: 1 1 0; min-width: 0; }
  /* 会员卡的「有效期至 …」在窄屏会与左边的等级挤成一团，允许换行 */
  .card-head { flex-wrap: wrap; }
}

/* ---- 结果区里「获得报告次数」这一行要跳出来 ----
   它不是又一个数字，是用户真正关心的产出。 */
.qrow.hero-row { padding: 9px 0; border-top: 1px solid var(--line-soft); margin-top: 5px; }
.qrow.hero-row .qk { color: var(--tx-2); }
.qrow.hero-row .qv { color: var(--ok); font-weight: 600; font-size: var(--fs-16); }
.qrow.hero-row .qv b { color: var(--ok); }
.card-head.tight { margin-bottom: 10px; }
.ph.tight { margin-bottom: 10px; }

/* ============================================================
   五期 · 通知中心 / 客服工单 / 顶栏铃铛 / 到期横幅（2026-11-03）
   ============================================================ */

/* ---- 顶栏铃铛：nav 之后、汉堡之前 ---- */
.bell {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; margin: 0 6px; border-radius: var(--r-sm);
  color: var(--tx-2); text-decoration: none; flex: none;
}
.bell:hover { background: var(--hover); color: var(--tx); }
.bell-dot {
  position: absolute; top: 2px; right: 1px; min-width: 15px; height: 15px;
  padding: 0 4px; border-radius: var(--r-pill);
  background: var(--red); color: var(--on-light);
  font-size: var(--fs-11); font-weight: 700; line-height: 15px;
  text-align: center; letter-spacing: 0;
}
@media (max-width: 640px) {
  /* 移动端热区 44px：铃铛是这一屏最容易被误触的目标 */
  .bell { width: 44px; height: 44px; margin: 0 2px; }
  .bell-dot { top: 6px; right: 4px; }
}

/* ---- 会员到期横幅 ----
   与顶栏同宽（wrap 的 880），不贴边；用语义色底，不用新的强调色。 */
.mem-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  max-width: 880px; margin: 12px auto 0; padding: 10px 16px;
  border-radius: var(--r-sm); font-size: var(--fs-13); line-height: 1.6;
}
.mem-banner .btn { flex: none; }
.mem-banner.warn {
  background: rgba(227, 191, 124, .10);
  border: 1px solid rgba(227, 191, 124, .32);
  color: var(--warn);
}
.mem-banner.bad {
  background: var(--bad-bg);
  border: 1px solid rgba(240, 133, 123, .28);
  color: var(--bad);
}
.mem-banner.warn .btn { border-color: rgba(227, 191, 124, .5); color: var(--warn); }
.mem-banner.bad .btn { border-color: rgba(240, 133, 123, .5); color: var(--bad); }

/* ---- 通知中心：分类 tab ---- */
.ntf-tabs {
  display: flex; gap: 18px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line); overflow-x: auto;
}
.ntf-tabs a {
  color: var(--tx-3); text-decoration: none; font-size: var(--fs-13);
  padding: 10px 0; border-bottom: 2px solid transparent;
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
}
.ntf-tabs a:hover { color: var(--tx-2); }
.ntf-tabs a.on { color: var(--tx); border-bottom-color: var(--blue-lt); }
.ntf-tabs .c {
  font-size: var(--fs-11); color: var(--tx-3); background: var(--surface-3);
  border-radius: var(--r-pill); padding: 0 6px; line-height: 16px;
}

/* ---- 通知列表：整行可点，未读只用一个蓝点表达 ---- */
.ntf-list { border-top: 1px solid var(--line-soft); }
.ntf {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 0 10px;
  align-items: start; padding: 15px 2px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none; color: inherit;
}
.ntf:last-child { border-bottom: none; }
.ntf:hover { background: rgba(255, 255, 255, .02); }
.ntf .ud { width: 6px; height: 6px; border-radius: 50%; background: var(--blue-lt); margin-top: 9px; }
.ntf.read .ud { background: transparent; }
.ntf-t {
  font-size: var(--fs-14); color: var(--tx); font-weight: 500;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.ntf.read .ntf-t { color: var(--tx-2); font-weight: 400; }
.ntf-cat {
  font-size: var(--fs-11); color: var(--tx-3); border: 1px solid var(--line-2);
  border-radius: 5px; padding: 0 6px; line-height: 17px; font-weight: 400;
}
.ntf-b { font-size: var(--fs-12); color: var(--tx-3); margin-top: 4px; line-height: 1.65; }
.ntf-time { font-size: var(--fs-11); color: var(--tx-3); padding-top: 3px; white-space: nowrap; }

/* ---- 客服会话 ---- */
.msgs { display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 76%; }
.msg .who { font-size: var(--fs-11); color: var(--tx-3); margin-bottom: 5px; }
.msg .bub {
  background: var(--surface-3); border: 1px solid var(--line);
  border-radius: 12px 12px 12px 4px; padding: 11px 14px;
  font-size: var(--fs-13); color: var(--tx); line-height: 1.7;
  white-space: pre-wrap; word-break: break-word;
}
.msg.me { margin-left: auto; text-align: right; }
.msg.me .bub {
  background: var(--blue-soft); border-color: var(--blue-line);
  border-radius: 12px 12px 4px 12px; text-align: left;
}

.ta {
  width: 100%; min-height: 64px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--field); color: var(--tx);
  font-family: inherit; font-size: var(--fs-13); padding: 10px 12px;
  resize: vertical; line-height: 1.6;
}
.ta:focus { outline: none; border-color: var(--blue-line); }
.sup-actions {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.sup-link { display: flex; flex-direction: column; gap: 3px; text-decoration: none; min-width: 0; flex: 1 1 auto; }
.sup-subj { color: var(--tx); font-size: var(--fs-14); }
.sup-meta { color: var(--tx-3); font-size: var(--fs-12); }
.sup-right { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.dot-new { width: 7px; height: 7px; border-radius: 50%; background: var(--blue-lt); flex: none; }
.badge-sup {
  font-size: var(--fs-12); border-radius: var(--r-pill); padding: 1px 9px;
  border: 1px solid var(--line-2); color: var(--tx-2); white-space: nowrap;
}
.badge-sup.s-open { color: var(--warn); border-color: rgba(227, 191, 124, .35); }
.badge-sup.s-replied { color: var(--ok); border-color: rgba(136, 223, 178, .35); }
.badge-sup.s-closed { color: var(--tx-3); }

/* ---- 通知中心 · 客服 tab 的「我的留言」常驻块 ----
   与下方通知列表是两个数据源：留言不等客服回复就该在。
   只靠通知列表的话，用户提交完到客服回复之间会"找不到入口"。 */
.sup-home { padding-bottom: 12px; }
.sup-home .ents { margin-top: 2px; }
.sup-acts { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 12px; }
.sup-wait { margin: 4px 0 14px; padding-left: 2px; }
@media (max-width: 640px) {
  .sup-home .ent { min-height: 48px; }         /* 视觉基线 §3：移动端可点行 48px */
  .sup-acts .btn { flex: 1 1 auto; height: 44px; justify-content: center; }
}

/* ---- 后台侧栏未读角标 ---- */
.side-badge {
  margin-left: auto; min-width: 18px; padding: 0 5px;
  border-radius: var(--r-pill); background: var(--red); color: var(--on-light);
  font-size: var(--fs-11); font-weight: 700; line-height: 18px;
  text-align: center; letter-spacing: 0;
}
/* 侧栏折叠成图标时，角标没有位置可放 —— 藏起来而不是挤掉图标 */
body.side-collapsed .side-badge { display: none; }

/* ============================================================
   六期 · 数据中心四屏（2026-11-03）
   纯 CSS 柱状图，不引图表库 —— 一张 echarts 是 1MB，
   而这里要画的只是 7 根柱子。
   ============================================================ */

/* ---- 第一屏：五格 KPI ----
   老 .kpi-grid 是 flex（自动换行），所以要显式改成 grid ——
   只写 grid-template-columns 在 flex 容器上不生效，结果会是
   「四个一行 + 一个孤零零吊在下面」。

   为什么是 5 格而不是 6：原第六格「建链成功率」与下方建链卡里的
   「失败率」同名不同口径（一格随区间、一格固定 24h），同一屏两个同名
   指标一个动一个不动，是误读的主要来源。保留卡片，删掉格子。
   布局用 6 列基准：前 3 格各占 1/3（span 2），后 2 格各占 1/2（span 3），
   两行都撑满，不留半列空白。 */
.kpi-grid.kpi5 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.kpi-grid.kpi5 > .kpi { grid-column: span 2; }
.kpi-grid.kpi5 > .kpi:nth-child(4),
.kpi-grid.kpi5 > .kpi:nth-child(5) { grid-column: span 3; }
@media (max-width: 900px) {
  .kpi-grid.kpi5 { grid-template-columns: repeat(2, 1fr); }
  .kpi-grid.kpi5 > .kpi,
  .kpi-grid.kpi5 > .kpi:nth-child(4),
  .kpi-grid.kpi5 > .kpi:nth-child(5) { grid-column: span 1; }
}
@media (max-width: 640px) { .kpi-grid.kpi5 { grid-template-columns: 1fr; } }
.kpi-sub.bad { color: var(--bad); }

/* ---- 第二屏：两栏链路卡 ---- */
.chain2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-bottom: 14px; }
.chain2 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .chain2 { grid-template-columns: 1fr; } }

/* 四宫格数字：用 1px 间隙露出底色当分隔线，比给每格加边框干净 */
.nums {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
  background: var(--line); border-radius: var(--r-sm); overflow: hidden;
  margin: 4px 0 12px;
}
.nums > div { background: var(--panel); padding: 10px 12px; display: flex; flex-direction: column; }
.nums .k { font-size: var(--fs-11); color: var(--tx-3); letter-spacing: .06em; }
.nums .v { font-size: var(--fs-15); font-weight: 600; color: var(--tx); margin-top: auto; padding-top: 8px; }
.nums .v.bad { color: var(--bad); }
.nums .v.ok { color: var(--ok); }
.nums .v.warn { color: var(--warn); }
/* 窄屏降两列：390px 下四格各约 85px，「频道在线」这种四字标签会折行 */
@media (max-width: 640px) { .nums { grid-template-columns: repeat(2, 1fr); } }

.kv-list { list-style: none; margin: 8px 0 0; padding: 0; }
.kv-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 7px 0; border-bottom: 1px dashed var(--line-soft);
  font-size: var(--fs-12);
}
.kv-list li:last-child { border-bottom: none; }
.kv-list .k { color: var(--tx-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kv-list .v { color: var(--tx); font-variant-numeric: tabular-nums; flex: none; }

/* ---- 频道 7 格 ---- */
.ch-row {
  display: grid; grid-template-columns: 110px 1fr auto auto; gap: 0 14px;
  align-items: center; padding: 9px 0;
  border-bottom: 1px solid var(--line-soft); font-size: var(--fs-12);
}
.ch-row:last-of-type { border-bottom: none; }
.ch-row .nm { color: var(--tx); font-size: var(--fs-13); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-days { display: flex; gap: 4px; }
.dc {
  width: 26px; height: 22px; border-radius: 4px;
  background: var(--surface-3); color: var(--tx-2);
  font-size: var(--fs-11); display: inline-flex; align-items: center;
  justify-content: center; font-variant-numeric: tabular-nums;
}
.dc.zero { color: var(--tx-3); background: var(--surface); }
/* 今天那格弱化：还没过完，0 不是真的 0 */
.dc.today { box-shadow: inset 0 0 0 1px var(--line-3); opacity: .72; }
.ch-row .last { color: var(--tx-3); font-size: var(--fs-11); white-space: nowrap; }
/* 三列版：上面那条定义是四列，给「频道 7 格日期」用的。
   只放「名称 / 人数 / 最后活跃」时若原样复用，频道名会被压进 110px、
   人数横跨中间一整列，看起来像表格错行。 */
.ch-row.only3 { grid-template-columns: 1fr auto auto; }
.ch-row.only3 .last { min-width: 96px; text-align: right; }

/* ---- 状态灯：四档，颜色只用语义色 ---- */
.lamp { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-11); white-space: nowrap; }
.lamp i { width: 6px; height: 6px; border-radius: 50%; display: block; background: currentColor; }
.lamp.ok { color: var(--ok); }
.lamp.warn { color: var(--warn); }
.lamp.bad { color: var(--bad); }
.lamp.off, .lamp.plain { color: var(--tx-3); }
.lamp.ok i { box-shadow: 0 0 0 3px rgba(136, 223, 178, .12); }
.lamp.warn i { box-shadow: 0 0 0 3px rgba(227, 191, 124, .12); }
.lamp.bad i { box-shadow: 0 0 0 3px rgba(240, 133, 123, .12); }

@media (max-width: 640px) {
  /* 窄屏把 7 格换成两行：一行放不下 7×26px + 名称 + 时间 */
  .ch-row { grid-template-columns: 1fr auto; gap: 6px 10px; }
  .ch-days { grid-column: 1 / -1; }
  .ch-row .last { grid-column: 1 / 2; }
  /* 三列版同样降两列。媒体查询不提升特异性，所以这里必须写成 .ch-row.only3 ——
     只写 .ch-row 打不过上面那条 .ch-row.only3 的三列定义。 */
  .ch-row.only3 { grid-template-columns: 1fr auto; }
}

/* ---- 第三屏：四张趋势卡 ---- */
.trend4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 14px; }
.trend4 > .card { margin-bottom: 0; }
@media (max-width: 900px) { .trend4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .trend4 { grid-template-columns: 1fr; } }

.bars { display: flex; align-items: flex-end; gap: 5px; height: 64px; margin-top: 12px; }
.bars span {
  flex: 1; min-height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(180deg, rgba(72, 144, 180, .65), rgba(72, 144, 180, .18));
}
.bars.dual { gap: 2px; }
.bars.dual .in { background: linear-gradient(180deg, rgba(136, 223, 178, .6), rgba(136, 223, 178, .16)); }
.bars.dual .out { background: linear-gradient(180deg, rgba(240, 133, 123, .6), rgba(240, 133, 123, .16)); }
/* 流量双柱（PV / UV）：.in / .out 是「进 / 出」语义，不能借来表示「浏览量」。
   颜色取 --blue-lt 与 --tx-2 的等价 rgba，不是新色值。 */
.bars.traffic .a { background: linear-gradient(180deg, rgba(72, 144, 180, .65), rgba(72, 144, 180, .18)); }
.bars.traffic .b { background: linear-gradient(180deg, rgba(182, 182, 192, .42), rgba(182, 182, 192, .10)); }
/* 图例色标跟着柱子同色。形态沿用 .legend i 的 10×2 短线，不另造方块 */
.legend .pa { background: linear-gradient(180deg, rgba(72, 144, 180, .65), rgba(72, 144, 180, .18)); }
.legend .pb { background: linear-gradient(180deg, rgba(182, 182, 192, .42), rgba(182, 182, 192, .10)); }
.baxis { display: flex; gap: 5px; margin-top: 6px; font-size: var(--fs-11); color: var(--tx-3); }
.baxis span { flex: 1; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 窄屏只留三个轴标签（第 1 / 7 / 14 个）。
   390px 下 14 格每格约 17px，7 个隔天标签会被省略号全部吃光，等于一个都没显示。
   ⚠️ 必须用 visibility，不能用 display:none —— 后者会让剩下 11 个 span 重新均分宽度，
   标签立刻和柱子错位。这三个位置与「14 天固定」绑定，天数一变这套就失效。 */
@media (max-width: 640px) {
  .baxis span { visibility: hidden; }
  .baxis span:nth-child(1),
  .baxis span:nth-child(7),
  .baxis span:nth-child(14) { visibility: visible; }
}

/* ---- 邮件额度卡里的基准同步（从师傅页搬来的） ---- */
.mail-base { margin-top: 10px; border-top: 1px solid var(--line-soft); padding-top: 10px; }
.mail-base summary { cursor: pointer; }
.mail-base-row {
  display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin-top: 10px;
}
.mail-base-row .field { max-width: 170px; }
.mail-base-row .inp-sm { width: 100%; }

/* ---- 后台客服工单：左列表 / 右会话 ---- */
.sup-admin { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.sup-side { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); overflow: hidden; }
.sup-filter { display: flex; gap: 2px; padding: 8px; border-bottom: 1px solid var(--line-soft); flex-wrap: wrap; }
.sup-filter a {
  font-size: var(--fs-12); color: var(--tx-3); text-decoration: none;
  padding: 4px 9px; border-radius: var(--r-sm);
}
.sup-filter a:hover { background: var(--hover); color: var(--tx-2); }
.sup-filter a.on { background: var(--surface-3); color: var(--tx); }
.sup-list { max-height: 620px; overflow-y: auto; }
.sup-item {
  display: block; padding: 11px 13px; text-decoration: none;
  border-bottom: 1px solid var(--line-soft); color: inherit;
}
.sup-item:last-child { border-bottom: none; }
.sup-item:hover { background: rgba(255, 255, 255, .03); }
.sup-item.on { background: var(--surface-3); box-shadow: inset 2px 0 0 var(--blue-lt); }
.sup-item-top { display: flex; align-items: center; gap: 8px; }
.sup-item-subj {
  font-size: var(--fs-13); color: var(--tx);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0;
}
.sup-item-meta {
  display: flex; align-items: center; gap: 8px; margin-top: 5px;
  font-size: var(--fs-11); color: var(--tx-3); flex-wrap: wrap;
}
.sup-item-mail {
  font-size: var(--fs-11); color: var(--tx-3); margin-top: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 超 24 小时没回：只有这一种情况标红。标太多颜色等于没标。 */
.sup-stale { color: var(--bad); }
.sup-item.stale { box-shadow: inset 2px 0 0 var(--bad); }

.sup-main { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 18px 20px 20px; min-height: 300px; }
.sup-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.sup-title { font-size: var(--fs-15); font-weight: 600; color: var(--tx); margin-bottom: 3px; }
.sup-search { display: flex; gap: 8px; align-items: center; }

@media (max-width: 900px) {
  .sup-admin { grid-template-columns: 1fr; }
  .sup-list { max-height: 260px; }
}


/* ---- 积分流水（弹窗内） ---- */
.recs { display: flex; flex-direction: column; }
.rec { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.rec:last-child { border-bottom: none; }
.rec .who { font-size: var(--fs-12); color: var(--tx-2); }
.rec .when { font-size: var(--fs-11); color: var(--tx-3); margin-top: 1px; }
.rec .amt { font-size: var(--fs-15); font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.rec .amt.in { color: var(--ok); }
.rec .amt.out { color: var(--tx-2); }
.rec-empty { font-size: var(--fs-12); color: var(--tx-3); line-height: 1.8; padding: 14px 0; text-align: center; }

/* ---- 批次明细（展开行） ---- */
.det td { background: #050506; }
.det-tbl { width: 100%; border-collapse: collapse; }
.det-tbl th { font-size: var(--fs-11); letter-spacing: .08em; text-transform: uppercase; color: var(--tx-3); text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); font-weight: 500; }
.det-tbl td { padding: 7px 10px; font-size: var(--fs-12); border-bottom: 1px solid #101013; color: var(--tx-2); }
.det-tbl tr:last-child td { border-bottom: none; }
.det-tbl tr:hover td { background: #0b0b0e; }

/* ---- 调权益弹窗内的分行 ---- */
.qf { display: flex; flex-direction: column; gap: 8px; padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.qf:last-of-type { border-bottom: none; }
.qf-h { display: flex; align-items: baseline; gap: 8px; }
.qf-h b { font-size: var(--fs-12); font-weight: 600; }
.qf-h span { font-size: var(--fs-11); color: var(--tx-3); }
.qline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: var(--fs-12); color: var(--tx-3); }
.qline .inp { width: 80px; }
.preview { border: 1px solid var(--line-2); border-radius: var(--r-sm); background: #050506; padding: 11px 13px; margin-top: 14px; }
.preview .k { font-size: var(--fs-11); letter-spacing: .09em; color: var(--tx-3); text-transform: uppercase; }
.preview .v { font-size: var(--fs-12); color: var(--tx); margin-top: 4px; line-height: 1.7; }
.dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line-3); vertical-align: -2px; }
.dot.on { border-color: #fff; background: #fff; box-shadow: inset 0 0 0 3.5px #08080a; }
.inh { font-size: var(--fs-11); color: var(--tx-3); border: 1px solid var(--line); border-radius: 4px; padding: 0 5px; }

/* ============================================================
   浮层短名（用户端积分弹窗 / 后台调权益）
   ------------------------------------------------------------
   与既有后台说明弹窗（.md-head/.md-title/.md-body，880px）并存：
   新浮层多带一个 .md-narrow，宽度收到 440 / 540，避免误伤旧弹窗。
   ============================================================ */
.md-narrow { width: min(440px, 100%); }
.md-narrow.md-lg { width: min(540px, 100%); }
.md-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 18px 20px 0; }
.md-t { font-size: var(--fs-15); font-weight: 600; }
.md-s { font-size: var(--fs-12); color: var(--tx-3); margin-top: 3px; }
.md-b { padding: 16px 20px 20px; overflow: auto; }
.md-f { display: flex; justify-content: flex-end; gap: 8px; padding: 0 20px 18px; }
.md-narrow .md-x { width: 26px; height: 26px; border: none; background: none; color: var(--tx-3); cursor: pointer; border-radius: 6px; display: flex; align-items: center; justify-content: center; flex: none; padding: 0; }
.md-narrow .md-x:hover { background: rgba(255,255,255,.06); color: var(--tx); }

/* ============================================================
   后台数据看板
   ============================================================ */
.kpigrid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; margin-bottom: 14px; }
.kpi { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--panel); padding: 13px 14px; }
.kpi .kl { font-size: var(--fs-11); color: var(--tx-3); letter-spacing: .09em; text-transform: uppercase; }
.kpi .val { font-size: var(--fs-24); font-weight: 600; letter-spacing: -.03em; margin-top: 3px; font-variant-numeric: tabular-nums; display: flex; align-items: baseline; gap: 3px; }
.kpi .val em { font-style: normal; font-size: var(--fs-11); color: var(--tx-3); font-weight: 400; }
.kpi .ks { font-size: var(--fs-11); color: var(--tx-3); margin-top: 4px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.kpi.hero { border-color: rgba(72,144,180,.34); background: linear-gradient(180deg, rgba(72,144,180,.10), rgba(72,144,180,.02)); }

.chart { width: 100%; height: 168px; display: block; overflow: visible; }
.chart .grid { stroke: #191a1e; stroke-width: 1; }
.chart .axis { font-size: var(--fs-11); fill: #5c5c64; }
.legend { display: flex; gap: 16px; margin-top: 10px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-11); color: var(--tx-3); }
.legend i { width: 10px; height: 2px; border-radius: 2px; flex: none; }
.xaxis { display: flex; justify-content: space-between; font-size: var(--fs-11); color: var(--tx-3); margin-top: 2px; font-variant-numeric: tabular-nums; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.split3 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; }

/* ---- 后台页头面包屑 ---- */
.ahead-crumb { font-size: var(--fs-12); color: var(--tx-3); margin-bottom: 14px; }
.ahead-crumb b { color: var(--tx); font-weight: 500; }

/* ---- 空状态 ---- */
.empty-state { border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: 26px 20px; text-align: center; color: var(--tx-3); font-size: var(--fs-12); line-height: 1.8; }

/* ---- 窄屏 ---- */
@media (max-width: 900px) {
  .kpigrid { grid-template-columns: repeat(2, 1fr); }
  .split, .split3 { grid-template-columns: 1fr; }
  .qwrap { grid-template-columns: 1fr; }
  .sum { grid-template-columns: 1fr; }
  .sum > div { border-right: none; border-bottom: 1px solid var(--line); }
  .sum > div:last-child { border-bottom: none; }
  .qfine { grid-template-columns: 1fr; }
  .kv3 { grid-template-columns: 1fr; }
  .ph { flex-wrap: wrap; align-items: flex-start; }
  .card { overflow-x: auto; }
  .card > .tbl { width: auto; min-width: 600px; table-layout: auto; }
}

/* ---- ≤640px：宽表重排成两列网格卡片（v20261107，稿 S15） ----
   为什么必须有这一段：≤900 那条给了 min-width:600px 兜底，640 以下屏幕放不下
   就只能左右滑，运营看一行要滑三屏、还容易串行。
   标签不在模板里手写：base.html 底部的脚本把 thead 的文字抄到 td[data-label]，
   这样新增表格不用再补一遍，列顺序变了也自动跟。
   ⚠️ 必须写在 min-width:600px 之后 —— 同一元素上后写的规则才盖得掉。 */
@media (max-width: 640px) {
  /* 只在后台解除横向滚动：后台的宽表已被脚本改成卡片，不需要滚动；
     用户端的表没被卡片化（见 base.html 那段脚本的 has-sidebar 判断），
     这里若也解除，600px 的表格会顶出屏幕、变成整页横滑。 */
  body.has-sidebar .card { overflow-x: visible; }
  table.tbl.tbl-cards { display: block; width: 100%; min-width: 0; border-collapse: separate; }
  table.tbl.tbl-cards thead { display: none; }
  table.tbl.tbl-cards tbody { display: block; }
  table.tbl.tbl-cards tbody tr {
    display: grid;
    grid-template-columns: minmax(84px, 38%) 1fr;
    gap: 8px 12px;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    align-items: start;
  }
  table.tbl.tbl-cards tbody tr:last-child { border-bottom: none; }
  table.tbl.tbl-cards tbody td {
    display: block; border: none; padding: 0; text-align: left;
    min-width: 0; overflow-wrap: anywhere;
  }
  /* 空单元格（如「操作」列没有按钮）不占位，否则卡片会多出一行空标签 */
  table.tbl.tbl-cards tbody td:empty { display: none; }
  table.tbl.tbl-cards tbody td::before {
    content: attr(data-label);
    display: block; color: var(--tx-3); font-size: var(--fs-11);
    line-height: 1.5; margin-bottom: 2px;
  }
  /* 批次号是 `B20261114-0001` 一整串，禁止折行时它比格子宽 49px，
     会压住右边「张数」的数字。窄屏让它独占一整行 —— 既保住不折行，
     也不用为此放宽字号或改列结构。 */
  table.tbl.invites-batch tbody td:first-child { grid-column: 1 / -1; }
}

/* ---- 兑换码页专用 ---- */
.codewrap {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 4px 14px; max-height: 280px; overflow-y: auto;
  padding: 12px 14px; background: #050506;
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.codeitem { color: var(--tx); font-size: var(--fs-12); letter-spacing: .04em; }
.codebox {
  margin-top: 12px; padding: 12px 14px; background: #050506;
  border: 1px solid var(--blue-line); border-radius: var(--r-sm);
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: var(--fs-14); letter-spacing: .08em; color: var(--tx); text-align: center;
  word-break: break-all;
}

/* 批次行里的二次确认：<details> 展开成一行表单，不弹原生 prompt */
.mini { display: inline-block; }
.mini > summary {
  list-style: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  height: var(--h-sm); padding: 0 10px; border-radius: 7px;
  border: 1px solid var(--line-2); background: transparent; color: var(--tx);
  font-size: var(--fs-12); font-weight: 500;
}
.mini > summary::-webkit-details-marker { display: none; }
.mini > summary:hover { background: rgba(255,255,255,.05); border-color: var(--line-3); }
.mini[open] > summary { border-color: var(--blue-line); background: var(--blue-soft); }
.mini-box {
  display: flex; gap: 6px; align-items: center; justify-content: flex-end;
  position: absolute; right: 12px; margin-top: 6px; z-index: 20;
  padding: 8px; background: #0b0b0e; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); box-shadow: var(--shadow);
}

/* ============================================================
   首页门户（三期改版：三张等宽卡，1px 线，无装饰条）
   ============================================================ */
.home-hero { margin-bottom: 22px; }
.home-hero h1 { margin: 0 0 6px; font-size: var(--fs-24); font-weight: 600; letter-spacing: -.025em; }
.home-hero .sub { margin: 0; font-size: var(--fs-12); color: var(--tx-3); }

.home-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; align-items: stretch; }

.home-card {
  display: flex; flex-direction: column; gap: 0;
  padding: 20px 20px 18px; margin-bottom: 0;
  text-decoration: none; color: inherit;
  transition: border-color .14s ease, background .14s ease;
}
.home-card:hover { border-color: var(--line-3); background: #0b0b0e; }
.home-card.locked { opacity: .72; }

.hc-head { display: flex; align-items: center; gap: 11px; margin-bottom: 12px; }
.hc-icon {
  width: 34px; height: 34px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--field); color: var(--tx-2);
}
.hc-icon .ico { width: 17px; height: 17px; }
.hc-meta { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hc-title { font-size: var(--fs-14); font-weight: 600; color: var(--tx); letter-spacing: -.01em; }
.hc-sub { font-size: var(--fs-11); color: var(--tx-3); }
.hc-desc {
  margin: 0 0 16px; font-size: var(--fs-12); line-height: 1.8; color: var(--tx-2);
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.hc-go {
  margin-top: auto; display: inline-flex; align-items: center; gap: 6px;
  font-size: var(--fs-12); font-weight: 500; color: var(--blue-lt);
}
.home-card.locked .hc-go { color: var(--tx-3); }

@media (max-width: 900px) { .home-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .home-grid { grid-template-columns: 1fr; } }

/* ============================================================
   Passkey 登录（v20261103）
   ------------------------------------------------------------
   共享身份 + 多把钥匙：passkey 是日常路径，密码是兜底。
   密码框默认折叠，「用密码登录」才展开 —— 首屏只留一个动作。
   展开态由 .on 类驱动（见 templates/admin_login.html 底部脚本）。
   无钥匙 / 浏览器不支持时不渲染整块，**不做禁用态**：
   灰按钮只会制造「为什么点不了」的困惑。
   ============================================================ */
.pk-btn { height: 40px; gap: 9px; }
.pk-btn svg { flex: none; }

/* 折叠入口。必须够大够亮：第二个人第一次来只会走这条路，
   做成浅灰小字等于把人挡在门外 —— 44px 是拇指能稳稳点中的下限。 */
.pk-link {
  display: block; width: 100%; margin-top: 4px;
  padding: 12px 14px; min-height: 44px;
  background: none; border: 0; border-radius: var(--r-sm);
  color: var(--tx-2); font-size: var(--fs-12); font-family: inherit;
  text-align: center; cursor: pointer;
  transition: color .14s ease, background .14s ease;
}
.pk-link:hover { color: var(--tx); background: rgba(255, 255, 255, .04); }
/* .pk-link 的 display:block 会盖掉 [hidden] 的 UA 样式，显式补一条 */
.pk-link[hidden] { display: none; }

.pw-form { display: none; margin-top: 4px; }
.pw-form.on { display: block; animation: pk-fade .18s ease; }
/* 没有钥匙时服务端直接铺开，不需要点一次才出现 */
.pw-form-open { display: block; }
@keyframes pk-fade {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: none; }
}

/* 安全设置页：一把钥匙一行 */
.pk-row {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface-2); padding: 12px 14px; margin-bottom: 10px;
}
.pk-ico {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  border: 1px solid var(--line-2);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--tx-3);
}
.pk-main { flex: 1; min-width: 0; }
.pk-label { font-size: var(--fs-14); font-weight: 500; letter-spacing: -.005em; color: var(--tx); }
.pk-meta { font-size: var(--fs-11); color: var(--tx-3); margin-top: 3px; }
.pk-meta .fresh { color: var(--ok); }
.pk-acts { display: flex; gap: 4px; flex: none; }
/* 改名的输入框与按钮同一行，避免为改三个字跳一个页面 */
.pk-rename { display: none; gap: 6px; align-items: center; margin-top: 8px; }
.pk-rename.on { display: flex; }
.pk-rename .inp { height: var(--ctl-h-sm); font-size: var(--fs-12); }
/* 删除确认带：点了「删除」才展开，里面要密码 */
.pk-del { display: none; gap: 6px; align-items: center; margin-top: 8px; }
.pk-del.on { display: flex; }
.pk-del .inp { height: var(--ctl-h-sm); font-size: var(--fs-12); max-width: 200px; }

/* ============================================================
   频道日报（v20261104）
   ------------------------------------------------------------
   模型产出的是受限 HTML，这里负责让它长得像站内的一页。
   **所有规则都限定在 .digest-body 作用域内** —— 日报正文里有 h2/h3/p/table，
   一旦写成全局选择器，会把全站标题样式带跑。
   颜色只用 v3 基线 token，不新增裸 hex。
   涨跌按国内习惯：涨红（--bad）跌绿（--ok）。
   ============================================================ */

/* ---- 列表页 ---- */
/* 每条日报是「左日期块 + 右正文」两栏。日报是一天一篇的横向序列，
   日期本身就是最好的定位锚点；纯文字日期排在标题上方则要逐行读才知道是哪天。 */
.digest-list { display: flex; flex-direction: column; gap: 10px; }
.digest-card {
  display: flex; align-items: stretch; gap: 16px;
  text-decoration: none; color: inherit; padding: 16px 16px 16px 18px;
  transition: border-color .15s ease;
}
.digest-card:hover { border-color: var(--gold-dim); }
.digest-date-block {
  flex: none; width: 56px; text-align: center;
  padding-right: 14px; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; justify-content: center;
}
.dd-num {
  display: block; font-size: var(--fs-24); font-weight: 700;
  color: var(--tx); line-height: 1.1; font-variant-numeric: tabular-nums;
}
.dd-sub {
  display: block; font-size: var(--fs-11); color: var(--tx-3);
  margin-top: 3px; white-space: nowrap;
}
/* 星期单独一行。和「11月」挤一行时 /56px 宽度放不下「11月·周三」，
   会溢到右边的竖线上（实测已发生）。 */
.dd-week {
  display: block; font-size: var(--fs-11); color: var(--tx-3);
  margin-top: 1px; white-space: nowrap;
}
.digest-card-body { flex: 1; min-width: 0; }
.digest-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.digest-date {
  font-size: var(--fs-12); color: var(--tx-3);
  font-variant-numeric: tabular-nums;
}
.digest-card-title {
  font-size: var(--fs-15); font-weight: 600; color: var(--tx);
  line-height: 1.5; margin-bottom: 6px;
}
.digest-card-desc {
  font-size: var(--fs-13); color: var(--tx-2); line-height: 1.75;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.digest-card-meta {
  display: flex; flex-wrap: wrap; gap: 4px 14px;
  margin-top: 8px; font-size: var(--fs-11); color: var(--tx-3);
}
.digest-card-arrow { flex: none; align-self: center; color: var(--tx-3); }
@media (max-width: 520px) {
  .digest-card { gap: 12px; padding: 14px; }
  .digest-date-block { width: 46px; padding-right: 10px; }
  .dd-num { font-size: var(--fs-20); }
  .digest-card-arrow { display: none; }
}

/* ---- 详情页外壳 ---- */
.digest-nav {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.digest-nav-date {
  margin-left: auto; font-size: var(--fs-12); color: var(--tx-3);
  font-variant-numeric: tabular-nums;
}
.digest-foot {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  margin-top: 28px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: var(--fs-12); color: var(--tx-3);
}

/* ---- 正文：基础排印 ---- */
.digest-body { font-size: var(--fs-14); line-height: 1.85; color: var(--tx-2); }
.digest-body p { margin: 0 0 12px; }
.digest-body strong, .digest-body b { color: var(--tx); font-weight: 600; }
.digest-body em, .digest-body i { font-style: normal; color: var(--tx); }
.digest-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: var(--fs-12); color: var(--gold);
  background: var(--surface-2); border-radius: 4px; padding: 1px 5px;
}
.digest-body blockquote {
  margin: 14px 0; padding: 10px 14px;
  border-left: 2px solid var(--gold-dim);
  background: var(--surface-2); border-radius: 0 8px 8px 0;
}
.digest-body ul, .digest-body ol { margin: 0 0 12px; padding-left: 20px; }
.digest-body li { margin-bottom: 4px; }

/* ---- 头部：kicker + 标题 + meta + 导语 ---- */
.digest-body .masthead {
  padding-bottom: 20px; margin-bottom: 22px;
  border-bottom: 1px solid var(--line-2);
}
.digest-body .kicker {
  font-size: var(--fs-11); letter-spacing: .16em; text-transform: uppercase;
  color: var(--tx-3); margin-bottom: 10px;
}
.digest-body .masthead h2 {
  font-size: var(--fs-24); line-height: 1.35; font-weight: 700;
  color: var(--tx); margin: 0 0 14px;
}
.digest-body .meta {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  font-size: var(--fs-12); color: var(--tx-3); margin-bottom: 14px;
}
.digest-body .meta strong { color: var(--tx-2); font-weight: 600; }
.digest-body .lede {
  font-size: var(--fs-15); line-height: 1.9; color: var(--tx-2); margin: 0;
}

/* ---- 数据条：四格 ---- */
.digest-body .stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin: 20px 0 26px;
}
.digest-body .stat {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 12px 14px;
}
.digest-body .stat .n {
  font-size: var(--fs-24); font-weight: 700; color: var(--tx);
  line-height: 1.2; font-variant-numeric: tabular-nums;
}
.digest-body .stat .n small {
  font-size: var(--fs-13); font-weight: 500; color: var(--tx-3); margin-left: 2px;
}
.digest-body .stat .l { font-size: var(--fs-12); color: var(--tx-3); margin-top: 4px; }
@media (max-width: 640px) {
  .digest-body .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---- 分节标题 ---- */
.digest-body section { margin: 30px 0 0; }
.digest-body .sec-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  padding-bottom: 8px; margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.digest-body .sec-head .num {
  font-size: var(--fs-20); font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.digest-body .sec-head h2 {
  font-size: var(--fs-16); font-weight: 600; color: var(--tx); margin: 0;
}
.digest-body .sec-head .note {
  margin-left: auto; font-size: var(--fs-12); color: var(--tx-3);
}

/* ---- 立场标签：涨红跌绿，中性取辅助灰 ---- */
.digest-body .stance {
  display: inline-block; padding: 1px 9px; border-radius: 999px;
  font-size: var(--fs-12); font-weight: 600; white-space: nowrap;
}
.digest-body .s-up   { color: var(--bad); background: var(--bad-bg); }
.digest-body .s-down { color: var(--ok);  background: var(--ok-bg); }
.digest-body .s-flat { color: var(--tx-3); background: var(--idle-bg); }

/* ---- 01 对比矩阵 ---- */
/* max-width: 100% 是保险：overflow-x:auto 的元素若被内容撑开，
   会把整页带出横向滚动条（手机上表现为「整页左右晃」）。 */
.digest-body .matrix-scroll { overflow-x: auto; max-width: 100%; margin: 0 0 8px; }
.digest-body .matrix {
  /* v5 转置后列变成维度（一列一个），列数比旧版多 1~2 列，
     最小宽从 620 提到 720，否则维度名会被挤成竖排换行。 */
  width: 100%; min-width: 720px;
  border-collapse: collapse; font-size: var(--fs-13);
}
.digest-body .matrix th, .digest-body .matrix td {
  border: 1px solid var(--line); padding: 10px 12px;
  text-align: left; vertical-align: top;
}
.digest-body .matrix thead th {
  background: var(--surface-2); color: var(--tx-2); font-weight: 600;
}
.digest-body .matrix thead th { white-space: nowrap; }
.digest-body .matrix tbody th {
  /* 转置后行首是频道名：给个固定宽，让同一列的四五个频道名对齐 */
  width: 132px; background: var(--surface-2); color: var(--tx); font-weight: 600;
  white-space: nowrap;
}
.digest-body .matrix .sub {
  display: block; font-size: var(--fs-11); font-weight: 400; color: var(--tx-3);
  margin-top: 2px;
}
.digest-body .matrix .body { margin-top: 6px; color: var(--tx-2); line-height: 1.7; }

/* ---- 02 各家观点明细 ---- */
/* v5：改成"一个频道一张卡"（2026-11-04 按宇辰给的标准样式）。
   旧版 st-row 一案一条平铺仍保留样式 —— 改版前生成的稿子还要能正常显示。 */
.digest-body .st-card {
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 16px 18px; margin: 0 0 14px;
}
.digest-body .st-card:last-child { margin-bottom: 0; }
.digest-body .st-card-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding-bottom: 10px; margin-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}
.digest-body .st-idx {
  font-size: var(--fs-12); font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.digest-body .st-name { font-size: var(--fs-15); font-weight: 600; color: var(--tx); }
.digest-body .st-alias {
  font-size: var(--fs-11); color: var(--tx-3);
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px;
}
.digest-body .st-meta {
  margin-left: auto; font-size: var(--fs-12); color: var(--tx-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.digest-body .st-list {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-direction: column; gap: 10px;
}
.digest-body .st-item {
  position: relative; padding-left: 14px;
  font-size: var(--fs-13); line-height: 1.85; color: var(--tx-2);
}
.digest-body .st-item::before {
  content: ""; position: absolute; left: 2px; top: .72em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--tx-3);
}
.digest-body .st-k { font-weight: 600; color: var(--tx); }
.digest-body .st-t {
  display: inline-block; margin-left: 6px; padding: 0 6px;
  border-radius: 4px; background: var(--surface-3);
  font-size: var(--fs-11); color: var(--tx-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.digest-body blockquote.st-quote {
  margin: 12px 0 0; padding: 10px 14px;
  background: var(--surface-3); border-left: 2px solid var(--gold-dim);
  border-radius: 0 8px 8px 0;
  font-size: var(--fs-12); line-height: 1.8; color: var(--tx-2);
}
.digest-body .st-src {
  display: block; margin-top: 6px;
  font-size: var(--fs-11); color: var(--tx-3);
}
.digest-body .st-row {
  display: grid; grid-template-columns: 132px 1fr; gap: 14px;
  padding: 10px 0; border-bottom: 1px solid var(--line-soft);
}
.digest-body .st-row:last-child { border-bottom: none; }
.digest-body .st-row .who {
  font-size: var(--fs-12); color: var(--tx-3);
  font-variant-numeric: tabular-nums;
}
.digest-body .st-row .what { font-size: var(--fs-13); line-height: 1.8; color: var(--tx-2); }
@media (max-width: 640px) {
  .digest-body .st-row { grid-template-columns: 1fr; gap: 4px; }
}

/* ---- 03 / 04 共识与分歧 ---- */
.digest-body .cons-item, .digest-body .div-item {
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.digest-body .cons-item:last-child, .digest-body .div-item:last-child {
  border-bottom: none;
}
.digest-body .b-head {
  display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap;
  margin-bottom: 6px;
}
.digest-body .b-idx {
  font-size: var(--fs-12); font-weight: 700; color: var(--gold);
  font-variant-numeric: tabular-nums;
}
.digest-body .b-name { font-size: var(--fs-14); font-weight: 600; color: var(--tx); }
.digest-body .b-count { font-size: var(--fs-12); color: var(--tx-3); }
.digest-body .stances { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.digest-body .body { font-size: var(--fs-13); line-height: 1.8; color: var(--tx-2); }

/* ---- 05 数据说明 ---- */
.digest-body .notes h3 {
  font-size: var(--fs-13); font-weight: 600; color: var(--tx-2);
  margin: 16px 0 6px;
}
.digest-body .notes h3:first-child { margin-top: 0; }
.digest-body .notes ul { margin: 0; padding-left: 20px; }
.digest-body .notes li { font-size: var(--fs-13); line-height: 1.8; color: var(--tx-3); }

/* 频道页的日报置顶入口：与下方频道列表拉开一档间距，
   视觉上是"给整个板块做汇总"的一层，不是又一个频道。 */
.ch-digest { margin-bottom: 12px; }
.ch-digest .ch-ico { font-size: var(--fs-12); font-weight: 700; letter-spacing: -.02em; }

/* 后台：可勾选的多行列表（频道日报的内容来源）。
   用 grid auto-fill 而不是 flex：频道数量不定，网格能自动排成整齐的列，
   flex-wrap 会在最后一列留下宽度不一的碎片。 */
.chk-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px; margin-top: 12px;
}
.chk {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2);
  font-size: var(--fs-13); color: var(--tx); cursor: pointer;
}
.chk:hover { border-color: var(--line-2); }
.chk input[type="checkbox"] {
  width: 15px; height: 15px; flex: none; cursor: pointer;
  accent-color: var(--gold);
}
.chk-meta {
  margin-left: auto; font-size: var(--fs-11); color: var(--tx-3);
  white-space: nowrap;
}
/* 第三档提示条：进来说明「需要留意」但不阻塞操作。沿用 alert-err/ok 的形状。 */
.alert-warn { background: var(--run-bg); border-color: rgba(227,191,124,.28); color: var(--run); }

/* 日报正文：窄屏收敛
   25px 的标题在 390px 下会占三行，把导语挤到首屏之外；
   矩阵的 620px 最小宽在手机上要滑两屏才能看完四个频道，收到 560 少滑一点
   （仍然保留横向滚动 —— 压成两列会让 6 个维度读起来串行，更糟）。 */
@media (max-width: 640px) {
  .digest-body .masthead h2 { font-size: var(--fs-20); line-height: 1.4; }
  .digest-body .lede { font-size: var(--fs-14); line-height: 1.85; }
  .digest-body .matrix { min-width: 640px; }
  .digest-body .stat .n { font-size: var(--fs-20); }
}

/* ============================================================
   频道日报 · 定时生成的可视化配置（v20261105）
   ------------------------------------------------------------
   时间 + 星期这一组。取消勾选「开启」时整体降透明，但**不禁用** ——
   禁用会让字段不提交，用户刚选好的会被静默丢掉。
   ============================================================ */
.dg-when {
  margin-top: 16px; display: flex; flex-direction: column; gap: 18px;
  transition: opacity .2s ease;
}
.dg-when.is-off { opacity: .42; }
/* .field 自带 margin-bottom，栏间距交给 gap，否则两处叠加成 32px 的豁口 */
.dg-when .field { margin-bottom: 0; }

/* 星期用可点的小块（pill）而不是默认复选框：
   点击区域更大，一眼看得出哪几天被选中。 */
.dg-week { display: flex; flex-wrap: wrap; gap: 8px; }
.dg-day { position: relative; display: inline-flex; }
.dg-day input { position: absolute; opacity: 0; width: 0; height: 0; }
.dg-day span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 52px; height: 32px; padding: 0 10px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  font-size: var(--fs-13); color: var(--tx-2);
  background: var(--field); cursor: pointer; user-select: none; transition: .15s;
}
.dg-day span:hover { border-color: var(--line-3); }
.dg-day input:checked + span {
  border-color: var(--blue-line); background: var(--blue-soft); color: var(--tx);
}
.dg-day input:focus-visible + span { outline: 2px solid var(--blue-line); outline-offset: 2px; }

/* ============================================================
   周刊后台重构（v20261117）
   ------------------------------------------------------------
   命名：本期新增类统一 .bf- 前缀。先查过现有类 —— .chip / .badge /
   .kv / .empty / .pager / .tabs / .alert 都已存在，直接复用，不造同名变体。
   这里只补真正缺的：工具条、字段网格、进度条、失败提示条、上传结果、轻提示。

   约束：颜色一律走 token（--line / --line-2 / --surface-2 / --field / --bad …），
   不在模板里写 rgba()。模板内联 style 只允许图标尺寸一类无法用类表达的。
   ============================================================ */

/* 卡片头右侧的操作区：把按钮推到右边，卡片头仍是 space-between */
.bf-cardops { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* 材料录入的两个 details：闭合时只占按钮宽，展开时独占整行，
   否则 inline-block 的 details 会把里面的表单挤成一条窄缝 */
.bf-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; margin-bottom: 14px; }
.bf-mini { display: block; width: 100%; }
.bf-toolbar > .bf-mini { width: auto; }
.bf-toolbar > .bf-mini[open] { flex: 1 1 100%; width: 100%; }
.bf-mini-body { padding: 14px 2px 4px; }
.bf-pwd { margin: 4px 0 10px; }

/* 字段网格：一行放几个字段，窄屏自动折行 */
.bf-grid { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 4px; }
.bf-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; min-width: 0; }
.bf-field > span { font-size: var(--fs-11); color: var(--tx-3); }
.bf-field.bf-grow, .bf-grow { flex: 1 1 220px; min-width: 0; }
.bf-field.bf-w130 { flex: 0 0 130px; }
.bf-field.bf-w150 { flex: 0 0 150px; }
.bf-field.bf-w160 { flex: 0 0 160px; }
.bf-field.bf-w180 { flex: 0 0 180px; }
.bf-field.bf-w200 { flex: 0 0 200px; }
.bf-field.bf-w340 { flex: 0 0 340px; }
.bf-formops { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.bf-check { display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
            font-size: var(--fs-12); color: var(--tx-2); margin-bottom: 10px; }

/* 多行输入与等宽小字 */
.bf-ta { height: auto; padding: 9px 11px; line-height: 1.65; resize: vertical; width: 100%; }
.bf-mono { font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace; font-size: var(--fs-12); }
.bf-file { height: auto; padding: 6px 10px; }

/* 表格里的列宽与数字 */
th.bf-w52 { width: 52px; } th.bf-w64 { width: 64px; } th.bf-w70 { width: 70px; }
th.bf-w80 { width: 80px; } th.bf-w88 { width: 88px; } th.bf-w90 { width: 90px; }
th.bf-w110 { width: 110px; } th.bf-w120 { width: 120px; } th.bf-w150 { width: 150px; }
th.bf-w190 { width: 190px; }
.bf-num { font-variant-numeric: tabular-nums; color: var(--tx-2); }
.bf-hint { font-size: var(--fs-11); color: var(--tx-3); line-height: 1.7; }
.bf-bad { color: var(--bad); }
.bf-link { color: var(--blue-lt); text-decoration: none; }
.bf-link:hover { text-decoration: underline; }
.bf-err { color: var(--bad); font-size: var(--fs-11); margin-top: 4px; max-width: 280px;
          overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 拖拽手柄与拖拽态 */
.bf-handle-cell { width: 30px; cursor: grab; text-align: center; user-select: none; letter-spacing: 0; }
tr.bf-drag { opacity: .4; }
tr.bf-over td { border-top: 2px solid var(--blue-lt); }

/* 顶部失败提示条（列表页看全站最近一次，详情页看本期） */
.bf-alert {
  display: flex; gap: 10px; align-items: flex-start;
  border: 1px solid var(--red-line); background: var(--bad-bg);
  border-radius: var(--r-md); padding: 11px 14px; margin-bottom: 14px;
  font-size: var(--fs-12); color: var(--tx-2); line-height: 1.75;
}
.bf-alert b { color: var(--bad); }

/* 说明条（虚线框）：材料区的「改动只影响后续生成」这类口径说明 */
.bf-note {
  border: 1px dashed var(--line-2); border-radius: var(--r-md);
  padding: 12px 14px; margin: 0 0 14px;
  font-size: var(--fs-11); color: var(--tx-3); line-height: 1.8;
}
.bf-note b { color: var(--tx-2); }

/* 筛选条：复用 .tabs/.tab 胶囊，只补搜索框与间距 */
.bf-filter { margin-bottom: 12px; }
.bf-search { width: 200px; }

/* 生成进度 */
.bf-progress {
  border: 1px solid var(--line-2); border-radius: var(--r-md);
  padding: 12px 14px; margin-bottom: 14px; background: var(--surface-2);
}
.bf-progress-head { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.bf-bar { height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; margin-top: 8px; }
.bf-bar i { display: block; height: 100%; width: 0; background: var(--grad-brand);
            transition: width .4s ease; }

/* 上传材料：逐文件结果 */
.bf-upload-result {
  margin-top: 12px; border: 1px solid var(--line-2); border-radius: var(--r-sm);
  padding: 10px 12px; background: var(--field);
}
.bf-ur-row { font-size: var(--fs-12); line-height: 1.8; }
.bf-ur-ok { color: var(--ok); }
.bf-ur-bad { color: var(--bad); }

/* 设置页运行记录：失败整行标红（置顶由模板排序完成） */
.bf-row-bad td { background: var(--bad-bg); }

/* 弹层：复用 .modal-mask / .modal / .modal-actions，只放宽与补标题副行 */
.bf-modal { max-width: 960px; padding: 20px 22px; }
.bf-pv-tag { margin: 0 0 10px; font-size: var(--fs-11); color: var(--tx-3); }
.bf-pv-meta { line-height: 1.9; }
.bf-pv-warn { color: var(--bad); font-size: var(--fs-12); margin-right: auto; }
.bf-del-title { margin: 0 0 8px; font-size: var(--fs-14); color: var(--tx); }
.bf-danger-note { margin: 0 0 8px; font-size: var(--fs-14); color: var(--bad); font-weight: 600; }
body.bf-modal-open { overflow: hidden; }

/* 轻提示：只用于「顺序已保存」这类一次性反馈，不做常驻提示条 */
.bf-toasts {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center;
}
.bf-toast {
  background: var(--surface-3); border: 1px solid var(--line-2);
  border-left: 3px solid var(--ok); border-radius: var(--r-sm);
  padding: 10px 16px; font-size: var(--fs-12); color: var(--tx);
  box-shadow: var(--shadow); opacity: 1; transition: opacity .26s ease;
}
.bf-toast.bad { border-left-color: var(--bad); }

@media (max-width: 640px) {
  /* 窄屏表格已由 base.html 重排成「标签 + 值」，拖拽手柄没有可拖的语义 */
  .bf-handle-cell { display: none !important; }
  .bf-search { width: 100%; }
  .bf-cardops { margin-left: 0; }
  .bf-field, .bf-field.bf-w130, .bf-field.bf-w150, .bf-field.bf-w160,
  .bf-field.bf-w180, .bf-field.bf-w200, .bf-field.bf-w340 { flex: 1 1 100%; }
  .bf-toasts { left: 12px; right: 12px; transform: none; align-items: stretch; }
}

/* 窄屏（≤640px）下表格由 base.html 重排成「标签 + 值」卡片，操作列必须独占整行：
   .ops 带 white-space:nowrap，放在 38% 宽的网格单元里会把按钮顶出卡片右边缘
   （390 视口下「看会员端」会被裁掉）。只对周刊三张表生效，不改动其它后台页面。 */
@media (max-width: 640px) {
  table.tbl.bf-list tbody td.ops,
  table.tbl.bf-mat tbody td.ops,
  table.tbl.bf-ver tbody td.ops {
    grid-column: 1 / -1;
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
    white-space: normal; text-align: left; padding-top: 6px;
  }
  table.tbl.bf-list tbody td.ops::before,
  table.tbl.bf-mat tbody td.ops::before,
  table.tbl.tbl-cards.bf-ver tbody td.ops::before { content: none; display: none; }
  table.tbl.bf-mat tbody td.ops form.inline,
  table.tbl.bf-ver tbody td.ops form.inline { margin-left: 0; }
}

/* 窄屏触控目标：.btn-sm 在桌面是 28~36px，手指点不稳（验收单 D-3 要求 ≥44px）。
   只抬周刊三个页面的操作按钮，不动 .btn-sm 全局尺寸 —— 其余后台页面以桌面为主，
   全局改动会牵连到没做窄屏适配的表格。 */
@media (max-width: 640px) {
  .head-ops .btn,
  .bf-cardops .btn,
  table.tbl.bf-list tbody td.ops .btn,
  table.tbl.bf-mat tbody td.ops .btn,
  table.tbl.bf-ver tbody td.ops .btn {
    min-height: 44px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* ===== 指标看板 v20261122 ===== */
.card-indicators { display: flex; flex-direction: column; gap: 26px; }
.ind-block { border-top: 1px solid var(--line); padding-top: 18px; }
.ind-block-head { display: flex; align-items: center; gap: 10px; }
.ind-h3 { font-size: var(--fs-14); font-weight: 600; color: var(--tx); margin: 0; }
.ind-tag { font-size: var(--fs-11); color: var(--run, var(--gold)); border: 1px solid var(--line-2); border-radius: 999px; padding: 1px 8px; }
.ind-tag[hidden] { display: none; }
.ind-note { font-size: var(--fs-11); color: var(--tx-3); margin: 8px 0 12px; line-height: 1.6; }
.ind-chart { width: 100%; }
.ind-chart-tall { height: 300px; }
.ind-gauge { height: 240px; min-width: 220px; }
.ind-fg-grid { display: grid; grid-template-columns: 260px 1fr; gap: 16px; align-items: center; }
.ind-detail { margin-top: 10px; font-size: var(--fs-12); color: var(--tx-2); }
.ind-detail-title { color: var(--tx); font-weight: 600; margin-bottom: 6px; }
.ind-detail-sub { color: var(--tx-3); margin: 8px 0 4px; }
.ind-row { display: flex; justify-content: space-between; padding: 3px 0; border-bottom: 1px solid var(--line-soft); }
.ind-pos { color: var(--red); }
.ind-neg { color: var(--ok); }
.ind-updated { font-size: var(--fs-11); }
.ind-empty { display: flex; align-items: center; justify-content: center; height: 100%; min-height: 180px; color: var(--tx-3); font-size: var(--fs-12); border: 1px dashed var(--line); border-radius: 8px; text-align: center; padding: 16px; }
@media (max-width: 640px) {
  .ind-fg-grid { grid-template-columns: 1fr; }
  .ind-gauge { height: 220px; }
  .ind-chart-tall { height: 260px; }
}
