/* 研报专家 Agent — 工作台样式表
 * ============================================================================
 * v2 · 2026-09-09 · UI 重构（仅视觉层，选择器与 DOM 契约完全兼容 v1）
 *
 * 定位没有变：本产品仍是《股票分析工作手册》的执行工具，仍用手册的
 * 靛蓝结构色、砖红强调、发丝线、编号章节。变的是承载它们的底色与密度——
 * 从纸色浅底换成暖墨底（#1a1b17 是纸色 #edeee8 的反相，不是冷灰），
 * 因为这个工具的实际使用场景是盘中长时间盯着一屏密集数字，
 * 而不是印出来读。手册的身份靠字体、栏线、编号和砖红保留，靠底色保留不了。
 *
 * 三条硬规则（新增元素也必须遵守）：
 *   1. 砖红 --red 只用于：章节编号、非共识/新事实、活动导航条、涨。
 *      不做任何装饰性使用。
 *   2. 靛蓝 --indigo 只用于：结构判定（A/B/C）、链接、主操作按钮。
 *   3. 琥珀 --amber 只用于可信度警告：单源 / 仅交易层 / 数据不足 / 换手过热。
 *      不用于"提示"或"次要信息"——那是 --ink-3 的活。
 *
 * 涨跌沿用 A 股惯例：红涨绿跌。任务成败用靛蓝/砖红，与涨跌语义分离。
 * ========================================================================== */

/* 字体：正文与数字分离。数字用等宽 + tabular-nums 才能纵向对齐扫读，
 * 标题用衬线承接手册的编辑感。只用系统字体栈：Google Fonts 在国内基本连不上，
 * CSS 里的 @import 会卡住整张样式表直到超时（首屏白等几秒），CSP 也不放行外站样式。 */

:root {
  /* ── 底与面 ───────────────────────────────────────────────── */
  --paper:    #1a1b17;   /* 应用底 */
  --paper-2:  #212219;   /* 面板 / 卡片 */
  --paper-3:  #26271f;   /* 输入框 / 高一层 */
  --paper-4:  #1e1f18;   /* 顶栏 / 侧栏页眉 */
  --rule:     #34362b;   /* 主分隔线 */
  --rule-soft:#26271f;   /* 次分隔线 */
  --rule-hard:#4c4f3f;   /* 描边（虚线徽标等） */

  /* ── 墨 ───────────────────────────────────────────────────── */
  --ink:      #eceee4;   /* 主文字 */
  --ink-2:    #c3c7b7;   /* 次文字 */
  --ink-3:    #a8ac9c;   /* 三级文字 · 对底 4.9:1，不再低于 4.5:1 */

  /* ── 结构色（靛蓝） ───────────────────────────────────────── */
  --indigo:      #7fa8d4;
  --indigo-2:    #a9c8e4;
  --indigo-deep: #3d6b96;  /* 实心按钮底 */
  --indigo-line: #4a7ba8;
  --indigo-soft: #223245;
  --on-indigo:   #141610;  /* 靛蓝实心上的文字 */

  /* ── 强调（砖红） / 涨 ────────────────────────────────────── */
  --red:      #e0685c;
  --red-deep: #b8352a;
  --red-soft: #2b1d1a;

  /* ── 跌 ───────────────────────────────────────────────────── */
  --green:      #4fae8c;
  --green-soft: #16261f;
  --green-line: #2c4a3e;

  /* ── 可信度警告 ───────────────────────────────────────────── */
  --amber:      #d1a04a;
  --amber-soft: #322a18;
  --amber-line: #5c4a24;

  /* ── 字体 ─────────────────────────────────────────────────── */
  --mono: "IBM Plex Mono", ui-monospace, "SF Mono", "JetBrains Mono", Menlo,
    Consolas, "Liberation Mono", monospace;
  --cn: "IBM Plex Sans", "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC",
    "Noto Sans CJK SC", "Microsoft YaHei", sans-serif;
  --serif: "Source Serif 4", "Songti SC", "Source Han Serif SC", Georgia, serif;

  /* ── 间距阶（4 的倍数，只用这些值） ───────────────────────── */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px;
  --s5: 20px; --s6: 26px; --s7: 34px; --s8: 44px;

  --radius: 4px;          /* 控件圆角，仅此一档 */
  --radius-pill: 20px;    /* chip */

  --t-fast: .12s cubic-bezier(.2,.6,.35,1);
  --t: .18s cubic-bezier(.2,.6,.35,1);

  font-size: 14px;
  color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--cn);
  font-size: 12.5px;
  height: 100vh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(224, 104, 92, .3); }

/* 滚动条：默认的亮色滚动条在深底上是一道白杠，必须收掉 */
* { scrollbar-width: thin; scrollbar-color: #3a3c30 transparent; }
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb {
  background: #3a3c30; border-radius: 9px; border: 2px solid var(--paper);
}
*::-webkit-scrollbar-thumb:hover { background: var(--rule-hard); }

/* 焦点环统一：键盘可达是硬要求，鼠标点击不该出现焦点环 */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 1px;
  border-radius: 2px;
}

#app { display: flex; height: 100vh; }

/* ══════════════════════════════════════════════════════════════
   侧栏：编号目录
   ═══════════════════════════════════════════════════════════ */
#sidebar {
  width: 206px; flex: none;
  background: #171812;
  border-right: 1px solid var(--rule-soft);
  display: flex; flex-direction: column;
  padding: var(--s5) 0 var(--s3);
}

.brand { display: flex; gap: 10px; align-items: baseline; padding: 0 18px var(--s5); }
.brand-mark {
  font-family: var(--mono); font-size: 10.5px; font-weight: 600;
  color: var(--red); letter-spacing: .14em; flex: none;
}
.brand-name {
  font-family: var(--serif);
  font-size: 17px; font-weight: 600; letter-spacing: -.01em; color: var(--ink);
}
.brand-sub {
  color: var(--ink-3); font-size: 9.5px; margin-top: 5px;
  font-family: var(--mono); letter-spacing: .18em;
}

#nav { display: flex; flex-direction: column; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
#nav a {
  color: var(--ink-2); text-decoration: none;
  padding: 7px 18px; font-size: 12.5px;
  border-left: 2px solid transparent;
  display: flex; align-items: center; gap: var(--s2);
  transition: background var(--t-fast), color var(--t-fast);
}
#nav a:hover { background: #1f2019; color: var(--ink); }
#nav a.active {
  color: var(--ink); font-weight: 600;
  border-left-color: var(--red-deep);
  background: #1f2019;
}
/* 导航右侧计数：让"今日 42"这类增量在不展开页面时就可见 */
#nav a .nav-count {
  margin-left: auto; font-family: var(--mono); font-size: 11px;
  color: var(--ink-3); font-variant-numeric: tabular-nums;
}
#nav a.active .nav-count { color: var(--red); }

.nav-group {
  padding: 14px 18px 6px;
  font-family: var(--mono); font-size: 9px; color: var(--ink-3);
  letter-spacing: .2em; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; user-select: none;
}
.nav-group::after {
  content: "▾"; font-size: 9px; color: var(--ink-3);
  transition: transform var(--t-fast); margin-left: auto;
}
.nav-group.closed::after { transform: rotate(-90deg); }

#status-badges {
  margin-top: auto; display: flex; flex-direction: column; gap: 6px;
  padding: var(--s3) 18px 10px; border-top: 1px solid var(--rule-soft);
  flex: none;
}
.badge {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  display: flex; align-items: center; gap: 8px; letter-spacing: .03em;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: var(--amber); flex: none; }
.badge.ok .dot { background: var(--green); }
.badge.ok { color: var(--ink-2); }
.badge.bad .dot { background: var(--red); }
.badge.bad { color: var(--ink-2); }

.sidebar-foot {
  color: var(--ink-3); font-size: 9px; padding: 10px 18px 0;
  line-height: 1.9; font-family: var(--mono); letter-spacing: .04em;
  flex: none;
}

/* 矮窗口（笔记本分屏、预览窗）：侧栏竖向预算不够时，按重要性依次舍弃。
 * 导航项本身永远不能被裁——看不见的入口等于不存在。 */
@media (max-height: 760px) {
  .sidebar-foot { display: none; }
  #status-badges {
    flex-direction: row; flex-wrap: wrap; gap: var(--s1) var(--s3);
    padding: var(--s2) 18px;
  }
  .badge { font-size: 9.5px; gap: 5px; }
  .nav-group { padding: 10px 18px 4px; }
  #nav a { padding: 6px 18px; }
  #sidebar { padding: var(--s4) 0 var(--s2); }
  .brand { padding: 0 18px var(--s4); }
}
@media (max-height: 620px) {
  #status-badges { display: none; }
  .brand-sub { display: none; }
}

/* ══════════════════════════════════════════════════════════════
   主区
   ═══════════════════════════════════════════════════════════ */
#main { flex: 1; min-width: 0; overflow-y: auto; padding: var(--s6) var(--s6) 48px; }

/* 页头：eyebrow + 衬线大标题 + 一行说明。三者是固定的信息顺序。 */
.view-title {
  font-family: var(--serif);
  font-size: 25px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1;
}
.view-sub {
  color: var(--ink-3); font-size: 12px; margin: var(--s2) 0 var(--s6);
  max-width: 64ch; line-height: 1.75;
}
.eyebrow {
  font-family: var(--mono); font-size: 9.5px; color: var(--red);
  letter-spacing: .2em; text-transform: uppercase;
  display: block; margin-bottom: var(--s2);
}

.row { display: flex; gap: var(--s3); flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: var(--s4); }

/* 卡片：面板色 + 1px 边。不投影——深底上的阴影只会变成一团脏。 */
.card {
  background: var(--paper-2);
  border: 1px solid var(--rule-soft);
  padding: var(--s4) var(--s5);
  margin-bottom: var(--s3);
}
.card h3 {
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--ink-3); letter-spacing: .16em; text-transform: uppercase;
  margin-bottom: var(--s3); padding-bottom: var(--s2);
  border-bottom: 1px solid var(--rule-soft);
  display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap;
}

/* KPI：不做成等权卡片墙，做成一行分栏。等权卡片没有主次，
 * 而这四个数就是首页唯一的顶层入口，必须在同一条基线上比较。 */
.stat-card {
  min-width: 148px; flex: 1;
  background: none; border: 0; border-right: 1px solid var(--rule-soft);
  padding: var(--s4) var(--s5) var(--s4) 0; margin: 0;
}
.stat-card:last-child { border-right: 0; }
.stat-value {
  font-family: var(--mono); font-size: 31px; font-weight: 400;
  margin: 7px 0 6px; letter-spacing: -.04em; font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-label {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3);
  letter-spacing: .18em; text-transform: uppercase;
}
.stat-link { text-decoration: none; color: inherit; display: block; }
.stat-link:hover .stat-value { color: var(--indigo-2); }
.stat-link:hover .stat-label { color: var(--ink-2); }

.evidence-stripe { display: flex; height: 3px; margin-top: 11px; background: var(--rule); }
.evidence-stripe span { display: block; height: 100%; }
.ev-settled { background: var(--indigo); }
.ev-pending { background: var(--indigo-deep); }
.ev-missing { background: var(--rule-hard); }
.evidence-note {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3);
  margin-top: 7px; letter-spacing: .02em; line-height: 1.65;
}

/* ══════════════════════════════════════════════════════════════
   主线三层徽标 A / B / C
   全站唯一写法：实心=成立，描边=部分成立，空框=不成立，虚线=数据不足。
   ═══════════════════════════════════════════════════════════ */
.mainline {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 10.5px;
}
.ml-track { display: flex; gap: 3px; flex: none; }
.ml-cell {
  width: 16px; height: 16px; border: 1px solid var(--rule);
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: var(--ink-3); background: transparent;
  flex: none;
}
.ml-cell[data-state="成立"] {
  background: var(--indigo); border-color: var(--indigo); color: var(--on-indigo);
}
.ml-cell[data-state="部分成立"] {
  background: var(--indigo-soft); border-color: var(--indigo-deep); color: var(--indigo-2);
}
.ml-cell[data-state="不成立"] { background: transparent; border-color: var(--rule); }
.ml-cell[data-state="数据不足"] {
  border-style: dashed; border-color: var(--rule-hard); background: transparent;
}
.ml-label { color: var(--ink-3); }
.ml-label.strong { color: var(--indigo-2); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   面包屑
   ═══════════════════════════════════════════════════════════ */
.crumb {
  font-family: var(--mono); font-size: 10.5px; color: var(--ink-3);
  margin-bottom: var(--s4); display: flex; gap: var(--s2);
  align-items: center; flex-wrap: wrap;
}
.crumb a {
  color: var(--indigo); text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color var(--t-fast);
}
.crumb a:hover { border-bottom-color: var(--indigo); }
.crumb .sep { color: var(--rule-hard); }

/* ── 成分条 ─────────────────────────────────────────────────── */
.comp-bar { display: flex; height: 6px; background: var(--rule); overflow: hidden; }
.comp-bar span { display: block; height: 100%; }
.comp-bull { background: var(--red); }
.comp-bear { background: var(--green); }
.comp-neut { background: var(--rule-hard); }
.comp-legend {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3);
  margin-top: 6px; display: flex; gap: var(--s3); flex-wrap: wrap;
}
.comp-legend b { font-weight: 500; }
.comp-legend .bull { color: var(--red); }
.comp-legend .bear { color: var(--green); }

.node {
  display: block; width: 100%; text-align: left;
  background: var(--paper-2); border: 1px solid var(--rule-soft);
  border-radius: 0; padding: var(--s3) var(--s4); margin-bottom: var(--s2);
  cursor: pointer; font-family: var(--cn); font-size: 12.5px; color: var(--ink);
  transition: border-color var(--t-fast), background var(--t-fast);
}
.node:hover { border-color: var(--indigo-deep); background: var(--paper-3); }
.node-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: var(--s2); }
.node-name { font-weight: 600; font-size: 13.5px; flex: 1; }
.node-count {
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  font-variant-numeric: tabular-nums; flex: none;
}
.node-meta {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  margin-top: 7px; display: flex; gap: var(--s3); flex-wrap: wrap;
}

/* ── 五步法阶梯 ─────────────────────────────────────────────── */
.ladder { display: flex; flex-direction: column; }
.rung {
  display: grid; grid-template-columns: 20px 62px minmax(0,1fr);
  gap: var(--s3); align-items: start;
  padding: 11px 0; border-bottom: 1px solid var(--rule-soft);
}
.rung:last-child { border-bottom: 0; }
.rung-idx { font-family: var(--mono); font-size: 10px; color: var(--ink-3); padding-top: 2px; }
.rung-name { font-weight: 600; font-size: 12.5px; }
.rung-detail { font-size: 12px; color: var(--ink-2); line-height: 1.75; }
.rung[data-status="有"] .rung-name { color: var(--indigo-2); }
.rung[data-status="部分"] .rung-name { color: var(--amber); }
.rung[data-status="缺"] .rung-name { color: var(--ink-3); }
.rung[data-status="缺"] .rung-detail { color: var(--ink-3); }
.rung-tag {
  font-family: var(--mono); font-size: 9px; padding: 1px 5px;
  border: 1px solid currentColor; margin-left: 7px; vertical-align: 1px;
}

/* ── 方法论条目 ─────────────────────────────────────────────── */
.method-card { border-left: 2px solid var(--red-deep); padding-left: var(--s4); margin: var(--s1) 0 var(--s4); }
.method-row { display: grid; grid-template-columns: 76px minmax(0,1fr); gap: var(--s3); margin-bottom: 9px; }
.method-key {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3);
  letter-spacing: .12em; padding-top: 3px;
}
.method-val { font-size: 12.5px; line-height: 1.8; color: var(--ink-2); }
.method-val strong { color: var(--ink); font-weight: 600; }
.chain { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; font-size: 11.5px; }
.chain-node {
  background: var(--paper-3); border: 1px solid var(--rule);
  padding: 3px 9px; color: var(--ink-2);
}
.chain-arrow { color: var(--rule-hard); font-family: var(--mono); }

/* ══════════════════════════════════════════════════════════════
   表格：本产品的主力控件
   ═══════════════════════════════════════════════════════════ */

/* .table-wrap 自己就是滚动容器（纵向 + 横向）。
 * 表头必须粘在表格自己的视口上，不能粘在 #main 上——#main 顶部已经被
 * 粘顶的 .toolbar 占住，两者都 top:0 会让表头滚到工具条底下看不见。
 * 主线板是 9 列数字表，滚动中丢掉列名等于这张表读不了。 */
.table-wrap {
  overflow: auto;
  max-height: min(72vh, 720px);
  overscroll-behavior: contain;
}
/* 需要整页滚动而不是表内滚动时加 .table-wrap.flow（周报、抽屉内的短表） */
.table-wrap.flow { overflow: visible; max-height: none; }
.table-wrap.flow th { position: static; }

table { width: 100%; border-collapse: collapse; font-size: 12px; }
th {
  text-align: left; font-family: var(--mono); font-weight: 600;
  color: var(--ink-3); font-size: 9px; letter-spacing: .16em; text-transform: uppercase;
  padding: 9px var(--s2) var(--s2) 0; border-bottom: 1px solid var(--rule);
  white-space: nowrap; position: sticky; top: 0; background: var(--paper); z-index: 2;
}
.card th, .tree-detail th, .table-wrap th { background: var(--paper-2); }
/* 裸表（不在 .table-wrap 里）没有自己的滚动容器，粘顶会撞上工具条 */
:not(.table-wrap) > table th { position: static; }
td {
  padding: 10px var(--s2) 10px 0; border-bottom: 1px solid var(--rule-soft);
  vertical-align: top;
}
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.nowrap, th.nowrap { white-space: nowrap; }
tbody tr { transition: background var(--t-fast); }
tbody tr:hover { background: var(--paper-2); }
tr.clickable { cursor: pointer; }
tr:last-child td { border-bottom: 0; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--ink-2); }
th.sortable.on { color: var(--red); }

/* ══════════════════════════════════════════════════════════════
   语义色
   ═══════════════════════════════════════════════════════════ */
.pos, .bull { color: var(--red); }
.neg, .bear { color: var(--green); }
.ok   { color: var(--indigo-2); }
.bad  { color: var(--red); }
.warn { color: var(--amber); }
.muted { color: var(--ink-3); }
.small { font-size: 11px; }
.mono { font-family: var(--mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }

.tag {
  display: inline-block; font-family: var(--mono); font-size: 9.5px;
  padding: 1px 6px; border: 1px solid var(--rule-hard); color: var(--ink-2);
  white-space: nowrap; letter-spacing: .04em;
}
.tag.bull { border-color: rgba(224, 104, 92, .5); color: var(--red); }
.tag.bear { border-color: var(--green-line); color: var(--green); }
.tag.warn { border-color: var(--amber-line); color: var(--amber); background: var(--amber-soft); }
.tag.solid { background: var(--indigo); border-color: var(--indigo); color: var(--on-indigo); font-weight: 600; }
.crowd-高 { color: var(--amber); }
.crowd-中 { color: var(--ink-2); }
.crowd-低 { color: var(--green); }

/* 空状态：不是"没有数据"，要说清为什么没有、下一步做什么 */
/* 条件性元素：值为空时整体不占位，避免出现空徽章／空缝隙 */
.hidden { display: none !important; }

/* 章节标题：eyebrow 编号右侧的衬线标题，全站统一 */
.sec-title { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); white-space: nowrap; }

/* 挂在结论下方的限定条件／风险 */
.anchor-note { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; line-height: 1.75; }

.empty {
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  padding: var(--s7) 0; text-align: center; letter-spacing: .05em; line-height: 1.9;
}
.empty b { display: block; color: var(--ink-2); font-weight: 500; margin-bottom: 6px; }
.empty button { margin-top: var(--s3); }

/* ══════════════════════════════════════════════════════════════
   控件
   ═══════════════════════════════════════════════════════════ */
button, .btn {
  background: transparent; color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 6.5px 12px; cursor: pointer;
  font-family: var(--cn); font-size: 12px; letter-spacing: 0;
  white-space: nowrap; flex: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
button:hover, .btn:hover { background: var(--paper-3); border-color: var(--rule-hard); }
button:active { transform: translateY(.5px); }
button:disabled { opacity: .4; cursor: not-allowed; transform: none; }
button.primary {
  background: var(--indigo-deep); border-color: var(--indigo-line); color: #f6f7f0; font-weight: 600;
}
button.primary:hover { background: #48789f; border-color: #5a8cb8; }
button.ghost { background: transparent; color: var(--ink-2); border-color: transparent; }
button.ghost:hover { color: var(--ink); background: var(--paper-3); }
button.danger { color: var(--red); border-color: #5c2f2a; }
button.danger:hover { background: var(--red-soft); }

input, select, textarea {
  background: var(--paper-3); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius);
  padding: 6.5px 9px; font-size: 12.5px; font-family: var(--cn); width: 100%;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
input::placeholder, textarea::placeholder { color: #8f937f; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--indigo-deep);
  box-shadow: 0 0 0 2px rgba(61, 107, 150, .25);
}
input:disabled, select:disabled { opacity: .5; }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 51%, calc(100% - 9px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 26px;
}
/* 数字输入用等宽——端口号、阈值、时间这类值对齐了才好核对 */
input[type="number"], input[type="time"], input.mono { font-family: var(--mono); }

/* 工具条：粘顶。筛选条滚走之后用户就不知道当前看的是哪个切片了。 */
.toolbar {
  display: flex; gap: var(--s2); align-items: center;
  margin-bottom: var(--s4); flex-wrap: wrap;
  position: sticky; top: 0; z-index: 5;
  background: var(--paper); padding: 10px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.toolbar input, .toolbar select { width: auto; min-width: 120px; }
.toolbar .spacer { flex: 1; min-width: 12px; }
.toolbar .divider { width: 1px; height: 16px; background: var(--rule); flex: none; }

.form-grid {
  display: grid; grid-template-columns: 150px minmax(0,1fr);
  gap: var(--s3) var(--s4); align-items: center;
}
.form-grid label {
  color: var(--ink-2); font-size: 12px; text-align: left;
  font-family: var(--cn); letter-spacing: 0;
}
.form-grid input, .form-grid select, .form-grid textarea { max-width: 340px; }
.form-grid .full { max-width: none; }
/* 字段说明挂在字段下方而不是右侧——右侧说明在窄屏会被挤成竖条 */
.form-hint {
  grid-column: 2; font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3); line-height: 1.8; margin-top: -6px;
}

.log {
  background: #141610; border: 1px solid var(--rule-soft);
  font-family: var(--mono); font-size: 11px; color: var(--ink-2);
  padding: var(--s3); max-height: 220px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.75; border-radius: var(--radius);
}
.spinner {
  display: inline-block; width: 9px; height: 9px; margin-right: 6px;
  border: 1.5px solid var(--rule-hard); border-top-color: var(--indigo);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 骨架屏：加载态给出即将出现的形状，而不是一个转圈。
 * 用 .skeleton 包住任意宽高的占位块即可。 */
.skeleton {
  background: linear-gradient(90deg, var(--paper-2) 25%, #2a2b22 37%, var(--paper-2) 63%);
  background-size: 400% 100%;
  animation: shimmer 1.3s ease infinite;
  border-radius: 2px; color: transparent !important;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

/* 错误条：说清哪一步失败、为什么、能怎么办 */
.error-bar {
  border-left: 2px solid var(--red-deep); background: var(--red-soft);
  padding: 10px 14px; margin-bottom: var(--s3); border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12px; color: var(--ink-2); line-height: 1.8;
}
.error-bar b { color: var(--red); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   抽屉
   ═══════════════════════════════════════════════════════════ */
.detail-drawer {
  position: fixed; top: 0; right: 0; width: min(760px, 92vw); height: 100vh;
  background: var(--paper-2); border-left: 1px solid var(--rule);
  padding: var(--s6) var(--s7); overflow-y: auto; z-index: 40;
  box-shadow: -24px 0 60px rgba(0, 0, 0, .5);
  animation: slidein .18s cubic-bezier(.2,.6,.35,1);
}
@keyframes slidein { from { transform: translateX(26px); opacity: 0; } }
.drawer-close {
  position: absolute; top: 16px; right: 20px;
  border: 0; background: none; color: var(--ink-3); font-size: 18px;
  padding: 4px 9px; line-height: 1; border-radius: var(--radius);
}
.drawer-close:hover { color: var(--ink); background: var(--paper-3); }
/* 抽屉遮罩：点空白处关闭需要有可点的空白 */
.drawer-scrim {
  position: fixed; inset: 0; background: rgba(10, 11, 8, .5);
  z-index: 39; animation: fadein .18s ease;
}
@keyframes fadein { from { opacity: 0; } }

/* ══════════════════════════════════════════════════════════════
   对话研究
   ═══════════════════════════════════════════════════════════ */
#chat-view { display: flex; flex-direction: column; height: calc(100vh - 96px); }
#chat-log { flex: 1; overflow-y: auto; padding-right: 10px; }
.msg { margin-bottom: var(--s5); display: flex; }
.msg.user { justify-content: flex-end; }
.bubble {
  max-width: 76ch; padding: 12px var(--s4);
  border: 1px solid var(--rule-soft); background: transparent;
  line-height: 1.85; font-size: 12.5px;
}
.msg.user .bubble {
  background: var(--paper-3); border-color: var(--rule);
  border-radius: 10px 10px 2px 10px; max-width: 62%;
}
.msg.assistant .bubble { border: 0; padding-left: 0; }

.thinking {
  border-left: 2px solid var(--rule); padding: 2px 0 2px var(--s3);
  margin-bottom: 11px; color: var(--ink-3); font-size: 11.5px; line-height: 1.85;
}
.thinking summary {
  cursor: pointer; font-family: var(--mono); font-size: 10px;
  letter-spacing: .1em; color: var(--ink-3); list-style: none; outline: none;
}
.thinking summary:hover { color: var(--ink-2); }
.thinking summary::-webkit-details-marker { display: none; }
.thinking summary::before { content: "▸ "; color: var(--indigo); }
.thinking[open] summary::before { content: "▾ "; }
.thinking .body { padding-top: var(--s2); white-space: pre-wrap; }

/* 工具调用：状态要可见——跑完的和正在跑的不能长得一样 */
.tool-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 10.5px; color: var(--indigo-2);
  border: 1px solid #2c3b4d; background: #1e2530;
  padding: 5px 9px; margin: 0 5px 5px 0; border-radius: var(--radius);
}
.tool-chip::before { content: "▸"; color: var(--indigo); }
.tool-chip.done::before { content: "✓"; color: var(--green); }
.tool-chip.running::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  border: 1.5px solid var(--indigo-2); border-top-color: transparent;
  animation: spin .7s linear infinite;
}
.tool-chip.failed { color: var(--red); border-color: #5c2f2a; background: var(--red-soft); }
.tool-chip.failed::before { content: "✕"; color: var(--red); }
.tool-chip .args { color: var(--ink-3); }

#chat-input-row {
  display: flex; gap: var(--s2); padding-top: var(--s4);
  border-top: 1px solid var(--rule); position: relative;
}
#chat-input {
  resize: none; height: 62px; font-size: 12.5px; line-height: 1.7; flex: 1;
}
.suggestions { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: var(--s3); }
.suggestions button { font-size: 11.5px; padding: 4px 11px; border-radius: var(--radius-pill); }

.compliance-flag {
  border-left: 2px solid var(--red-deep); background: var(--red-soft);
  padding: 10px var(--s3); margin-bottom: 11px;
  font-family: var(--mono); font-size: 10.5px; color: var(--red); line-height: 1.8;
}

/* ══════════════════════════════════════════════════════════════
   Markdown（周报 / 深度分析 / 对话回答共用）
   ═══════════════════════════════════════════════════════════ */
.md { line-height: 1.9; font-size: 13px; color: var(--ink-2); max-width: 76ch; }
.md h1 {
  font-family: var(--serif); font-size: 25px; margin: 6px 0 var(--s4);
  font-weight: 600; letter-spacing: -.02em; color: var(--ink); line-height: 1.3;
}
.md h2 {
  font-family: var(--serif); font-size: 18px; margin: var(--s6) 0 var(--s3);
  font-weight: 600; color: var(--ink);
  padding-bottom: var(--s2); border-bottom: 1px solid var(--rule);
}
.md h3 { font-family: var(--serif); font-size: 15px; margin: var(--s5) 0 var(--s2); font-weight: 600; color: var(--ink); }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0 10px 22px; }
.md li { margin: 5px 0; }
.md table { margin: var(--s3) 0; }
.md code {
  font-family: var(--mono); font-size: 11.5px;
  background: var(--paper-3); padding: 1px 5px; color: var(--indigo-2);
  border-radius: 2px;
}
.md blockquote {
  border-left: 2px solid var(--red); background: transparent;
  padding: 2px 0 2px var(--s3); margin: var(--s3) 0;
  color: var(--ink-2); font-size: 12.5px;
}
.md strong { font-weight: 600; color: var(--ink); }
.md a { color: var(--indigo); }
.md a:hover { color: var(--indigo-2); }
.md hr { border: 0; border-top: 1px solid var(--rule); margin: var(--s6) 0; }

/* ══════════════════════════════════════════════════════════════
   观点树：左大纲 + 右详情
   ═══════════════════════════════════════════════════════════ */
.tree-split {
  display: grid; grid-template-columns: minmax(320px, 42%) minmax(0,1fr);
  border: 1px solid var(--rule-soft); background: var(--paper-2);
  height: calc(100vh - 250px); min-height: 420px;
}
.tree-outline { overflow: auto; border-right: 1px solid var(--rule-soft); padding: 6px 0; }
.tree-detail { overflow: auto; padding: var(--s5) var(--s6); }
.tree-detail .card { background: #1c1d16; }

.tw-row {
  display: grid; grid-template-columns: 16px minmax(0,1fr) auto auto;
  gap: var(--s2); align-items: center;
  padding: 5px var(--s3) 5px calc(var(--s3) + var(--d, 0) * 18px);
  cursor: pointer; font-size: 12px; line-height: 1.5;
  border-left: 2px solid transparent;
  transition: background var(--t-fast);
}
.tw-row:hover { background: var(--paper-3); }
.tw-row.sel { background: var(--indigo-soft); border-left-color: var(--indigo); color: var(--ink); }
.tw-row.leaf { grid-template-columns: 16px minmax(0,1fr) auto; font-size: 11.5px; }
.tw-twist { font-family: var(--mono); font-size: 9px; color: var(--ink-3); }
.tw-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tw-count {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mini-bar { display: inline-flex; width: 54px; height: 4px; background: var(--rule); flex: none; }
.mini-bar span { display: block; height: 100%; }

.detail-title { font-family: var(--serif); font-size: 19px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.detail-sub { color: var(--ink-3); font-size: 12px; line-height: 1.8; margin-bottom: var(--s4); }
.kv { display: grid; grid-template-columns: 66px minmax(0,1fr); gap: var(--s3); margin-bottom: 9px; font-size: 12px; }
.kv > span:first-child {
  font-family: var(--mono); font-size: 9.5px; color: var(--ink-3); letter-spacing: .12em;
}
.kv b { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }

/* ── 原文引用 ───────────────────────────────────────────────── */
.quote {
  border-left: 2px solid var(--indigo-deep); padding: 10px 0 10px var(--s3);
  margin-bottom: var(--s3); font-size: 12.5px; line-height: 1.95;
}
.quote.miss { border-left-color: var(--rule); }
.quote-ctx { color: var(--ink-3); white-space: pre-wrap; }
.quote-hit {
  background: rgba(224, 104, 92, .18); color: var(--ink);
  padding: 2px 0; white-space: pre-wrap; font-weight: 500;
  box-shadow: 0 0 0 2px rgba(224, 104, 92, .18);
}
.quote-text { color: var(--ink-2); white-space: pre-wrap; }
.quote-line { padding: 3px 0 3px var(--s2); border-left: 2px solid var(--rule); margin: 3px 0; }
.fulltext {
  margin-top: var(--s3); padding: var(--s3) var(--s4); background: #141610;
  border: 1px solid var(--rule-soft); max-height: 420px; overflow: auto;
  white-space: pre-wrap; font-size: 12px; line-height: 1.9; color: var(--ink-2);
}

/* ── 原文直出 ───────────────────────────────────────────────── */
.doc-frame {
  width: 100%; height: 560px; border: 1px solid var(--rule);
  background: #fff; display: block;
}
.doc-img { max-width: 100%; border: 1px solid var(--rule); display: block; }
.doc-md {
  max-height: 560px; overflow-y: auto; border: 1px solid var(--rule-soft);
  padding: var(--s4) var(--s5); background: #1c1d16;
}

ul.plain { margin: var(--s1) 0 var(--s1) 18px; font-size: 12.5px; line-height: 1.85; color: var(--ink-2); }
ul.plain b { color: var(--ink); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   对话会话列表
   ═══════════════════════════════════════════════════════════ */
.chat-split {
  display: grid; grid-template-columns: 210px minmax(0,1fr); gap: var(--s5);
  height: calc(100vh - 150px); min-height: 400px;
}
.chat-sessions { border-right: 1px solid var(--rule-soft); padding-right: var(--s3); overflow-y: auto; }
.session-group {
  font-family: var(--mono); font-size: 9px; letter-spacing: .2em; color: var(--ink-3);
  margin: var(--s3) 0 var(--s1); text-transform: uppercase;
}
.session-item {
  display: flex; align-items: center; gap: 6px;
  padding: 7px var(--s2); cursor: pointer; font-size: 12px;
  border-left: 2px solid transparent; color: var(--ink-2);
  transition: background var(--t-fast);
}
.session-item:hover { background: var(--paper-2); color: var(--ink); }
.session-item.sel {
  border-left-color: var(--red-deep); background: var(--paper-3);
  color: var(--ink); font-weight: 600;
}
.session-title { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.session-meta { color: var(--ink-3); font-family: var(--mono); font-size: 10px; flex: none; font-weight: 400; }
.session-del { color: var(--ink-3); font-size: 10px; flex: none; padding: 0 2px; visibility: hidden; }
.session-item:hover .session-del { visibility: visible; }
.session-del:hover { color: var(--red); }
.chat-main { display: flex; flex-direction: column; min-width: 0; }
.chat-main #chat-log { flex: 1; overflow-y: auto; padding-right: 6px; }
#chat-view .chat-split { flex: 1; min-height: 0; }

/* ══════════════════════════════════════════════════════════════
   页内标签
   ═══════════════════════════════════════════════════════════ */
.tabstrip { display: flex; gap: 2px; border-bottom: 1px solid var(--rule); margin: 0 0 var(--s4); }
.tabstrip a {
  padding: 7px var(--s4); font-size: 12.5px; color: var(--ink-3); text-decoration: none;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--t-fast), border-color var(--t-fast);
}
.tabstrip a:hover { color: var(--ink-2); }
.tabstrip a.on { color: var(--ink); font-weight: 600; border-bottom-color: var(--red-deep); background: none; }

/* ══════════════════════════════════════════════════════════════
   稀缺信号
   ═══════════════════════════════════════════════════════════ */
.sig-day {
  margin: var(--s5) 0 var(--s1);
  font-family: var(--mono); font-size: 9.5px; font-weight: 600;
  color: var(--red); letter-spacing: .2em;
  border-bottom: 1px solid var(--rule); padding-bottom: 6px;
  font-variant-numeric: tabular-nums;
}
.sig-item {
  display: flex; gap: var(--s3); padding: 11px var(--s1);
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer; align-items: baseline; flex-wrap: wrap;
  transition: background var(--t-fast);
}
.sig-item:hover { background: var(--paper-2); }
.sig-item .who {
  flex: 0 0 96px; color: var(--ink-3); font-family: var(--mono);
  font-size: 9.5px; letter-spacing: .12em;
}
.sig-item .what { flex: 0 0 140px; font-weight: 600; font-size: 12.5px; }
.sig-item .why { flex: 1 1 260px; font-size: 11.5px; color: var(--ink-2); line-height: 1.75; }

.wr-bad { color: var(--green); font-weight: 600; }
.wr-good { color: var(--red); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   chip（skill 条 / 筛选条通用）
   ═══════════════════════════════════════════════════════════ */
.chip {
  padding: 3.5px 11px; border: 1px solid var(--rule); border-radius: var(--radius-pill);
  font-size: 11.5px; color: var(--ink-2); cursor: pointer; user-select: none;
  background: transparent; white-space: nowrap; flex: none;
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.chip:hover { border-color: var(--rule-hard); color: var(--ink); }
.chip.on {
  border-color: var(--indigo-line); color: #f6f7f0; font-weight: 600; background: var(--indigo-deep);
}
/* 次级选中（多选筛选）：与"当前视图"的主选中区分开 */
.chip.on-soft { border-color: var(--rule-hard); color: var(--ink); background: #2f3128; font-weight: 500; }
.skillbar { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; margin: 0 0 var(--s2); font-size: 12.5px; }

/* slash 弹层 */
.slash-pop {
  position: absolute; bottom: calc(100% + 6px); left: 0;
  min-width: 320px; max-height: 260px; overflow: auto;
  background: var(--paper-3); border: 1px solid var(--rule);
  border-radius: var(--radius); box-shadow: 0 12px 32px rgba(0,0,0,.5); z-index: 30;
}
.slash-pop .opt { padding: var(--s2) var(--s3); cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.slash-pop .opt.sel, .slash-pop .opt:hover { background: var(--indigo-soft); }
.slash-pop .opt b { color: var(--indigo-2); font-family: var(--mono); font-size: 11.5px; }
.slash-pop .opt span {
  color: var(--ink-3); font-size: 11.5px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; flex: 1;
}

.ep-row {
  display: grid; grid-template-columns: 110px minmax(0,1fr) minmax(0,1fr) auto auto;
  gap: var(--s2); margin: 6px 0; align-items: center;
}
.model-cell { display: flex; gap: 6px; align-items: center; }
.model-cell input { flex: 1; }

/* ══════════════════════════════════════════════════════════════
   研报阅读模式
   ═══════════════════════════════════════════════════════════ */
.reader-split {
  display: grid; grid-template-columns: 300px minmax(0,1fr); gap: var(--s3);
  height: calc(100vh - 175px); min-height: 480px;
}
.reader-list {
  overflow-y: auto; border: 1px solid var(--rule-soft); background: var(--paper-2);
  border-radius: var(--radius);
}
.reader-item {
  padding: 9px var(--s3); border-bottom: 1px solid var(--rule-soft); cursor: pointer;
  border-left: 3px solid transparent; transition: background var(--t-fast);
}
.reader-item:hover { background: var(--paper-3); }
.reader-item.sel { background: var(--indigo-soft); border-left-color: var(--indigo); }
.reader-item .t {
  font-size: 12.5px; line-height: 1.5; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.reader-item .m {
  font-size: 10.5px; color: var(--ink-3); margin-top: 4px;
  font-family: var(--mono); font-variant-numeric: tabular-nums;
}
.reader-pane {
  overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid var(--rule-soft); border-radius: var(--radius); background: var(--paper-2);
}
.reader-head {
  padding: var(--s2) var(--s3); border-bottom: 1px solid var(--rule);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; font-size: 12.5px;
}
.reader-body { flex: 1; overflow-y: auto; padding: 0; }
.reader-body .doc-frame { width: 100%; height: 100%; border: 0; min-height: 480px; }
.reader-body .doc-img { max-width: 100%; display: block; margin: 0 auto; }
.reader-body .doc-md, .reader-body .fulltext { padding: var(--s4) var(--s5); max-height: none; border: 0; }
.reader-more { padding: var(--s3); text-align: center; color: var(--ink-3); font-size: 11.5px; }

/* ══════════════════════════════════════════════════════════════
   主线板
   ═══════════════════════════════════════════════════════════ */
.ml-table td, .ml-table th { white-space: nowrap; }
.ml-table .ml-name { white-space: normal; min-width: 230px; max-width: 340px; }
.ml-table .ml-liner {
  white-space: normal; font-size: 11px; color: var(--ink-3);
  margin-top: 3px; line-height: 1.6;
}
.ml-table .ml-cands { white-space: normal; min-width: 150px; max-width: 220px; line-height: 1.7; }
.ml-table .ml-cands a { color: var(--indigo); text-decoration: none; }
.ml-table .ml-cands a:hover { color: var(--indigo-2); }
.ml-row { cursor: pointer; }
.ml-row:hover td { background: var(--paper-2); }
.ml-row.dim td { color: var(--ink-3); }
.ml-row.dim td b { font-weight: 500; }

.score-bar {
  display: inline-flex; align-items: center; gap: 7px; min-width: 90px;
  font-family: var(--mono); font-size: 11px; font-variant-numeric: tabular-nums;
}
.score-bar i { display: inline-block; height: 4px; background: var(--indigo); max-width: 42px; flex: none; }
.score-bar b { font-weight: 500; }
.spark { color: var(--indigo); vertical-align: middle; }

.kv-grid {
  display: grid; grid-template-columns: max-content minmax(0,1fr);
  gap: 5px var(--s3); font-size: 12.5px; align-items: baseline;
}
.kv-grid > span { color: var(--ink-3); font-family: var(--mono); font-size: 9.5px; letter-spacing: .12em; }
.kv-grid.small { font-size: 12px; }

.cand-card { border-top: 1px solid var(--rule-soft); padding: var(--s3) 0; }
.cand-card:first-child { border-top: none; padding-top: var(--s1); }
.cand-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: var(--s2); flex-wrap: wrap; }
.cand-head a { color: var(--ink); text-decoration: none; font-weight: 600; }
.cand-head a:hover { color: var(--indigo-2); }
.bear-list li { color: var(--red); }
.deep-out { margin-top: var(--s2); }

/* 主线板卡片流：顶边 2px 编码可信度——蓝=三层齐备，琥珀=有警告，灰=仅交易层 */
.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(380px, 1fr)); gap: var(--s3); }
.board-card {
  border: 1px solid var(--rule-soft); border-top: 2px solid var(--indigo);
  background: var(--paper-2); padding: var(--s3) var(--s4); cursor: pointer;
  display: flex; flex-direction: column; gap: 7px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.board-card:hover { border-color: var(--rule-hard); border-top-color: var(--indigo-2); background: #24261c; }
.board-card.warn { border-top-color: var(--amber); }
.board-card.dim { opacity: 1; background: var(--paper-4); border-top-color: var(--rule-hard); }
.board-card.dim .board-liner { color: var(--ink-3); }
.board-head { display: flex; align-items: center; gap: var(--s2); }
.board-head b { font-family: var(--serif); font-size: 16px; font-weight: 600; }
.board-liner { font-size: 12px; color: var(--ink-2); line-height: 1.75; min-height: 3.2em; }
.board-metrics {
  display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: var(--s2) var(--s3);
  font-size: 13.5px; font-family: var(--mono); font-variant-numeric: tabular-nums;
  padding: 11px 0; border-top: 1px solid var(--rule-soft); border-bottom: 1px solid var(--rule-soft);
}
.board-metrics span > i {
  display: block; font-style: normal; font-size: 9px; color: var(--ink-3);
  font-family: var(--mono); letter-spacing: .14em; margin-bottom: 3px;
}
.board-cands { font-size: 11.5px; color: var(--ink-3); }
.board-cands a { color: var(--indigo); text-decoration: none; }
.board-cands a:hover { color: var(--indigo-2); }

/* ══════════════════════════════════════════════════════════════
   风向变化
   ═══════════════════════════════════════════════════════════ */
.ev-day { margin-bottom: var(--s4); }
.ev-day h3 {
  font-family: var(--mono); font-size: 9.5px; color: var(--red); letter-spacing: .2em;
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: var(--s1);
  display: flex; gap: var(--s3); align-items: baseline;
}
.ev-day h3 .wd { font-family: var(--serif); font-size: 15px; color: var(--ink); letter-spacing: 0; }
.ev-item {
  display: grid; grid-template-columns: 112px minmax(0,1fr); gap: var(--s3);
  padding: 11px 0; border-bottom: 1px solid var(--rule-soft); border-left: 0;
  margin: 0; font-size: 12.5px; align-items: start;
}
.ev-item a { color: var(--ink); text-decoration: none; font-weight: 600; }
.ev-item a:hover { color: var(--indigo-2); }
.ev-item b { font-weight: 600; }
.ev-item .ev-detail { font-size: 11.5px; color: var(--ink-3); line-height: 1.75; margin-top: 3px; }

/* 整行可下钻：去处标签平时隐着，hover 才出现——列表默认状态要干净 */
.ev-item.clickable { cursor: pointer; transition: background var(--t-fast); }
.ev-item.clickable:hover { background: var(--paper-2); }
.ev-item.clickable:hover b { color: var(--indigo-2); }
.ev-go {
  font-family: var(--mono); font-size: 10px; color: var(--indigo);
  letter-spacing: .06em; margin-left: 7px; opacity: 0; transition: opacity var(--t-fast);
}
.ev-item.clickable:hover .ev-go { opacity: 1; }
/* 不可下钻的行：板块名不做成链接色，并说明为什么进不去 */
.ev-item b.plain { color: var(--ink-2); }
.ev-nodrill { display: block; color: var(--ink-3); opacity: .8; margin-top: 2px; }

/* 事件类型标记：整块色条而不是小徽章——它是这一行的"栏目名" */
.kind-tag {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .1em;
  padding: 3px 0; text-align: center; margin: 0;
  border: 1px solid var(--rule-hard); color: var(--ink-2); background: transparent;
  display: block; height: fit-content; white-space: nowrap;
}
.kind-tag.k-in     { background: var(--indigo); border-color: var(--indigo); color: var(--on-indigo); }
.kind-tag.k-out    { background: var(--ink-2); border-color: var(--ink-2); color: var(--on-indigo); }
.kind-tag.k-scarce { background: var(--red); border-color: var(--red); color: var(--on-indigo); }
.kind-tag.k-dens   { background: var(--amber); border-color: var(--amber); color: var(--on-indigo); }
.kind-tag.k-first  { background: var(--indigo); border-color: var(--indigo); color: var(--on-indigo); }
.kind-tag.k-flip   { border-color: var(--rule-hard); color: var(--ink-2); }
.kind-tag.k-hot    { border-color: var(--amber-line); color: var(--amber); background: var(--amber-soft); }
.kind-tag.k-news   { border-color: var(--indigo-deep); color: var(--indigo-2); background: var(--indigo-soft); }
/* 行内使用时（表格里）退回为小徽章 */
td .kind-tag, .tl-item .kind-tag { display: inline-block; padding: 1px 6px; margin-right: 6px; }

/* ══════════════════════════════════════════════════════════════
   今日
   ═══════════════════════════════════════════════════════════ */
.brief-overview {
  font-size: 13px; line-height: 1.85; padding: 0 0 0 var(--s3);
  border-left: 2px solid var(--indigo); background: none;
  margin-bottom: var(--s3); color: var(--ink-2); max-width: 76ch;
}
.brief-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: var(--s3); }
.brief-sector {
  border: 0; border-bottom: 1px solid var(--rule-soft); background: none;
  padding: var(--s4) 0;
}
.brief-head { display: flex; align-items: center; gap: var(--s2); margin-bottom: 7px; }
.brief-head b { font-family: var(--serif); font-size: 15.5px; font-weight: 600; }
.brief-view { font-size: 12.5px; line-height: 1.85; margin-bottom: var(--s2); color: var(--ink-2); }
.brief-item {
  font-size: 12px; padding: 7px 0 0; border-top: 0; line-height: 1.75;
  display: grid; grid-template-columns: 54px minmax(0,1fr); gap: 10px; color: var(--ink-2);
}
.brief-item > .k {
  font-family: var(--mono); font-size: 9.5px; letter-spacing: .14em;
  color: var(--indigo-2); padding-top: 4px;
}
.brief-item.nonc > .k { color: var(--red); }
.brief-item .anchor {
  font-size: 11.5px; color: var(--ink-3); margin-top: 4px;
  padding-left: 11px; border-left: 2px solid var(--rule);
}
.td-ml td, .td-ml th { vertical-align: top; }
.td-ml .ml-liner { max-width: 320px; }

/* 方法学脚注：从正文剥出来，看得懂但不抢视线 */
.method-note {
  font-family: var(--mono); font-size: 10px; color: var(--ink-3);
  line-height: 1.85; margin-top: 9px; padding-left: 11px;
  border-left: 2px solid var(--rule);
}

/* ══════════════════════════════════════════════════════════════
   研报库时间线
   ═══════════════════════════════════════════════════════════ */
.tl-day { margin-bottom: var(--s6); }
.tl-day h3 {
  display: flex; align-items: baseline; gap: var(--s3); flex-wrap: wrap;
  font-family: var(--mono); font-size: 9.5px; color: var(--red); letter-spacing: .2em;
  border-bottom: 1px solid var(--rule); padding-bottom: 6px; margin-bottom: var(--s1);
  text-transform: none;
}
.tl-day h3 .wd { font-family: var(--serif); font-size: 17px; color: var(--ink); letter-spacing: 0; }
.tl-channel { margin: var(--s2) 0 var(--s3); }
.tl-chan-head {
  padding: var(--s3) 0 var(--s2); border-bottom: 0; margin-bottom: 0;
  font-family: var(--mono); font-size: 10px; color: var(--ink-3); letter-spacing: .18em;
}
.tl-item {
  display: grid; grid-template-columns: 26px minmax(0,1fr) auto;
  gap: var(--s3); align-items: baseline;
  padding: 9px 0; border-bottom: 1px solid var(--rule-soft);
  font-size: 12.5px;
}
.tl-item.clickable { cursor: pointer; transition: background var(--t-fast); }
.tl-item.clickable:hover { background: var(--paper-2); }
.tl-title { line-height: 1.6; }
.tl-title .tl-sub { font-size: 11px; color: var(--ink-3); margin-top: 3px; }
.tl-meta { flex: none; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.tl-topics { display: flex; gap: 3px; flex-wrap: wrap; }
/* 档位标记：A 实心 / B 描边 / C 虚线，与三层徽标同一套编码逻辑 */
.tl-tier {
  font-family: var(--mono); font-size: 10px; text-align: center;
  padding: 2px 0; border: 1px solid transparent;
}
.tl-tier.A { background: var(--indigo); color: var(--on-indigo); }
.tl-tier.B { border-color: var(--rule-hard); color: var(--ink-2); }
.tl-tier.C { border-color: var(--rule-hard); border-style: dashed; color: var(--ink-3); }

/* ══════════════════════════════════════════════════════════════
   账号 / 付费
   ═══════════════════════════════════════════════════════════ */
.user-card {
  margin: var(--s2) 18px 0; padding: 10px var(--s3);
  border: 1px solid var(--rule-soft); background: var(--paper-2); font-size: 12px;
  border-radius: var(--radius);
}
.user-card a { color: var(--indigo); text-decoration: none; }
.user-card a:hover { color: var(--indigo-2); }
.btn {
  display: inline-block; padding: 5px var(--s3);
  border: 1px solid var(--indigo-deep); color: var(--indigo-2); text-decoration: none;
  font-size: 12px; background: transparent; cursor: pointer; border-radius: var(--radius);
}
.btn:hover { background: var(--indigo-soft); color: var(--ink); }
a.btn.small, .btn.small { padding: 2px var(--s2); font-size: 11px; }
.cost { font-family: var(--mono); font-size: 10px; color: var(--amber); margin-left: var(--s1); }

.paywall {
  position: fixed; inset: 0; background: rgba(10, 11, 8, .62);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  animation: fadein .18s ease;
}
.paywall-card {
  position: relative; background: var(--paper-2); border: 1px solid var(--rule);
  padding: var(--s6) var(--s7); width: min(460px, 92vw); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(0,0,0,.55);
  animation: popin .2s cubic-bezier(.2,.6,.35,1);
}
@keyframes popin { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.paywall-card h3 { font-family: var(--serif); font-size: 19px; font-weight: 600; margin-bottom: var(--s2); }
.paywall-card p { color: var(--ink-2); margin-bottom: var(--s3); line-height: 1.8; font-size: 12.5px; }

.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--s3); margin-bottom: var(--s4); }
.plan-card {
  border: 1px solid var(--rule-soft); background: var(--paper-2);
  padding: var(--s4) var(--s5); display: flex; flex-direction: column; gap: var(--s2);
  border-top: 2px solid var(--rule-hard);
}
.plan-card.hot { border-top-color: var(--red-deep); }
.plan-name { font-family: var(--mono); font-size: 9.5px; letter-spacing: .2em; color: var(--ink-3); }
.plan-price {
  font-size: 30px; font-family: var(--mono); color: var(--ink);
  font-weight: 400; letter-spacing: -.03em; font-variant-numeric: tabular-nums;
}
.plan-card ul { padding-left: 18px; font-size: 12px; line-height: 1.85; flex: 1; color: var(--ink-2); }
.pay-qr { width: 200px; height: 200px; display: block; margin: 10px 0; background: #fff; padding: 8px; }

/* ══════════════════════════════════════════════════════════════
   响应式
   ═══════════════════════════════════════════════════════════ */

/* 中等宽度：先牺牲侧栏宽度和主区留白，不动内容结构 */
@media (max-width: 1280px) {
  #sidebar { width: 180px; }
  #main { padding: var(--s5) var(--s5) 44px; }
  .board-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
  .brief-grid { grid-template-columns: 1fr; }
}

@media (max-width: 1100px) {
  .tree-split { grid-template-columns: 1fr; height: auto; }
  .tree-outline { max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--rule-soft); }
  .grid-2 { grid-template-columns: 1fr; }
}

/* 窄屏：侧栏转为横向标签条 */
@media (max-width: 900px) {
  :root { font-size: 15px; }   /* 触屏上正文放大一档 */
  #app { flex-direction: column; }
  #sidebar {
    width: 100%; flex-direction: row; align-items: center;
    padding: var(--s2) var(--s3); overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--rule);
    position: sticky; top: 0; z-index: 20;
  }
  .brand { padding: 0 var(--s4) 0 0; }
  .brand-name { font-size: 15px; }
  .brand-sub, #status-badges, .sidebar-foot, .nav-group { display: none; }
  #nav { flex-direction: row; flex: none; overflow: visible; }
  #nav a {
    border-left: 0; border-bottom: 2px solid transparent;
    padding: 10px var(--s3); white-space: nowrap; min-height: 44px;
  }
  #nav a.active { border-left: 0; border-bottom-color: var(--red-deep); }
  .user-card { margin: 0 0 0 auto; flex: none; }

  #main { padding: var(--s4) var(--s3) 44px; }
  .view-title { font-size: 21px; }

  /* KPI 行在窄屏改为 2×2，横向 4 栏会把数字压到读不清 */
  .row > .stat-card {
    flex: 1 1 calc(50% - var(--s3)); border-right: 0;
    border-bottom: 1px solid var(--rule-soft); padding: var(--s3) 0;
  }
  .stat-value { font-size: 26px; }

  .toolbar { position: static; }
  .table-wrap { max-height: none; overflow: auto; }
  .board-grid { grid-template-columns: 1fr; }
  .board-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .detail-drawer { width: 100vw; padding: var(--s5) var(--s4); }
  .rung { grid-template-columns: 18px minmax(0,1fr); }
  .rung-detail { grid-column: 2; }
  .form-grid { grid-template-columns: 1fr; gap: var(--s1) 0; }
  .form-grid label { margin-top: var(--s3); }
  .form-grid input, .form-grid select, .form-grid textarea { max-width: none; }
  .form-hint { grid-column: 1; }
  .ep-row { grid-template-columns: 1fr; }
  .chat-split { grid-template-columns: 1fr; height: auto; }
  .chat-sessions { border-right: 0; border-bottom: 1px solid var(--rule-soft); max-height: 160px; padding-right: 0; }
  .reader-split { grid-template-columns: 1fr; height: auto; }
  .reader-list { max-height: 220px; }
  .ev-item { grid-template-columns: 1fr; gap: var(--s1); }
  .kind-tag { display: inline-block; padding: 2px var(--s2); }
  .tl-item { grid-template-columns: 26px minmax(0,1fr); }
  .tl-meta { grid-column: 2; }
  .sig-item .who, .sig-item .what { flex: 0 0 auto; }
  .msg.user .bubble { max-width: 84%; }

  /* 触屏命中区 44px */
  button, .btn, .chip, .tabstrip a, .session-item, .reader-item { min-height: 44px; }
  button, .btn { display: inline-flex; align-items: center; justify-content: center; }
  .chip { display: inline-flex; align-items: center; }
  .btn.small, a.btn.small, .suggestions button { min-height: 36px; }
}

@media (max-width: 560px) {
  .row > .stat-card { flex: 1 1 100%; }
  .board-metrics { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .plan-grid { grid-template-columns: 1fr; }
}

/* 打印：周报要能直接出 PDF，深底必须翻回纸色 */
@media print {
  :root {
    --paper: #fff; --paper-2: #fff; --paper-3: #fff; --paper-4: #fff;
    --ink: #111; --ink-2: #333; --ink-3: #666;
    --rule: #bbb; --rule-soft: #ddd; --rule-hard: #999;
    --indigo: #1e3a57; --indigo-2: #1e3a57; --red: #b8352a; --green: #1c6f55;
  }
  body { height: auto; overflow: visible; }
  #sidebar, .toolbar, #chat-input-row, .drawer-close, .suggestions { display: none !important; }
  #app { display: block; }
  #main { overflow: visible; padding: 0; height: auto; }
  .table-wrap { overflow: visible; max-height: none; }
  th { position: static; }
  .md { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}


/* ── 全局横幅（登录态过期等需要用户动手的事） ──────────────── */
#session-banner { margin-bottom: var(--s4); }
.banner {
  padding: var(--s3) var(--s4);
  border: 1px solid var(--amber-line);
  background: var(--amber-soft);
  color: var(--ink);
  border-radius: var(--radius);
  margin-bottom: var(--s4);
  line-height: 1.7;
}
.banner b { color: var(--amber); }
.banner a { margin-left: var(--s2); }

/* 设置页里的登录态面板 */
.sess-grid { display: grid; grid-template-columns: max-content 1fr; gap: var(--s2) var(--s4); align-items: baseline; }
.sess-grid > span:nth-child(odd) { color: var(--ink-3); font-size: 12px; }
.sess-ok { color: var(--green); }
.sess-bad { color: var(--red); }
.sess-steps { color: var(--ink-2); line-height: 1.9; margin: var(--s3) 0 0; padding-left: 1.2em; }
.sess-steps code { background: var(--paper-3); padding: 1px 5px; border-radius: 3px; }

/* ── 轻提示 ─────────────────────────────────────────────── */
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  z-index: 90; max-width: min(560px, 90vw);
  padding: var(--s3) var(--s5); border-radius: var(--radius);
  background: var(--paper-3); color: var(--ink);
  border: 1px solid var(--rule-hard); box-shadow: 0 6px 24px rgba(0,0,0,.45);
  font-size: 13px; opacity: 0; transition: opacity var(--t);
  pointer-events: none;
}
.toast.err { border-color: var(--red); color: var(--red); }

/* ── 登录态：书签栏一键更新 ─────────────────────────────── */
.sess-quick {
  display: flex; align-items: center; gap: var(--s5);
  justify-content: space-between; flex-wrap: wrap;
  margin: var(--s4) 0 var(--s3); padding: var(--s4);
  border: 1px dashed var(--rule-hard); border-radius: var(--radius);
  background: var(--paper-3);
}
.sess-quick .btn { white-space: nowrap; cursor: grab; }
.sess-quick .btn:active { cursor: grabbing; }
.sess-manual { margin-top: var(--s3); }
.sess-manual summary { cursor: pointer; }

/* ══════════════════════════════════════════════════════════════
   v3：账号 / 管理后台 / 对话工作台 / 方法论库
   这几块是「操作界面」而不是「阅读版面」：字号比全站正文大一档（13.5px），
   用留白和分组而不是框线分隔；数字一律等宽；只有一种强调色用于「需要注意」。
   ═══════════════════════════════════════════════════════════ */
/* 组件自己的 display 规则会压过 hidden 属性，统一在这里让 hidden 说了算 */
[hidden] { display: none !important; }
.acct, .adm, .ws, .mth, .ui-dialog, .upanel { font-size: 13.5px; line-height: 1.6; }
.acct h1, .adm h1, .mth h1, .ws-hello h1 { font-family: var(--serif); font-weight: 600; letter-spacing: -.01em; color: var(--ink); }
.fine { font-size: 12px; color: var(--ink-3); line-height: 1.6; }
.muted { color: var(--ink-3); }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: right; }
button.danger-solid { background: var(--red-deep); border-color: var(--red-deep); color: #fff; font-weight: 600; }
button.danger-solid:hover { background: #cc4034; }
button.ghost.danger, button.danger { color: var(--red); }
.acct button, .adm button, .ws button, .mth button, .ui-dialog button, .upanel button, .side-acct button { font-size: 13px; padding: 7px 14px; }
.acct input, .adm input, .adm select, .adm textarea, .ui-dialog input, .ui-dialog select, .ui-dialog textarea, .upanel input, .upanel select, .upanel textarea, .mth input { font-size: 13px; padding: 8px 10px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label, .pair label { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
label em { font-style: normal; color: var(--ink-3); font-size: 11.5px; margin-left: 4px; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
label.check { flex-direction: row; align-items: center; gap: 8px; }
label.check input { width: auto; }

/* ---------- 小组件 ---------- */
.ui-avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #f3f1e8; font-weight: 600; flex: none; font-family: var(--cn); letter-spacing: 0; }
.ui-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; line-height: 1; padding: 4px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent; }
.ui-pill.member { background: var(--indigo-soft); color: var(--indigo-2); }
.ui-pill.trial { background: #243328; color: #8fd0b0; }
.ui-pill.soon { background: var(--amber-soft); color: var(--amber); }
.ui-pill.lapsed { border-color: var(--rule-hard); color: var(--ink-3); }
.ui-pill.free { border-color: var(--rule); color: var(--ink-3); }
.ui-pill.admin { background: #34293d; color: #cdb4e6; }
.ui-pill.off { background: var(--red-soft); color: var(--red); }

/* 额度条：签名元件。剩余量是实心条（从左往右消耗），满格=本月一点没用 */
.ui-quota { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.ui-quota .q-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.ui-quota .q-label { font-size: 12px; color: var(--ink-3); }
.ui-quota .q-num { font-family: var(--mono); font-variant-numeric: tabular-nums; color: var(--ink-2); font-size: 12.5px; }
.ui-quota .q-num b { font-size: 20px; font-weight: 500; color: var(--ink); letter-spacing: -.02em; }
.ui-quota .q-of { color: var(--ink-3); }
.ui-quota .q-track { height: 6px; border-radius: 3px; background: var(--paper-4); box-shadow: inset 0 0 0 1px var(--rule); overflow: hidden; }
.ui-quota .q-track i { display: block; height: 100%; background: linear-gradient(90deg, var(--indigo-deep), var(--indigo)); border-radius: 3px; transition: width .5s cubic-bezier(.2,.6,.35,1); }
.ui-quota.low .q-track i { background: var(--amber); }
.ui-quota.low .q-num b { color: var(--amber); }
.ui-quota.empty .q-num b { color: var(--red); }
.ui-quota .q-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); }
.ui-quota .q-foot b { color: var(--ink-2); font-family: var(--mono); font-weight: 500; }
.ui-quota.compact { gap: 4px; }
.ui-quota.compact .q-num b { font-size: 13px; }
.ui-quota.compact .q-track { height: 4px; }
.ui-quota.unlimited { flex-direction: row; justify-content: space-between; }

.ui-bars { width: 100%; height: 46px; display: block; }
.ui-empty { text-align: center; padding: 36px 16px; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.ui-empty-title { color: var(--ink-2); font-size: 14px; }
.ui-empty-hint { font-size: 12.5px; max-width: 36ch; }
.ui-empty button, .ui-empty .btn { margin-top: 6px; }

/* 对话框 */
.ui-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(8, 9, 6, .66); display: grid; place-items: center; padding: 16px; animation: fadein .14s ease; }
.ui-backdrop.out { opacity: 0; transition: opacity .14s; }
.ui-dialog { position: relative; width: min(440px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 10px; padding: 26px 28px 22px; box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: popin .18s cubic-bezier(.2,.6,.35,1); }
.ui-dialog.wide { width: min(640px, 100%); }
.ui-dialog-title { font-family: var(--serif); font-size: 19px; font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.ui-dialog-body p { color: var(--ink-2); margin-bottom: 10px; }
.ui-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.ui-dialog-error { color: var(--red); font-size: 12.5px; margin-top: 12px; }
.ui-x { position: absolute; top: 12px; right: 12px; padding: 4px 9px !important; color: var(--ink-3); }
.secret { font-size: 20px; letter-spacing: .06em; padding: 14px 16px; background: var(--paper-4); border: 1px dashed var(--rule-hard); border-radius: 6px; text-align: center; user-select: all; color: var(--ink); }
.code-dump { max-height: 280px; overflow: auto; background: var(--paper-4); padding: 12px 14px; border-radius: 6px; user-select: all; font-size: 13px; line-height: 1.8; }

.ui-toasts { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.ui-toast { background: #2b2d23; border: 1px solid var(--rule-hard); color: var(--ink); padding: 10px 16px; border-radius: 8px; font-size: 13px; box-shadow: 0 12px 30px rgba(0,0,0,.45); animation: popin .18s ease; }
.ui-toast.err { border-color: #6b3a33; color: #f0b3aa; }
.ui-toast.out { opacity: 0; transform: translateY(6px); transition: all .2s; }

/* ---------- 登录 ---------- */
.ui-dialog.auth { width: min(720px, 100%); padding: 0; display: grid; grid-template-columns: 250px 1fr; overflow: hidden; }
.auth-side { background: linear-gradient(160deg, #22301f 0%, #1c2433 100%); padding: 34px 28px; display: flex; flex-direction: column; gap: 14px; }
.auth-mark { font-family: var(--serif); font-size: 15px; color: #f3efe0; background: var(--red-deep); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 8px; font-weight: 600; }
.auth-pitch { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-top: 10px; }
.auth-perks { list-style: none; display: flex; flex-direction: column; gap: 10px; color: var(--ink-2); font-size: 13px; }
.auth-perks li { padding-left: 16px; position: relative; }
.auth-perks li::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--indigo); }
.auth-trial { margin-top: auto; font-size: 13px; color: #8fd0b0; }
.auth-trial b { font-family: var(--mono); font-size: 18px; }
.auth-form { padding: 30px 32px 26px; display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); font-size: 12.5px; }
.auth-switch { display: flex; gap: 22px; margin-bottom: 6px; }
.auth-switch button { background: none !important; border: 0; border-radius: 0; padding: 4px 0 !important; font-family: var(--serif); font-size: 19px !important; color: var(--ink-3); border-bottom: 2px solid transparent; }
.auth-switch button.on { color: var(--ink); border-bottom-color: var(--red-deep); font-weight: 600; }
.auth-go { padding: 10px !important; margin-top: 4px; }
.auth-err { color: var(--red); font-size: 12.5px; min-height: 0; }
.auth-err:empty { display: none; }
.auth-note { font-size: 12px; color: var(--ink-3); }

/* ---------- 侧栏账号卡 ---------- */
#user-block { padding: 0 var(--s3); margin-bottom: var(--s2); }
.side-acct { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 8px; background: var(--paper-2); border: 1px solid var(--rule-soft); color: inherit; text-decoration: none; transition: border-color var(--t-fast); }
a.side-acct:hover { border-color: var(--rule-hard); }
.side-acct.guest { flex-direction: row; }
.side-acct.guest button { flex: 1; padding: 7px 0; }
.sa-row { display: flex; gap: 9px; align-items: center; min-width: 0; }
.sa-name { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.sa-name b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-name .ui-pill { align-self: flex-start; font-size: 10.5px; padding: 3px 7px; }
.sa-warn { font-size: 11.5px; color: var(--amber); }
.side-admin { display: block; font-size: 12px; color: var(--ink-3); padding: 7px 12px 0; text-decoration: none; }
.side-admin:hover { color: var(--ink); }

/* ---------- 方案 / 账户 ---------- */
.acct { max-width: 980px; }
.acct-head h1 { font-size: 28px; }
.acct-head p { color: var(--ink-2); margin: 8px 0 22px; max-width: 60ch; }
.plan-current { background: var(--indigo-soft); color: var(--indigo-2); padding: 12px 16px; border-radius: 8px; margin-bottom: 14px; }
.plan-promo { color: var(--amber); margin-bottom: 14px; font-size: 13px; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-bottom: 26px; }
.plan { background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 22px 22px 20px; display: flex; flex-direction: column; gap: 6px; position: relative; }
.plan.featured { border-color: var(--indigo-line); background: linear-gradient(180deg, #1f2a37 0%, var(--paper-2) 60%); }
.plan.is-current::after { content: "当前"; position: absolute; top: 18px; right: 18px; font-size: 11px; color: var(--indigo-2); border: 1px solid var(--indigo-line); padding: 2px 8px; border-radius: 999px; }
.plan-name { font-family: var(--serif); font-size: 17px; color: var(--ink); font-weight: 600; }
.plan-price { margin-top: 8px; color: var(--ink-3); }
.plan-price b { font-family: var(--mono); font-size: 30px; font-weight: 400; color: var(--ink); letter-spacing: -.03em; }
.plan-sub { font-size: 12px; color: var(--ink-3); }
.plan-quota { margin: 10px 0 4px; padding: 8px 10px; background: var(--paper-4); border-radius: 6px; color: var(--ink-2); font-size: 13px; }
.plan-quota b { font-family: var(--mono); color: var(--ink); font-size: 15px; }
.plan ul { list-style: none; display: flex; flex-direction: column; gap: 7px; margin: 10px 0 18px; flex: 1; color: var(--ink-2); font-size: 13px; }
.plan ul li { padding-left: 18px; position: relative; }
.plan ul li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-size: 12px; }
.plan button { width: 100%; }
.acct-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-bottom: 14px; }
.panel { background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 20px 22px; margin-bottom: 14px; }
.panel h2 { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.panel h2 em { font-style: normal; font-family: var(--mono); font-size: 12px; color: var(--ink-3); font-weight: 400; }
.panel h2 select, .panel h2 button { margin-left: auto; width: auto; font-size: 12px; padding: 5px 10px; }
.cost-table { width: 100%; border-collapse: collapse; }
.cost-table td { padding: 11px 0; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.cost-table small { display: block; color: var(--ink-3); font-size: 12px; margin-top: 2px; }
.redeem-row { display: flex; gap: 8px; margin-top: 12px; }
.redeem-row input { flex: 1; text-transform: uppercase; letter-spacing: .05em; }
.packs { display: flex; flex-wrap: wrap; gap: 8px; }

.acct-hero { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.acct-hero .hero-id { flex: 1; }
.acct-hero h1 { font-size: 26px; }
.hero-sub { color: var(--ink-3); font-size: 12.5px; margin-top: 2px; }
.sub-card { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 12px; padding: 24px 26px; margin-bottom: 22px; align-items: center; }
.sub-card.soon { border-color: var(--amber-line); }
.sub-kicker { font-size: 12px; color: var(--ink-3); }
.sub-name { font-family: var(--serif); font-size: 26px; font-weight: 600; color: var(--ink); margin: 2px 0 4px; }
.sub-line { color: var(--ink-2); }
.sub-card.soon .sub-line { color: var(--amber); }
.sub-acts { display: flex; gap: 8px; margin-top: 16px; }
.sub-quota { padding-left: 26px; border-left: 1px solid var(--rule-soft); }
.acct-tabs, .adm-tabs, .up-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--rule); margin-bottom: 18px; }
.acct-tabs button, .adm-tabs button, .up-tabs button { background: none !important; border: 0; border-bottom: 2px solid transparent; border-radius: 0; color: var(--ink-3); padding: 9px 14px !important; margin-bottom: -1px; }
.acct-tabs button:hover, .adm-tabs button:hover, .up-tabs button:hover { color: var(--ink); }
.acct-tabs button.on, .adm-tabs button.on, .up-tabs button.on { color: var(--ink); border-bottom-color: var(--red-deep); font-weight: 600; }
.usage-days { display: flex; flex-direction: column; gap: 18px; }
.ud-date { display: flex; justify-content: space-between; color: var(--ink-3); font-size: 12px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); margin-bottom: 4px; }
.ud-date span { font-family: var(--mono); }
.ud-row { display: grid; grid-template-columns: 1fr auto 60px 50px; gap: 12px; padding: 6px 0; align-items: center; }
.ud-src { font-size: 11.5px; color: var(--ink-3); }
.ud-time { font-family: var(--mono); font-size: 12px; color: var(--ink-3); }
.ud-pts { font-family: var(--mono); text-align: right; color: var(--ink-2); }
.timeline { list-style: none; position: relative; padding-left: 4px; }
.timeline li { display: flex; gap: 14px; padding: 0 0 16px; position: relative; }
.timeline li::before { content: ""; position: absolute; left: 4px; top: 14px; bottom: 0; width: 1px; background: var(--rule); }
.timeline li:last-child::before { display: none; }
.tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--indigo); margin-top: 6px; flex: none; box-shadow: 0 0 0 3px var(--paper-2); }
.tl-when { font-size: 11.5px; color: var(--ink-3); font-family: var(--mono); margin-top: 2px; }
.tl-detail { font-size: 12.5px; color: var(--ink-2); margin-top: 2px; }
.timeline a { color: var(--indigo); }
table.plain { width: 100%; border-collapse: collapse; }
table.plain th { text-align: left; font-weight: 500; color: var(--ink-3); font-size: 12px; padding: 8px 10px 8px 0; border-bottom: 1px solid var(--rule); }
table.plain td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--rule-soft); }
.devices { list-style: none; }
.devices li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.devices li:last-child { border: 0; }
.devices .ui-pill { margin-left: 8px; }

/* ---------- 管理后台 ---------- */
.adm { max-width: 1180px; }
.adm-head { display: flex; flex-direction: column; gap: 14px; margin-bottom: 4px; }
.adm-head h1 { font-size: 26px; }
.adm-tabs { margin-bottom: 22px; }
.kpis { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px; background: var(--rule-soft); border: 1px solid var(--rule-soft); border-radius: 10px; overflow: hidden; margin-bottom: 16px; }
.kpi { background: var(--paper-2); padding: 18px 18px 16px; }
.kpi-v { font-family: var(--mono); font-size: 26px; color: var(--ink); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.kpi-l { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.kpi.warn .kpi-v { color: var(--amber); }
.trends { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.trend { background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 16px 18px 12px; }
.trend-h { display: flex; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.trend-h span { color: var(--ink-2); font-size: 13px; }
.trend-h b { font-family: var(--mono); font-weight: 500; color: var(--ink); font-size: 16px; }
.trend-h em { font-style: normal; font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.trend-x { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); margin-top: 6px; }
.adm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.people { list-style: none; }
.people li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--rule-soft); cursor: pointer; }
.people li:last-child { border: 0; }
.people .p-who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.people .p-who em, .u-who em { font-style: normal; font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.people button { padding: 5px 10px !important; font-size: 12px !important; }
.ranks { list-style: none; counter-reset: r; }
.ranks li { display: grid; grid-template-columns: 22px 1fr auto 44px; gap: 8px; padding: 8px 0; align-items: baseline; cursor: pointer; border-bottom: 1px solid var(--rule-soft); }
.ranks li::before { counter-increment: r; content: counter(r); font-family: var(--mono); color: var(--ink-3); font-size: 12px; }
.ranks b { font-family: var(--mono); font-weight: 500; }
.ranks em { font-style: normal; font-size: 12px; color: var(--ink-3); text-align: right; }

.users-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.users-bar input { width: 220px; }
.users-bar select { width: auto; }
.users-bar .primary { margin-left: auto; }
.seg { display: inline-flex; background: var(--paper-4); border: 1px solid var(--rule); border-radius: 8px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; border-radius: 6px; padding: 6px 12px !important; color: var(--ink-3); font-size: 12.5px !important; display: inline-flex; gap: 6px; align-items: baseline; }
.seg button span { font-family: var(--mono); font-size: 11px; color: var(--ink-3); }
.seg button:hover { color: var(--ink); background: none; }
.seg button.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 1px 0 rgba(0,0,0,.3), 0 0 0 1px var(--rule-hard); }
.u-table { background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 10px; overflow: hidden; }
.u-row { display: grid; grid-template-columns: 40px minmax(220px, 2fr) minmax(150px, 1fr) minmax(150px, 1fr) 110px; gap: 14px; align-items: center; padding: 12px 18px 12px 14px; border-bottom: 1px solid var(--rule-soft); cursor: pointer; transition: background var(--t-fast); }
.u-row:last-child { border: 0; }
.u-row:hover { background: var(--paper-3); }
.u-row.head { cursor: default; font-size: 12px; color: var(--ink-3); padding-top: 10px; padding-bottom: 10px; background: var(--paper-4); }
.u-row.head:hover { background: var(--paper-4); }
.u-row input[type=checkbox] { width: 16px; height: 16px; margin-left: 6px; accent-color: var(--indigo); }
.u-who { display: flex; gap: 11px; align-items: center; min-width: 0; }
.u-who > span { display: flex; flex-direction: column; min-width: 0; }
.u-who b { color: var(--ink); font-weight: 500; }
.u-who i { font-style: normal; font-size: 11.5px; color: var(--amber); }
.pager { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin-top: 12px; color: var(--ink-3); font-size: 12.5px; }
.bulk { position: sticky; bottom: 16px; margin: 16px auto 0; width: fit-content; display: flex; align-items: center; gap: 10px; background: #26303c; border: 1px solid var(--indigo-line); padding: 10px 14px 10px 18px; border-radius: 10px; box-shadow: 0 14px 40px rgba(0,0,0,.5); }
.bulk input { width: 70px; }

.choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 18px; }
.choice label { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--rule); border-radius: 8px; cursor: pointer; background: var(--paper-3); }
.choice label.on { border-color: var(--indigo-line); background: var(--indigo-soft); }
.choice input { display: none; }
.choice span { font-size: 12px; color: var(--ink-3); }
.field-row { display: flex; flex-wrap: wrap; gap: 18px 28px; }
.field-row label { display: flex; align-items: center; gap: 8px; color: var(--ink-2); }
.field-row input { width: 80px; }
.field-row select { width: auto; }
.plan-edit { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.pe { border: 1px solid var(--rule); border-radius: 8px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--paper-3); }
.pe label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-3); }
.pe-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pe-row label { flex-direction: row; align-items: center; }
.pe-name { font-family: var(--serif); font-size: 16px !important; font-weight: 600; background: none !important; border-color: transparent !important; padding-left: 0 !important; }
.pe-name:focus { border-color: var(--indigo-deep) !important; padding-left: 8px !important; }
.pe-foot { display: flex; justify-content: space-between; align-items: center; font-size: 11.5px; }
.save-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding: 14px 0; background: linear-gradient(0deg, var(--paper) 70%, transparent); }
.save-bar span { margin-right: auto; }

.codes-layout { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.code-maker { position: sticky; top: 0; }
.code-preview { background: var(--paper-4); padding: 10px 12px; border-radius: 6px; color: var(--ink-2); font-size: 12.5px; }
.batch { border-bottom: 1px solid var(--rule-soft); }
.batch summary { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 90px 50px 110px auto; gap: 12px; align-items: center; padding: 12px 0; cursor: pointer; list-style: none; }
.batch summary::-webkit-details-marker { display: none; }
.batch summary b { color: var(--ink); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.batch summary span, .batch summary em { font-size: 12.5px; color: var(--ink-3); font-style: normal; }
.batch-use { height: 5px; background: var(--paper-4); border-radius: 3px; overflow: hidden; }
.batch-use i { display: block; height: 100%; background: var(--green); }
.codes { list-style: none; padding: 0 0 12px 12px; }
.codes li { display: grid; grid-template-columns: 150px 60px 50px auto auto; gap: 12px; align-items: center; padding: 4px 0; font-size: 12.5px; }
.codes li.used, .codes li.expired, .codes li.disabled { color: var(--ink-3); }
.codes li.disabled .mono { text-decoration: line-through; }
.codes button { padding: 3px 8px !important; font-size: 12px !important; }

/* 用户详情面板（右侧滑出） */
.upanel-scrim { position: fixed; inset: 0; background: rgba(8,9,6,.45); z-index: 44; animation: fadein .15s ease; }
.upanel { position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100vw); background: var(--paper-2); border-left: 1px solid var(--rule); z-index: 45; display: flex; flex-direction: column; box-shadow: -30px 0 70px rgba(0,0,0,.5); animation: slidein .2s cubic-bezier(.2,.6,.35,1); }
.upanel.out { transform: translateX(30px); opacity: 0; transition: all .16s; }
.up-head { display: flex; gap: 14px; align-items: flex-start; padding: 26px 28px 16px; position: relative; }
.up-head h2 { font-family: var(--serif); font-size: 21px; font-weight: 600; color: var(--ink); line-height: 1.3; padding-right: 30px; }
.up-sub { color: var(--ink-3); font-size: 12.5px; }
.up-pills { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.up-tabs { padding: 0 20px; margin-bottom: 0; }
.up-body { flex: 1; overflow-y: auto; padding: 20px 28px 32px; }
.up-quota { margin-bottom: 20px; }
.up-block { padding: 16px 0; border-top: 1px solid var(--rule-soft); }
.up-block:first-child { border-top: 0; padding-top: 0; }
.up-block h3 { font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 10px; display: flex; gap: 8px; align-items: baseline; }
.up-block h3 em { font-style: normal; font-weight: 400; font-size: 12px; color: var(--ink-3); }
.up-block p { color: var(--ink-2); }
.up-block textarea { width: 100%; margin-bottom: 8px; }
.up-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.up-row select, .up-row input[type=date] { width: auto; }
.up-row input:not([type]) { flex: 1; min-width: 140px; }
.kv { list-style: none; }
.kv li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--rule-soft); }
.kv b { font-weight: 500; }
.danger-zone { border-top-color: #4a2e29; }
.rp-vp { padding: 8px 0; border-bottom: 1px solid var(--rule-soft); }
.rp-vp p { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }

/* ---------- 对话工作台 ---------- */
#main:has(> .ws) { padding: 0; overflow: hidden; }
.ws { display: grid; grid-template-columns: 250px minmax(0, 1fr); height: 100vh; }
.ws-rail { border-right: 1px solid var(--rule-soft); background: #1c1d17; display: flex; flex-direction: column; padding: 18px 12px; gap: 10px; min-height: 0; }
.ws-new { width: 100%; padding: 9px !important; }
.ws-find { font-size: 12.5px !important; }
.ws-list { flex: 1; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.ws-group { font-size: 11.5px; color: var(--ink-3); margin: 14px 8px 4px; }
.ws-item { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; border-radius: 6px; cursor: pointer; color: var(--ink-2); font-size: 13px; }
.ws-item:hover { background: var(--paper-3); color: var(--ink); }
.ws-item.on { background: var(--paper-3); color: var(--ink); box-shadow: inset 2px 0 0 var(--red-deep); }
.ws-t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-live { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex: none; animation: pulse 1.4s infinite; }
@keyframes pulse { 50% { opacity: .35; } }
.ws-more { visibility: hidden; padding: 0 6px !important; background: none !important; border: 0 !important; color: var(--ink-3); font-size: 15px !important; line-height: 1; }
.ws-item:hover .ws-more, .ws-item.on .ws-more { visibility: visible; }
.ws-none { color: var(--ink-3); font-size: 12.5px; padding: 20px 8px; }
.ws-menu { position: fixed; z-index: 70; background: var(--paper-3); border: 1px solid var(--rule-hard); border-radius: 8px; padding: 4px; display: flex; flex-direction: column; min-width: 110px; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.ws-menu button { background: none; border: 0; text-align: left; padding: 7px 12px; font-size: 13px; border-radius: 5px; }
.ws-menu button:hover { background: var(--paper-2); }
.ws-main { display: flex; flex-direction: column; min-height: 0; position: relative; }
.ws-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 28px; border-bottom: 1px solid var(--rule-soft); }
.ws-title { font-family: var(--serif); font-size: 16px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-title.editable { cursor: text; }
.ws-title.editable:hover { color: var(--indigo-2); }
.ws-link { font-size: 12.5px; color: var(--ink-3); text-decoration: none; flex: none; }
.ws-link:hover { color: var(--ink); }
.ws-log { flex: 1; overflow-y: auto; padding: 28px 28px 20px; }
.ws-log > * { max-width: 780px; margin-left: auto; margin-right: auto; }

.ws-hello { padding-top: 7vh; }
.ws-hello h1 { font-size: 30px; }
.ws-hello > p { color: var(--ink-2); margin: 8px 0 28px; font-size: 14px; }
.starters { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.st-col { display: flex; flex-direction: column; gap: 8px; }
.st-h { font-size: 12px; color: var(--ink-3); margin-bottom: 2px; }
.st-q { text-align: left; white-space: normal; line-height: 1.55; padding: 12px 14px !important; background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 8px; color: var(--ink-2); font-size: 13px !important; }
.st-q:hover { border-color: var(--indigo-line); color: var(--ink); background: var(--paper-2); }
.st-methods { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 8px; }
.st-m { text-align: left; white-space: normal; display: flex; flex-direction: column; gap: 3px; padding: 10px 12px !important; border-radius: 8px; border-color: var(--rule-soft); }
.st-m b { color: var(--ink); font-weight: 500; font-size: 13px; }
.st-m span { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }

.turn-user { display: flex; justify-content: flex-end; margin-bottom: 22px; }
.tu-body { max-width: 78%; background: var(--paper-3); border: 1px solid var(--rule); border-radius: 14px 14px 4px 14px; padding: 11px 16px; }
.tu-text { white-space: pre-wrap; color: var(--ink); font-size: 14px; line-height: 1.65; }
.tu-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 7px; }
.chip-m, .chip-r { display: inline-flex; align-items: center; gap: 5px; font-size: 12px !important; padding: 4px 9px !important; border-radius: 999px; border: 1px solid; line-height: 1.3; }
.chip-m { background: var(--amber-soft); border-color: var(--amber-line); color: var(--amber); }
.chip-r { background: var(--indigo-soft); border-color: #2f4a66; color: var(--indigo-2); }
.chip-m b, .chip-r b { font-weight: 500; color: var(--ink); }
.chip-m button, .chip-r button { background: none !important; border: 0 !important; padding: 0 0 0 2px !important; color: inherit; font-size: 11px !important; opacity: .7; }

/* 研究过程：签名元件——一行摘要，点开是时间线 */
.turn-ai { margin-bottom: 34px; }
.trail { display: flex; align-items: center; gap: 12px; width: 100%; background: none !important; border: 0 !important; border-top: 1px solid var(--rule-soft) !important; border-radius: 0 !important; padding: 10px 0 !important; text-align: left; color: var(--ink-3); font-size: 12.5px !important; }
.trail:hover .trail-chev { color: var(--ink); }
.trail-pips { display: flex; gap: 3px; align-items: center; flex: none; }
.trail-pips i { width: 7px; height: 7px; border-radius: 2px; background: var(--rule-hard); display: block; }
.trail-pips i.q { background: var(--indigo); }
.trail-pips i.t { background: #5d6150; }
.trail-pips i.m { background: var(--amber); }
.trail-pips i.w { background: var(--red); }
.turn-ai.live .trail-pips i:last-child { animation: pulse 1s infinite; }
.trail-sum { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.turn-ai.live .trail-sum { color: var(--ink-2); }
.trail-chev { font-size: 12px; flex: none; }
.steps { list-style: none; border-left: 1px solid var(--rule); margin: 2px 0 14px 5px; padding: 4px 0 4px 18px; display: flex; flex-direction: column; gap: 10px; }
.step { display: grid; grid-template-columns: 40px 1fr; gap: 8px; position: relative; font-size: 13px; }
.step::before { content: ""; position: absolute; left: -23px; top: 7px; width: 9px; height: 9px; border-radius: 2px; background: var(--rule-hard); box-shadow: 0 0 0 3px var(--paper); }
.step.tool::before { background: var(--indigo); }
.step.tool.running::before { animation: pulse 1s infinite; }
.step.tool.failed::before { background: var(--red); }
.step.method::before { background: var(--amber); }
.step.think::before { background: #5d6150; }
.step.warn::before { background: var(--red); }
.s-t { font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 2px; }
.s-tool { display: flex; gap: 10px; align-items: baseline; cursor: pointer; }
.s-tool b { font-weight: 500; color: var(--ink); }
.s-tool span { color: var(--ink-3); font-family: var(--mono); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.step.tool.done .s-tool::after { content: "查看返回"; font-size: 11.5px; color: var(--ink-3); margin-left: auto; }
.step.tool.failed .s-tool b { color: var(--red); }
.s-out { margin-top: 8px; font-family: var(--mono); font-size: 11.5px; line-height: 1.5; max-height: 260px; overflow: auto; background: var(--paper-4); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 10px 12px; color: var(--ink-3); white-space: pre-wrap; word-break: break-all; }
.step details summary { cursor: pointer; color: var(--ink-3); list-style: none; }
.step details summary::-webkit-details-marker { display: none; }
.step details summary::after { content: " ›"; }
.step details[open] summary::after { content: " ⌄"; }
.s-think { white-space: pre-wrap; color: var(--ink-3); font-size: 12.5px; line-height: 1.7; margin-top: 6px; }
.ticker { font-size: 12.5px; color: var(--ink-3); font-style: italic; padding: 2px 0 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.answer { font-size: 14.5px; line-height: 1.9; color: var(--ink); max-width: none; }
.answer.md p, .answer.md li { color: var(--ink); }
.answer:empty::before { content: ""; display: inline-block; width: 8px; height: 17px; background: var(--indigo); vertical-align: text-bottom; animation: pulse .9s infinite; }
.turn-ai:not(.live) .answer:empty { display: none; }
.turn-err { color: var(--red); background: var(--red-soft); padding: 10px 14px; border-radius: 8px; font-size: 13px; }
.cites { margin-top: 18px; padding-top: 12px; border-top: 1px dashed var(--rule); }
.cites-h { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }
.cites ol { list-style: none; counter-reset: c; display: flex; flex-direction: column; }
.cites li { counter-increment: c; }
.cites li button { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 2px 8px; width: 100%; text-align: left; background: none !important; border: 0 !important; border-radius: 6px !important; padding: 6px 8px !important; white-space: normal; }
.cites li button::before { content: counter(c); grid-row: span 2; font-family: var(--mono); font-size: 11px; color: var(--ink-3); padding-top: 2px; }
.cites li button:hover { background: var(--paper-3) !important; }
.c-meta { font-size: 11.5px; color: var(--ink-3); }
.c-title { color: var(--indigo-2); font-size: 13px; }
.turn-acts { display: flex; gap: 4px; margin-top: 10px; opacity: 0; transition: opacity var(--t-fast); }
.turn-ai:hover .turn-acts, .turn-ai:last-child .turn-acts { opacity: 1; }
.turn-acts button { padding: 5px 10px !important; font-size: 12px !important; color: var(--ink-3); }

.cmp { margin: 0 28px 20px; max-width: 780px; width: calc(100% - 56px); align-self: center; background: var(--paper-2); border: 1px solid var(--rule); border-radius: 14px; padding: 10px 12px 10px 14px; position: relative; box-shadow: 0 -10px 30px rgba(10, 11, 8, .35); transition: border-color var(--t-fast); }
.cmp:focus-within { border-color: var(--indigo-line); }
.cmp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-chips:not(:empty) { margin-bottom: 8px; }
#cmp-in { border: 0 !important; background: none !important; box-shadow: none !important; resize: none; padding: 4px 2px !important; font-size: 14.5px !important; line-height: 1.6; min-height: 30px; max-height: 240px; }
.cmp-bar { display: flex; align-items: center; gap: 6px; margin-top: 6px; }
.cmp-space { flex: 1; }
.cmp-tool { background: none !important; border: 1px solid transparent !important; color: var(--ink-3); padding: 5px 10px !important; font-size: 12.5px !important; border-radius: 999px !important; }
.cmp-tool:hover { color: var(--ink); border-color: var(--rule) !important; }
.cmp-tool.toggle.on { color: var(--green); border-color: var(--green-line) !important; }
.cmp-mode { display: inline-flex; background: var(--paper-4); border: 1px solid var(--rule); border-radius: 999px; padding: 2px; }
.cmp-mode button { background: none; border: 0; border-radius: 999px; padding: 5px 12px !important; font-size: 12.5px !important; color: var(--ink-3); display: inline-flex; gap: 5px; align-items: baseline; }
.cmp-mode button small { font-family: var(--mono); font-size: 10.5px; opacity: .75; }
.cmp-mode button.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 0 0 1px var(--rule-hard); }
.cmp-send { border-radius: 999px !important; padding: 7px 18px !important; }
.cmp-send.stop { background: var(--paper-3); border-color: var(--rule-hard); color: var(--ink); font-weight: 500; }
.cmp-pop { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); background: var(--paper-3); border: 1px solid var(--rule-hard); border-radius: 12px; box-shadow: 0 18px 50px rgba(0,0,0,.55); z-index: 30; overflow: hidden; }
.pop-head { display: flex; align-items: center; gap: 12px; padding: 12px 14px 8px; font-size: 12px; color: var(--ink-3); }
.pop-head input { flex: 1; }
.pop-list { max-height: 300px; overflow-y: auto; padding: 0 6px 6px; }
.pop-item { display: flex; flex-direction: column; gap: 3px; width: 100%; text-align: left; background: none !important; border: 0 !important; border-radius: 8px !important; padding: 9px 10px !important; white-space: normal; }
.pop-item.sel, .pop-item:hover { background: var(--indigo-soft) !important; }
.pi-t { color: var(--ink); font-size: 13.5px; display: flex; gap: 8px; align-items: baseline; }
.pi-t em { font-style: normal; font-size: 11px; color: var(--ink-3); }
.pi-d { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.pop-empty { padding: 16px 10px; color: var(--ink-3); font-size: 13px; }
.pop-empty a, .pop-foot { color: var(--indigo); }
.pop-foot { display: block; padding: 10px 16px; border-top: 1px solid var(--rule); font-size: 12.5px; text-decoration: none; }

/* ---------- 方法论库 ---------- */
.mth { max-width: 1080px; }
.mth-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; margin-bottom: 22px; }
.mth-head h1 { font-size: 28px; }
.mth-head p { color: var(--ink-2); margin-top: 8px; max-width: 62ch; }
.mth-acts, .md-acts, .me-acts { display: flex; gap: 8px; flex: none; }
.mth-bar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; }
.mth-bar input { width: 240px; }
.mth-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 12px; }
.mth-card { background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 10px; padding: 18px 18px 14px; cursor: pointer; display: flex; flex-direction: column; gap: 8px; transition: border-color var(--t-fast), transform var(--t-fast); }
.mth-card:hover { border-color: var(--rule-hard); transform: translateY(-1px); }
.mth-card h3 { font-family: var(--serif); font-size: 17px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.mth-card p { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.mc-top { display: flex; gap: 8px; align-items: center; }
.mc-src { font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--rule-hard); color: var(--ink-3); }
.mc-src.mine { border-color: var(--indigo-line); color: var(--indigo-2); }
.mc-src.public { border-color: var(--amber-line); color: var(--amber); }
.mc-pin { font-size: 11px; color: var(--green); }
.mc-foot { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); border-top: 1px solid var(--rule-soft); padding-top: 8px; }
.mth-back { display: inline-block; color: var(--ink-3); text-decoration: none; font-size: 12.5px; margin-bottom: 14px; }
.mth-back:hover { color: var(--ink); }
.md-head { display: flex; justify-content: space-between; gap: 24px; align-items: flex-start; padding-bottom: 20px; border-bottom: 1px solid var(--rule); margin-bottom: 24px; }
.md-head h1 { font-size: 28px; margin: 8px 0; }
.md-desc { color: var(--ink-2); max-width: 64ch; }
.md-acts { flex-direction: column; align-items: stretch; min-width: 170px; }
.md-pin { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--ink-2); padding: 4px 2px; }
.md-pin input { width: auto; accent-color: var(--indigo); }
.md-body { max-width: 76ch; font-size: 14px; }
.me-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.me-head h1 { font-size: 24px; }
.me-name { margin-bottom: 12px; }
.me-name label { display: flex; align-items: center; gap: 10px; color: var(--ink-2); }
.me-name input { max-width: 340px; }
.me-name .fine { margin-top: 6px; }
.me-split { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; height: calc(100vh - 250px); min-height: 380px; }
#me-src { height: 100%; font-family: var(--mono); font-size: 12.5px; line-height: 1.7; resize: none; padding: 14px 16px; }
.me-prev { height: 100%; overflow-y: auto; background: var(--paper-2); border: 1px solid var(--rule-soft); border-radius: 6px; padding: 14px 20px; max-width: none; }
.imp { display: flex; flex-direction: column; gap: 18px; }
.imp h4 { font-size: 13px; color: var(--ink); margin-bottom: 6px; }
.imp-row { display: flex; gap: 8px; margin-top: 8px; }
.imp-row select { width: auto; }
.imp textarea { width: 100%; margin: 6px 0 8px; }
.imp-scan { max-height: 220px; overflow-y: auto; }
.imp-scan div { display: grid; grid-template-columns: 150px 1fr auto; gap: 10px; padding: 6px 0; font-size: 12.5px; align-items: center; border-bottom: 1px solid var(--rule-soft); }
.imp-scan span { color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 1100px) {
  .kpis { grid-template-columns: repeat(3, 1fr); }
  .trends, .adm-grid { grid-template-columns: 1fr; }
  .codes-layout { grid-template-columns: 1fr; }
  .code-maker { position: static; }
}
@media (max-width: 760px) {
  .ws { grid-template-columns: 1fr; height: auto; min-height: 100vh; }
  .ws-rail { display: none; }
  .ws-log { padding: 18px 14px; }
  .cmp { margin: 0 12px 12px; width: calc(100% - 24px); }
  .cmp-bar { flex-wrap: wrap; }
  .starters { grid-template-columns: 1fr; }
  .sub-card { grid-template-columns: 1fr; }
  .sub-quota { padding: 0; border: 0; }
  .ui-dialog.auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .u-row { grid-template-columns: 30px 1fr; }
  .u-row > span:nth-child(n+4) { display: none; }
  .u-row.head { display: none; }
  .choice { grid-template-columns: 1fr; }
  .me-split { grid-template-columns: 1fr; height: auto; }
  .me-prev { display: none; }
  .mth-head, .md-head { flex-direction: column; align-items: stretch; }
}
@media (prefers-reduced-motion: reduce) {
  .ui-dialog, .ui-backdrop, .upanel, .ui-toast, .ws-live, .trail-pips i, .step::before, .answer:empty::before { animation: none !important; transition: none !important; }
}
.cites-more { font-size: 12px !important; padding: 5px 10px !important; margin-top: 4px; color: var(--ink-3); }
.pe-row label { white-space: nowrap; gap: 6px; }
.pe-row input { min-width: 0; flex: 1; }
.field-row select, .up-row select, .users-bar select { min-width: 96px; padding-right: 28px; }
.u-row .ui-quota .q-label { display: none; }
a.btn.primary { background: var(--indigo-deep); border-color: var(--indigo-line); color: #f6f7f0; font-weight: 600; text-decoration: none; }
a.btn.primary:hover { background: #48789f; }
.acct a.btn, .ui-empty a.btn { padding: 7px 14px; font-size: 13px; text-decoration: none; }
.side-acct .ui-quota .q-label { font-size: 11px; white-space: nowrap; }
.side-acct .ui-quota .q-num { white-space: nowrap; font-size: 11px; }
.plan-price span { font-size: 13px; font-family: var(--cn); letter-spacing: 0; }

/* 登录方式 / 验证码 / 接入配置 */
.auth-h { font-family: var(--serif); font-size: 20px; font-weight: 600; color: var(--ink); }
.auth-methods { display: flex; gap: 2px; background: var(--paper-4); border: 1px solid var(--rule); border-radius: 8px; padding: 3px; margin-bottom: 4px; }
.auth-methods button { flex: 1; background: none; border: 0; border-radius: 6px; padding: 7px 0 !important; color: var(--ink-3); font-size: 13px !important; }
.auth-methods button.on { background: var(--paper-2); color: var(--ink); box-shadow: 0 0 0 1px var(--rule-hard); }
.auth-form label > span { display: flex; gap: 4px; align-items: baseline; }
.cap-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: end; }
.cap-img { width: 120px; height: 38px; padding: 0 !important; border: 1px solid var(--rule) !important; border-radius: 6px !important; overflow: hidden; background: var(--paper-4) !important; font-size: 11px !important; color: var(--ink-3); }
.cap-img svg { display: block; width: 120px; height: 38px; }
.send-code { height: 38px; min-width: 120px; border: 1px solid var(--rule) !important; }
.wx-box { display: flex; flex-direction: column; gap: 12px; align-items: stretch; padding: 8px 0; }
.wx-mark { width: 52px; height: 52px; border-radius: 12px; background: #1f8a4c; color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 14px; }
.wx-box p { color: var(--ink-2); font-size: 13px; }
.auth-note a { color: var(--indigo); }
.binds { list-style: none; margin-bottom: 10px; }
.binds li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule-soft); }
.bind-acts { display: flex; gap: 6px; }
.golive .checks { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 10px; }
.golive .checks span { color: var(--ink-3); }
.golive .checks span.ok { color: var(--green); }
.intg h2 .ui-pill { margin-left: 4px; font-family: var(--cn); }
.intg-how { margin: -4px 0 14px; max-width: 90ch; }
.intg-how code { font-family: var(--mono); color: var(--ink-2); background: var(--paper-4); padding: 1px 5px; border-radius: 4px; user-select: all; }
.intg-fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 14px; }
.intg-fields label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-3); }
.intg-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.intg-msg { font-size: 12.5px; }
.intg-msg.ok { color: var(--green); }
.intg-msg.bad { color: var(--red); }
.intg-msg a { color: var(--indigo); }
.side-acct.guest { flex-direction: column; gap: 8px; }
.sa-guest-t { font-size: 12px; color: var(--ink-3); line-height: 1.5; }
.side-acct.guest button { width: 100%; }
@media (max-width: 900px) {
  .sa-guest-t { display: none; }
  .side-acct.guest button { width: auto; white-space: nowrap; }
}

/* ---------- 方法论多选 / 分享 / 回答版式 ---------- */
.pop-head em { font-style: normal; color: var(--ink-3); font-size: 11.5px; margin-left: 4px; }
.pop-item { display: grid !important; grid-template-columns: 20px 1fr; column-gap: 8px; }
.pop-item .pi-t, .pop-item .pi-d { grid-column: 2; }
.pi-check { grid-row: span 2; width: 18px; height: 18px; border-radius: 5px; border: 1px solid var(--rule-hard);
  display: grid; place-items: center; font-size: 12px; color: var(--on-indigo); margin-top: 2px; }
.pop-item.picked .pi-check { background: var(--indigo); border-color: var(--indigo); }
.pop-item.picked .pi-t { color: var(--indigo-2); }
div.pop-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
div.pop-foot a { color: var(--indigo); text-decoration: none; }
div.pop-foot button { padding: 5px 14px !important; font-size: 12.5px !important; border-radius: 999px !important; }
.ws-top-acts { display: flex; align-items: center; gap: 14px; flex: none; }
.ws-share { font-size: 12.5px !important; padding: 5px 12px !important; color: var(--ink-2); }

.share-scope { display: flex; flex-direction: column; gap: 8px; }
.share-form label.check { color: var(--ink-2); font-size: 13px; }
.share-result { display: grid; grid-template-columns: 148px 1fr; gap: 18px; align-items: center; }
.share-kit { display: grid; grid-template-columns: 1fr 220px; gap: 20px; align-items: start; }
.share-kit .sk-label { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.share-kit .sk-label .fine { margin-left: 6px; }
.share-kit .sk-text { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.share-kit textarea { width: 100%; font-size: 13px; line-height: 1.7; resize: vertical; }
.share-kit .share-acts { flex-wrap: wrap; }
.share-kit .sk-poster { display: flex; flex-direction: column; gap: 8px; }
.share-kit .sk-img { aspect-ratio: 3 / 4; display: grid; place-items: center; border: 1px solid var(--rule); border-radius: 10px; overflow: hidden; background: var(--paper-2, #212219); }
.share-kit .sk-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.share-kit .sk-img img.sk-qr { width: 70%; height: auto; background: #fff; padding: 8px; border-radius: 8px; }
.share-result img { background: #fff; padding: 8px; border-radius: 10px; width: 148px; height: 148px; }
.share-link { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.share-link input { font-size: 12px !important; }
.share-acts { display: flex; gap: 8px; }
.share-acts .btn { padding: 7px 14px; font-size: 13px; text-decoration: none; }
.auth-from { font-size: 12.5px; color: #8fd0b0; background: #1e2a22; border: 1px solid #2c4a3e; padding: 8px 12px; border-radius: 8px; }
.up-ref { margin-top: 6px; }
.up-ref a { color: var(--indigo); }
.shares-table tr.revoked td { color: var(--ink-3); }
.shares-table td a { color: var(--ink); text-decoration: none; }
.shares-table td a:hover { color: var(--indigo-2); }

/* 回答版式：结论卡、表格、代码块、有序列表 */
.answer h2 { font-family: var(--serif); font-size: 18px; font-weight: 600; color: var(--ink); margin: 26px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule-soft); }
.answer h3 { font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--ink); margin: 20px 0 8px; }
.answer ol, .answer ul { margin: 10px 0 10px 24px; }
.answer li { margin: 6px 0; }
.answer li::marker { color: var(--ink-3); font-family: var(--mono); font-size: .9em; }
.answer em { color: var(--ink-2); }
.answer a { color: var(--indigo); }
.answer blockquote { margin: 14px 0; padding: 10px 16px; border-left: 3px solid var(--rule-hard); background: var(--paper-2); border-radius: 0 8px 8px 0; color: var(--ink-2); }
.answer blockquote p { margin: 4px 0; }
.answer .md-conclusion { border-left-color: var(--red-deep); background: linear-gradient(90deg, #2b1e1a, var(--paper-2)); padding: 14px 18px; font-size: 15px; }
.answer .md-conclusion p { color: var(--ink); }
.md-table { overflow-x: auto; margin: 14px 0; border: 1px solid var(--rule); border-radius: 8px; }
.md-table table { width: 100%; border-collapse: collapse; font-size: 13px; }
.md-table th { text-align: left; font-weight: 500; color: var(--ink-3); background: var(--paper-2); padding: 8px 12px; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.md-table td { padding: 8px 12px; border-bottom: 1px solid var(--rule-soft); vertical-align: top; }
.md-table tr:last-child td { border-bottom: 0; }
.md-table .num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.md-code { background: var(--paper-4); border: 1px solid var(--rule-soft); border-radius: 8px; padding: 12px 14px; overflow-x: auto; font-size: 12.5px; line-height: 1.6; margin: 12px 0; }
.md-code code { background: none !important; padding: 0 !important; }
@media (max-width: 560px) { .share-result, .share-kit { grid-template-columns: 1fr; justify-items: stretch; } .share-kit .sk-poster { max-width: 260px; justify-self: center; } }

/* 换页载入中：旧页面变淡、不可点。延迟出现，快的页面不闪 */
#main.route-loading { opacity: .5; pointer-events: none; transition: opacity .15s ease .12s; }

/* ── 全局搜索 ─────────────────────────────────────────────── */
.gs-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: calc(100% - 24px); margin: 4px 12px 10px; padding: 7px 10px;
  background: var(--paper-3); border: 1px solid var(--rule); border-radius: 6px;
  color: var(--ink-3); font-size: 12.5px; cursor: pointer; text-align: left;
}
.gs-trigger:hover, .gs-trigger:focus-visible { border-color: var(--rule-hard); color: var(--ink-2); }
.gs-trigger kbd, .gs-foot span { font-family: var(--mono); font-size: 10.5px; }
.gs-trigger kbd { border: 1px solid var(--rule-hard); border-radius: 3px; padding: 0 5px; }
.gs-back {
  position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.45);
  display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
}
.gs-box {
  width: min(640px, 100%); max-height: 70vh; display: flex; flex-direction: column;
  background: var(--paper-2); border: 1px solid var(--rule-hard); border-radius: 10px;
  box-shadow: 0 18px 48px rgba(0,0,0,.45); overflow: hidden;
}
.gs-box input {
  border: 0; border-bottom: 1px solid var(--rule); border-radius: 0; background: transparent;
  padding: 14px 16px; font-size: 16px; color: var(--ink); outline: none;
}
.gs-list { overflow-y: auto; padding: 6px 0; }
.gs-group { padding: 8px 16px 4px; font-size: 11px; color: var(--ink-3); letter-spacing: .08em; }
.gs-item {
  display: flex; justify-content: space-between; align-items: baseline; gap: 12px;
  padding: 8px 16px; color: var(--ink); text-decoration: none;
}
.gs-item.on, .gs-item:hover { background: var(--paper-3); }
.gs-item.on { box-shadow: inset 2px 0 0 var(--indigo); }
.gs-main { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-main b { font-weight: 600; }
.gs-code { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--ink-3); }
.gs-meta { flex: none; font-size: 11.5px; color: var(--ink-3); }
.gs-empty { padding: 22px 16px; color: var(--ink-2); font-size: 13px; line-height: 1.8; text-align: center; }
.gs-foot { display: flex; gap: 16px; padding: 7px 16px; border-top: 1px solid var(--rule); color: var(--ink-3); }
@media (max-width: 760px) {
  .gs-back { padding-top: 8px; }
  .gs-box { max-height: 85vh; }
  .gs-meta { display: none; }
  .gs-foot { display: none; }
}

/* ── 我的关注 ─────────────────────────────────────────────── */
.watch-btn { vertical-align: middle; margin-left: 8px; font-size: 12px; font-weight: 400; }
.watch-btn.on { color: var(--amber); border-color: var(--amber); }
.wl-card h3 { margin-bottom: 8px; }
.wl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 18px; }
.wl-item { padding: 8px 0; border-top: 1px solid var(--rule-soft); min-width: 0; }
.wl-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.wl-head a { color: var(--ink); text-decoration: none; }
.wl-head a:hover { text-decoration: underline; }
.wl-evs { margin: 6px 0 0; padding: 0; list-style: none; font-size: 12.5px; color: var(--ink-2); line-height: 1.7; }
.wl-empty kbd { font-family: var(--mono); border: 1px solid var(--rule-hard); border-radius: 3px; padding: 0 4px; }

/* ── 窄屏：搜索按钮收短；对话会话列表做成抽屉 ─────────────────── */
.gs-short, .ws-rail-toggle { display: none; }
@media (max-width: 900px) {
  .brand { flex: none; }
  .brand-name { white-space: nowrap; }
  .gs-trigger { width: auto; flex: none; margin: 0 var(--s3) 0 0; min-height: 36px; }
  .gs-long, .gs-trigger kbd { display: none; }
  .gs-short { display: inline; }
}
@media (max-width: 760px) {
  .ws { position: relative; }
  .ws-rail-toggle { display: inline-flex; flex: none; min-height: 36px; padding: 0 10px; }
  .ws-rail {
    display: flex; position: fixed; z-index: 60; top: 0; bottom: 0; left: 0; width: min(300px, 86vw);
    transform: translateX(-102%); transition: transform .18s ease; box-shadow: 8px 0 28px rgba(0,0,0,.45);
  }
  .ws.rail-open .ws-rail { transform: none; }
  .ws.rail-open .ws-main { filter: brightness(.6); }
  .ws-top { padding: 10px 14px; }
}

/* 原文锁定卡（非会员）：原地说明，不弹全屏付费墙 */
.lock-card { border: 1px dashed var(--rule-hard); border-radius: 8px; padding: 14px 16px; background: var(--paper-3); }
.lock-card p { margin: 6px 0 10px; color: var(--ink-2); font-size: 13px; line-height: 1.7; }

/* 首次导览 */
.onboard { position: relative; border-color: var(--indigo); }
.onboard-x { position: absolute; top: 10px; right: 10px; }
.onboard-steps { margin: 6px 0 8px 1.2em; padding: 0; line-height: 1.85; color: var(--ink-2); font-size: 13.5px; }
.onboard-steps b { color: var(--ink); }
.onboard kbd { font-family: var(--mono); border: 1px solid var(--rule-hard); border-radius: 3px; padding: 0 4px; }

/* 键盘焦点可见（可点击的行 / 卡片） */
.ml-row:focus-visible, .board-card:focus-visible, .ev-item.clickable:focus-visible, .ws-item:focus-visible,
[data-open]:focus-visible, .mth-card:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

.sa-legacy { display: block; margin-top: 8px; font-size: 12px; color: var(--ink-3); text-align: center; }
.sa-legacy:hover { color: var(--ink-2); }

/* 统一登录面板：微信按钮用微信绿（品牌色，用户一眼认得）；其余沿用站内按钮 */
.wx-go { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
  padding: 11px; border-radius: 6px; border: 0; background: #07c160; color: #fff; font-size: 14.5px; font-weight: 600; cursor: pointer; }
.wx-go:hover { background: #06ad56; }
.wx-go:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.auth-form .auth-go { width: 100%; }
.auth-alt { font-size: 12.5px; color: var(--ink-3); text-align: center; margin-top: 2px; }
.auth-alt a { color: var(--indigo); }
.auth-alt .sep { margin: 0 6px; }

/* 对话结束后的实际消耗 */
.turn-bill { margin-top: 6px; font-size: 12px; color: var(--ink-3); }

/* 价格：原价划线 + 折扣标 */
.price-off { display: inline-block; margin-left: 8px; padding: 1px 7px; border-radius: 10px; font-size: 12px; font-weight: 600;
  color: #fff; background: var(--red, #b8352a); vertical-align: middle; }
.price-was { color: var(--ink-3); }
.plan-quota small { display: block; margin-top: 2px; font-size: 12px; color: var(--ink-3); font-weight: 400; }
.packs button { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }
.packs button s { color: var(--ink-3); font-size: 12px; }

/* 后台方案编辑：实付 / 成本线预览 */
.pe.off { opacity: .6; }
.pe-price { font-size: 12.5px; color: var(--ink-2); padding: 4px 0; }
.pe-price .ok { color: var(--indigo-2, #7fa8d4); }
.pe-price .bad { color: var(--red, #b8352a); }
.pe .chk { flex-direction: row !important; align-items: center; gap: 6px; }

/* ---------- 套餐分档：免费预览的提示条、功能对比 ---------- */
.lock-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px;
  border: 1px dashed var(--rule-hard); border-radius: 8px; background: var(--paper-3); font-size: 13px; color: var(--ink-2); }
.lock-bar > span:nth-child(2) { flex: 1; min-width: 200px; line-height: 1.6; }
.lock-bar .lock-ico { font-size: 14px; }
.cost.lock { color: var(--ink-3); }
.locked-view { max-width: 560px; margin: 60px auto; }
.plan-badge { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 600;
  background: var(--amber); color: var(--paper); vertical-align: 2px; }
.tier-table th { text-align: left; font-size: 12px; color: var(--ink-3); padding: 8px 8px 8px 0; border-bottom: 1px solid var(--rule-hard); font-weight: 600; }
.tier-table th.on { color: var(--ink); }
.tier-table td { padding: 9px 8px 9px 0; font-size: 13px; }
.tier-table td:first-child { color: var(--ink); min-width: 180px; }
.tier-table td .ok { color: var(--pos, #1a7f37); font-weight: 700; }
.tier-edit td { padding: 6px 8px 6px 0; vertical-align: middle; }
.tier-edit select, .pe select, .field-row select { margin: 0 4px; }
.nav-lock { margin-left: 6px; font-size: 11px; opacity: .7; }

/* ---------- 研报原文在线阅读（防下载：canvas 逐页 + 水印） ---------- */
.reader { user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.reader-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 12px; color: var(--ink-3); margin: 0 0 8px; }
.reader-pages { display: flex; flex-direction: column; gap: 10px; }
.rpage { position: relative; background: var(--paper-3); border: 1px solid var(--rule-soft); border-radius: 4px; overflow: hidden; }
.rpage.img { aspect-ratio: 1 / 1.414; }
.rpage.txt { min-height: 120px; }
.rpage canvas { display: block; width: 100%; height: auto; pointer-events: none; }
.rpage-no { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: var(--ink-3); z-index: 1; }
.rpage.loaded .rpage-no { opacity: .6; }
.rpage-err { padding: 16px; font-size: 13px; color: var(--ink-2); }
.rtext { white-space: pre-wrap; line-height: 1.8; font-size: 14px; padding: 16px 18px 26px; color: var(--ink); background-repeat: repeat; }

/* ---------- 每日领取 / 畅读 / 加赠 ---------- */
.claim-btn { display: block; width: 100%; box-sizing: border-box; white-space: normal; line-height: 1.45; text-align: center;
  margin-top: 8px; padding: 7px 8px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
  border: 1px solid var(--amber); color: var(--amber); background: transparent; cursor: pointer; }
.claim-btn:hover { background: var(--amber); color: var(--paper); }
.claim-on, .claim-done { margin-top: 8px; font-size: 12px; color: var(--ink-3); text-align: center; }
.claim-on { color: var(--amber); }
.q-perm { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }
.bonus-tag { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 8px; font-size: 11px; font-weight: 600;
  color: #fff; background: var(--red, #b8352a); vertical-align: 2px; }
.packs .bonus-tag { margin: 2px 0 0; }
.code-dump { white-space: pre-wrap; word-break: break-all; line-height: 1.8; max-height: 50vh; overflow: auto; user-select: all; }
.claim-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 12px; padding: 10px 14px;
  border: 1px solid var(--amber); border-radius: 8px; font-size: 13px; color: var(--ink-2); }
.claim-banner > span { flex: 1; min-width: 220px; line-height: 1.6; }
.sub-quota .claim-btn { max-width: 320px; }

/* 首屏产品说明（index.html 里服务端直出，给爬虫与禁用脚本的访客看；工作台渲染后被替换） */
.seo-intro { max-width: 720px; padding: 32px 8px; color: var(--ink-2); line-height: 1.8; }
.seo-intro h1 { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-bottom: 12px; }
.seo-intro ul { margin: 12px 0 12px 20px; }
.seo-intro p { margin: 10px 0; }
.sidebar-public { margin-top: 4px; }
.sidebar-public a { color: var(--ink-3); }
.sidebar-public a:hover { color: var(--ink); }

/* 风向变化：时间窗概览 */
.wind-summary { margin: 4px 0 10px; color: var(--ink-3); }
.wind-summary b { color: var(--ink); }
.wind-days { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.wind-days .chip { cursor: pointer; font-variant-numeric: tabular-nums; }
.wind-days .chip.off, .toolbar .chip.off { opacity: .45; cursor: default; }

/* 开放 API：建 Key 的一行表单 */
.inline-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 12px; }
.inline-form input { flex: 1 1 220px; width: auto; }
