/* ============================================================
   观点对照阅读助手 — v3 现代 AI 工具风
   中性灰阶 + 青绿强调；系统无衬线；纯 CSS，无外部资源
   ============================================================ */

:root {
  --bg: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #fbfbfc;
  --border: #e5e7eb;
  --border-strong: #d4d7dd;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9ca3af;

  --teal: #0d9488;
  --teal-dark: #0f766e;
  --teal-soft: #f0fdfa;
  --teal-border: #99e5da;

  --pro: #16a34a;
  --pro-dark: #15803d;
  --pro-soft: #f0fdf4;
  --pro-border: #bbf7d0;

  --con: #e11d48;
  --con-dark: #be123c;
  --con-soft: #fff1f2;
  --con-border: #fecdd3;

  --amber: #d97706;
  --amber-dark: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --hl: #fef3c7;
  --hl-border: #f59e0b;

  --radius: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(17, 24, 39, .05);
  --shadow-md: 0 6px 20px -6px rgba(17, 24, 39, .12), 0 2px 6px rgba(17, 24, 39, .05);
  --shadow-lg: 0 20px 50px -12px rgba(17, 24, 39, .25);

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --sidebar-w: 250px;
  --topbar-h: 56px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------------- App 外壳 ---------------- */

.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
}

.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  gap: 4px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 8px 16px;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--teal);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-name { font-size: 15px; font-weight: 650; line-height: 1.25; }
.brand-sub { font-size: 11px; color: var(--faint); line-height: 1.3; }

.side-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--faint);
  padding: 12px 10px 6px;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }
.side-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 9px;
  color: var(--text-2);
  font-size: 14px;
  transition: background .15s, color .15s;
}
.side-nav a:hover { background: var(--bg); text-decoration: none; }
.side-nav a.active { background: var(--teal-soft); color: var(--teal-dark); font-weight: 600; }
.side-nav .nav-ico {
  width: 20px; height: 20px;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  display: grid; place-items: center;
  font-size: 10.5px; font-weight: 700;
  flex: none;
  opacity: .85;
}
.side-nav a.active .nav-ico { background: var(--teal); border-color: var(--teal); color: #fff; opacity: 1; }

.side-sample {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.side-sample:hover { border-color: var(--teal-border); box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.side-sample .ss-title { font-size: 13.5px; font-weight: 600; color: var(--text); line-height: 1.45; }
.side-sample .ss-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.sidebar-foot {
  margin-top: auto;
  padding: 14px 10px 2px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--faint);
  line-height: 1.6;
}

.main-col { display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: var(--topbar-h);
  flex: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 22px;
  background: rgba(255, 255, 255, .82);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  z-index: 20;
}
.topbar-title { font-size: 15px; font-weight: 650; }
.topbar-sub { font-size: 12.5px; color: var(--muted); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }

main {
  flex: 1;
  overflow-y: auto;
  padding: 26px 30px 48px;
  scroll-behavior: smooth;
}
.page { max-width: 1180px; margin: 0 auto; animation: viewIn .28s ease both; }
.page-narrow { max-width: 880px; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- 通用组件 ---------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 2.5px 9px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.badge-teal { background: var(--teal-soft); border-color: var(--teal-border); color: var(--teal-dark); }
.badge-pro  { background: var(--pro-soft);  border-color: var(--pro-border);  color: var(--pro-dark); }
.badge-con  { background: var(--con-soft);  border-color: var(--con-border);  color: var(--con-dark); }
.badge-warn { background: var(--amber-soft); border-color: var(--amber-border); color: var(--amber-dark); }
.badge-mute { color: var(--muted); }

.chip-stat {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 12.5px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px 11px;
}
.chip-stat b { color: var(--text); font-size: 13.5px; font-weight: 650; }
.chip-stat.pro b { color: var(--pro-dark); }
.chip-stat.con b { color: var(--con-dark); }
.chip-stat.warn b { color: var(--amber-dark); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 18px;
  transition: background .15s, border-color .15s, box-shadow .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--teal); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--teal-dark); }
.btn-ghost { background: var(--surface); border-color: var(--border-strong); color: var(--text-2); }
.btn-ghost:hover { border-color: var(--teal); color: var(--teal-dark); }
.btn-sm { padding: 6px 13px; font-size: 13px; border-radius: 9px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.eyebrow {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .1em;
  color: var(--teal-dark);
  text-transform: uppercase;
}

h1.page-title {
  font-size: 27px;
  font-weight: 750;
  letter-spacing: -.01em;
  line-height: 1.3;
  margin: 6px 0 8px;
}
.sub { color: var(--muted); font-size: 14.5px; line-height: 1.7; margin: 0; }

.section { margin-top: 26px; }
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.section-head h2 { font-size: 16.5px; font-weight: 700; margin: 0; }
.section-note { font-size: 12.5px; color: var(--faint); margin-left: auto; text-align: right; }

.hint-line {
  display: flex;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 14px 0 0;
}
.hint-line .hi-ico {
  flex: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 1.5px solid var(--faint);
  color: var(--faint);
  font-size: 10.5px;
  display: grid; place-items: center;
  margin-top: 2px;
}

#toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 16px);
  background: #111827;
  color: #f9fafb;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s;
  z-index: 200;
  max-width: min(92vw, 560px);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 首页 ---------------- */

.hero { padding: 34px 0 6px; text-align: center; }
.hero h1 {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.25;
  margin: 10px 0 12px;
}
.hero h1 .hl { color: var(--teal-dark); }
.hero .sub { max-width: 640px; margin: 0 auto; }

.hero-steps {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
}
.hero-steps li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 13px 5px 6px;
  font-size: 13px;
  color: var(--text-2);
  box-shadow: var(--shadow-sm);
}
.hero-steps b {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 11.5px;
  display: grid; place-items: center;
}

.composer {
  margin-top: 26px;
  padding: 20px 22px 18px;
  text-align: left;
}

.seg {
  display: inline-flex;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  transition: background .15s, color .15s, box-shadow .15s;
}
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

.field { margin-top: 18px; }
.label-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 7px; }
.field-label { font-size: 13.5px; font-weight: 650; }
.label-hint { font-size: 12px; color: var(--faint); margin-left: auto; text-align: right; }

.field input[type="text"], .field textarea {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 11px 13px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field textarea { min-height: 148px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: var(--faint); }
.field input:focus, .field textarea:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .15);
}
.field-focus input[type="text"], .field-focus textarea { border-color: var(--teal-border); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 550;
  transition: all .15s;
}
.chip:hover { border-color: var(--teal); color: var(--teal-dark); }
.chip.on { background: var(--teal); border-color: var(--teal); color: #fff; }

.actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }

.sample-entry {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 18px 20px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.sample-entry:hover { border-color: var(--teal-border); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.se-kicker { font-size: 11.5px; font-weight: 650; letter-spacing: .1em; color: var(--teal-dark); }
.se-title { font-size: 16.5px; font-weight: 700; margin-top: 3px; }
.se-desc { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.65; }
.se-stats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 11px; }
.sample-entry .btn { margin-left: auto; flex: none; }

/* ---------------- 对照页：概览 ---------------- */

.cmp-head { padding: 20px 22px 18px; }
.cmp-head-top { display: flex; gap: 16px; align-items: flex-start; }
.cmp-head-top .btn { flex: none; }
.cmp-head h1 { font-size: 22px; font-weight: 750; margin: 4px 0 6px; line-height: 1.35; }
.cmp-head .sub { font-size: 13.5px; max-width: 820px; }

.overview { margin-top: 16px; padding-top: 15px; border-top: 1px solid var(--border); }
.dist-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13px;
  flex-wrap: wrap;
}
.dist-head .side-pro { color: var(--pro-dark); font-weight: 650; }
.dist-head .side-con { color: var(--con-dark); font-weight: 650; margin-left: auto; text-align: right; }
.dist-head .pct { font-size: 15px; font-weight: 750; }
.dist-verdict {
  width: 100%;
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.dist-track {
  display: flex;
  height: 9px;
  border-radius: 99px;
  overflow: hidden;
  background: var(--bg);
  margin-top: 9px;
  gap: 2px;
}
.dist-track .fill-pro { background: var(--pro); border-radius: 99px 0 0 99px; transition: width .6s ease; }
.dist-track .fill-con { background: var(--con); border-radius: 0 99px 99px 0; transition: width .6s ease; }
.dist-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--faint);
  margin-top: 6px;
}
.chips-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 13px; }

/* ---------------- 对照页：双栏阅读器 ---------------- */

.reader {
  display: grid;
  grid-template-columns: minmax(330px, 5fr) minmax(430px, 7fr);
  gap: 16px;
  margin-top: 16px;
  align-items: start;
}
.pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pane-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.5px;
  font-weight: 700;
}
.pane-head .ph-note { font-size: 12px; font-weight: 500; color: var(--faint); margin-left: auto; text-align: right; }
.pane-head .ph-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--teal); flex: none; }
.pane-head .ph-dot.alt { background: #6366f1; }
.pane-body {
  overflow-y: auto;
  max-height: calc(100vh - 385px);
  min-height: 300px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overscroll-behavior: contain;
}

/* 材料卡 */
.mat-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 15px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s;
  scroll-margin: 12px;
}
.mat-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.mat-card.linked {
  border-color: var(--teal);
  background: var(--teal-soft);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, .18), var(--shadow-sm);
}
.mat-head { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 8px; }
.mat-label { font-size: 13.5px; font-weight: 700; }
.mat-meta { font-size: 11.5px; color: var(--muted); background: var(--bg); border: 1px solid var(--border); padding: 1px 8px; border-radius: 999px; }
.mat-stance { margin-left: auto; font-size: 11.5px; font-weight: 650; padding: 1px 9px; border-radius: 999px; }
.st-pro { background: var(--pro-soft); color: var(--pro-dark); }
.st-con { background: var(--con-soft); color: var(--con-dark); }
.st-mid { background: var(--bg); color: var(--muted); }
.mat-text { font-size: 13.5px; line-height: 1.75; color: var(--text-2); }
.mat-text mark {
  background: var(--hl);
  border-bottom: 2px solid var(--hl-border);
  border-radius: 2px;
  padding: 0 1px;
  color: inherit;
}
.mat-note { font-size: 12px; color: var(--faint); margin-top: 9px; }
.mat-refs { display: none; margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--teal-border); font-size: 12px; color: var(--teal-dark); font-weight: 600; }
.mat-card.linked .mat-refs { display: block; }

/* 结果分区 */
.res-sec-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 700;
  margin: 4px 2px 0;
}
.res-sec-head .count { margin-left: auto; font-size: 12px; color: var(--faint); font-weight: 550; }
.res-sec-head .rs-note { font-size: 11.5px; color: var(--faint); font-weight: 500; }

.arg-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface);
  cursor: pointer;
  transition: border-color .18s, box-shadow .18s, background .18s, transform .15s;
  scroll-margin: 12px;
  animation: viewIn .3s ease both;
  animation-delay: calc(var(--i, 0) * 45ms);
}
.arg-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.arg-card.pro { border-left-color: var(--pro); }
.arg-card.con { border-left-color: var(--con); }
.arg-card.linked.pro { border-color: var(--pro); background: var(--pro-soft); box-shadow: 0 0 0 3px rgba(22, 163, 74, .16); }
.arg-card.linked.con { border-color: var(--con); background: var(--con-soft); box-shadow: 0 0 0 3px rgba(225, 29, 72, .14); }
.arg-top { display: flex; gap: 9px; align-items: flex-start; }
.arg-idx {
  flex: none;
  width: 20px; height: 20px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 700;
  display: grid; place-items: center;
  margin-top: 1px;
}
.pro .arg-idx { background: var(--pro-soft); color: var(--pro-dark); }
.con .arg-idx { background: var(--con-soft); color: var(--con-dark); }
.arg-claim { font-size: 14px; font-weight: 600; line-height: 1.55; }
.arg-hits { font-size: 12px; color: var(--faint); margin: 6px 0 0 29px; }
.arg-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 9px 0 0 29px;
  font-size: 12px;
}
.arg-src { color: var(--teal-dark); font-weight: 600; }
.arg-tag { font-size: 11px; font-weight: 650; color: var(--muted); background: var(--bg); border: 1px solid var(--border); border-radius: 6px; padding: 0 6px; }
.arg-tag-thesis { color: var(--teal-dark); border-color: var(--teal-border); background: var(--teal-soft); }
.arg-detail { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--muted); }
.arg-detail:hover { color: var(--teal-dark); }
.col-empty { font-size: 13px; color: var(--faint); padding: 14px 6px; text-align: center; }

/* 共识 / 概念 / 待核实（右栏内） */
.cons-item {
  border: 1px solid var(--teal-border);
  background: var(--teal-soft);
  border-radius: var(--radius);
  padding: 11px 14px;
  cursor: pointer;
  transition: box-shadow .18s, border-color .18s;
  scroll-margin: 12px;
}
.cons-item:hover { box-shadow: var(--shadow-sm); }
.cons-item.linked { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 148, 136, .18); background: #e6fbf6; }
.cons-item p { margin: 0; font-size: 13.5px; line-height: 1.65; color: var(--text-2); }
.cons-item .refs { font-size: 12px; color: var(--teal-dark); font-weight: 600; margin-top: 6px; }

.concept-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.concept-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 13px;
  background: var(--surface-2);
}
.concept-term { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.concept-term .k {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  border-radius: 5px;
  padding: 0 5px;
}
.concept-def { font-size: 12.5px; color: var(--muted); line-height: 1.65; margin: 6px 0 0; }
.concept-note { font-size: 11.5px; color: var(--faint); margin-top: 6px; }

.pend-item {
  border: 1px solid var(--amber-border);
  background: var(--amber-soft);
  border-radius: var(--radius);
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.7;
  color: #713f12;
  cursor: pointer;
  scroll-margin: 12px;
  transition: box-shadow .18s, border-color .18s;
}
.pend-item:hover { box-shadow: var(--shadow-sm); }
.pend-item.linked { border-color: var(--amber); box-shadow: 0 0 0 3px rgba(217, 119, 6, .18); }
.pend-ref { display: block; font-size: 12px; font-weight: 600; color: var(--amber-dark); margin-top: 5px; }

.empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--muted);
}

/* ---------------- 证据页 ---------------- */

.back-link { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 600; margin-bottom: 16px; }
.ev-card { padding: 22px 24px; }
.detail-claim { font-size: 19px; font-weight: 700; line-height: 1.55; margin: 4px 0 18px; }
.meta-table { display: grid; grid-template-columns: 92px 1fr; gap: 9px 16px; margin: 0 0 20px; font-size: 13.5px; }
.meta-table dt { color: var(--faint); font-weight: 600; }
.meta-table dd { margin: 0; color: var(--text-2); line-height: 1.65; }
.ev-card h3 { font-size: 14.5px; font-weight: 700; margin: 20px 0 10px; }
.excerpt-card {
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  background: var(--surface-2);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.excerpt-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 8px; }
.excerpt-head b { color: var(--text); font-size: 13px; }
.excerpt-text { margin: 0; font-size: 14px; line-height: 1.8; color: var(--text-2); }
.excerpt-text mark {
  background: var(--hl);
  border-bottom: 2px solid var(--hl-border);
  border-radius: 2px;
  padding: 0 1px;
  color: inherit;
}
.excerpt-legend { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: -2px 0 10px; }
.excerpt-legend .swatch { width: 14px; height: 10px; background: var(--hl); border-bottom: 2px solid var(--hl-border); border-radius: 2px; flex: none; }

/* ---------------- 追问页（聊天） ---------------- */

.qa-summary { padding: 16px 20px; margin-bottom: 16px; }
.qa-summary .qs-title { font-size: 15px; font-weight: 700; line-height: 1.5; }
.qa-summary .chips-row { margin-top: 10px; }

.chat {
  padding: 20px 22px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.chat-pair { display: flex; flex-direction: column; gap: 10px; animation: viewIn .3s ease both; }
.msg { display: flex; gap: 10px; max-width: 88%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 9px;
  display: grid; place-items: center;
  font-size: 12.5px; font-weight: 700;
}
.msg.bot .avatar { background: var(--teal); color: #fff; }
.msg.user .avatar { background: #e0e7ff; color: #4338ca; }
.bubble {
  border-radius: 14px;
  padding: 11px 15px;
  font-size: 14px;
  line-height: 1.7;
}
.msg.user .bubble {
  background: var(--teal);
  color: #fff;
  border-top-right-radius: 5px;
  font-weight: 550;
}
.msg.bot .bubble {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top-left-radius: 5px;
  color: var(--text-2);
  flex: 1;
  min-width: 0;
}
.bubble .qa-verdict { margin-bottom: 8px; }
.bubble p { margin: 0 0 8px; }
.bubble p:last-child { margin-bottom: 0; }
.bubble ul { margin: 0 0 8px; padding-left: 19px; }
.bubble li { margin: 3px 0; }
.bubble .qa-tail { font-size: 12.5px; color: var(--muted); }
.bubble .not-mentioned {
  background: var(--amber-soft);
  border: 1px solid var(--amber-border);
  color: #713f12;
  border-radius: 9px;
  padding: 10px 13px;
  font-size: 13.5px;
  line-height: 1.7;
}
.qa-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ref-pill {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-soft);
  border: 1px solid var(--teal-border);
  border-radius: 999px;
  padding: 1px 9px;
}

.ask-box {
  margin-top: 16px;
  padding: 16px 18px 14px;
  position: sticky;
  bottom: 14px;
  box-shadow: var(--shadow-md);
}
.preset-qs { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.preset-q {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  padding: 5px 13px;
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-2);
  transition: all .15s;
}
.preset-q:hover { border-color: var(--teal); color: var(--teal-dark); background: var(--teal-soft); }
.ask-bar { display: flex; gap: 9px; }
.ask-bar input {
  flex: 1;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 10px 13px;
  font-size: 14px;
  min-width: 0;
}
.ask-bar input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(13, 148, 136, .15); }

/* ---------------- 说明页 ---------------- */

.steps-list { list-style: none; margin: 0; padding: 0; counter-reset: st; }
.steps-list li {
  display: flex;
  gap: 14px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  counter-increment: st;
}
.steps-list li:last-child { border-bottom: 0; }
.steps-list li::before {
  content: counter(st);
  flex: none;
  width: 24px; height: 24px;
  border-radius: 8px;
  background: var(--teal-soft);
  color: var(--teal-dark);
  font-size: 12.5px;
  font-weight: 700;
  display: grid; place-items: center;
  margin-top: 1px;
}
.st-title { font-size: 14.5px; font-weight: 650; }
.st-desc { font-size: 13.5px; color: var(--muted); line-height: 1.7; margin-top: 2px; }

.boundary-list { list-style: none; margin: 0; padding: 0; }
.boundary-list li {
  display: flex;
  gap: 11px;
  padding: 8.5px 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.7;
  border-bottom: 1px solid var(--border);
}
.boundary-list li:last-child { border-bottom: 0; }
.boundary-list .bx {
  flex: none;
  width: 19px; height: 19px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  display: grid; place-items: center;
  margin-top: 3px;
  background: var(--teal-soft); color: var(--teal-dark);
}
.boundary-list .bx.no { background: var(--bg); color: var(--faint); border: 1px solid var(--border); }
.about-card { padding: 6px 22px 10px; }
.about-card.plain { padding: 20px 22px; }
.about-card p.body-text { font-size: 14px; color: var(--text-2); line-height: 1.8; margin: 4px 0 12px; }

/* ---------------- 生成进度 ---------------- */

.progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .44);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 300;
  animation: viewIn .2s ease both;
  padding: 20px;
}
.progress-card {
  background: var(--surface);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: min(480px, 94vw);
  padding: 26px 28px 22px;
}
.pc-eyebrow { font-size: 11.5px; font-weight: 700; letter-spacing: .12em; color: var(--teal-dark); }
.progress-card h3 { font-size: 18px; font-weight: 750; margin: 7px 0 4px; }
.pc-topic { font-size: 13px; color: var(--muted); margin: 0 0 18px; line-height: 1.6; }
.pstep { display: flex; gap: 12px; padding: 9px 0; align-items: flex-start; }
.pstep-ico {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  margin-top: 1px;
  position: relative;
  transition: all .2s;
}
.pstep.doing .pstep-ico { border-color: var(--teal); border-top-color: transparent; animation: spin .7s linear infinite; }
.pstep.done .pstep-ico { background: var(--teal); border-color: var(--teal); animation: none; }
.pstep.done .pstep-ico::after {
  content: "";
  position: absolute;
  left: 6.5px; top: 3.5px;
  width: 5px; height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
@keyframes spin { to { transform: rotate(360deg); } }
.pstep .pt { font-size: 14px; font-weight: 650; color: var(--faint); transition: color .2s; }
.pstep .ps { font-size: 12.5px; color: var(--faint); line-height: 1.55; transition: color .2s; }
.pstep.doing .pt, .pstep.done .pt { color: var(--text); }
.pstep.doing .ps, .pstep.done .ps { color: var(--muted); }
.progress-bar {
  height: 6px;
  border-radius: 99px;
  background: var(--bg);
  overflow: hidden;
  margin-top: 16px;
}
.progress-bar i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--teal), #2dd4bf);
  border-radius: 99px;
  transition: width .35s ease;
}

/* ---------------- 响应式 ---------------- */

@media (max-width: 1020px) {
  .reader { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 820px) {
  .app { grid-template-columns: 1fr; height: auto; }
  .sidebar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 10px 14px;
    gap: 8px;
  }
  .brand { padding: 0; }
  .brand-sub, .side-label, .sidebar-foot { display: none; }
  .side-nav { flex-direction: row; flex-wrap: wrap; margin-left: auto; }
  .side-nav a { padding: 6px 9px; font-size: 13px; }
  .side-nav .nav-ico { display: none; }
  .side-sample { display: none; }
  main { overflow: visible; padding: 18px 14px 40px; }
  .hero h1 { font-size: 26px; }
  .reader { grid-template-columns: 1fr; }
  .pane-body { max-height: none; min-height: 0; overflow: visible; }
  .concept-grid { grid-template-columns: 1fr; }
  .cmp-head-top { flex-direction: column; }
  .msg { max-width: 96%; }
  .sample-entry { flex-direction: column; align-items: flex-start; }
  .sample-entry .btn { margin-left: 0; }
  .ask-box { position: static; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001s !important;
    transition-duration: .001s !important;
  }
  main { scroll-behavior: auto; }
}
