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

* { box-sizing: border-box; }

/* [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 {
  background: var(--bg);
  background-image: radial-gradient(1100px 620px at 22% -12%, var(--bg-glow) 0%, rgba(20, 48, 77, 0) 62%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "PingFang SC", -apple-system, BlinkMacSystemFont, "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* Topbar */
.topbar {
  background: linear-gradient(180deg, #10263d 0%, #0c1c2e 100%);
  border-bottom: 1px solid rgba(217, 185, 92, .35);
  box-shadow: 0 1px 0 rgba(217, 185, 92, .12), 0 8px 24px -18px rgba(0, 0, 0, .9);
}
.bar-inner { display: flex; align-items: center; justify-content: space-between; height: 66px; }
.brand { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; }
.brand-logo {
  /* v20261011 新 logo（LT 2.1）：透明底彩色笔画，负空间已抠除。
     原来给灰底图形加的金色描边 + object-fit:cover 会切掉笔画，必须去掉。 */
  width: 46px; height: 40px; object-fit: contain; display: block;
}
.brand-text { font-size: 16px; font-weight: 600; letter-spacing: .5px; }
.bar-nav a {
  color: #a9bdd1; text-decoration: none; margin-left: 22px; font-size: 14px;
  padding-bottom: 2px; border-bottom: 1px solid transparent; transition: color .15s ease, border-color .15s ease;
}
.bar-nav a:hover { color: #fff; border-bottom-color: var(--gold); }

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

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

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

/* ============================================================
   表单控件统一规范 · v9.2
   ------------------------------------------------------------
   全站 input / select / textarea 共用同一套视觉 token：
   - 高度 34px（紧凑场景 .inp-sm/.sel-sm 30px）
   - 字号 14px（紧凑 13px）—— 修复 .inp-sm 12px 在筛选框里
     「字体大小奇怪」的全站性问题
   - select 自绘下拉箭头（appearance:none + 内嵌 SVG），
     彻底摆脱原生控件在暗色主题下的不一致渲染
   ============================================================ */
:root {
  --ctl-h: 34px;            /* 标准控件高度 */
  --ctl-h-sm: 30px;         /* 紧凑控件高度（筛选条/表格外） */
  --ctl-bg: rgba(10, 22, 36, .75);
  --ctl-font: 14px;
  --ctl-font-sm: 13px;
}

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

/* 统一原生下拉：自绘箭头，尺寸/字体与 .inp 一致 */
.sel {
  height: var(--ctl-h); padding: 0 30px 0 12px;
  border: 1px solid var(--line); border-radius: 8px;
  font-size: var(--ctl-font); color: var(--text); background: var(--ctl-bg);
  outline: none; font-family: inherit; cursor: pointer;
  appearance: none; -webkit-appearance: none;
  /* 箭头用 currentColor 画不了（background 不吃 currentColor），用主题金色 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238ba0b6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 9px center;
  transition: border-color .15s ease, box-shadow .15s ease;
  max-width: none;
}
.sel:hover { border-color: #3a5f85; }
.sel:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(217, 185, 92, .14); }
.sel option { background: var(--surface-2); color: var(--text); }

/* 紧凑变体：筛选条、表格内 */
.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: 28px; background-position: right 8px center; }

/* 旧类收口：.inp-sm 原为 12px/3px padding 的表格内迷你控件，
   被筛选条、搜索框复用后字号突兀。统一到紧凑 token 上。 */
.inp-sm {
  border: 1px solid var(--line); background: var(--ctl-bg); color: var(--text);
  max-width: none; padding: 0 10px;
}
/* 表格内联编辑（额度/排序这类纯数字小框）单独收窄 */
.tbl .inp-sm { max-width: 150px; }

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

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

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

/* Table */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th {
  text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-weight: 500; font-size: 12.5px; letter-spacing: 1px;
  background: rgba(10, 22, 36, .35); text-transform: none; white-space: nowrap;
}
.tbl td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.tbl tbody tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s ease; }
.tbl tbody tr:hover td { background: rgba(255, 255, 255, .022); }
.tbl tr.row-disabled td { background: rgba(240, 145, 129, .045); }
.right { text-align: right; }
.ops { white-space: nowrap; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }
/* 生成进度小字（后台报告列表操作列）：窄列内允许换行，与下方「⋯」保持间距 */
.stage-line { line-height: 1.35; margin-bottom: 2px; }
.err-line { color: var(--bad); font-size: 12.5px; margin-top: 4px; }

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


/* Badges */
.badge {
  display: inline-block; padding: 3px 11px; border-radius: 20px; font-size: 12.5px;
  background: var(--idle-bg); color: var(--muted); border: 1px solid transparent;
}
.badge.ok { background: var(--ok-bg); color: var(--ok); border-color: rgba(94, 207, 161, .25); }
.badge.bad { background: var(--bad-bg); color: var(--bad); border-color: rgba(240, 145, 129, .25); }
.badge.run { background: var(--run-bg); color: var(--run); border-color: rgba(232, 199, 116, .25); }
/* 师傅徽章（报告列表分类：巴菲特/红杯子/LT老技师） */
.m-badge {
  display: inline-block; padding: 1px 9px; margin-right: 8px;
  border-radius: 10px; font-size: 11.5px; font-weight: 600; vertical-align: 1px;
}
.m-badge.lv { color: var(--accent); border: 1px solid rgba(76, 154, 255, .45); background: rgba(76, 154, 255, .10); }
.m-badge.t { color: var(--ok); border: 1px solid rgba(94, 207, 161, .45); background: rgba(94, 207, 161, .10); }
.m-badge.bf { color: var(--gold); border: 1px solid rgba(217, 185, 92, .45); background: rgba(217, 185, 92, .10); }
.chip {
  font-size: 12.5px; color: #a9bacb; background: rgba(20, 39, 60, .8);
  padding: 4px 12px; border-radius: 20px; border: 1px solid var(--line-soft); letter-spacing: .3px;
}

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

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

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

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

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

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

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

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

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

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

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

/* ---- 邀请码生成表单 · v20261011 ----
   问题：这段表单原先用 .row-form（display:flex; align-items:center），
   但「可用次数」下方多一行 .label-hint，导致该列比相邻列高，
   居中对齐后整行输入框上下错位（截图里第 2 个框明显偏高）。
   解决：改用 grid + align-items:end，并给所有输入框固定同一行高，
   label / 输入框 / 提示文字三段严格对齐；提交按钮独立占一行右侧。 */
.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 input { height: 42px; }
.invite-form .field:has(.label-hint) input { margin-bottom: 0; }
.invite-form .label-hint { display: block; line-height: 14px; }
/* 提示文字占位：没有 hint 的字段补一个等高空位，保证输入框同一水平线 */
.invite-form .field::after {
  content: ''; display: block; height: 14px; margin-top: 4px;
}
.invite-form .field:has(.label-hint)::after { display: none; }
.invite-form .btn { align-self: end; height: 42px; 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: 12px; font-family: inherit;
}
.link-btn:hover { text-decoration: underline; }

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

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

/* 邀请码页表格列宽：7 列在窄屏会挤爆，「备注」被压成竖排一列字。
   用 col 元素的显式宽度而不是 nth-child —— 后者在 table-layout:fixed 下
   与实际列序错位（PDF 渲染下可见徽章与列标题对不上）。 */
.tbl.invites-table { table-layout: fixed; width: 100%; }
.tbl.invites-table col.c-code  { width: 132px; }
.tbl.invites-table col.c-label { width: auto; }   /* 备注吃掉剩余空间 */
.tbl.invites-table col.c-state { width: 64px; }
.tbl.invites-table col.c-used  { width: 82px; }
.tbl.invites-table col.c-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; }

/* ---- 分析师管理页 · 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: 11px;
}

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

/* 登录页品牌区：logo + eyebrow 竖排 */
.login-brand {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; margin-bottom: 4px;
}
.login-brand .login-logo {
  width: 64px; height: 64px;
  /* 新 logo 为彩色笔画（蓝 #006BA0 / 红 #FC6D6D），本身已有足够对比度，
     不需要为「立得住」而额外描边；只留极轻阴影托住层次。 */
  object-fit: contain;
  box-shadow: 0 2px 10px rgba(31, 35, 40, .10);
}
.login-brand .login-eyebrow { margin: 0; }

/* 顶栏 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: 12px;
}
.alt-path-line { flex: 1; height: 1px; background: var(--line); }
.alt-path-text { white-space: nowrap; }
.alt-path-btn {
  display: block; text-align: center; text-decoration: none;
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
}
.alt-path-btn:hover { background: var(--surface-2); border-color: #3a5f85; }

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

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

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

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

/* 侧栏本体：贴在顶栏下方的固定条 */
.sidebar {
  position: fixed; top: var(--top-h); left: 0; z-index: 40;
  width: var(--side-w);
  height: calc(100vh - var(--top-h));
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  overflow-y: auto; overflow-x: hidden;
  transition: width .18s ease;
  padding: 12px 8px;
}
.side-nav { display: flex; flex-direction: column; gap: 2px; }

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

.side-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 7px;
  color: var(--muted-2); text-decoration: none;
  font-size: 13.5px; line-height: 1.4; white-space: nowrap;
  transition: background .12s, color .12s;
}
.side-item:hover { background: var(--surface-2); color: var(--ink); }
.side-item.on { background: #eef4ff; color: #1f5fbf; font-weight: 600; }
.side-ico {
  flex: none; width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
/* Lucide 内联 SVG：随文字色走（currentColor），悬停/选中自动变色 */
.side-ico svg { width: 16px; height: 16px; display: block; }
.side-label { overflow: hidden; text-overflow: ellipsis; }
/* 二级子项：缩进 + 小一号字，视觉上归属父项（如「用户管理 → 邀请码」） */
.side-sub { margin: -2px 0 2px 12px; padding: 6px 10px; font-size: 12.5px; }
.side-sub .side-ico { width: 12px; opacity: .7; }
.side-sub.on { background: #eef4ff; color: #1f5fbf; font-weight: 600; }

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

/* 折叠开关按钮：图标化，折叠态箭头翻转为向右（表示「展开」） */
.side-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px;
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--surface-3); cursor: pointer; color: var(--muted);
  padding: 0;
  transition: background .12s, color .12s, border-color .12s;
}
.side-toggle svg { width: 14px; height: 14px; transition: transform .18s ease; }
.side-toggle:hover { background: var(--surface-2); color: var(--ink); border-color: #3a5f85; }
.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
   ============================================================ */
.page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.page-title { font-size: 19px; font-weight: 600; margin: 0; }

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

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

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

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

/* ---- 报告列表：筛选条 / 下拉菜单 / 分页 ---- */
.filter-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: 12px;
}
.filter-count { font-size: 12.5px; color: var(--muted-2); margin-left: auto; }
/* 右上角「用户：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: 11.5px; color: var(--bad); max-width: 260px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* 单元格里的错误：hover 展开全文（用 title 属性即可，不需 JS） */
.err-line:hover { white-space: normal; }

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

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

/* 智能翻转：下方空间不足时，浮层向上展开（由各页面脚本加 .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: 13px; }
.pager-item {
  padding: 4px 11px; border: 1px solid var(--border); border-radius: 6px;
  color: var(--muted-2); text-decoration: none; background: var(--surface-2);
}
.pager-item:hover { background: var(--surface-2); }
.pager-cur { color: var(--muted-2); font-variant-numeric: tabular-nums; }

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

/* debug 生成入口已收成按钮 + 独立页（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: #a9bdd1;
  cursor: pointer; padding: 0;
}
.nav-burger svg { width: 20px; height: 20px; }
.nav-burger:hover { color: #fff; border-color: #3a5f85; }
/* 面板锚定在顶栏上：topbar 必须是定位上下文 */
.topbar { position: relative; }

@media (max-width: 640px) {
  .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: #0c1c2e;
    border-bottom: 1px solid rgba(217, 185, 92, .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: 15px;
    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); }

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

  /* ---- 触控目标：主按钮 ≥40px，小按钮 ≥36px ---- */
  .btn { min-height: 40px; }
  .btn-sm { min-height: 36px; padding: 6px 14px; }
}

/* ---- 登录/注册/改密页（page-login）：手机上压缩 hero，首屏见表单 ---- */
@media (max-width: 640px) {
  .login-art { min-height: 200px; }
  .login-quote { padding: 30px 22px 18px; font-size: 13.5px; line-height: 1.65; }
  .login-quote em { font-size: 12px; margin-top: 5px; }
  .login-panel { padding: 30px 22px 40px; }
  .login-title { font-size: 22px; }
  .login-sub { font-size: 13px; margin-bottom: 22px; }
  .login-btn { letter-spacing: 4px; }
  .page-login .alert { margin: 14px auto 0; }
}

/* ============================================================
   频道消息（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(217, 185, 92, .14); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; 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(217, 185, 92, .14);
  display: flex; align-items: center; justify-content: center;
}
.ch-main { flex: 1; min-width: 0; }
.ch-name { font-size: 15.5px; font-weight: 600; color: var(--text); }
.ch-meta { font-size: 12.5px; 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: #23100c;
  font-size: 11.5px; font-weight: 700; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.ch-lock { color: var(--muted-2); font-size: 12.5px; display: inline-flex; align-items: center; gap: 5px; }
.ch-arrow { color: var(--muted-2); font-size: 15px; }

/* ---- 详情页 ---- */
.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: 13px; 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(217, 185, 92, .16); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  overflow: hidden;            /* 与频道头像同款圆角方形，不再用正圆 */
}
.msg-name { font-size: 13px; font-weight: 600; color: var(--text); }
.msg-time { margin-left: auto; font-size: 11.5px; color: var(--muted-2); }
.msg-text { font-size: 14px; 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: 12.5px; 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: 13.5px; color: var(--text); line-height: 1.5; }
.msg-link-url { display: block; font-size: 12px; color: var(--accent); word-break: break-all; margin-top: 3px; }
.ch-hint { text-align: center; font-size: 12.5px; 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: #22180a; font-size: 13px; 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(217, 185, 92, .12); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
}
.ch-lockbox h3 { margin: 0 0 8px; font-size: 16px; font-weight: 600; color: var(--text); }
.ch-lockbox p { margin: 0; font-size: 13px; 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: 19px; 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: 13.5px; 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(217, 185, 92, .12); color: var(--gold);
  border-color: rgba(217, 185, 92, .35); font-weight: 600;
}
.ch-switch-ico {
  width: 24px; height: 24px; border-radius: 7px; flex: none;
  background: rgba(217, 185, 92, .14); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  overflow: hidden;
}
/* 下拉项里的徽标比列表页小一号：一屏要塞下多个频道，20px 会显得笨重 */
.ch-switch-item .ch-badge { min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; }

/* ---- ≤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: 14.5px; }
  /* ⚠️ ≤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, #161b22) / var(--border, #30363d) —— 实际一直回退到
   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: 16px; color: var(--text); font-weight: 500; }
.modal-body { font-size: 14px; 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: 13.5px; 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: 13px; 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: 12.5px; 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: 13px; }
.credit-row .v { color: var(--text); font-size: 14px; }
.credit-row .n { color: var(--muted-2); font-size: 12.5px; }

/* 权益一览：一行一个功能点 */
.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: 13.5px; }
.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); }

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

/* 导航项上的小徽章（「需升级」/「V3 · 12天」）。
   紧贴链接文字，不能撑高顶栏 —— 顶栏高度在 ≤640px 有汉堡按钮对齐问题。 */
.nav-badge {
  display: inline-block; margin-left: 5px; padding: 1px 6px;
  border-radius: 999px; font-size: 10.5px; line-height: 1.5;
  background: var(--run-bg); color: var(--run);
  border: 1px solid rgba(232, 199, 116, .25);
  vertical-align: middle; white-space: nowrap;
}
.nav-badge.ok {
  background: var(--ok-bg); color: var(--ok);
  border-color: rgba(94, 207, 161, .25);
}

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

/* 注册页的赠礼说明：介于标题与步骤条之间，一屏内要读得清 */
.login-gift {
  margin: 0 0 16px; font-size: 13px; 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; }
