/* doxt — 单入口 AI 搜索工作台 v4
   设计纪律：中性表面 + 1px 发线 + 单一品牌色；不做 tab，场景由意图自动切换。 */

:root {
  --bg: #ffffff;
  --bg-soft: #f7f7f8;
  --surface: #ffffff;
  --surface-2: #f7f7f8;
  --line: #e9e9ec;
  --line-strong: #dcdce2;
  --text: #0f1419;
  --text-2: #536471;
  --text-3: #8b98a5;
  --navy: #0f1419;
  --accent: #2f6fed;
  --accent-2: #2f6fed;
  --accent-soft: #eef3fe;
  --accent-line: #d8e2fb;
  --ok: #12805c;
  --ok-soft: #eaf7f1;
  --warn: #a15c07;
  --warn-soft: #fff8e8;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 20, 25, .04);
  --shadow: 0 1px 2px rgba(15, 20, 25, .04), 0 8px 24px rgba(15, 20, 25, .05);
  --shadow-lift: 0 2px 4px rgba(15, 20, 25, .05), 0 16px 40px rgba(15, 20, 25, .08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: var(--accent-soft); color: var(--text); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon { width: 17px; height: 17px; flex: none; }
.chevron { width: 13px; height: 13px; opacity: .65; }

/* ---------- 品牌 ---------- */
.brand, .home-brand {
  font-weight: 800;
  letter-spacing: -.45px;
  color: var(--text);
  text-decoration: none;
  font-size: 22px;
  line-height: 1;
}
.brand-do, .home-brand .brand-do { font-size: 1.18em; letter-spacing: -.6px; }
.brand:hover { text-decoration: none; }
.brand-x, .grad {
  color: var(--accent);
}
.getapp {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: filter .15s, box-shadow .15s;
}
.getapp:hover { text-decoration: none; filter: brightness(1.03); box-shadow: 0 0 0 1.5px var(--accent-line); }
.lang-btn {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: color .15s, border-color .15s, background .15s;
}
.lang-btn:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 76px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 22px;
}
.brand { font-size: 24px; }
.top-search {
  flex: 1;
  max-width: 844px;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 52px;
  padding: 0 9px 0 20px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text-3);
  transition: border-color .15s, box-shadow .15s;
}
.top-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, .10);
}
.top-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 15.5px;
}
.top-search .btn { height: 36px; padding: 0 20px; }
.top-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

.mode-chip, .mode-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .15s;
}
.mode-chip { height: 34px; padding: 0 11px; font-size: 12.5px; font-weight: 600; }
.mode-inline { height: 28px; padding: 0 10px; font-size: 12px; font-weight: 600; }
.mode-chip:hover, .mode-inline:hover { background: #e6e9ff; border-color: #cfd5ff; }
.mode-chip:active, .mode-inline:active { transform: scale(.98); }
.mode-icon { display: inline-flex; width: 15px; height: 15px; color: var(--accent); }
.mode-icon svg { width: 15px; height: 15px; }

.icon-btn {
  width: 34px;
  height: 34px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s, transform .15s;
}
.icon-btn:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.icon-btn:active { transform: scale(.96); }
.icon-btn.attach { width: 30px; height: 30px; border: 0; background: transparent; color: var(--text-3); }
.icon-btn.attach:hover { background: var(--surface-2); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 18px;
  height: 40px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: filter .15s, transform .15s, background .15s, border-color .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--navy);
  color: #fff;
}
.btn-primary:hover { background: #1c2431; filter: none; }
.btn-primary:hover { filter: brightness(1.07); }
.btn-sm { height: 32px; padding: 0 13px; font-size: 12.5px; border-radius: 999px; }
.btn-ghost {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--text-2);
  font-weight: 500;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------- 首页 ---------- */
.home {
  position: relative;
  min-height: calc(100dvh - 64px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.home-glow {
  position: absolute;
  top: -260px;
  left: 50%;
  width: 900px;
  height: 520px;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(47, 111, 237, .07), transparent 70%);
  pointer-events: none;
}
.home-inner {
  position: relative;
  width: 100%;
  max-width: 880px;
  margin: auto;
  padding: 48px 24px 32px;
  text-align: center;
}
.home-brand { font-size: 80px; margin-bottom: 44px; letter-spacing: -.04em; }
.home-tag {
  margin-top: 30px;
  color: var(--text-3);
  font-size: 12.5px;
  letter-spacing: .02em;
}
.tag-slogan { color: var(--text-2); font-weight: 600; }
.home-sub { display: none; }
.composer {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 12px 12px 12px 22px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow);
  transition: border-color .18s, box-shadow .18s;
}
.composer:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, .10), var(--shadow-lift);
}
.composer-icon { color: var(--text-3); width: 21px; height: 21px; }
.composer input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 17.5px;
}
.composer input::placeholder { color: var(--text-3); }
.composer .btn { height: 48px; border-radius: 999px; padding: 0 28px; font-size: 15px; }

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  max-width: 700px;
  margin: 22px auto 0;
  transition: opacity .25s ease;
}
.examples-label { color: var(--text-3); font-size: 12px; margin-right: 2px; }
.example {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 12.5px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.example:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.example:active { transform: translateY(1px); }
.home-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 20px;
  color: var(--text-3);
  font-size: 12px;
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px var(--ok-soft);
}
.dot-sep { color: var(--line-strong); }
.home-foot {
  position: relative;
  padding: 18px;
  text-align: center;
  color: var(--text-3);
  font-size: 11.5px;
}

/* ---------- 结果工作台 ---------- */
.workspace {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 24px 92px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}
.canvas { min-width: 0; }
.canvas-head { margin-bottom: 16px; }
.crumbs {
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
}
.question {
  margin: 6px 0 10px;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.7px;
  font-weight: 700;
}
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
}
.meta-text { color: var(--text-3); font-size: 12.5px; }
.link-btn {
  border: 0;
  background: none;
  padding: 0;
  color: var(--text-3);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--line-strong);
}
.link-btn:hover { color: var(--accent); text-decoration-color: var(--accent); }

/* 进度 */
.status { margin: 14px 0 18px; }
.status-track {
  height: 3px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}
.status-track span {
  display: block;
  width: 24%;
  height: 100%;
  border-radius: inherit;
  background: var(--navy);
  transition: width .5s cubic-bezier(.16, 1, .3, 1);
}
.status-text { margin-top: 7px; color: var(--text-3); font-size: 12px; }

/* 导航官方卡 */
.nav-slot { margin-bottom: 14px; }
.nav-card {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, var(--ok-soft), var(--surface) 70%);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.nav-ver { color: var(--ok); font-size: 11.5px; font-weight: 700; margin-bottom: 4px; }
.nav-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}
.nav-main:hover { text-decoration: none; color: var(--accent); }
.nav-url { color: var(--accent); font-size: 12.5px; font-weight: 400; }
.nav-icp { color: var(--text-3); font-size: 11px; margin-top: 3px; }
.nav-subs { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 9px; }
.nav-sub {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 999px;
  padding: 3px 11px;
  color: var(--text-2);
  font-size: 12px;
}
.nav-sub:hover { color: var(--accent); border-color: var(--accent-line); text-decoration: none; }

/* 结论卡 */
.conclusion {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}
.conclusion-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 7px;
}
.conclusion-label {
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .14em;
}
.confidence {
  color: var(--text-3);
  font-size: 11px;
  margin-left: auto;
}
.conclusion p {
  font-size: 17px;
  line-height: 1.68;
  font-weight: 500;
  letter-spacing: -.1px;
}
.conclusion-foot { margin-top: 9px; color: var(--text-3); font-size: 11.5px; }

/* ---------- 动态组件 ---------- */
.modules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}
.module-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px 14px;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  animation: fadeUp .28s cubic-bezier(.16, 1, .3, 1) both;
}
.module-card.wide { grid-column: 1 / -1; }
.module-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
}
.module-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.module-icon svg { width: 15px; height: 15px; }
.module-title {
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: -.1px;
}
.module-tag {
  margin-left: auto;
  color: var(--text-3);
  font-size: 10.5px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  white-space: nowrap;
}
.module-note {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 11.5px;
  line-height: 1.55;
}
.module-note strong { color: var(--text-2); font-weight: 600; }
.refs { display: inline-flex; gap: 3px; margin-left: 5px; vertical-align: 1px; }
.mini-cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 15px;
  padding: 0 4px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.mini-cite:hover { background: var(--accent); color: #fff; }

/* 表格 */
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 430px; }
th {
  text-align: left;
  padding: 7px 9px;
  color: var(--text-3);
  font-size: 11px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
td {
  padding: 9px;
  border-bottom: 1px solid var(--line);
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  vertical-align: top;
}
td:first-child { color: var(--text); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: var(--bg-soft); }
.num { font-variant-numeric: tabular-nums; }

/* 计算器 */
.calc-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.field label {
  display: block;
  margin-bottom: 4px;
  color: var(--text-3);
  font-size: 11px;
}
.field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xs);
  padding: 6px 8px;
  background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.field-row:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 237, .10);
}
.field-row input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.field-unit { color: var(--text-3); font-size: 11px; flex: none; }
.calc-result {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding: 11px 13px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-sm);
}
.calc-result span { color: var(--accent); font-size: 11.5px; font-weight: 600; }
.calc-result strong {
  color: var(--accent);
  font-size: 25px;
  line-height: 1.1;
  letter-spacing: -.6px;
  font-variant-numeric: tabular-nums;
}

/* 时间线 */
.timeline { list-style: none; display: flex; flex-direction: column; gap: 0; }
.timeline li {
  position: relative;
  padding: 0 0 13px 20px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 5px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--accent);
}
.timeline li::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 0;
  width: 1px;
  background: var(--line);
}
.timeline li:last-child { padding-bottom: 0; }
.timeline li:last-child::after { display: none; }
.timeline .t-title { color: var(--text); font-size: 12.5px; font-weight: 650; }
.timeline .t-desc { color: var(--text-2); font-size: 11.5px; line-height: 1.55; margin-top: 1px; }

/* 清单 */
.checklist { display: flex; flex-direction: column; gap: 7px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text-2);
  font-size: 12.5px;
  line-height: 1.55;
  cursor: pointer;
}
.check-row input {
  appearance: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface);
  cursor: pointer;
  flex: none;
  position: relative;
}
.check-row input:checked { background: var(--accent); border-color: var(--accent); }
.check-row input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}
.check-row.done span { color: var(--text-3); text-decoration: line-through; }
.check-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--text-3);
  font-size: 11px;
}
.check-progress .bar {
  flex: 1;
  height: 3px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.check-progress .bar i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--accent);
  border-radius: inherit;
  transition: width .2s;
}

/* 简易图表 */
.chart { display: flex; align-items: flex-end; gap: 12px; height: 118px; padding: 6px 2px 0; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 0; }
.chart-bar {
  width: 100%;
  max-width: 38px;
  border-radius: 6px 6px 2px 2px;
  background: var(--navy);
  opacity: .85;
}
.chart-label { color: var(--text-3); font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.chart-value { color: var(--text-2); font-size: 10.5px; font-variant-numeric: tabular-nums; }

/* 插件来源脚注 */
.plugin-foot {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 2px 2px 0;
  color: var(--text-3);
  font-size: 11px;
}
.plugin-dot {
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: var(--accent);
}
.plugin-foot .link-btn { font-size: 11px; }
.disclaimer {
  grid-column: 1 / -1;
  border: 1px solid var(--accent-line);
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  padding: 9px 13px;
  font-size: 11.5px;
  line-height: 1.55;
}
.empty {
  padding: 14px 4px;
  color: var(--text-3);
  font-size: 12px;
}
.error-text { color: var(--warn); font-size: 13px; }

/* 骨架 */
.skeleton-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 15px 17px;
  min-height: 118px;
}
.skeleton-card.wide { grid-column: 1 / -1; }
.skeleton-line {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f0f1f4 25%, #e8e9ee 50%, #f0f1f4 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
  margin-top: 10px;
}
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-head { display: flex; align-items: center; gap: 8px; }
.skeleton-chip { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); }
.skeleton-title { width: 42%; height: 11px; border-radius: 4px; background: var(--surface-2); }

/* ---------- 完整回答 ---------- */
.answer-card {
  margin-top: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 22px 14px;
  box-shadow: var(--shadow-sm);
}
.answer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 9px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.answer-title { font-size: 13px; font-weight: 700; }
.ai-tag {
  color: var(--text-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 10px;
}
.answer-status { margin-left: auto; color: var(--text-3); font-size: 11px; }
.answer-body { font-size: 15px; line-height: 1.72; color: var(--text); }
.answer-body p { margin: 8px 0; }
.answer-body h3 {
  margin: 16px 0 6px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.1px;
}
.answer-body ul { margin: 7px 0 9px 3px; list-style: none; }
.answer-body li { position: relative; padding-left: 15px; margin: 3px 0; }
.answer-body li::before {
  content: "";
  position: absolute;
  left: 1px;
  top: .68em;
  width: 4px;
  height: 4px;
  border-radius: 2px;
  background: var(--accent);
}
.answer-body blockquote {
  margin: 10px 0;
  padding: 8px 12px;
  border-left: 2px solid var(--accent-line);
  background: var(--bg-soft);
  border-radius: 0 8px 8px 0;
  color: var(--text-2);
  font-size: 13.5px;
}
.answer-body code {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 1px 5px;
  font-size: 12.5px;
}
.answer-body .md-table { margin: 10px 0; }
.answer-body .md-table td, .answer-body .md-table th { font-size: 12.5px; }
.cite {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 16px;
  padding: 0 4px;
  margin: 0 1px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  vertical-align: 1px;
}
.cite:hover { background: var(--accent); color: #fff; }
.cursor {
  display: inline-block;
  width: 6px;
  height: 15px;
  margin-left: 2px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -2px;
  animation: blink 1s infinite;
}
.answer-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
.foot-note { color: var(--text-3); font-size: 10.5px; }

/* 追问 */
.followup {
  position: static;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 11px;
  max-width: 820px;
  margin: 20px auto 0;
  padding: 11px 11px 11px 18px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  box-shadow: var(--shadow-lift);
  color: var(--text-3);
  transition: border-color .15s, box-shadow .15s;
}
.followup:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(47, 111, 237, .10), var(--shadow-lift);
}
.followup input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
  font-size: 15.5px;
}

/* ---------- 证据栏 ---------- */
.evidence {
  position: sticky;
  top: 84px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: var(--shadow-sm);
}
.evidence-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding-bottom: 9px;
  border-bottom: 1px solid var(--line);
}
.evidence-title { font-size: 13px; font-weight: 700; }
.count {
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 600;
}
.evidence-sub { margin-left: auto; color: var(--text-3); font-size: 10.5px; }
.trust { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0 4px; }
.trust-chip {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--text-2);
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10.5px;
}
.trust-chip.official { color: var(--ok); border-color: #ccebdd; background: var(--ok-soft); }
.sources { display: flex; flex-direction: column; gap: 8px; padding-top: 8px; }
.src-card {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 12px;
  padding: 10px 11px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.src-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-sm); background: var(--bg-soft); }
.src-card.active { border-color: var(--accent); background: var(--accent-soft); }
.src-top { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.fav {
  width: 19px;
  height: 19px;
  border-radius: 5px;
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex: none;
}
.src-site { color: var(--text-3); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.src-date { margin-left: auto; color: var(--text-3); font-size: 10px; flex: none; }
.src-title { color: var(--text); font-size: 12.5px; font-weight: 600; line-height: 1.45; }
.src-snip {
  margin-top: 2px;
  color: var(--text-2);
  font-size: 11.5px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.src-url {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  color: var(--text-3);
  font-size: 10px;
  word-break: break-all;
}
.copy-btn {
  margin-left: auto;
  border: 0;
  background: none;
  color: var(--text-3);
  font-size: 10px;
  cursor: pointer;
  opacity: 0;
  flex: none;
}
.src-card:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--accent); }
.evidence-actions { padding-top: 10px; }
.more-sources {
  width: 100%;
  margin-top: 2px;
  border: 1px dashed var(--line-strong);
  background: transparent;
  color: var(--text-3);
  border-radius: 9px;
  padding: 7px;
  font-size: 11.5px;
  cursor: pointer;
}
.more-sources:hover { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }

/* ---------- 场景插件菜单 ---------- */
.mode-menu {
  position: fixed;
  z-index: 70;
  width: 340px;
  padding: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lift);
  animation: popIn .16s cubic-bezier(.16, 1, .3, 1) both;
}
.mode-menu-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 5px 7px 7px;
  font-size: 12px;
  font-weight: 700;
}
.mode-menu-hint { color: var(--text-3); font-size: 10.5px; font-weight: 400; }
.mode-options { display: flex; flex-direction: column; gap: 2px; }
.mode-option {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  width: 100%;
  padding: 9px 8px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.mode-option:hover { background: var(--bg-soft); }
.mode-option.active { background: var(--accent-soft); }
.mode-option-icon {
  width: 28px;
  height: 28px;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
}
.mode-option.active .mode-option-icon { background: var(--surface); color: var(--accent); }
.mode-option-icon svg { width: 15px; height: 15px; }
.mode-option-text { min-width: 0; }
.mode-option-label { display: flex; align-items: center; gap: 6px; color: var(--text); font-size: 12.5px; font-weight: 600; }
.mode-option-desc { color: var(--text-3); font-size: 10.5px; line-height: 1.45; margin-top: 1px; }
.mode-check { margin-left: auto; color: var(--accent); flex: none; }
.mode-check svg { width: 15px; height: 15px; }
.mode-menu-foot {
  margin-top: 7px;
  padding: 8px 7px 5px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.5;
}
.mode-menu.sheet {
  left: 10px !important;
  right: 10px;
  bottom: 10px;
  top: auto !important;
  width: auto;
}

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--text);
  color: #fff;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 12.5px;
  box-shadow: var(--shadow-lift);
  animation: fadeUp .2s ease both;
}

/* ---------- 动效 ---------- */
@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  from { opacity: 0; transform: translateY(4px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1120px) {
  .workspace { grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; }
}
@media (max-width: 960px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .evidence { position: static; }
  .evidence .sources { max-height: none; }
}
@media (max-width: 720px) {
  .topbar { height: auto; min-height: 58px; }
  .topbar-inner { flex-wrap: wrap; gap: 8px; padding: 8px 14px; min-height: 0; height: auto; }
  .brand { font-size: 20px; }
  .top-search { order: 3; flex-basis: 100%; max-width: none; height: 44px; }
  .top-actions { gap: 6px; }
  .mode-chip { max-width: 42vw; overflow: hidden; }
  .mode-chip span { overflow: hidden; text-overflow: ellipsis; }
  .home-inner { padding: 32px 16px 24px; }
  .home-title { font-size: 34px; letter-spacing: -1px; }
  .home-sub { font-size: 14.5px; }
  .composer { min-height: 56px; padding-left: 13px; }
  .composer input { font-size: 15px; }
  .composer .btn { padding: 0 16px; }
  .examples { gap: 6px; }
  .example { font-size: 11.5px; padding: 6px 10px; }
  .workspace { padding: 20px 14px 84px; }
  .question { font-size: 24px; letter-spacing: -.4px; }
  .meta-row { gap: 7px; }
  .meta-text { flex-basis: 100%; order: 3; }
  .why-btn { order: 4; }
  .modules { grid-template-columns: minmax(0, 1fr); }
  .module-card.wide { grid-column: auto; }
  .conclusion p { font-size: 15.5px; }
  .answer-card { padding: 15px 16px 12px; }
  .answer-body { font-size: 14.5px; }
  .followup { border-radius: 12px; }
  .calc-inputs { grid-template-columns: minmax(0, 1fr); }
  .toast { bottom: 14px; width: max-content; max-width: calc(100vw - 28px); }
}

/* ---------- 打印 ---------- */
@media print {
  body { background: #fff; }
  .topbar, .home, .status, .evidence, .followup, .mode-menu, .toast,
  .answer-foot, .canvas-head .meta-row, .plugin-foot { display: none !important; }
  .workspace { display: block; max-width: none; padding: 0; }
  .canvas { max-width: none; }
  .question { font-size: 22px; }
  .conclusion, .module-card, .answer-card { box-shadow: none; break-inside: avoid; }
  .module-card { border-color: #ddd; }
}
