/* ==========================================================================
   portal.css — 用户端门户全部样式 · REGSCI Atlas 乐城海图
   视觉语言：深海墨蓝海面（#071B2A/#0D2A3D）+ 暖象牙纸面（#F5F1E8）
   主强调：博鳌青（#1F7A72/#46A99B，交互与门户构件）
   报告文书：香槟金（#C7AE7C，封面 / 文书编号 / 评分）
   海图语汇：经纬线网格、虚线航线、罗盘饰纹；状态色低饱和
   ========================================================================== */

:root {
  --ink: #071B2A;          /* 深海墨蓝 */
  --ink-2: #0D2A3D;        /* 墨蓝 · 浮层 */
  --ink-3: #123449;        /* 墨蓝 · 更高一层 */
  --paper: #F5F1E8;        /* 暖象牙 */
  --card: #FCFAF4;         /* 卡片 */
  --line: #E3DAC7;         /* 纸面分隔线 */
  --teal: #1F7A72;         /* 博鳌青（主强调） */
  --teal-2: #46A99B;       /* 博鳌青 · 亮（深底上的交互/文字） */
  --teal-deep: #175E57;    /* 博鳌青 · 悬停 */
  --teal-ghost: rgba(31, 122, 114, .1);
  --gold: #C7AE7C;         /* 香槟金（报告文书） */
  --gold-2: #D9C9A3;       /* 香槟金 · 亮（深底） */
  --text: #22313C;
  --muted: #6E7A78;
  --ok: #3E7A5C;
  --warn: #96713C;
  --bad: #A0554F;
  /* 深底上的用色 */
  --mist: #C9D8D6;         /* 海面雾色（深底正文） */
  --mist-dim: #8FA5A3;     /* 深底次要文字 */
  --serif: "Noto Serif SC", "Source Han Serif SC", "STSong", serif;
  --sans: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --mono: ui-monospace, "JetBrains Mono", Consolas, monospace;
  --shadow-warm: 0 1px 3px rgba(34, 49, 60, .08), 0 10px 28px -14px rgba(34, 49, 60, .14);
  --shadow-ink: 0 18px 48px rgba(2, 12, 20, .5);
  --ease: cubic-bezier(.16, 1, .3, 1);
  /* 海图经纬网格（叠在墨蓝底上，极淡） */
  --graticule:
    repeating-linear-gradient(0deg, rgba(148, 196, 188, .055) 0 1px, transparent 1px 64px),
    repeating-linear-gradient(90deg, rgba(148, 196, 188, .055) 0 1px, transparent 1px 64px);
}

/* ---------- reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: var(--paper);
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible, .dz:focus-visible, summary:focus-visible {
  outline: 2px solid var(--teal-2); outline-offset: 2px;
}
::selection { background: rgba(70, 169, 155, .28); }
svg { vertical-align: middle; }
h1, h2, h3, h4 { line-height: 1.4; color: var(--ink); }

/* ---------- 载入动效（克制档：仅 transform/opacity） ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
@media (prefers-reduced-motion: reduce) {
  .rise { animation: none; }
  * { transition: none !important; }
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--ink);
  color: var(--mist);
  border-bottom: 1px solid rgba(70, 169, 155, .38);
  position: relative;
}
.topbar::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--graticule);
}
.topbar-in {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.tb-brand { display: flex; align-items: center; gap: 10px; color: #F2EEDF; text-decoration: none; flex: none; }
.tb-brand:hover { text-decoration: none; }
.tb-brand .bn { font-family: var(--serif); font-size: 16px; letter-spacing: .06em; }
.tb-brand .bs { font-size: 10px; color: var(--teal-2); letter-spacing: .22em; font-family: var(--mono); }
.tb-nav { display: flex; gap: 2px; flex: 1; overflow-x: auto; scrollbar-width: none; }
.tb-nav::-webkit-scrollbar { display: none; }
.tb-link {
  color: #A9BCBB;
  font-size: 13.5px;
  padding: 6px 12px;
  border-radius: 6px;
  white-space: nowrap;
  transition: color .3s var(--ease), background .3s var(--ease);
}
.tb-link:hover { color: #F2EEDF; text-decoration: none; background: rgba(255, 255, 255, .06); }
.tb-link.on { color: var(--teal-2); background: rgba(70, 169, 155, .12); }
.tb-admin {
  flex: none;
  font-size: 13px;
  color: var(--teal-2);
  border: 1px solid rgba(70, 169, 155, .5);
  padding: 5px 12px;
  border-radius: 6px;
  transition: background .3s var(--ease);
}
.tb-admin:hover { background: rgba(70, 169, 155, .14); text-decoration: none; }

/* ---------- 主体与页脚 ---------- */
#main { flex: 1 0 auto; width: 100%; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 40px 20px 56px; }
.foot {
  background: var(--ink);
  color: #7E9491;
  font-size: 12.5px;
  border-top: 1px solid rgba(70, 169, 155, .38);
  position: relative;
}
.foot::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--graticule);
}
.foot-in {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 20px;
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
}
.foot a { color: var(--teal-2); }
.foot .f-priv { max-width: 640px; line-height: 1.7; }
.foot .f-priv b { color: var(--gold-2); }

/* ---------- 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 14.5px;
  padding: 11px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s var(--ease), background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease);
  user-select: none;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 16px; height: 16px; }
.btn-gold { background: var(--teal); color: #F2F7F5; }
.btn-gold:hover { background: var(--teal-deep); }
.btn-line { background: transparent; color: var(--teal); border-color: var(--teal); }
.btn-line:hover { background: var(--teal-ghost); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.badge {
  display: inline-block;
  font-size: 12.5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid currentColor;
  line-height: 1.5;
  white-space: nowrap;
}
.b-ok { color: var(--ok); }
.b-warn { color: var(--warn); }
.b-bad { color: var(--bad); }
.b-info { color: var(--muted); }
.b-gold { color: var(--gold); }

.tag {
  display: inline-block;
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 7px;
  background: var(--card);
}
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.serif { font-family: var(--serif); }

.sec { border-top: 1px solid var(--line); padding: 34px 0; }
.sec:first-child { border-top: 0; }
.sec-t {
  font-family: var(--serif);
  font-size: 21px;
  color: var(--ink);
  margin-bottom: 6px;
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.sec-t .no { font-family: var(--mono); font-size: 12px; color: var(--gold); letter-spacing: .15em; }
.sec-sub { font-size: 13.5px; color: var(--muted); margin-bottom: 18px; }

.hintbox, .errbox, .okbox {
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 13.5px;
  margin: 12px 0;
  border: 1px solid;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  line-height: 1.65;
}
.hintbox { background: rgba(150, 113, 60, .08); border-color: rgba(150, 113, 60, .32); color: var(--warn); }
.errbox { background: rgba(160, 85, 79, .07); border-color: rgba(160, 85, 79, .32); color: var(--bad); }
.okbox { background: rgba(62, 122, 92, .07); border-color: rgba(62, 122, 92, .32); color: var(--ok); }
.hintbox svg, .errbox svg, .okbox svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }

.empty {
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 30px 22px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
}

.twrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
table.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; min-width: 640px; }
.tbl th, .tbl td { border-bottom: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; }
.tbl th { background: #EDE6D3; color: var(--ink); font-weight: 600; white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tr.hl td { background: var(--teal-ghost); }

/* 骨架屏（不用转圈 spinner） */
@keyframes skl {
  from { opacity: .45; }
  to { opacity: 1; }
}
.skl {
  height: 12px;
  border-radius: 6px;
  background: var(--line);
  animation: skl 1s var(--ease) infinite alternate;
}

/* toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(8px);
  background: var(--ink);
  color: #F2EEDF;
  border: 1px solid rgba(70, 169, 155, .5);
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--ease), transform .3s var(--ease);
  z-index: 900;
  box-shadow: var(--shadow-ink);
  max-width: 90vw;
}
#toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 首页 · Hero（海图主视觉） ---------- */
.hero {
  background: var(--ink);
  color: var(--mist);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(680px 360px at 84% 12%, rgba(70, 169, 155, .17), transparent 62%),
    radial-gradient(520px 300px at 6% 96%, rgba(199, 174, 124, .09), transparent 60%),
    var(--graticule);
}
.hero::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(112deg, transparent 0 46px, rgba(199, 174, 124, .12) 46px 50px, transparent 50px 150px);
  mask-image: linear-gradient(100deg, transparent 30%, #000 72%);
  -webkit-mask-image: linear-gradient(100deg, transparent 30%, #000 72%);
}
.hero-in {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 20px 64px;
  display: grid;
  grid-template-columns: 5fr 6fr;
  gap: 48px;
  align-items: center;
}
.hero-kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: .28em;
  color: var(--teal-2);
  margin-bottom: 18px;
}
.hero-t {
  font-family: var(--serif);
  font-size: 40px;
  line-height: 1.3;
  color: #F2EEDF;
  margin-bottom: 20px;
}
.hero-t em { font-style: normal; color: var(--teal-2); }
.hero-p { font-size: 15px; color: #A9BFBD; max-width: 46ch; margin-bottom: 30px; }
.hero-btns { display: flex; gap: 14px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero .btn-ghost { color: var(--mist); border-color: rgba(255, 255, 255, .28); }
.hero .btn-ghost:hover { border-color: var(--teal-2); color: var(--teal-2); }

/* ---------- 首页 · 双轨入口（药品 / 器械） ---------- */
.tracks { max-width: 1200px; margin: 0 auto; padding: 10px 20px 8px; }
.tracks-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.tracks-head .th-t { font-family: var(--serif); font-size: 19px; color: var(--ink); }
.tracks-head .th-en { font-family: var(--mono); font-size: 11px; letter-spacing: .2em; color: var(--teal); }
.track-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.track {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px 20px;
  overflow: hidden;
  transition: transform .2s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.track::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--teal);
}
.track.t-gold::before { background: var(--gold); }
.track::after {
  content: ""; position: absolute; right: -56px; top: -56px; width: 160px; height: 160px;
  border: 1px dashed var(--line); border-radius: 50%; pointer-events: none;
}
.track:hover { transform: translateY(-2px); border-color: rgba(31, 122, 114, .5); box-shadow: var(--shadow-warm); }
.track.t-gold:hover { border-color: rgba(199, 174, 124, .65); }
.track-no { font-family: var(--mono); font-size: 11px; letter-spacing: .22em; color: var(--teal); }
.track.t-gold .track-no { color: #A98F5C; }
.track-t { font-family: var(--serif); font-size: 20px; color: var(--ink); margin: 4px 0 2px; }
.track-en { font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; color: var(--muted); margin-bottom: 10px; }
.track-d { font-size: 13.5px; color: var(--muted); line-height: 1.8; margin-bottom: 12px; }
.track-d b { color: var(--text); font-weight: 600; }
.track-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 16px; }
.track-tags .tag { background: var(--paper); }
.track-go { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--teal); }
.track.t-gold .track-go { color: #8F7440; }
.track-go svg { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.track-go:hover { text-decoration: none; }
.track-go:hover svg { transform: translateX(3px); }
.track-more { font-size: 12.5px; color: var(--muted); margin-left: 14px; }

/* ---------- 首页 · 信息带 ---------- */
.strips { max-width: 1200px; margin: 0 auto; padding: 18px 20px 56px; }
.strip {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 26px 0;
  border-top: 1px dashed var(--line);
}
.strip:first-child { border-top: 0; }
.strip-t { font-family: var(--serif); font-size: 16px; color: var(--ink); padding-top: 2px; }
.strip-t .no { display: block; font-family: var(--mono); font-size: 11px; color: var(--teal); letter-spacing: .2em; margin-bottom: 4px; }
.strip-b { font-size: 14px; color: var(--muted); line-height: 1.8; }
.strip-b b { color: var(--text); font-weight: 600; }

/* ---------- 表单（提交页） ---------- */
.form-sec { border-top: 1px solid var(--line); padding: 30px 0; }
.form-sec:first-child { border-top: 0; padding-top: 6px; }
.fld { margin-bottom: 20px; max-width: 640px; }
.fld > label { display: block; font-size: 13.5px; color: var(--ink); font-weight: 600; margin-bottom: 6px; }
.fld > label .req { color: var(--bad); margin-left: 2px; }
.fld .tip { font-size: 12.5px; color: var(--muted); margin-top: 5px; }
.fld .ferr { font-size: 12.5px; color: var(--bad); margin-top: 5px; display: none; }
.fld.err .ferr { display: block; }
.fld.err .inp { border-color: var(--bad); }
.inp {
  width: 100%;
  font-family: var(--sans);
  font-size: 14.5px;
  color: var(--text);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 13px;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.inp:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(31, 122, 114, .16); }
textarea.inp { resize: vertical; min-height: 96px; line-height: 1.7; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 28px; align-items: start; }
.grid2 > .fld { align-self: start; }

/* 药品字段分组小标题（展示用，不触碰字段逻辑） */
.fsub {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 28px 0 16px;
  max-width: 640px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--teal);
}
.fsub::after { content: ""; flex: 1; border-top: 1px dashed var(--line); }
.fsub .fs-n { font-family: var(--mono); font-size: 11px; color: var(--gold); letter-spacing: .15em; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--card); }
.seg.seg-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  align-content: start;
  justify-content: start;
  width: 100%;
  max-width: 100%;
  height: auto;
}
.seg.seg-wrap > button { min-width: 0; }
.seg button {
  border: 0;
  background: transparent;
  padding: 9px 18px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--muted);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.seg button + button { border-left: 1px solid var(--line); }
.seg button.on { background: var(--teal); color: #F2F7F5; }

.dz {
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  padding: 34px 20px;
  text-align: center;
  color: var(--muted);
  cursor: pointer;
  transition: border-color .3s var(--ease), background .3s var(--ease);
  background: var(--card);
}
.dz:hover, .dz.over { border-color: var(--teal); background: var(--teal-ghost); }
.dz svg { width: 30px; height: 30px; color: var(--teal); margin-bottom: 10px; }
.dz .dz-t { font-size: 14.5px; color: var(--text); margin-bottom: 4px; }
.dz .dz-s { font-size: 12.5px; }

.flist { margin-top: 14px; border-top: 1px solid var(--line); }
.frow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.frow svg.fi { width: 17px; height: 17px; color: var(--teal); flex: none; }
.frow .fn { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frow .fs { color: var(--muted); font-size: 12.5px; font-family: var(--mono); flex: none; }
.frow .fst {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
}
.frow .fst.ok { color: var(--ok); }
.frow .fst.ing { color: var(--warn); }
.frow .fst.bad { color: var(--bad); }
.frow .fdel {
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
  border-radius: 5px;
  transition: color .3s var(--ease);
  flex: none;
}
.frow .fdel:hover { color: var(--bad); }
.frow .fdel svg { width: 15px; height: 15px; }

/* ---------- 分析态（六阶段流水） ---------- */
.an-wrap { max-width: 720px; margin: 0 auto; padding: 70px 20px 90px; }
.an-t { font-family: var(--serif); font-size: 24px; color: var(--ink); margin-bottom: 8px; }
.an-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 34px; }
.an-stage {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 15px 4px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  transition: color .3s var(--ease);
}
.an-stage .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--line);
  flex: none;
  transition: background .3s var(--ease), border-color .3s var(--ease);
}
.an-stage.on { color: var(--ink); }
.an-stage.on .dot { background: var(--teal); border-color: var(--teal); }
.an-stage .an-no { font-family: var(--mono); font-size: 12px; color: var(--teal); flex: none; }
.an-stage .skl { width: 90px; margin-left: auto; }
.an-stage.on .skl { display: none; }
.an-stage .an-done { margin-left: auto; display: none; color: var(--ok); }
.an-stage.on .an-done { display: inline-flex; }
.an-stage .an-done svg { width: 15px; height: 15px; }

/* ---------- 报告页 · 封面（香槟金文书） ---------- */
.cover {
  background: var(--ink);
  color: var(--mist);
  position: relative;
  overflow: hidden;
  padding: 26px 22px;
}
.cover::before {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: var(--graticule);
}
.cover-frame {
  position: relative;
  border: 1px solid rgba(199, 174, 124, .85);
  outline: 1px solid rgba(199, 174, 124, .35);
  outline-offset: 6px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 54px 56px 40px;
  min-height: 560px;
  display: flex;
  flex-direction: column;
}
.cover-deco {
  position: absolute;
  right: -120px;
  top: -120px;
  width: 420px;
  height: 420px;
  pointer-events: none;
  opacity: .55;
  z-index: 0;
}
.cov-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(199, 174, 124, .4);
  padding-bottom: 18px;
}
.cov-brand { font-family: var(--serif); font-size: 16px; color: #F2EEDF; letter-spacing: .12em; }
.cov-brand .en { display: block; font-family: var(--mono); font-size: 10px; letter-spacing: .3em; color: var(--gold-2); margin-top: 3px; }
.cov-no { font-family: var(--mono); font-size: 13px; color: var(--gold-2); letter-spacing: .08em; }
.cov-mid { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 44px 0; }
.cov-kick { font-family: var(--mono); font-size: 11.5px; letter-spacing: .3em; color: var(--gold-2); margin-bottom: 18px; }
.cov-title {
  font-family: var(--serif);
  font-size: 42px;
  line-height: 1.3;
  color: #F2EEDF;
  margin-bottom: 16px;
  word-break: break-all;
}
.cov-sub { font-family: var(--serif); font-size: 18px; color: #AFC0BE; }
.cov-sub .cov-ptype {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--teal-2);
  border: 1px solid rgba(70, 169, 155, .55);
  border-radius: 999px;
  padding: 2px 12px;
  margin-left: 12px;
  vertical-align: 3px;
}
.cov-rule {
  width: 72px; height: 3px; margin-top: 22px;
  background: linear-gradient(90deg, var(--gold) 0 34%, transparent 34% 44%, var(--teal-2) 44% 100%);
  border-radius: 2px;
}
.cov-bot {
  border-top: 1px solid rgba(199, 174, 124, .4);
  padding-top: 18px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  font-size: 13px;
  color: #9DB2B0;
}
.cov-bot .cb-i b { color: #EAE4D2; font-weight: 600; display: block; font-size: 12px; letter-spacing: .1em; margin-bottom: 2px; }
.cov-badge {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cov-badge .cv {
  font-family: var(--serif);
  font-size: 20px;
  padding: 8px 20px;
  border: 1px solid currentColor;
  border-radius: 4px;
}
.cov-badge .sc { font-family: var(--mono); font-size: 13px; }
.cv.tone-ok { color: #82B39A; }
.cv.tone-warn { color: #C9A96A; }
.cv.tone-bad { color: #C08A85; }
.cv.tone-info { color: #93A8BC; }
.cov-pageno {
  position: absolute;
  right: 18px;
  bottom: 12px;
  font-family: var(--mono);
  font-size: 10.5px;
  color: rgba(199, 174, 124, .75);
  letter-spacing: .2em;
}

/* ---------- 报告页 · 正文与操作条 ---------- */
.actions-bar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 241, 232, .94);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid var(--line);
}
.actions-in {
  max-width: 1080px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.actions-in .ab-key { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-right: auto; }
.rep { max-width: 1080px; margin: 0 auto; padding: 0 20px 60px; overflow-wrap: anywhere; }
.verdict-line {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin: 10px 0 4px;
}
.verdict-line .v {
  font-family: var(--serif);
  font-size: 26px;
  color: var(--ink);
}
.verdict-line .v.tone-ok { color: var(--ok); }
.verdict-line .v.tone-warn { color: var(--warn); }
.verdict-line .v.tone-bad { color: var(--bad); }
.verdict-line .v.tone-info { color: var(--muted); }
.verdict-line .sc { font-family: var(--mono); font-size: 15px; color: var(--muted); }

.kv { display: grid; grid-template-columns: 150px 1fr; gap: 8px 18px; font-size: 14px; max-width: 860px; }
.kv dt { color: var(--muted); }
.kv dd { color: var(--text); }

.dimrow { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.dimrow .dn { width: 240px; flex: none; font-size: 13.5px; }
.dimrow .dn .w { color: var(--muted); font-size: 12px; margin-left: 6px; }
.dimrow .bar { flex: 1; height: 9px; background: #EAE2CE; border-radius: 5px; overflow: hidden; }
.dimrow .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-2)); border-radius: 5px; }
.dimrow .ds { width: 56px; flex: none; font-family: var(--mono); font-size: 13px; color: var(--ink); text-align: right; }

.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  color: var(--text);
  transition: border-color .3s var(--ease), color .3s var(--ease);
  max-width: 100%;
  overflow-wrap: anywhere;
}
.chip:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.chip .cn { font-family: var(--mono); color: var(--teal); font-size: 11.5px; }

.stage-block { border-top: 1px solid var(--line); padding: 14px 0; }
.stage-block:first-child { border-top: 0; }
.stage-h { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.stage-h .sn { font-family: var(--mono); font-size: 12px; color: var(--gold); }
.stage-h .st { font-weight: 600; color: var(--ink); font-size: 15px; }
.stage-sum { font-size: 13.5px; color: var(--muted); margin: 6px 0 10px; }
.stage-items { padding-left: 2px; }
.sitem { padding: 9px 0 9px 16px; border-left: 2px solid var(--line); margin: 8px 0; }
.sitem .si-t { font-size: 13.5px; font-weight: 600; color: var(--ink); }
.sitem .si-t .badge { margin-left: 8px; }
.sitem .si-x { font-size: 13.5px; color: var(--text); margin-top: 3px; }
.sitem .si-c { margin-top: 5px; font-size: 12px; color: var(--muted); }
.sitem .si-c a { font-family: var(--mono); }

details.stage-det { border-top: 1px solid var(--line); padding: 12px 0; }
details.stage-det summary {
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 10px;
}
details.stage-det summary::-webkit-details-marker { display: none; }
details.stage-det summary .sm-n { font-family: var(--mono); font-size: 12px; color: var(--gold); }
details.stage-det summary .sm-c { margin-left: auto; color: var(--muted); font-size: 12px; font-weight: 400; }
details.stage-det[open] summary .sm-c { transform: rotate(90deg); }
details.stage-det .sd-b { padding: 8px 0 4px 4px; }

/* ---------- 密钥弹层 ---------- */
.keymask {
  position: fixed;
  inset: 0;
  background: rgba(7, 27, 42, .74);
  z-index: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.keymodal {
  background: var(--paper);
  border: 1px solid var(--teal);
  outline: 1px solid rgba(70, 169, 155, .35);
  outline-offset: 5px;
  border-radius: 6px;
  max-width: 520px;
  width: 100%;
  padding: 40px 38px 32px;
  text-align: center;
  box-shadow: var(--shadow-ink);
}
.keymodal .km-t { font-family: var(--serif); font-size: 21px; color: var(--ink); margin-bottom: 8px; }
.keymodal .km-s { font-size: 13.5px; color: var(--muted); margin-bottom: 22px; }
.keycode {
  font-family: var(--mono);
  font-size: 34px;
  letter-spacing: .1em;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 16px 10px;
  margin-bottom: 12px;
  user-select: all;
  box-shadow: inset 0 0 0 4px rgba(31, 122, 114, .06);
}
.keymodal .km-warn { font-size: 12.5px; color: var(--bad); margin-bottom: 22px; }
.keymodal .km-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ---------- 密钥查询页 ---------- */
.acc-box { max-width: 560px; margin: 0 auto; }
.acc-form { display: flex; gap: 12px; margin: 18px 0 8px; }
.acc-form .inp { flex: 1; font-family: var(--mono); letter-spacing: .06em; }
.acc-list { margin-top: 26px; }
.acc-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.acc-row .ak { font-family: var(--mono); color: var(--teal); flex: none; }
.acc-row .ap { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row .ad { color: var(--muted); font-size: 12.5px; font-family: var(--mono); flex: none; }

/* ---------- 决策树页 ---------- */
.tree-note {
  font-size: 14px;
  color: var(--mist);
  border-left: 2px solid var(--teal-2);
  padding-left: 12px;
  margin-bottom: 0;
  max-width: 52ch;
}
.tree-grid { display: grid; grid-template-columns: 1fr 320px; gap: 28px; align-items: start; }
.tree-scroll {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  padding: 18px;
  position: relative;
}
.tree-scroll::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: var(--graticule);
}
.tree-scroll > svg { position: relative; display: block; width: 100%; height: auto; min-width: 760px; }
.tree-tip {
  position: fixed;
  z-index: 700;
  max-width: 300px;
  background: var(--ink-3);
  color: #EDE7D3;
  border: 1px solid var(--teal-2);
  border-radius: 8px;
  padding: 10px 13px;
  font-size: 12.5px;
  line-height: 1.65;
  pointer-events: none;
  display: none;
  box-shadow: var(--shadow-ink);
}
.tree-side {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  padding: 20px;
  position: sticky;
  top: 20px;
}
.tree-side h3 { font-family: var(--serif); font-size: 16px; margin-bottom: 4px; }
.tree-side .ts-g { font-family: var(--mono); font-size: 11.5px; color: var(--teal); letter-spacing: .12em; }
.tree-side .ts-q { font-size: 13.5px; margin: 8px 0; color: var(--text); }
.tree-side .ts-d { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.tree-side .ts-basis { border-top: 1px dashed var(--line); padding-top: 12px; margin-top: 12px; }
.tree-side .ts-basis .bh { font-size: 12px; color: var(--muted); letter-spacing: .1em; margin-bottom: 8px; }
.tnode { cursor: pointer; }
.tnode .nd-dia { fill: var(--ink-2); stroke: rgba(70, 169, 155, .55); stroke-width: 1.2; transition: all .3s var(--ease); }
.tnode:hover .nd-dia, .tnode.sel .nd-dia { stroke: var(--teal-2); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(70, 169, 155, .4)); }
.tnode text { fill: #DCE7E5; font-size: 13px; font-family: var(--sans); }
.tnode .nd-id { fill: var(--teal-2); font-family: var(--mono); font-size: 12px; letter-spacing: .12em; }
.tnode .nd-hint { fill: #5E7A78; font-size: 10px; opacity: 0; transition: opacity .3s var(--ease); }
.tnode:hover .nd-hint { opacity: 1; }
.texit .ex-box { fill: var(--ink-2); stroke: rgba(199, 174, 124, .38); stroke-width: 1; transition: all .3s var(--ease); }
.texit .ex-ico { fill: none; stroke: var(--teal-2); stroke-width: 1.5; }
.texit .ex-t { fill: #E9E2CC; font-size: 14px; font-family: var(--serif); }
.texit .ex-n { fill: #8AA0A0; font-size: 10.5px; font-family: var(--sans); }
.texit.hl .ex-box { stroke: var(--gold-2); stroke-width: 1.8; filter: drop-shadow(0 0 12px rgba(199, 174, 124, .4)); }
.texit.hl .ex-t { fill: var(--gold-2); }
.tedge { stroke: rgba(70, 169, 155, .55); stroke-width: 1.4; fill: none; }
.tedge-lb { fill: var(--teal-2); font-size: 12px; font-family: var(--mono); paint-order: stroke; stroke: var(--ink); stroke-width: 4; }
.tret { stroke: rgba(199, 174, 124, .6); stroke-width: 1.2; stroke-dasharray: 5 5; fill: none; }
.tret-lb { fill: #8AA0A0; font-size: 10.5px; font-family: var(--sans); paint-order: stroke; stroke: var(--ink); stroke-width: 4; }
.legend text { fill: #8AA0A0; font-size: 11px; font-family: var(--sans); }
.tedge.hl { stroke: var(--teal-2); stroke-width: 2.2; filter: drop-shadow(0 0 6px rgba(70, 169, 155, .55)); }
.tedge-lb.hl { fill: #E9E2CC; }
.tnode.hl .nd-dia { stroke: var(--teal-2); stroke-width: 2; filter: drop-shadow(0 0 10px rgba(70, 169, 155, .4)); }
.thl-note { fill: var(--gold-2); font-size: 12px; font-family: var(--mono); }

/* ---------- 官方依据页 ---------- */
.basis-grid { display: grid; grid-template-columns: 300px 1fr; gap: 28px; align-items: start; }
.basis-list { border: 1px solid var(--line); border-radius: 10px; background: var(--card); overflow: hidden; position: sticky; top: 20px; }
.basis-search { padding: 12px; border-bottom: 1px solid var(--line); }
.basis-items { max-height: 62vh; overflow-y: auto; }
.basis-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 13.5px;
  font-family: var(--sans);
  color: var(--text);
  transition: background .3s var(--ease), color .3s var(--ease);
}
.basis-item:last-child { border-bottom: 0; }
.basis-item:hover { background: var(--teal-ghost); }
.basis-item.on { background: var(--teal); color: #F2F7F5; }
.basis-item .bi-f { display: block; font-size: 11px; color: var(--muted); font-family: var(--mono); margin-top: 2px; }
.basis-item.on .bi-f { color: rgba(242, 247, 245, .75); }
.basis-doc { min-width: 0; }
.basis-doc .bd-name { font-family: var(--serif); font-size: 20px; color: var(--ink); margin-bottom: 4px; }
.basis-doc .bd-src { font-size: 12px; color: var(--muted); font-family: var(--mono); margin-bottom: 18px; word-break: break-all; }

/* ---------- md.js 渲染内容 ---------- */
.md { font-size: 14.5px; line-height: 1.85; color: var(--text); overflow-wrap: anywhere; }
.md h1, .md h2, .md h3, .md h4 { font-family: var(--serif); color: var(--ink); margin: 26px 0 10px; }
.md h1 { font-size: 23px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.md h2 { font-size: 19px; }
.md h3 { font-size: 16.5px; }
.md h4 { font-size: 15px; }
.md h1:first-child, .md h2:first-child, .md h3:first-child { margin-top: 0; }
.md p { margin: 10px 0; }
.md ul, .md ol { margin: 10px 0; padding-left: 1.6em; }
.md li { margin: 4px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 24px 0; }
.md a { color: var(--teal); }
.md code { font-family: var(--mono); font-size: .92em; background: #EDE6D3; border-radius: 4px; padding: 1px 5px; }
.md .md-twrap { overflow-x: auto; margin: 14px 0; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.md table { border-collapse: collapse; width: 100%; font-size: 13px; min-width: 620px; }
.md th, .md td { border-bottom: 1px solid var(--line); padding: 8px 11px; text-align: left; vertical-align: top; }
.md th { background: #EDE6D3; color: var(--ink); white-space: nowrap; }
.md tr:last-child td { border-bottom: 0; }
.md blockquote { border-left: 2px solid var(--teal); padding-left: 14px; color: var(--muted); margin: 12px 0; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-in { grid-template-columns: 1fr; gap: 34px; padding: 52px 20px 46px; }
  .hero-t { font-size: 30px; }
  .track-grid { grid-template-columns: 1fr; }
  .tree-grid, .basis-grid { grid-template-columns: 1fr; }
  .tree-side, .basis-list { position: static; }
  .basis-items { max-height: 300px; }
  .strip { grid-template-columns: 1fr; gap: 8px; }
  .grid2 { grid-template-columns: 1fr; }
  .cover-frame { padding: 34px 22px 30px; min-height: 0; }
  .cov-title { font-size: 27px; }
  .cov-badge { margin-left: 0; }
  .kv { grid-template-columns: 1fr; gap: 2px 0; }
  .kv dd { margin-bottom: 8px; }
  .dimrow .dn { width: 150px; }
  .tb-nav { gap: 0; }
  .tb-link { padding: 6px 9px; }
  .topbar-in { gap: 12px; }
  .keymodal { padding: 30px 20px 26px; }
  .keycode { font-size: 24px; padding: 14px 8px; letter-spacing: .08em; }
}

@media (max-width: 480px) {
  .seg.seg-wrap { grid-template-columns: 1fr; }
  .dimrow { flex-wrap: wrap; gap: 6px 10px; }
  .dimrow .dn { width: 100%; }
  .dimrow .ds { width: auto; margin-left: auto; }
  .acc-form { flex-direction: column; }
  .hero-btns .btn { width: 100%; justify-content: center; }
  .tracks-head { margin-bottom: 14px; }
  .cov-sub .cov-ptype { margin-left: 0; margin-top: 8px; }
  .sec-t { font-size: 19px; }
}

/* ---------- 打印（报告页） ---------- */
@media print {
  .topbar, .foot, .actions-bar, .keymask, .no-print, #toast { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .cover { page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .cover-frame { min-height: 240mm; }
  .rep { max-width: none; padding: 0; }
  .sec { padding: 18px 0; page-break-inside: avoid; }
  .twrap { overflow-x: visible; }
  table.tbl { min-width: 0; }
  details.stage-det { display: none; }
  a { color: var(--text); text-decoration: none; }
}

/* ================= AI 生成图片（Gemini，assets/img/） ================= */
/* 顶栏品牌徽章 */
.tb-logo { width: 30px; height: 30px; border-radius: 50%; display: block;
  box-shadow: 0 0 0 1px rgba(70, 169, 155, .6); }

/* 首页 Hero 右侧主视觉 */
.hero-art { min-width: 0; position: relative; z-index: 1; }
.hero-art img { width: 100%; height: auto; display: block; border-radius: 14px;
  border: 1px solid rgba(70, 169, 155, .45);
  box-shadow: 0 0 0 6px rgba(70, 169, 155, .08), 0 24px 48px -16px rgba(2, 12, 20, .6); }
.hero-art-cap { position: absolute; right: 14px; bottom: 14px;
  font-size: 12px; color: #EDE7D3; text-decoration: none;
  background: rgba(7, 27, 42, .74); border: 1px solid rgba(70, 169, 155, .5);
  padding: 6px 12px; border-radius: 999px; backdrop-filter: blur(4px);
  transition: all .3s var(--ease); }
.hero-art-cap:hover { color: #FFF; border-color: var(--teal-2); background: rgba(7, 27, 42, .92); }

/* 报告封面 guilloche 纹理（衬在金框之下） */
.cover-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background: url('img/cover-texture.png') center / cover no-repeat;
  opacity: .22; }
/* 封面内容层叠：纹理垫底（首个子元素），装饰 SVG 居中，文字最上 */
.cov-top, .cov-mid, .cov-bot, .cov-pageno { position: relative; z-index: 1; }

/* 决策树页头横幅 */
.tree-hero { position: relative; overflow: hidden; border-radius: 14px;
  border: 1px solid rgba(70, 169, 155, .4); margin-bottom: 22px;
  background: var(--ink) url('img/tree-banner.png') right center / cover no-repeat; }
.tree-hero-t { position: relative; padding: 34px 30px;
  background: linear-gradient(90deg, rgba(7, 27, 42, .92) 22%, rgba(7, 27, 42, .55) 58%, rgba(7, 27, 42, 0) 88%); }
.tree-hero .sec-t { color: #F2EEDF; margin: 0 0 6px; }

@media print {
  .cover-bg { opacity: .18; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .tree-hero { display: none; }
}
