/* 智研 Zhiyan — 主题变量与基础排印 */
:root {
  --brand: #1e3a8a;
  --brand-soft: #dbe6ff;
  --accent: #d97706;
  --accent-soft: #fff1d6;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --paper: #ffffff;
  --paper-soft: #f8fafc;
  --line: #e2e8f0;
  --line-soft: #f1f5f9;
  --ink: #0f172a;
  --ink-soft: #334155;
  --muted: #64748b;
  --inverse: #e2e8f0;
  --pos: #0e7a5a;
  --pos-bg: #dcfce7;
  --neu: #64748b;
  --neu-bg: #f1f5f9;
  --cau: #b45309;
  --cau-bg: #fef3c7;
  --neg: #b91c1c;
  --neg-bg: #fee2e2;
  --mono: Consolas, "SF Mono", "Menlo", monospace;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 4px rgba(15, 23, 42, .06);
  --shadow-hover: 0 10px 28px rgba(15, 23, 42, .10);
}

:root[data-theme="dark"] {
  --paper: #0b1220;
  --paper-soft: #111a2e;
  --line: #243049;
  --line-soft: #1b2740;
  --ink: #e2e8f0;
  --ink-soft: #cbd5e1;
  --muted: #94a3b8;
  --brand-soft: #1c2a55;
  --accent-soft: #3d2b0a;
  --pos-bg: #052e21;
  --neu-bg: #1b2740;
  --cau-bg: #3d2b0a;
  --neg-bg: #3a0f0f;
  --shadow-card: 0 1px 4px rgba(0, 0, 0, .45);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, .55);
}

* { box-sizing: border-box; }

html {
  max-width: 100%;
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html, body {
  margin: 0; padding: 0;
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper-soft);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

img,
video {
  height: auto;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

pre,
code {
  overflow-wrap: anywhere;
}

.plotly-graph-div,
.js-plotly-plot,
.svg-container,
.main-svg {
  max-width: 100% !important;
  min-width: 0 !important;
}

h1, h2, h3, h4 { color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: 28px; line-height: 1.3; }
h2 { font-size: 20px; line-height: 1.35; }
h3 { font-size: 16px; line-height: 1.4; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.mono, code, pre { font-family: var(--mono); }

.pos { color: var(--pos); }
.neu { color: var(--neu); }
.cau { color: var(--cau); }
.neg { color: var(--neg); }

.stance-pos { color: var(--pos); background: var(--pos-bg); }
.stance-neu { color: var(--neu); background: var(--neu-bg); }
.stance-cau { color: var(--cau); background: var(--cau-bg); }
.stance-neg { color: var(--neg); background: var(--neg-bg); }

.pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: .05em;
  font-weight: 600;
}
.pill-brand { background: var(--brand-soft); color: var(--brand); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }

.value.positive { color: var(--pos); }
.value.negative { color: var(--neg); }
.value.neutral { color: var(--neu); }

/* ---- 宏观导览: tone 色调 ---- */
.tone-hot      { color: #c2410c; }                /* 暖橙·扩张/热 */
.tone-warm     { color: var(--neg); }             /* 警示红 */
.tone-neutral  { color: var(--ink-soft); }
.tone-cool     { color: #0ea5e9; }
.tone-cold     { color: #0369a1; }                /* 冷蓝·收缩/冷 */
:root[data-theme="dark"] .tone-hot  { color: #fdba74; }
:root[data-theme="dark"] .tone-cold { color: #7dd3fc; }
:root[data-theme="dark"] .tone-cool { color: #67e8f9; }

/* smooth anchor scroll */
html { scroll-behavior: smooth; }

/* chart-hint small caption under each Plotly chart */
.chart-hint {
  font-size: 12px; color: var(--muted);
  margin: -4px 0 10px; line-height: 1.6;
  padding-left: 8px; border-left: 2px solid var(--line);
}

/* 指标行内 hint & 参考区间 */
.fin-row .ref {
  color: var(--muted); font-size: 11px; margin-left: 6px;
  font-weight: 400; letter-spacing: 0;
}
.fin-hint {
  font-size: 11px; color: var(--ink-soft); line-height: 1.5;
  padding: 2px 0 6px; border-bottom: 1px dashed transparent;
}
.group-desc {
  font-size: 11px; color: var(--muted); margin: -4px 0 8px;
  letter-spacing: 0; text-transform: none;
}

/* TL;DR 导读面板 */
.tldr-panel {
  background: linear-gradient(135deg, var(--brand-soft), transparent 70%);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px 22px; margin-bottom: 16px;
}
.tldr-panel .tldr-headline {
  font-size: 16px; font-weight: 600; color: var(--ink);
  margin: 0 0 10px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.tldr-signals { display: flex; gap: 8px; flex-wrap: wrap; margin: 6px 0 10px; }
.tldr-chip {
  padding: 4px 12px; border-radius: 999px; font-size: 12px;
  background: var(--paper); border: 1px solid var(--line);
  display: inline-flex; align-items: center; gap: 6px;
}
.tldr-chip .lbl { color: var(--muted); font-size: 11px; }
.tldr-chip .num { font-family: var(--mono); font-weight: 600; }
.tldr-action {
  font-size: 13px; color: var(--ink-soft); line-height: 1.7;
  padding: 8px 12px; background: var(--paper-soft); border-radius: 6px;
  border-left: 3px solid var(--brand);
}

/* 五维综合 gauge */
.fw-composite {
  display: grid; grid-template-columns: 180px 1fr; gap: 18px;
  background: var(--paper-soft); border: 1px solid var(--line);
  border-radius: 10px; padding: 14px 18px; margin-bottom: 14px;
  align-items: center;
}
.fw-gauge { text-align: center; }
.fw-gauge-num {
  font-family: var(--mono); font-size: 28px; font-weight: 700;
  color: var(--brand); line-height: 1;
}
.fw-gauge-num span { font-size: 13px; color: var(--muted); margin-left: 4px; }
.fw-gauge-bar {
  position: relative; height: 8px; background: var(--line);
  border-radius: 4px; overflow: hidden; margin: 10px auto 0;
}
.fw-gauge-bar > span {
  position: absolute; inset: 0 auto 0 0;
  background: linear-gradient(90deg, #ef4444 0%, #f59e0b 40%, #22c55e 75%);
  border-radius: 4px; transition: width .4s ease;
}
.fw-composite-text { font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.fw-composite-sub { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* FAQ 折叠 */
.faq-item {
  background: var(--paper-soft); border: 1px solid var(--line);
  border-radius: 8px; padding: 10px 14px; margin-bottom: 8px;
}
.faq-item > summary {
  cursor: pointer; font-weight: 600; font-size: 14px; color: var(--ink);
  list-style: none; display: flex; align-items: center; gap: 8px;
}
.faq-item > summary::before {
  content: "›"; display: inline-block;
  transition: transform .2s ease; color: var(--brand); font-size: 16px;
}
.faq-item[open] > summary::before { transform: rotate(90deg); }
.faq-item[open] { background: var(--paper); }
.faq-item p {
  margin: 8px 0 2px; font-size: 13px; line-height: 1.7;
  color: var(--ink-soft);
}

/* 侧边 TOC */
.macro-toc {
  position: sticky; top: 78px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 8px;
  max-height: calc(100vh - 110px); overflow-y: auto;
}
.macro-toc h4 {
  margin: 0 0 8px; padding: 0 10px; font-size: 11px;
  color: var(--muted); letter-spacing: .1em; text-transform: uppercase;
}
.macro-toc a {
  display: block; padding: 8px 12px; font-size: 13px;
  color: var(--ink-soft); border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
}
.macro-toc a:hover {
  background: var(--paper-soft); border-left-color: var(--brand);
  color: var(--brand); text-decoration: none;
}

/* ============ AI 对话 · 浮动球 + 抽屉 ============ */
.chat-fab {
  position: fixed; right: 24px; bottom: 24px;
  width: 56px; height: 56px; border-radius: 50%; border: none;
  background: var(--brand); color: #fff; font-size: 24px; cursor: pointer;
  box-shadow: 0 8px 24px rgba(15,23,42,.22);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; transition: transform .18s ease, box-shadow .18s ease, opacity .2s ease;
}
.chat-fab:hover { transform: scale(1.06); box-shadow: 0 12px 28px rgba(15,23,42,.28); }
.chat-fab:focus-visible { outline: 3px solid var(--brand-soft); outline-offset: 2px; }
/* 抽屉打开时让出右下角，避免气泡遮挡发送按钮 */
.chat-fab.is-hidden { opacity: 0; pointer-events: none; transform: scale(.6); }

/* 点击空白区域关闭抽屉 */
.chat-backdrop {
  position: fixed; inset: 0; background: rgba(15,23,42,.18);
  opacity: 0; transition: opacity .24s ease;
  z-index: 100; cursor: pointer;
}
.chat-backdrop.open { opacity: 1; }

.chat-drawer {
  position: fixed; right: 0; top: 0; width: 420px; max-width: 92vw; height: 100vh;
  background: var(--paper); border-left: 1px solid var(--line);
  box-shadow: -8px 0 24px rgba(15,23,42,.18);
  transform: translateX(100%); transition: transform .28s cubic-bezier(.4,0,.2,1);
  z-index: 101; display: flex; flex-direction: column;
}
.chat-drawer[hidden],
.chat-backdrop[hidden] {
  display: none !important;
}
.chat-drawer.open { transform: translateX(0); }
.chat-drawer .chat-head {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--paper-soft); display: flex; justify-content: space-between; align-items: flex-start; gap: 10px;
}
.chat-drawer .chat-head h3 { margin: 0 0 2px; font-size: 14px; }
.chat-drawer .chat-head .sub { color: var(--muted); font-size: 11px; }
.chat-drawer .chat-close {
  background: transparent; border: none; color: var(--muted); font-size: 22px;
  line-height: 1; cursor: pointer; flex-shrink: 0;
  width: 32px; height: 32px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.chat-drawer .chat-close:hover { color: var(--ink); background: rgba(15,23,42,.06); }
.chat-drawer .chat-close:focus-visible { outline: 2px solid var(--brand-soft); outline-offset: 1px; }
.chat-drawer .chat-scroll {
  flex: 1; overflow-y: auto; padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.chat-drawer .msg { padding: 8px 12px; border-radius: 10px; font-size: 13px; line-height: 1.55; max-width: 90%; word-break: break-word; }
.chat-drawer .msg.user { align-self: flex-end; background: var(--brand-soft); color: var(--brand); }
.chat-drawer .msg.asst { align-self: flex-start; background: var(--paper-soft); border: 1px solid var(--line); }
.chat-drawer .msg.asst p { margin: 6px 0; line-height: 1.6; }
.chat-drawer .msg.asst p:first-child { margin-top: 0; }
.chat-drawer .msg.asst p:last-child { margin-bottom: 0; }
.chat-drawer .msg.asst h3, .chat-drawer .msg.asst h4, .chat-drawer .msg.asst h5 {
  margin: 10px 0 6px; font-size: 14px; font-weight: 700; color: var(--ink);
}
.chat-drawer .msg.asst h3 { font-size: 15px; }
.chat-drawer .msg.asst ul, .chat-drawer .msg.asst ol { margin: 6px 0; padding-left: 22px; line-height: 1.7; }
.chat-drawer .msg.asst li { margin: 2px 0; }
.chat-drawer .msg.asst strong { font-weight: 700; color: var(--ink); }
.chat-drawer .msg.asst em { font-style: italic; }
.chat-drawer .msg.asst a { color: var(--brand); text-decoration: underline; }
.chat-drawer .msg.asst code {
  font-family: var(--mono); font-size: 12px; padding: 1px 5px;
  background: rgba(15,23,42,.06); border-radius: 4px; color: var(--ink);
}
.chat-drawer .msg.asst pre {
  background: rgba(15,23,42,.06); border-radius: 6px; padding: 10px 12px;
  overflow-x: auto; margin: 8px 0; font-size: 12px; line-height: 1.5;
}
.chat-drawer .msg.asst pre code { background: transparent; padding: 0; font-size: inherit; }
.chat-drawer .msg.asst blockquote {
  margin: 8px 0; padding: 6px 12px; color: var(--ink-soft);
  border-left: 3px solid var(--brand-soft); background: rgba(15,23,42,.03);
  border-radius: 0 4px 4px 0;
}
.chat-drawer .msg.sys  { align-self: center; color: var(--muted); font-size: 11px; font-style: italic; }
.chat-drawer .chat-input { border-top: 1px solid var(--line); padding: 10px; background: var(--paper); }
.chat-drawer .chat-input textarea {
  width: 100%; resize: none; border: 1px solid var(--line); border-radius: 6px;
  padding: 8px 10px; font-family: inherit; font-size: 13px; outline: none;
  background: var(--paper); color: var(--ink);
}
.chat-drawer .chat-input textarea:focus { border-color: var(--brand); }
.chat-drawer .chat-input .bar { display: flex; justify-content: flex-end; margin-top: 6px; }
.chat-drawer .chat-input .btn { padding: 6px 14px; font-size: 12px; }

@media (max-width: 640px) {
  .chat-drawer { width: 100vw; max-width: 100vw; }
  .chat-fab { right: 16px; bottom: 16px; width: 52px; height: 52px; font-size: 22px; }
}

/* ---- 抽屉预设问题（空状态引导） ---- */
.chat-preset-wrap {
  margin-top: 4px; padding: 10px 2px;
  border-top: 1px dashed var(--line);
}
.chat-preset-title {
  font-size: 12px; color: var(--muted); margin-bottom: 8px;
}
.chat-preset-list {
  display: flex; flex-direction: column; gap: 6px;
}
.chat-preset {
  text-align: left; padding: 8px 12px; font-size: 13px;
  background: var(--paper-soft); color: var(--ink);
  border: 1px solid var(--line); border-radius: 8px;
  cursor: pointer; transition: all .12s;
  line-height: 1.5;
}
.chat-preset:hover {
  background: var(--brand-soft); border-color: var(--brand);
  color: var(--brand);
}

/* ---- 一句话白话（tldr-panel / consensus-strip 之内） ---- */
.tldr-novice, .consensus-novice {
  font-size: 13px; color: var(--ink-soft); line-height: 1.7;
  margin-top: 8px; padding: 8px 12px;
  background: var(--accent-soft); border-radius: 6px;
  border-left: 3px solid var(--accent);
  display: flex; gap: 8px; align-items: flex-start;
}
.consensus-novice { margin-top: 6px; }
.tldr-novice-tag {
  font-weight: 600; color: var(--accent); flex-shrink: 0;
  font-size: 12px; letter-spacing: .02em;
}

/* ---- 「白话解释本节」chip 视觉区分 ---- */
.ask-chip.ask-chip-plain {
  background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent);
}
.ask-chip.ask-chip-plain::before { content: "" !important; }
.ask-chip.ask-chip-plain:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* ========================================================================
   承接页 (stock_pending) — hero + 进度卡 + 边栏推荐
   ======================================================================== */

/* Hero：深色 surface，与 home 的 hero 风格同源，但更紧凑 */
.pending-hero {
  background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%);
  color: #e2e8f0;
  padding: 48px 28px 56px;
  position: relative; overflow: hidden;
}
.pending-hero::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.pending-hero-inner {
  max-width: 1100px; margin: 0 auto; position: relative;
}
.pending-hero .eyebrow {
  display: inline-block; padding: 4px 12px; border-radius: 999px;
  background: rgba(217,119,6,.15); color: var(--accent);
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  font-weight: 600; margin-bottom: 16px;
}
.pending-hero h1 {
  margin: 0 0 10px; color: #fff;
  font-size: 34px; line-height: 1.2; font-weight: 700;
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
}
.pending-hero h1 .code {
  font-family: var(--mono); color: var(--accent); letter-spacing: .04em;
}
.pending-hero h1 .cn { color: #fff; font-weight: 600; }
.pending-hero .lead {
  margin: 0; color: #cbd5e1;
  font-size: 15px; line-height: 1.7; max-width: 640px;
}

/* Body */
.pending-body { padding: 40px 28px 64px; background: var(--paper-soft); }
.pending-inner { max-width: 1100px; margin: 0 auto; }
.pending-layout {
  display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 24px;
  margin-top: -64px;  /* 让卡片叠进 hero */
  position: relative; z-index: 2;
}

/* 进度卡 */
.pending-progress-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 26px 28px;
  box-shadow: 0 8px 28px rgba(15,23,42,.08);
}
.ppc-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 18px; border-bottom: 1px solid var(--line-soft); padding-bottom: 14px;
}
.ppc-head .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 4px var(--brand-soft);
  animation: zy-pulse 1.6s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes zy-pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--brand-soft); }
  50%      { box-shadow: 0 0 0 7px rgba(30,58,138,.15); }
}
.ppc-head h2 {
  margin: 0; font-size: 15px; letter-spacing: .04em;
  color: var(--ink); font-weight: 700;
}
.ppc-stage {
  margin-left: auto; font-size: 13px; color: var(--ink-soft);
  font-weight: 500;
}

.ppc-bar {
  height: 10px; background: var(--line-soft); border-radius: 999px;
  overflow: hidden; margin: 0 0 10px;
}
.ppc-fill {
  height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--brand) 0%, #3b82f6 50%, var(--accent) 100%);
  background-size: 200% 100%;
  transition: width .5s ease;
  animation: zy-flow 2.4s linear infinite;
}
@keyframes zy-flow {
  0%   { background-position: 0%   0; }
  100% { background-position: 200% 0; }
}
.ppc-meta {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 22px;
}
.ppc-meta .pct {
  font-family: var(--mono); font-size: 22px; font-weight: 700; color: var(--brand);
}
.ppc-meta .mono {
  font-family: var(--mono); color: var(--muted); font-size: 12px;
}

/* stage 时间线 */
.ppc-timeline {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 2px;
}
.ppc-timeline li {
  display: grid; grid-template-columns: 28px 1fr; align-items: center;
  gap: 12px; padding: 10px 4px; position: relative;
  color: var(--muted); font-size: 14px;
  transition: color .2s;
}
.ppc-timeline li .marker {
  width: 24px; height: 24px; border-radius: 50%;
  border: 1.5px solid var(--line);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 12px; font-weight: 700;
  color: var(--muted); background: var(--paper);
  transition: all .25s ease;
  flex-shrink: 0;
}
.ppc-timeline li:not(:last-child)::before {
  content: ''; position: absolute;
  left: 14px; top: 34px; bottom: 0; width: 1.5px;
  background: var(--line);
}
.ppc-timeline li.active {
  color: var(--brand); font-weight: 600;
}
.ppc-timeline li.active .marker {
  border-color: var(--brand); color: var(--brand);
  background: var(--brand-soft);
  box-shadow: 0 0 0 4px rgba(30,58,138,.08);
}
.ppc-timeline li.done {
  color: var(--ink-soft);
}
.ppc-timeline li.done .marker {
  background: var(--brand); border-color: var(--brand); color: #fff;
}
.ppc-timeline li.done .marker::after {
  content: '✓'; font-weight: 700;
}
.ppc-timeline li.done .marker > * { display: none; }
.ppc-timeline li.done:not(:last-child)::before {
  background: var(--brand);
}

.ppc-error {
  margin-top: 16px; padding: 14px 16px; border-radius: 10px;
  background: var(--neg-bg); color: var(--neg); font-size: 13px;
  border: 1px solid rgba(185,28,28,.25);
}
.ppc-error-title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.ppc-error-body { color: var(--ink); font-size: 13px; margin-bottom: 12px; word-break: break-all; }
.ppc-error-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.ppc-error-actions .btn { padding: 8px 16px; font-size: 13px; }
.ppc-longrun {
  margin-top: 12px; padding: 10px 14px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 13px; line-height: 1.6;
}

/* 边栏：推荐区 */
.pending-aside { display: flex; flex-direction: column; gap: 14px; }
.pa-heading {
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); font-weight: 600; padding-left: 2px;
  margin-top: 8px;
}
.pa-card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 18px 20px;
  box-shadow: var(--shadow-card);
  transition: box-shadow .2s, transform .15s, border-color .15s;
}
.pa-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--brand-soft);
  text-decoration: none;
}

.pa-card.macro-cta {
  display: grid; grid-template-columns: 52px 1fr; gap: 14px;
  align-items: start; color: inherit;
}
.pa-card.macro-cta .icon {
  width: 52px; height: 52px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-soft); color: var(--brand);
  font-size: 20px; font-weight: 700;
}
.pa-card.macro-cta h3 {
  margin: 0 0 4px; font-size: 15px; color: var(--ink);
}
.pa-card.macro-cta p {
  margin: 0 0 10px; color: var(--ink-soft); font-size: 13px; line-height: 1.65;
}
.pa-card.macro-cta .cta {
  font-size: 12px; font-weight: 600; color: var(--accent);
  letter-spacing: .04em;
}
.pa-card.macro-cta:hover .cta { text-decoration: underline; }

.pa-card.recent-card { padding: 16px 20px; }
.pa-card-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 10px;
}
.pa-card-head h3 { margin: 0; font-size: 15px; color: var(--ink); }
.pa-card-head .more { font-size: 12px; color: var(--muted); }
.pa-card-head .more:hover { color: var(--brand); }

.pa-recent-list { list-style: none; padding: 0; margin: 0; }
.pa-recent-list li { border-top: 1px solid var(--line-soft); }
.pa-recent-list li:first-child { border-top: none; }
.pa-recent-list a {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 9px 4px; color: var(--ink);
  font-size: 13px; text-decoration: none;
  transition: background .15s;
  border-radius: 6px;
}
.pa-recent-list a:hover { background: var(--paper-soft); text-decoration: none; }
.pa-recent-list .rl-code { color: var(--brand); font-weight: 700; font-size: 12px; }
.pa-recent-list .rl-name {
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pa-recent-list .rl-pill {
  padding: 1px 8px; font-size: 10px; letter-spacing: 0;
  font-weight: 600;
}

.pa-tip {
  margin: 4px 0 0; font-size: 12px; color: var(--muted);
  line-height: 1.6; padding: 0 2px;
}
.pa-tip .mono {
  font-family: var(--mono); color: var(--accent);
  background: var(--accent-soft); padding: 1px 6px; border-radius: 4px;
  margin-right: 4px; font-weight: 600;
}

/* 承接页同业快捷入口 — 复用 .pa-recent-list 的布局类名 */
.pa-peers-card { padding: 16px 20px; }
.pa-peer-list { list-style: none; padding: 0; margin: 0; }
.pa-peer-list li { border-top: 1px solid var(--line-soft); }
.pa-peer-list li:first-child { border-top: none; }
.pa-peer-list a {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 10px; align-items: center;
  padding: 9px 4px; color: var(--ink);
  font-size: 13px; text-decoration: none;
  border-radius: 6px; transition: background .15s;
}
.pa-peer-list a:hover { background: var(--paper-soft); text-decoration: none; }
.pa-peer-list .rl-code { color: var(--brand); font-weight: 700; font-size: 12px; }
.pa-peer-list .rl-name {
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pa-peer-list .rl-pill { padding: 1px 8px; font-size: 10px; font-weight: 600; }
.pill-muted {
  background: var(--line-soft); color: var(--muted);
  border: 1px solid var(--line);
}

/* 承接页宏观 peek — 替代原 .pa-card.macro-cta 的纯链接卡 */
.pa-card.macro-peek {
  display: flex; flex-direction: column; gap: 10px;
  color: inherit;
}
.pa-card.macro-peek .mp-stance {
  padding: 1px 10px; font-size: 11px; font-weight: 600;
}
.pa-card.macro-peek .mp-headline {
  margin: -2px 0 2px; color: var(--ink-soft); font-size: 13px; line-height: 1.6;
}
.pa-card.macro-peek .mp-fallback {
  margin: 0; color: var(--ink-soft); font-size: 12.5px; line-height: 1.6;
}
.pa-card.macro-peek .mp-indicators {
  display: flex; gap: 6px; flex-wrap: wrap;
}
.pa-card.macro-peek .mp-chip {
  display: inline-flex; align-items: baseline; gap: 5px;
  padding: 3px 9px; border-radius: 999px;
  background: var(--paper-soft); border: 1px solid var(--line);
  font-size: 11.5px;
}
.pa-card.macro-peek .mp-chip .mp-label { color: var(--muted); font-size: 11px; }
.pa-card.macro-peek .mp-chip .mp-value { font-weight: 700; }
.pa-card.macro-peek .cta {
  margin-top: 2px;
  font-size: 12px; font-weight: 600; color: var(--accent); letter-spacing: .04em;
}
.pa-card.macro-peek:hover .cta { text-decoration: underline; }

@media (max-width: 900px) {
  .pending-hero { padding: 36px 20px 48px; }
  .pending-hero h1 { font-size: 26px; }
  .pending-body { padding: 28px 20px 48px; }
  .pending-layout {
    grid-template-columns: 1fr; gap: 16px;
    margin-top: -48px;
  }
  .pending-progress-card { padding: 22px 20px; }
  .pa-card.macro-cta { grid-template-columns: 44px 1fr; }
  .pa-card.macro-cta .icon { width: 44px; height: 44px; font-size: 17px; }
}

@media (max-width: 640px) {
  .pending-hero { padding: 24px 14px 36px; }
  .pending-hero h1 { font-size: 22px; flex-wrap: wrap; }
  .pending-hero .code, .pending-hero .cn { display: inline-block; }
  .pending-body { padding: 20px 14px 40px; }
  .pending-progress-card { padding: 16px 14px; border-radius: 12px; }
  .ppc-head { flex-wrap: wrap; gap: 8px; }
  .ppc-stage { font-size: 12px; }
  .ppc-timeline { gap: 8px; }
  .ppc-timeline li { font-size: 12px; }
  .ppc-error-actions { flex-direction: column; }
  .ppc-error-actions .btn { width: 100%; text-align: center; }
  .pa-card { padding: 14px; }
  .pa-card.macro-cta .icon { width: 40px; height: 40px; }
  .pa-recent-list li a {
    grid-template-columns: auto 1fr;
    gap: 8px;
  }
  .pa-recent-list .rl-pill { grid-column: 1 / -1; justify-self: start; margin-top: 2px; }
}

/* ========================================================================
   选股页候选下拉 (suggest popover)
   ======================================================================== */
.suggest {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 14px; max-height: 340px; overflow-y: auto;
  box-shadow: 0 12px 32px rgba(15,23,42,.14);
  padding: 6px;
  animation: zy-fade-in .12s ease-out;
}
@keyframes zy-fade-in {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.suggest-item {
  padding: 10px 12px; cursor: pointer;
  display: grid; grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 10px; align-items: center;
  font-size: 14px; color: var(--ink);
  border-radius: 10px;
  border-left: 3px solid transparent;
  transition: background .1s, border-color .1s;
}
.suggest-item + .suggest-item {
  margin-top: 2px;
}
.suggest-item:hover {
  background: var(--paper-soft);
}
.suggest-item.active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
}
.suggest-item.suggest-fallback {
  background: var(--paper-soft);
  border-left-color: var(--cau, #f59e0b);
  opacity: .88;
}
.suggest-item.suggest-fallback .name { font-style: italic; color: var(--ink-soft); }
.suggest-item.suggest-fallback.active { opacity: 1; }
.suggest-item .code {
  font-family: var(--mono); color: var(--brand);
  font-size: 13px; font-weight: 700;
  letter-spacing: .02em;
}
.suggest-item .name {
  color: var(--ink); font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.suggest-item .py {
  color: var(--muted); font-size: 10px;
  text-transform: uppercase; letter-spacing: .1em;
  font-family: var(--mono);
  padding: 2px 8px; border-radius: 999px;
  background: var(--line-soft);
}
.suggest-empty {
  padding: 22px 16px; color: var(--muted); font-size: 13px;
  text-align: center; line-height: 1.7;
}
.suggest-empty .t {
  display: block; color: var(--ink-soft); font-weight: 600;
  margin-bottom: 4px;
}
.suggest-footer {
  padding: 8px 12px 6px; font-size: 11px; color: var(--muted);
  border-top: 1px solid var(--line-soft); margin-top: 4px;
  display: flex; justify-content: space-between;
  letter-spacing: .04em;
}
.suggest-footer .kbd {
  font-family: var(--mono); font-size: 10px;
  padding: 1px 5px; border: 1px solid var(--line);
  border-radius: 4px; background: var(--paper-soft);
  color: var(--ink-soft); margin: 0 2px;
}

/* ========================================================================
   研报段落流式填充 — stock_detail 页 LLM narrative 的骨架屏 + 状态指示器
   ======================================================================== */
#narrative-stream[data-status="pending"] .narrative-stream-text { min-height: 1em; }
/* .narrative-skeleton / .narrative-status 的 display:flex 会覆盖 UA 默认 [hidden]{display:none}，
   导致 JS 设置 .hidden=true 后骨架屏 / 撰写中指示器仍然可见（用户误以为流式没完成）。
   显式锁回 none。 */
.narrative-skeleton[hidden],
.narrative-status[hidden] { display: none !important; }
.narrative-skeleton {
  display: flex; flex-direction: column; gap: 10px; padding: 6px 0;
}
.narrative-skeleton .sk-line {
  height: 14px; border-radius: 4px;
  background: linear-gradient(90deg,
    var(--surface-2) 0%,
    var(--paper-soft) 50%,
    var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: zy-shimmer 1.6s ease-in-out infinite;
}
.narrative-skeleton .sk-line-60 { width: 60%; }
.narrative-skeleton .sk-line-70 { width: 70%; }
.narrative-skeleton .sk-line-80 { width: 80%; }
.narrative-skeleton .sk-line-90 { width: 90%; }
.narrative-skeleton .sk-line-95 { width: 95%; }
@keyframes zy-shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.narrative-stream-text > p { margin: 0 0 10px; line-height: 1.75; }
.narrative-status {
  display: flex; align-items: center; gap: 8px;
  margin-top: 10px; font-size: 12px; color: var(--muted);
}
.narrative-status .nv-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--brand);
  box-shadow: 0 0 0 0 var(--brand-soft);
  animation: zy-pulse 1.4s ease-out infinite;
}
@keyframes zy-pulse {
  0%   { box-shadow: 0 0 0 0   var(--brand-soft); }
  70%  { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0   transparent; }
}
.narrative-status.is-error .nv-dot { background: var(--cau); animation: none; }
.narrative-status.is-error .nv-label { color: var(--cau); }

/* ========================================================================
   打印 / PDF 输出: 隐藏导航/页脚/抽屉/交互控件,展开长列表,强制浅色
   ======================================================================== */
@media print {
  @page { margin: 14mm; size: A4; }
  html, body {
    background: #fff !important; color: #000 !important;
    font-size: 10pt !important;
  }
  [data-theme="dark"] html,
  [data-theme="dark"] body { color-scheme: light; background: #fff !important; color: #000 !important; }
  .site-nav, .site-footer, .chat-drawer, .chat-fab,
  .nav-theme, .nav-cta, .no-print,
  .header-actions, .archive-chip,
  [data-share], [data-print] {
    display: none !important;
  }
  .site-main { padding: 0 !important; min-height: 0 !important; }
  .panel, .card, .report-card,
  .ppc-timeline, .cell {
    box-shadow: none !important;
    border-color: #cbd5e1 !important;
    background: #fff !important;
    page-break-inside: avoid;
  }
  h1, h2, h3, h4 { page-break-after: avoid; }
  section, article { page-break-inside: auto; }
  a { color: #000 !important; text-decoration: none !important; }
  /* Plotly 图表: 避免被裁在页间 */
  .plotly-graph-div, .js-plotly-plot { page-break-inside: avoid; }
}
