:root {
  color-scheme: light;
  --bg: #f7f6f0;
  --panel: #ffffff;
  --ink: #111816;
  --muted: #66706c;
  --line: #dce3de;
  --line-strong: #c8d2cc;
  --accent: #245c45;
  --accent-2: #315f7c;
  --warn: #a76518;
  --bad: #a63b32;
  --soft: #edf2ee;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
.shell { min-height: 100dvh; display: grid; grid-template-columns: 232px minmax(0, 1fr); }
.sidebar { background: #111816; color: white; padding: 24px 14px; position: sticky; top: 0; height: 100dvh; display: flex; flex-direction: column; }
.brand { padding: 0 10px 28px; }
.brand strong { display: block; font-size: 25px; letter-spacing: 0; }
.brand span { display: block; margin-top: 4px; color: rgba(255,255,255,.62); font-size: 12px; }
.nav { display: grid; gap: 4px; }
.nav button {
  width: 100%;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255,255,255,.76);
  text-align: left;
  padding: 0 12px;
  cursor: pointer;
}
.nav button.active { background: var(--accent); color: white; font-weight: 750; }
.boundary { margin-top: auto; padding: 14px 10px 0; color: rgba(255,255,255,.58); font-size: 12px; line-height: 1.45; border-top: 1px solid rgba(255,255,255,.12); }
.content { padding: 28px 34px 44px; max-width: 1360px; width: 100%; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.security-topbar { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 22px; }
/* 返回按钮：无底色，只在 hover 时浮出一层浅底。它是这一行的第三顺位，
   跟标题和 tab 抢视觉重量没有道理。与 h1 垂直居中。 */
.back-btn {
  flex: 0 0 auto;
  width: 34px; height: 34px; margin: -1px 2px 0 -6px;
  display: grid; place-items: center;
  border: 0; border-radius: 9px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s;
}
.back-btn:hover { background: var(--soft); color: var(--ink); }
.back-btn:active { transform: translateY(1px); }
.back-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* tab 紧跟标题，不推到行右端：它切的是这只标的的两份档案，挨着标的名才读得出从属关系。
   与 h1（32px 行高）居中对齐，不跟 subtitle 那一行扯平。 */
.security-topbar-title { flex: 0 1 auto; min-width: 0; }
.security-title-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.security-code { color: var(--muted); font-size: 13px; }
/* tab 在标题下面自成一行，宽度只包住自己：这一栏以后还会加 tab，
   横排迟早跟右边的状态块抢位置。 */
.security-topbar .sec-tabs { display: inline-flex; margin: 9px 0 0; }
/* 标的状态（基本面/信心/欠的功课）挂在这一行右端的空白里，两个 tab 共享。
   它以前是标题下面一条全宽横条，而 chat-route 把整页钉在 100dvh 内，
   那条横条吃掉的 240px 是直接从对话框高度里扣的。 */
.security-topbar-status { flex: 0 0 auto; margin-left: auto; margin-top: 3px; display: grid; gap: 6px; justify-items: end; }
.topbar-pills { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; justify-content: flex-end; }
.topbar-counts { font-size: 12px; color: var(--muted); white-space: nowrap; }
.topbar-counts b { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.topbar-counts b.alert { color: var(--warn); }
h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: 0; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.grid { display: grid; gap: 14px; }
.metrics { grid-template-columns: repeat(var(--metric-cols, 4), minmax(0, 1fr)); }
.two { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 16px; min-width: 0; }
.panel.tight { padding: 0; overflow: hidden; }
.position-table { overflow-x: auto !important; }
/* 表头不折行：列宽由最短的数值单元格（"7.0%"）决定，四个字的表头会被挤成两行。 */
.position-table th { white-space: nowrap; }
/* 标的页右栏放不下七列表格，一笔成交一行 */
.trade-line { padding: 7px 0; border-bottom: 1px solid var(--line); }
.trade-line:last-child { border-bottom: 0; padding-bottom: 0; }
.panel h2 { margin: 0 0 4px; font-size: 15px; }
.hint { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.metric .label { color: var(--muted); font-size: 12px; }
.metric .value { margin-top: 8px; font-size: clamp(20px, 1.8vw, 25px); font-weight: 780; font-variant-numeric: tabular-nums; }
.metric .sub { margin-top: 6px; color: var(--muted); font-size: 12px; }
/* 归一到人民币的总额占第一列：它是主数（仓位纪律的分母全是它），右边几列是它
   按币种的拆解。标记用底色和描边，不动字号——同一行里字号不齐会让人以为读的
   是两种东西；而不标记的话，几个都以 ¥ 开头的数看上去平级，没有任何线索告诉
   读的人纪律在比的是哪一个。 */
.metric.primary { border-color: var(--line-strong); background: var(--soft); }
.metric-warn { color: var(--warn); font-weight: 700; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; color: var(--muted); font-weight: 700; border-bottom: 1px solid var(--line); padding: 9px 10px; }
td { border-bottom: 1px solid #edf0ed; padding: 10px; vertical-align: top; }
tr:last-child td { border-bottom: 0; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 24px; border-radius: 999px; padding: 2px 10px; color: white; font-size: 12px; line-height: 1; font-weight: 750; background: var(--accent); white-space: nowrap; }
.pill-label { display: block; transform: translateY(1px); }
.pill.warn { background: #7a4308; color: white; }
.pill.bad { background: var(--bad); color: white; }
.pill.blue { background: var(--accent-2); color: white; }
.pill.muted { background: #59615c; color: white; }
.actions-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn {
  border: 0;
  border-radius: 8px;
  min-height: 36px;
  padding: 0 13px;
  background: var(--accent);
  color: white;
  font-weight: 750;
  cursor: pointer;
}
.btn.secondary { background: #e6ebe7; color: var(--ink); border: 1px solid var(--line); }
.btn.danger { background: var(--bad); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .58; cursor: wait; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field { display: grid; gap: 5px; margin-bottom: 11px; }
label { color: var(--muted); font-size: 12px; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 9px 10px;
}
textarea { min-height: 82px; resize: vertical; line-height: 1.45; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(286px, 1fr)); gap: 16px; align-items: stretch; }
.security-card {
  position: relative;
  min-height: 248px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--tile-ink, var(--accent)) 18%, transparent);
  background: var(--tile-bg, var(--panel));
  color: var(--tile-ink, var(--ink));
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.security-card::after {
  content: "";
  position: absolute;
  right: -28px;
  bottom: -30px;
  width: 124px;
  height: 124px;
  border-radius: 8px;
  background: var(--tile-accent, var(--accent));
  opacity: .14;
  transform: rotate(9deg);
  pointer-events: none;
}
.security-card:hover, .security-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tile-ink, var(--accent)) 42%, transparent);
  box-shadow: 0 16px 34px rgba(39, 48, 43, .10);
  outline: 0;
}
.security-card:active { transform: translateY(1px); }
/* 有持仓的标的：左侧一条竖杠，在一屏卡片里一眼能扫出来哪些是真金白银。 */
.security-card.held { border-color: color-mix(in srgb, var(--tile-ink, var(--accent)) 45%, transparent); }
.security-card.held::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--tile-accent, var(--accent));
  pointer-events: none;
  z-index: 1;
}
.security-card > * { position: relative; z-index: 1; }
.security-title { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.security-title strong { display: block; font-size: 18px; }
.security-title > div > span { display: block; color: color-mix(in srgb, var(--tile-ink, var(--ink)) 70%, white); font-size: 12px; margin-top: 3px; }
.security-card .text-block { margin-top: 28px; color: color-mix(in srgb, var(--tile-ink, var(--ink)) 82%, white); font-size: 14px; }
.security-quote { display: flex; align-items: baseline; gap: 10px; margin-top: 14px; font-variant-numeric: tabular-nums; }
.security-quote-label { color: color-mix(in srgb, var(--tile-ink, var(--ink)) 68%, white); font-size: 12px; }
.security-quote-price { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.security-quote-change { font-size: 13px; font-weight: 800; }
.security-quote-change.up { color: #147a45; }
.security-quote-change.down { color: #bc4037; }
.security-quote-empty { color: color-mix(in srgb, var(--tile-ink, var(--ink)) 68%, white); font-size: 13px; }
.position-pnl { display: inline-grid; gap: 2px; font-weight: 750; font-variant-numeric: tabular-nums; }
.position-pnl small { font-size: 11px; font-weight: 650; }
.position-pnl.up { color: #147a45; }
.position-pnl.down { color: #bc4037; }
.tile-signal { min-height: 22px; color: color-mix(in srgb, var(--tile-ink, var(--ink)) 68%, white); font-size: 12px; }
.tile-code-mark { margin-top: 18px; font-size: 11px; font-weight: 850; letter-spacing: .08em; color: color-mix(in srgb, var(--tile-ink, var(--ink)) 58%, white); }
.tile-mark-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.tile-mark-row .tile-code-mark { margin-top: 0; }
.tile-held {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 9px;
  background: var(--tile-accent, var(--accent));
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .02em;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.add-security-card {
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-height: 248px;
  text-align: center;
  border: 1px dashed #c8d0e2;
  background: linear-gradient(135deg, #ffffff 0%, #f3f5ff 100%);
  color: #202942;
}
.add-security-card::after { display: none; }
.add-security-mark {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #e8ecff;
  color: #3f57ff;
  font-size: 42px;
  line-height: 1;
  font-weight: 360;
}
.add-security-card strong { display: block; font-size: 20px; }
.add-security-card p { max-width: 22ch; margin: 8px auto 0; color: #667085; font-size: 13px; line-height: 1.45; }
.kv { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px; font-size: 13px; line-height: 1.45; }
.kv .k { color: var(--muted); }
.text-block { white-space: pre-wrap; font-size: 13px; line-height: 1.5; }
.today-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.today-panel-head h2 { margin: 0 0 4px; }
.today-panel-head .hint { margin: 0; }
.today-link { border: 0; background: transparent; color: var(--accent); font-size: 12px; font-weight: 750; cursor: pointer; padding: 0; white-space: nowrap; }
.today-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.today-move { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.today-move b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.today-move b.up { color: #147a45; }
.today-move b.down { color: #bc4037; }
.today-alloc { display: flex; height: 9px; border-radius: 999px; overflow: hidden; background: var(--soft); }
.today-alloc span { display: block; height: 100%; }
.today-alloc-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; font-size: 12px; color: var(--muted); }
.today-alloc-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.today-alloc-legend b { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }
.today-holdings { margin-top: 16px; border-top: 1px solid var(--line); }
.today-holding { display: grid; grid-template-columns: minmax(0, 1fr) 104px 132px; gap: 12px; align-items: center; padding: 11px 0; border-bottom: 1px solid #edf0ed; }
.today-holding:last-child { border-bottom: 0; }
.today-holding-name strong { display: block; font-size: 14px; }
.today-holding-name span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.today-change { text-align: right; font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.today-change small { display: block; margin-top: 2px; font-size: 11px; font-weight: 650; }
.today-change.up { color: #147a45; }
.today-change.down { color: #bc4037; }
.today-change.flat { color: var(--muted); font-weight: 700; }
.today-weight-label { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.today-weight-bar { margin-top: 5px; height: 5px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.today-weight-bar span { display: block; height: 100%; background: var(--accent); }
/* 占比是这一栏的主角，比"占总资产"这个标签深一档。 */
.today-weight-value { color: var(--ink); font-weight: 700; }
/* 超过单一标的上限：条已经满格，只剩颜色能说明"这不是刚好到顶，是过了"。 */
.today-weight-bar span.over { background: var(--bad); }
.today-weight-label .over { color: var(--bad); font-weight: 750; }
.today-group { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.today-group:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.today-group h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 9px; font-size: 12px; letter-spacing: .03em; color: var(--muted); }
.today-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--soft); color: var(--ink); font-size: 11px; font-weight: 800; }
.today-count.alert { background: #f3e2d3; color: #7a4308; }
.today-task { margin-top: 8px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; }
.today-task:first-child { margin-top: 0; }
.today-task-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.today-task-head > div > strong { display: block; font-size: 14px; }
.today-task-head > div > span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.today-task p { margin: 8px 0 0; font-size: 13px; line-height: 1.45; }
.today-task .actions-row { margin-top: 9px; }
.today-empty { padding: 16px; border: 1px dashed var(--line-strong); border-radius: 8px; background: rgba(255,255,255,.58); color: var(--muted); font-size: 13px; line-height: 1.5; }
.today-empty p { margin: 0 0 10px; }
.today-empty p:last-child { margin-bottom: 0; }
.empty, .error { border: 1px dashed var(--line-strong); background: rgba(255,255,255,.58); border-radius: 8px; padding: 22px; color: var(--muted); }
.error { color: var(--bad); border-color: rgba(166,59,50,.45); }
.error.inline { margin-bottom: 14px; padding: 10px 12px; }
.notice { padding: 10px 12px; border-radius: 8px; background: #e9f0ec; color: #214935; font-size: 13px; margin-bottom: 14px; }
.advisor-box { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; align-items: stretch; min-height: 0; }
/* 列轨道必须钉死 minmax(0, 1fr)：默认的 auto 轨道下限是气泡的 min-content，
   消息里一旦出现 nowrap 的宽表格，轨道会被撑到容器之外，连带 .bubble 的
   max-width: 82% 一起放大，整个对话框被迫横向滚动。 */
.advisor-log { min-height: 320px; max-height: 480px; overflow: auto; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; background: var(--soft); border-radius: 8px; padding: 14px; }
.bubble { max-width: 82%; min-width: 0; display: flex; align-items: flex-end; gap: 9px; padding: 12px 14px; border-radius: 10px; font-size: 15px; line-height: 1.7; color: #0d1512; background: #ffffff; border: 1px solid var(--line-strong); }
.bubble-content { white-space: pre-wrap; word-break: break-word; }
/* 研究员那半边是渲染过的 markdown：换行交给块元素，不再靠 pre-wrap。 */
.bubble-content.md { white-space: normal; }
.md > :first-child { margin-top: 0; }
.md > :last-child { margin-bottom: 0; }
.md p { margin: 8px 0; }
.md h4, .md h5, .md h6 { margin: 13px 0 6px; font-size: 15px; font-weight: 650; }
.md ul, .md ol { margin: 8px 0; padding-left: 21px; }
.md li { margin: 3px 0; }
.md a { color: var(--accent); }
.md code { padding: 1px 5px; border-radius: 4px; background: #eef2ef; font-size: 13px; }
.md pre { margin: 8px 0; padding: 10px 12px; border-radius: 8px; background: #eef2ef; overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md blockquote { margin: 8px 0; padding: 2px 0 2px 12px; border-left: 3px solid var(--line-strong); color: #55605b; }
.md hr { margin: 13px 0; border: 0; border-top: 1px solid var(--line-strong); }
.md-table { margin: 8px 0; overflow-x: auto; }
.md-table table { border-collapse: collapse; font-size: 14px; }
.md-table th, .md-table td { padding: 5px 9px; border: 1px solid var(--line-strong); text-align: left; vertical-align: top; white-space: nowrap; }
.md-table th { background: var(--soft); font-weight: 650; }
/* 全局那条 `tr:last-child td { border-bottom: 0 }` 是给持仓表那类数据表设的（最后一行不画线），
   特异度比 .md-table td 高，会把消息里表格的底边框吃掉。这里是四面都要有框的网格，显式补回来。 */
.md-table tr:last-child td { border-bottom: 1px solid var(--line-strong); }
.bubble-body { min-width: 0; }
.bubble-time { flex: 0 0 auto; padding-bottom: 4px; font-size: 11px; line-height: 1; color: var(--muted); font-variant-numeric: tabular-nums; }
.bubble.user .bubble-time { color: #5c7a6b; }
.bubble.user { margin-left: auto; background: #d3e7da; border-color: #a9c9b6; color: #0c2119; }
.bubble.agent { margin-right: auto; }
.bubble.pending { margin-right: auto; align-items: center; color: #55605b; background: transparent; border-style: dashed; font-size: 14px; }
.spinner { flex: 0 0 auto; width: 13px; height: 13px; border: 2px solid #c2cdc6; border-top-color: var(--accent); border-radius: 50%; animation: spinner-turn .8s linear infinite; }
@keyframes spinner-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 2.4s; } }
.advisor-log .empty { padding: 14px; font-size: 14px; line-height: 1.6; color: #55605b; }
.advisor-attachments { display: grid; gap: 8px; }
.bubble-content + .advisor-attachments { margin-top: 8px; }
.advisor-audio { display: grid; gap: 5px; min-width: 230px; }
.advisor-audio audio { width: 100%; height: 34px; }
.advisor-attachment-link { color: var(--accent); font-size: 13px; font-weight: 600; text-decoration: none; }
.advisor-attachment-link:hover { text-decoration: underline; }
.small { color: var(--muted); font-size: 12px; }
.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 390px; gap: 14px; align-items: start; }
.security-layout { display: grid; grid-template-columns: minmax(0, 1fr) 430px; gap: 14px; align-items: stretch; min-height: 0; }
.chat-panel { min-height: 0; display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.chat-log { flex: 1 1 auto; min-height: 0; max-height: none; border-radius: 0; }
.chat-form { flex: 0 0 auto; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: end; padding: 12px 16px; border-top: 1px solid var(--line); background: var(--panel); }
.chat-form .field { margin-bottom: 0; }
.chat-form textarea { min-height: 54px; max-height: 150px; }
/* 发送是这块区域唯一的主操作，做成实心圆钮：图标够说明它做什么，
   发给谁由页面本身决定，不必再写一遍。 */
.send-btn {
  width: 42px; height: 42px; margin-bottom: 6px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: var(--accent); color: white;
  cursor: pointer;
  transition: background .12s, transform .06s;
}
.send-btn:hover { background: #1c4b38; }
.send-btn:active { transform: translateY(1px); }
.send-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.send-btn svg { display: block; margin: 0 1px 1px 0; }
/* 语音输入：麦克风是次操作，空心圆钮，和实心的发送键分出主次。
   录音中整格变红并显示计时，旁边给一个「放弃」——说岔了不该只有「发出去」一条路。 */
.chat-actions { display: flex; align-items: flex-end; gap: 8px; }
.voice-slot { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.voice-btn {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 999px;
  background: var(--panel); color: var(--muted);
  cursor: pointer;
  transition: background .12s, color .12s, border-color .12s, transform .06s;
}
.voice-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--soft); }
.voice-btn:active { transform: translateY(1px); }
.voice-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.voice-btn svg { display: block; }
.voice-btn.recording {
  border-color: var(--bad); background: var(--bad); color: #fff;
  animation: voice-pulse 1.4s ease-in-out infinite;
}
.voice-btn.recording:hover { background: #8f322a; border-color: #8f322a; color: #fff; }
.voice-btn.busy { cursor: default; }
.voice-btn.busy:hover { background: var(--panel); color: var(--muted); border-color: var(--line-strong); }
/* 计时和「识别中」共用这一格：宽度定死，秒数跳动时旁边的按钮不会跟着左右晃。 */
.voice-status { min-width: 46px; text-align: right; font-size: 12px; font-variant-numeric: tabular-nums; color: var(--muted); }
.voice-discard {
  width: 26px; height: 26px;
  display: grid; place-items: center;
  border: 0; border-radius: 999px;
  background: transparent; color: var(--muted);
  cursor: pointer;
}
.voice-discard:hover { color: var(--bad); background: var(--soft); }
.voice-discard:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chat-form .actionResult:empty { display: none; }
.chat-form .error.inline { margin: 0; }
@keyframes voice-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(166,59,50,.42); } 50% { box-shadow: 0 0 0 6px rgba(166,59,50,0); } }
@media (prefers-reduced-motion: reduce) { .voice-btn.recording { animation: none; } }
.security-panel-rail { min-height: 0; border-left: 1px solid var(--line); padding-left: 14px; }
.research-profile-updated { color: var(--accent); font-size: 12px; font-weight: 650; animation: research-update-fade 2.4s ease-out both; }
@keyframes research-update-fade { 0%, 70% { opacity: 1; } 100% { opacity: .25; } }
.research-item { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: #fbfcfa; margin-top: 8px; }
.research-item:first-child { margin-top: 0; }
.research-item-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.research-item p { margin: 7px 0 0; white-space: pre-wrap; font-size: 13px; line-height: 1.45; }
.research-item-meta { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.research-item-meta a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.research-history { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.research-history summary { color: var(--muted); font-size: 12px; cursor: pointer; }
.research-history .research-item { opacity: .78; }
.icon-btn.small { width: 30px; height: 30px; }
.icon-btn.accent { background: var(--accent); border-color: var(--accent); color: white; }
.icon-btn svg { display: block; }
.security-panel-rail { display: grid; gap: 12px; align-content: start; }

/* 投资推荐表：当前判断 + 判断层 + 待办层 + 折叠的事实层 */
.rec-current .sec-head { margin-bottom: 8px; }
.rec-view { margin: 0; font-size: 13.5px; line-height: 1.55; white-space: pre-wrap; }
.rec-view.muted-view { color: var(--muted); }
.maturity { margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--line); display: flex; gap: 9px; align-items: center; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.bar { flex: 0 0 132px; height: 5px; border-radius: 3px; background: var(--soft); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--warn); }
.pill.ghost { background: transparent; color: var(--muted); border: 1px dashed var(--line-strong); font-weight: 600; }
.sec-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.sec-head h2 { margin: 0; font-size: 13px; letter-spacing: .04em; color: var(--muted); font-weight: 700; }
.layer-note { font-size: 11px; color: var(--muted); }
.jcard { border: 1px solid var(--line); border-radius: 9px; padding: 11px 12px; margin-top: 9px; background: var(--panel); }
.jcard:first-of-type { margin-top: 0; }
.jcard.draft { border-style: dashed; background: #fcfcfa; }
.jcard-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 7px; }
.jcard-kind { font-size: 11px; font-weight: 750; color: var(--accent); }
.jcard.risk .jcard-kind { color: var(--bad); }
.jcard.assumption .jcard-kind { color: var(--warn); }
.jcard p { margin: 0; font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.fals { margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line-strong); display: grid; gap: 4px; }
.fals-label { font-size: 10.5px; font-weight: 750; letter-spacing: .05em; color: var(--bad); }
.fals p { font-size: 12.5px; line-height: 1.5; }
.fals-missing { font-size: 12px; color: var(--warn); }
.jcard-actions { margin-top: 9px; display: flex; gap: 7px; }
.topbar-pills .mini { margin-left: 2px; }
.mini { height: 26px; padding: 0 10px; font-size: 11.5px; border-radius: 7px; border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); cursor: pointer; }
.mini.primary { border-color: var(--accent); background: var(--accent); color: white; }
.mini[disabled] { opacity: .55; cursor: default; }
.mini.ghost { border-color: transparent; color: var(--muted); background: transparent; }
.mini.ghost:hover { color: var(--bad); border-color: var(--line-strong); }
/* 候选追问：贴在最后一条回复下面，点一下直接发出去。
   靠右排是因为它们是**用户将要说的话**——摆在左边会让人以为研究员又说了三句。 */
.follow-ups { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; margin: 2px 0 6px; }
.follow-up {
  max-width: 100%; text-align: left; padding: 7px 12px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink);
  font-size: 12.5px; line-height: 1.45; cursor: pointer;
}
.follow-up:hover { border-color: var(--accent); color: var(--accent); }
/* 质疑那一条要一眼看得出不一样：整块界面里，它是唯一替用户踩刹车的按钮。 */
.follow-up.challenge { border-color: var(--warn); color: var(--warn); }
.follow-up.challenge:hover { background: var(--warn); border-color: var(--warn); color: var(--panel); }
.todo { display: flex; gap: 9px; padding: 9px 0; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.45; }
.todo:first-of-type { border-top: 0; padding-top: 0; }
.todo .dot { flex: 0 0 6px; height: 6px; border-radius: 50%; background: var(--accent-2); margin-top: 6px; }
.todo .dot.due { background: var(--warn); }
.todo em { font-style: normal; color: var(--muted); font-size: 11px; display: block; margin-top: 3px; }
/* 元信息和「去聊这题」共一行：按钮是这一条的次要出口，不该自己占一行把列表撑散。 */
.todo-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 3px; }
.todo-foot em { margin-top: 0; min-width: 0; }
.todo-foot .mini { flex: 0 0 auto; }
details.facts { border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
details.facts > summary { padding: 12px 14px; cursor: pointer; font-size: 13px; display: flex; justify-content: space-between; gap: 10px; list-style: none; }
details.facts > summary::-webkit-details-marker { display: none; }
.facts-body { padding: 0 14px 13px; }
.ev { padding: 8px 0; border-top: 1px solid var(--line); font-size: 12.5px; line-height: 1.45; }
.ev span { display: block; color: var(--muted); font-size: 11px; margin-top: 3px; }
/* 对话页面（投资顾问 / 标的研究）锁定在视口内：输入框固定在底部，最新消息始终紧贴输入框上方，无需手动下翻。 */
body.chat-route { overflow: hidden; }
body.chat-route .shell { height: 100dvh; min-height: 0; overflow: hidden; }
body.chat-route .content { height: 100dvh; min-height: 0; overflow: hidden; display: flex; flex-direction: column; padding-bottom: 22px; }
/* 只有聊天布局本身该占满视口并在内部滚动；其余直接子块按自身内容高度排。
   反过来写（所有 section 都 flex:1、再逐个钉住例外）已经撞了三次：
   估值带被压成 19px 装 66px 溢出盖住 tab、表头压成 56px 装 133px 盖住聊天面板、
   企业档案每一组压到视口内互相叠字。按标签名命中的规则会把以后加的每一块横条
   都算进去，所以例外列表只会越来越长。 */
body.chat-route .content > section { flex: 0 0 auto; min-height: 0; }
body.chat-route .content > .security-layout,
body.chat-route .content > .advisor-box { flex: 1 1 auto; }
body.chat-route .advisor-box > aside { max-height: 100%; overflow: auto; }
body.chat-route .security-panel-rail { max-height: 100%; overflow: auto; }
.login-shell { min-height: calc(100dvh - 72px); display: grid; place-items: center; }
.login-card { width: min(420px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 22px; }
.login-card h1 { font-size: 26px; }
.login-card .btn { width: 100%; margin-top: 4px; }
/* 登录/注册互切的那行小字：它不是页面的主操作，所以不做成按钮。 */
.auth-switch { margin: 14px 0 0; text-align: center; color: var(--muted); font-size: 12px; }
.auth-switch a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.sidebar-tools { margin-top: 14px; display: grid; gap: 8px; }
.sidebar-tools .btn { width: 100%; background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.16); color: white; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(17, 24, 22, .38);
  z-index: 20;
}
.modal-card {
  width: min(620px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  box-shadow: 0 26px 70px rgba(24, 35, 30, .20);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.modal-head h2 { margin: 0 0 4px; font-size: 20px; }
.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f4f6f3;
  color: var(--ink);
  cursor: pointer;
}
.icon-btn:active { transform: translateY(1px); }
@media (max-width: 980px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; }
  .content { padding: 22px 16px 34px; }
  .metrics, .two, .three, .advisor-box, .detail-layout, .security-layout, .form-grid { grid-template-columns: 1fr; }
  .security-panel-rail { min-height: auto; border-left: 0; padding-left: 0; }
  .security-topbar { flex-wrap: wrap; }
  .security-topbar-status { margin-left: 0; margin-top: 10px; width: 100%; justify-items: start; }
  .topbar-pills { justify-content: flex-start; }
  body.chat-route { overflow: auto; }
  body.chat-route .shell { height: auto; min-height: 100dvh; overflow: visible; }
  body.chat-route .content { height: auto; overflow: visible; display: block; }
  .chat-panel { min-height: 62vh; }
  .chat-log { max-height: 62vh; }
  .chat-form { grid-template-columns: 1fr; }
  .chat-form .btn { justify-self: end; }
  .chat-actions { justify-content: flex-end; }
  .cards { grid-template-columns: 1fr; }
  .today-holding { grid-template-columns: minmax(0, 1fr) 104px; }
  .today-holding-weight { grid-column: 1 / -1; }
  .modal-backdrop { padding: 14px; }
}

/* ---- 实时估值带 ---- */
/* 市值/PE/PB/ROE 每天都在变，所以不落档案：这条是现取现显的，两个 tab 都在。 */
.quote-strip { display: flex; flex-wrap: wrap; gap: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 2px 0; margin-bottom: 12px; }
.quote-strip.loading, .quote-strip.error { padding: 12px 16px; color: var(--muted); font-size: 12px; }
.quote-strip.error { color: var(--bad); }
.qcell { flex: 1 1 108px; min-width: 0; padding: 11px 16px; border-right: 1px solid var(--line); white-space: nowrap; }
.qcell:last-child { border-right: 0; }
.qcell span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 3px; }
.qcell b { font-size: 17px; font-weight: 650; letter-spacing: -.01em; }
.qcell b em { font-style: normal; font-size: 12px; font-weight: 600; margin-left: 6px; }
.qcell b em.up { color: var(--bad); }
.qcell b em.down { color: var(--accent); }
.qcell b em.flat { color: var(--muted); }
.qcell b em.hint-mark { color: var(--muted); font-size: 10.5px; border: 1px solid var(--line-strong); border-radius: 4px; padding: 1px 4px; cursor: help; }
.qsrc b { font-size: 12px; font-weight: 500; color: var(--muted); }
/* 上次同步的数字：还能看，但要一眼看出不是刚取的。 */
.quote-strip.is-stale .qcell b { color: var(--muted); }

/* ---- 标的页 tab ---- */
/* 分段控件而不是两个独立按钮：一个浅底槽里二选一，"这是同一件东西的两个面"
   比"两个可点的东西"更准，也更显眼。 */
.sec-tabs { display: flex; gap: 3px; margin-bottom: 12px; padding: 3px; background: var(--soft); border: 1px solid var(--line); border-radius: 11px; }
.sec-tabs button {
  height: 34px; padding: 0 20px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
  font-size: 14px; font-weight: 600; letter-spacing: .01em;
  transition: background .12s, color .12s;
}
.sec-tabs button:hover:not(.active) { background: rgba(255,255,255,.7); color: var(--ink); }
.sec-tabs button.active { background: var(--accent); color: white; box-shadow: 0 1px 3px rgba(17,24,22,.18); }

/* ---- 企业经营档案 ---- */
/* 每道题一张卡：题面、答案、来源和操作都收在自己的边框里，读完一张再读下一张。 */
.briefing-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 16px; max-width: 900px; }
.briefing-head .maturity { margin-top: 0; padding-top: 0; border-top: 0; font-size: 12.5px; }
.briefing-head .bar { flex-basis: 168px; height: 6px; }
/* 进度条走 accent 不走 warn：橙色是「有问题」，这里只是「还没答完」。 */
.briefing-head .bar i { background: var(--accent); }
.briefing-head .hint { margin: 8px 0 0; }
.primer-empty { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.primer-empty p { margin: 0; color: var(--muted); font-size: 13.5px; }
.briefing-group { margin-bottom: 26px; max-width: 900px; }
/* 分组是章节标题，不再包在面板里：卡片才是面板，标题只统领它们。 */
.briefing-group .sec-head { align-items: baseline; margin-bottom: 10px; }
.briefing-group .sec-head h2 { font-size: 19px; font-weight: 700; color: var(--ink); letter-spacing: 0; }
.briefing-group .sec-head .layer-note { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.bq-list { display: grid; gap: 10px; }
/* 每组一种极浅的底色：滚过半页还能认出自己在读哪一类问题。
   饱和度压到几乎只剩色相，答案正文的对比度不受影响。 */
.briefing-group[data-group="business"] { --bq-tint: #edf4ef; }
.briefing-group[data-group="position"] { --bq-tint: #edf3f8; }
.briefing-group[data-group="earning"] { --bq-tint: #f9f3e7; }
.briefing-group[data-group="people_change"] { --bq-tint: #f3eff8; }
.briefing-group[data-group="market"] { --bq-tint: #eaf4f3; }
.bq {
  background: var(--bq-tint, var(--panel));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px 12px;
}
/* 答过的题默认收起，整张卡是那个开关；收起时下面没有内容，底边留白收窄。 */
.bq[data-primer-toggle] { cursor: pointer; padding-bottom: 14px; }
.bq[data-primer-toggle]:hover { border-color: var(--line-strong); }
.bq[data-primer-toggle]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bq[data-primer-toggle].is-open { padding-bottom: 12px; }
/* 收起按钮。展开态它是唯一能收起卡片的地方，所以是个真按钮。
   热区是按钮本身的 22px，箭头画在 ::before 上仍然只有 8px——箭头的两条边是 border，
   直接给按钮加 padding 会把 border 推到外圈，等于把箭头一起放大。 */
.bq-caret {
  flex: 0 0 auto; width: 22px; height: 22px; margin: -4px -6px 0 0; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 0; cursor: pointer;
}
.bq-caret::before {
  content: ''; width: 8px; height: 8px; margin-top: -3px;
  border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg); transition: transform .15s ease;
}
.bq-caret:hover::before { border-color: var(--ink); }
.bq-caret:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.bq.is-open .bq-caret::before { transform: rotate(225deg); margin-top: 3px; }
/* 折叠态的「里面有图表」标记 */
.bq-rich { flex: 0 0 auto; display: inline-flex; align-items: center; margin-top: 3px; color: var(--muted); }
.bq-rich svg { fill: currentColor; display: block; }
.bq-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.bq-head { min-width: 0; }
/* 短名只是索引用的标签，做成 eyebrow；抢在题面前面是本末倒置。 */
.bq-name { font-size: 11px; font-weight: 700; letter-spacing: .09em; color: var(--accent); margin-bottom: 5px; }
.bq-q { margin: 0; font-size: 15.5px; font-weight: 600; line-height: 1.5; color: var(--ink); }
.bq-actions { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; }
.bq-status { flex: 0 0 auto; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--muted); white-space: nowrap; }
.bq-status.ok { border-color: var(--line); }
.bq-status.warn { border-color: var(--warn); color: var(--warn); }
.bq-status.todo { border-style: dashed; }
.bq-answer { margin: 13px 0 0; font-size: 13.5px; line-height: 1.75; white-space: pre-wrap; }
/* 走 markdown 渲染的答案不能再 pre-wrap：块级元素自己带间距，pre-wrap 会把
   标签之间的换行也画成空行。 */
.bq-answer.md { white-space: normal; }
/* 底栏把来源和操作收在同一行：左边是这条答案的出处，右边是能对它做的事。 */
.bq-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 10px 12px;
  flex-wrap: wrap;
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line);
}
.bq-meta { min-width: 0; font-size: 11px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bq-meta a { text-decoration: underline; text-underline-offset: 2px; }
/* 空题只有答案区是空的，题面照常显眼——读者正是靠这些没答的问题知道还缺什么。
   它不吃分组底色：留成透明虚线，才能从一组同色的卡里一眼挑出来。 */
.bq.is-empty { background: transparent; border-style: dashed; }
.bq.is-empty .bq-foot { border-top: 0; padding-top: 0; margin-top: 10px; justify-content: flex-end; }
.bq.is-empty .bq-meta { display: none; }
/* 来源分档要看得见：财报算出来的数字和搜来的数字可信度差着量级。 */
.tier-badge { font-size: 10.5px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--line-strong); }
.tier-badge.filing { border-color: var(--accent); color: var(--accent); }
.tier-badge.media { border-color: var(--line-strong); color: var(--muted); }
.tier-badge.discussion { border-color: var(--line-strong); border-style: dashed; color: var(--muted); }
.tier-badge.inference { border-color: var(--bad); border-style: dashed; color: var(--bad); cursor: help; }
.tier-badge.bad { border-color: var(--bad); color: var(--bad); cursor: help; }

/* 投资动作流：候选动作和成交按时间倒序混排，输入口是流里的第一条 */
.feed { display: grid; gap: 10px; max-width: 760px; }
.feed-item { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
.feed-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.feed-head-main { min-width: 0; }
.feed-head-main strong { display: block; font-size: 15px; }
.feed-head-main > span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.feed-head-side { flex: 0 0 auto; display: grid; justify-items: end; gap: 5px; }
.feed-time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.feed-facts { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 11px; font-size: 13px; }
.feed-facts > div { display: flex; align-items: baseline; gap: 6px; }
.feed-facts span { color: var(--muted); font-size: 11px; }
.feed-item .text-block { margin: 10px 0 0; }
.feed-item .actions-row { margin-top: 11px; }
/* 动作卡配色：方向给色相，状态给明暗。
   方向是这笔动作的固有身份（钱是进去还是出来），不会因为纪律结论改变，所以它拿
   左侧色条这条稳定通道；状态是会变的结论，拿底色深浅和边框虚实。红色整条留给
   「不通过」，所以卖出方向走琥珀/棕，不跟状态抢红。 */
.action-item { border-left: 3px solid var(--dir-accent, var(--line-strong)); }
.action-item.dir-buy { --dir-accent: #1f6f48; }
.action-item.dir-add { --dir-accent: #5aa06d; }
.action-item.dir-reduce { --dir-accent: #cf9a2e; }
.action-item.dir-sell { --dir-accent: #96590f; }
/* 通过的动作是唯一可以直接去执行的，底色最实、色条最粗，一眼能从流里挑出来 */
.action-item.st-approved { border-left-width: 4px; background: color-mix(in srgb, var(--dir-accent) 11%, var(--panel)); }
.action-item.st-conditional { background: color-mix(in srgb, var(--dir-accent) 5%, var(--panel)); }
/* 不通过和草案不给底色，只把色条改成虚线/点线——它们不该看起来像一件办好了的事。
   已成交（st-done）同样留白底：方向照旧读得出，但既成事实不需要再争取注意力。 */
.action-item.st-rejected { border-left-style: dashed; }
.action-item.st-draft { border-left-style: dotted; }

/* 检查明细：不通过/有条件通过时把成立的检查项摊开，不然用户不知道要修什么 */
.check-list { margin-top: 11px; padding: 10px 12px; border-radius: 7px; border: 1px solid var(--line); background: var(--soft); }
.check-list.fail { border-color: color-mix(in srgb, var(--bad) 38%, var(--line)); background: color-mix(in srgb, var(--bad) 6%, var(--panel)); }
.check-list.warn { border-color: color-mix(in srgb, var(--warn) 38%, var(--line)); background: color-mix(in srgb, var(--warn) 6%, var(--panel)); }
.check-list-title { font-size: 11px; font-weight: 750; letter-spacing: .02em; color: var(--muted); }
.check-list.fail .check-list-title { color: var(--bad); }
.check-list.warn .check-list-title { color: var(--warn); }
.check-row { margin-top: 7px; font-size: 12.5px; line-height: 1.5; }
.check-row strong { display: block; font-weight: 700; }
.check-row span { display: block; color: color-mix(in srgb, var(--ink) 74%, white); }

.feed-composer { padding: 6px 16px; }
.feed-composer.open { padding: 6px 16px 14px; }
.feed-tabs { display: flex; gap: 4px; margin: 0 -4px; }
.feed-composer.open .feed-tabs { margin-bottom: 14px; }
.feed-tab {
  border: 0; background: transparent; color: var(--muted);
  padding: 8px 10px; border-radius: 8px 8px 0 0;
  border-bottom: 2px solid transparent;
  font-weight: 650; cursor: pointer;
}
.feed-tab:hover { color: var(--ink); }
.feed-tab.active { color: var(--ink); border-bottom-color: var(--accent); }
.feed-composer .actionForm .form-grid { margin-bottom: 0; }
.today-group .feed-item { margin-top: 8px; }
.today-group .feed-item:first-child { margin-top: 0; }

/* 消息里的图表（```chart 围栏块，见 app.js renderChart） */
.md-chart { margin: 10px 0; }
.md-chart-title { margin-bottom: 8px; font-size: 12px; font-weight: 750; color: var(--muted); }
.md-chart-donut-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.md-chart-donut { flex: 0 0 auto; width: 108px; height: 108px; border-radius: 50%; -webkit-mask: radial-gradient(circle, transparent 52%, #000 53%); mask: radial-gradient(circle, transparent 52%, #000 53%); }
.md-chart-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--muted); }
.md-chart-legend.column { flex-direction: column; flex-wrap: nowrap; gap: 5px; }
.md-chart-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 6px; }
.md-chart-legend b { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }
.md-chart-bars { display: flex; flex-direction: column; gap: 6px; }
.md-chart-bar { display: grid; grid-template-columns: minmax(56px, 5.5em) minmax(0, 1fr) auto; gap: 9px; align-items: center; font-size: 12px; }
.md-chart-bar-label { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.md-chart-bar-track { height: 9px; border-radius: 999px; background: var(--soft); overflow: hidden; }
.md-chart-bar-track i { display: block; height: 100%; }
.md-chart-bar-value { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink); }

.cognition-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
  border-color: color-mix(in srgb, var(--tile-ink, var(--accent)) 18%, transparent);
  background: var(--tile-bg, var(--panel));
  color: var(--tile-ink, var(--ink));
}
.cognition-card::after {
  content: "";
  position: absolute;
  right: -30px;
  bottom: -34px;
  width: 118px;
  height: 118px;
  border-radius: 8px;
  background: var(--tile-accent, var(--accent));
  opacity: .12;
  transform: rotate(9deg);
  pointer-events: none;
}
.cognition-card > * { position: relative; z-index: 1; }
.cognition-card.stale { opacity: .55; }
.cognition-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.cognition-card h2 { margin: 0 0 4px; font-size: 16px; line-height: 1.35; }
.cognition-card .hint { margin: 0; color: color-mix(in srgb, var(--tile-ink, var(--ink)) 65%, white); }
.cognition-card .text-block { color: color-mix(in srgb, var(--tile-ink, var(--ink)) 86%, white); font-size: 13.5px; }
.cognition-grid {
  /* 卡片高度不齐，用多列瀑布流：按列纵向填充，卡片不被拆断。 */
  columns: 320px;
  column-gap: 14px;
}
.cognition-grid > * { break-inside: avoid; margin-bottom: 14px; }

/* ── 产业资讯 ───────────────────────────────────────────── */
.news-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.news-chip span { font-size: 11px; font-weight: 650; font-variant-numeric: tabular-nums; opacity: .75; }
.news-chip:hover { color: var(--ink); border-color: var(--line-strong); }
.news-chip.active { background: var(--accent); border-color: var(--accent); color: white; }
/* 拖动中的那个压平一点，让"它正在被搬"这件事看得出来。 */
.news-chip.dragging { opacity: .45; cursor: grabbing; }
.news-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 14px; }
.news-toolbar input { width: 280px; }
.news-list { display: grid; gap: 10px; max-width: 780px; }
.news-day { display: grid; gap: 10px; }
.news-day-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; }
.news-day-head h2 { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.news-day-head span { color: var(--muted); font-size: 12px; }
.news-item { position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 14px 16px; }
/* 读过的沉下去但不隐藏：一天四五百条，没有这一层就没法回访。 */
.news-item.read { opacity: .52; }
.news-item.read:hover { opacity: .8; }
.news-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.news-head-main { min-width: 0; }
.news-head-main > span { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; }
.news-title { display: block; font-size: 15px; font-weight: 750; line-height: 1.4; }
a.news-title:hover { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.news-head-side { flex: 0 0 auto; display: flex; gap: 6px; align-items: center; }
.news-ghost {
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.news-ghost:hover { color: var(--ink); border-color: var(--line-strong); background: var(--soft); }
.news-ghost.done { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.news-summary { margin: 10px 0 0; font-size: 13px; line-height: 1.55; }
.news-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.news-tags span { border-radius: 4px; background: var(--soft); padding: 2px 7px; color: var(--muted); font-size: 11px; }
.news-save-menu {
  display: grid;
  gap: 2px;
  margin-top: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
  max-height: 260px;
  overflow-y: auto;
}
.news-save-menu button {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 7px 9px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}
.news-save-menu button span { color: var(--muted); font-size: 11px; font-weight: 650; }
.news-save-menu button:hover { background: var(--panel); }
.news-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 18px; max-width: 780px; }
