:root {
  --bg: #f5f6f8; --panel: #fff; --line: #dde1e7; --text: #1b1f24; --muted: #66727f;
  --accent: #1f6feb; --accent-soft: #e7f0ff; --ok: #177245; --ok-soft: #e6f4ec;
  --warn: #b4551a; --warn-soft: #fdf0e3; --sample: #7a4dd6; --sample-soft: #f1ebfd; --radius: 8px;
  color-scheme: light;
}
/* 暗色：跟系统；在价值链分析页的悬浮窗里由页面的主题开关指定（data-theme） */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171b; --panel: #1b1f24; --line: #2c333b; --text: #e6e9ed; --muted: #9aa7b4;
    --accent: #5a9bff; --accent-soft: #1b2c47; --ok: #59c08b; --ok-soft: #173327;
    --warn: #e9a267; --warn-soft: #34261a; --sample: #b89af0; --sample-soft: #2a2140;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171b; --panel: #1b1f24; --line: #2c333b; --text: #e6e9ed; --muted: #9aa7b4;
  --accent: #5a9bff; --accent-soft: #1b2c47; --ok: #59c08b; --ok-soft: #173327;
  --warn: #e9a267; --warn-soft: #34261a; --sample: #b89af0; --sample-soft: #2a2140;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 6px 12px; }
button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button:disabled { opacity: .5; cursor: default; }
header { display: flex; align-items: center; gap: 20px; padding: 10px 20px; background: var(--panel);
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 600; color: var(--text); }
header nav { display: flex; gap: 16px; flex: 1; }
header nav a { color: var(--muted); }
/* 本站子页面（知识图谱、资料库）：新标签页打开，和页内的几个视图隔开 */
header nav a:not(.ext) + a.ext { margin-left: 8px; padding-left: 16px; border-left: 1px solid var(--line); }
header nav a.ext::after { content: " ↗"; font-size: 0.85em; }
.health { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.me { color: var(--muted); white-space: nowrap; }
.me:empty { display: none; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 4px; background: var(--warn); }
.dot.ok { background: var(--ok); }
main { max-width: 1280px; margin: 0 auto; padding: 20px; }
h1 { font-size: 20px; margin: 0 0 4px; } h2 { font-size: 15px; margin: 18px 0 8px; } h3 { font-size: 14px; margin: 0 0 6px; }
.muted { color: var(--muted); } .small { font-size: 12.5px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.grid { display: grid; gap: 12px; } .row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; background: var(--accent-soft);
  color: var(--accent); border: 1px solid transparent; cursor: pointer; }
.chip.plain { background: transparent; color: var(--muted); border-color: var(--line); cursor: default; }
.chip.ok { background: var(--ok-soft); color: var(--ok); } .chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.sample { background: var(--sample-soft); color: var(--sample); }
.ask { display: grid; grid-template-columns: 1fr auto auto; gap: 8px; }
.ask textarea { width: 100%; min-height: 64px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); resize: vertical; }
.ask select { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); padding: 6px; }
.step { border-left: 3px solid var(--line); padding: 4px 0 4px 14px; margin: 14px 0; }
.step.done { border-left-color: var(--ok); } .step.fail { border-left-color: var(--warn); }
.step > h3 { display: flex; gap: 8px; align-items: baseline; }
.cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; min-width: 0; }
.card.hl { outline: 2px solid var(--accent); }
.chart { width: 100%; max-width: 100%; min-height: 60px; overflow-x: auto; }
.card .mono { overflow-wrap: anywhere; }
.dairy-case .chart { max-width: 100%; overflow-x: auto; }
.dairy-case table { display: block; max-width: 100%; overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
th, td { border-bottom: 1px solid var(--line); padding: 4px 8px; text-align: left; }
th { color: var(--muted); font-weight: 500; }
details > summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
pre { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--bg); padding: 8px; border-radius: 6px; font-size: 12px; }
.claim { margin: 6px 0; } .claim .cite { margin-left: 4px; }
.claim .kind { font-size: 11.5px; color: var(--muted); margin-right: 6px; }
.rejected { color: var(--warn); }
.drawer { position: fixed; top: 52px; right: 0; bottom: 0; width: min(520px, 100vw); background: var(--panel);
  border-left: 1px solid var(--line); overflow: auto; padding: 16px; box-shadow: -4px 0 16px rgba(0,0,0,.08); z-index: 6; }
.vc { display: grid; gap: 8px; grid-template-columns: repeat(5, minmax(0, 1fr)) 120px; }
.vc .support { grid-column: 1 / 6; }
.vc .margin { grid-column: 6; grid-row: 1 / span 5; display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; padding: 8px; }
.act { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; min-width: 0; }
.act h3 { display: flex; justify-content: space-between; }
.metric { font-size: 12.5px; border-top: 1px dashed var(--line); padding-top: 4px; margin-top: 4px; }
.err { color: var(--warn); }
@media (max-width: 900px) { .vc { grid-template-columns: 1fr; } .vc .support, .vc .margin { grid-column: auto; grid-row: auto; } }
header nav a.on { color: var(--text); font-weight: 600; }
button.mini { padding: 1px 8px; font-size: 12px; }
.summary { font-size: 15px; font-weight: 500; }
.banner { background: var(--warn-soft); color: var(--warn); border: 1px solid var(--warn); border-radius: var(--radius); padding: 8px 12px; margin: 8px 0; }
.checks { margin: 10px 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.checks > div { flex-basis: 100%; }
.big { display: flex; gap: 24px; flex-wrap: wrap; margin: 8px 0; }
.big .num { font-size: 26px; font-weight: 600; }
.big .num2 { font-size: 16px; }
.claim .chip { margin-right: 4px; }
.pulse { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
.act .metric .row { gap: 6px; }
select { border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); padding: 4px 6px; }
.row > h1 { margin: 0; }
/* 多轮问答 */
.turn { margin: 18px 0; }
.turn .q { display: flex; gap: 10px; align-items: baseline; background: var(--accent-soft); border-radius: var(--radius);
  padding: 8px 12px; font-weight: 500; }
.turn .q .who { flex: none; font-size: 12px; color: var(--accent); }
.turn .a { display: grid; gap: 8px; border-left: 3px solid var(--line); margin: 8px 0 0 4px; padding: 4px 0 4px 14px; min-width: 0; }
.turn .a > :empty { display: none; }
.tools .tool { color: var(--muted); }
.tools .tool b { font-weight: 500; color: var(--text); }
.tools .mark { display: inline-block; width: 1.4em; }
.notes pre { max-height: 260px; overflow: auto; }
.reply { white-space: pre-wrap; }
.clarify { background: var(--panel); border: 1px solid var(--accent); border-radius: var(--radius); padding: 10px 14px; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 8px; position: sticky; bottom: 0; background: var(--bg);
  padding: 10px 0; border-top: 1px solid var(--line); margin-top: 12px; }
.composer textarea { width: 100%; min-height: 56px; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel); resize: vertical; }

/* 多轮问答里价值链分析页带来的"这一格"：问题下面一行；输入框上方是这一问会带上的格子 */
.turn .qctx { margin: 4px 0 0 2px; color: var(--muted); }
.vctx b { color: var(--text); font-weight: 500; }
.ctxpend { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; padding: 6px 10px;
  border: 1px dashed var(--accent); border-radius: var(--radius); background: var(--accent-soft); }
.ctxpend[hidden] { display: none; }
.ctxpend button.mini { margin-left: auto; }
/* 嵌在价值链分析页的"问NI"悬浮窗里（/?embed=1）：不要页头，版面收紧 */
body.embed header { display: none; }
body.embed main { max-width: none; padding: 8px 12px 0; }
body.embed .intro { display: none; }
body.embed h1 { font-size: 14px; }
body.embed .ask { grid-template-columns: 1fr; }
body.embed .cards { grid-template-columns: 1fr; }
body.embed .drawer { top: 0; width: 100%; }
body.embed table { display: block; overflow-x: auto; }
body.embed .composer { margin-top: 8px; padding: 8px 0 10px; }
body.embed .turn { margin: 12px 0; }
/* 问题放进输入框后：输入框闪一下，底部弹出提示（10-07） */
textarea.filled { border-color: var(--accent); animation: fillpulse 1.4s ease-out; }
@keyframes fillpulse { from { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1px var(--accent); } to { box-shadow: 0 0 0 0 transparent; } }
.fill-tip { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 9; max-width: calc(100vw - 32px);
  background: var(--text); color: var(--bg); padding: 6px 14px; border-radius: 999px; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.fill-tip[hidden] { display: none; }
#ni-health[hidden] { display: none; }
#ask-gate[hidden] { display: none; }   /* 带 .chip（inline-block），不写这条 hidden 就不生效，四家页面会露出侨银提示 */
@media (prefers-reduced-motion: reduce) { textarea.filled { animation: none; } }

/* 问题记录（10-07）：列表、详情（Markdown）、处理按钮 */
a.chip.plain { cursor: pointer; }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
table.issues td { vertical-align: top; }
.md { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 18px 12px; margin: 10px 0; line-height: 1.65; }
.md h2 { font-size: 18px; margin: 14px 0 6px; } .md h3 { font-size: 14px; margin: 16px 0 6px; color: var(--muted); }
.md h4, .md h5 { font-size: 13px; margin: 12px 0 4px; }
.md blockquote { margin: 6px 0; padding: 4px 10px; border-left: 3px solid var(--line); color: var(--muted); font-size: 12.5px; }
.md pre { background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; overflow: auto; max-height: 420px;
  font: 11.5px/1.5 ui-monospace, Consolas, monospace; white-space: pre-wrap; word-break: break-all; }
.md code { font: 12px ui-monospace, Consolas, monospace; background: var(--bg); padding: 0 4px; border-radius: 4px; }
.md ul, .md ol { padding-left: 22px; margin: 4px 0; }
.issue-act { display: grid; gap: 6px; max-width: 760px; }
.issue-act textarea { width: 100%; font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }

/* 版本号（页头品牌名旁） */
.ver { font-size: 11px; color: var(--muted); margin: 0 10px 0 4px; }

/* 中文 / EN 切换（10-07）：和价值链分析页（vca.css）的 .seg 同一套样式；border-radius 0 盖掉上面通用的 button 圆角 */
.seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--panel); }
.seg button { font-size: 13px; padding: 5px 12px; border: 0; border-radius: 0; background: transparent; color: var(--muted); cursor: pointer; }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.seg button:disabled { opacity: .45; cursor: default; }
/* 英文的导航字更长：窄一些的窗口里按整项换行，不在一项中间断开 */
header nav { flex-wrap: wrap; row-gap: 2px; }
header nav a, .health { white-space: nowrap; }
