/* ==========================================================================
   战略管理分析 · Strategic Desk
   依据 Web Tools 统一视觉与交互规范（STYLE_GUIDE.md v1.0）实现
   柔光植物工作台：暖纸白 + 鼠尾草绿 + 位图植物画框
   ========================================================================== */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #eeede7;

  --ink: #24231f;
  --ink-2: #56544c;
  --muted: #6b685d;

  --line: #e7e5dc;
  --line-strong: #d9d6ca;

  --accent: #5f7c61;
  --accent-deep: #42584a;
  --accent-soft: #e6ece1;

  --success: #4f9d6b;
  --warning: #a47735;
  --danger: #b0594b;

  --radius-panel: 18px;
  --radius-control: 10px;
  --radius-small: 7px;

  --shadow-sm:
    0 1px 2px rgba(36, 35, 31, 0.05),
    0 4px 12px rgba(36, 35, 31, 0.05);
  --shadow-md:
    0 2px 6px rgba(36, 35, 31, 0.05),
    0 16px 40px rgba(36, 35, 31, 0.10);

  --font-display: 'Space Grotesk', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, 'Courier New', monospace;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 固定植物背景（规范 4.1） */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url('/assets/botanical-frame-desktop-v1.png');
  background-repeat: no-repeat;
  background-position: center -64px;
  background-size: 100% auto;
  opacity: 0.38;
}

.shell { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; }

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; background: none; border: none; padding: 0; }

a { color: inherit; }

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

/* --------------------------------------------------------------------------
   顶部品牌横条（规范 4.2）
   -------------------------------------------------------------------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(20px, 5vw, 72px);
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; }

.brand__mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-control);
  box-shadow: var(--shadow-sm);
  flex: none;
}

.brand__mark svg { width: 36px; height: 36px; display: block; }

.brand__word { display: flex; flex-direction: column; line-height: 1.15; }

/* 标题颜色锁定（规范 3.2） */
.brand__word strong,
.hero__title,
.hero__title * {
  color: #42584a;
}

.brand__word strong {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand__word small {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.topbar__meta { display: flex; align-items: center; gap: 18px; }

.back {
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: color 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.back:hover { color: var(--accent-deep); border-color: var(--accent); background: var(--accent-soft); }

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
}

/* --------------------------------------------------------------------------
   内容容器与标题区（规范 4.3 / 4.4）
   -------------------------------------------------------------------------- */
.main {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
  padding-top: 40px;
  padding-bottom: 72px;
}

.hero { margin-bottom: 36px; }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.eyebrow__rule {
  width: 28px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.hero__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(25px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.hero__lead {
  margin: 12px 0 0;
  max-width: 640px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-2);
}

/* --------------------------------------------------------------------------
   Tabs 视图导航（规范 5.6 分段控件）
   -------------------------------------------------------------------------- */
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
  width: fit-content;
  max-width: 100%;
}

.tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-control);
  color: var(--ink-2);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.tab:hover { color: var(--accent-deep); background: var(--accent-soft); }

.tab.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.tab__icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.tab__label { font-size: 13.5px; font-weight: 500; }

.tab__code {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  opacity: 0.72;
}

/* --------------------------------------------------------------------------
   区块标题
   -------------------------------------------------------------------------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.section-kicker {
  margin: 0 0 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  color: var(--accent);
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--accent-deep);
}

.section-head p:not(.section-kicker) {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
  max-width: 620px;
}

.section-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.period-chip {
  padding: 7px 14px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-deep);
}

/* --------------------------------------------------------------------------
   面板（规范 5.5）
   -------------------------------------------------------------------------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.panel__head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-deep);
}

.panel__code {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.panel__body { padding: 18px 20px; }

/* --------------------------------------------------------------------------
   表单（规范 5.4）
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px 16px;
}

.field { display: flex; flex-direction: column; gap: 6px; }

.field > span { font-size: 12px; font-weight: 500; color: var(--ink-2); }

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  font-size: 13.5px;
  color: var(--ink);
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(95, 124, 97, 0.18);
}

.field input::placeholder, .field textarea::placeholder { color: var(--muted); opacity: 0.7; }

.field textarea { resize: vertical; min-height: 56px; line-height: 1.6; }

.field--area { grid-column: 1 / -1; }

.notes-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px 16px; }

/* --------------------------------------------------------------------------
   表格（规范 5.4 / 数据展示）
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-control); }

.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  padding: 10px 12px;
  background: var(--surface-2);
  text-align: left;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }

.table tbody tr:hover { background: var(--accent-soft); }

.table .num, .table th.num { text-align: right; font-family: var(--font-mono); }

.table th.chk, .table td.chk { text-align: center; }

.table td input, .table td select {
  width: 100%;
  min-width: 90px;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-small);
  font-size: 12.5px;
}

.table td input[type='checkbox'] { width: 16px; height: 16px; min-width: 16px; accent-color: var(--accent); }

.table td input:focus, .table td select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(95, 124, 97, 0.15);
}

.row-del {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-small);
  color: var(--muted);
  transition: color 0.18s ease, background 0.18s ease;
}

.row-del:hover { color: var(--danger); background: rgba(176, 89, 75, 0.1); }

.row-del svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

/* --------------------------------------------------------------------------
   工具栏与按钮（规范 5.3）
   -------------------------------------------------------------------------- */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.toolbar--page { margin-top: 22px; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--shadow-sm); }

.toolbar__spacer { flex: 1; }

.toolbar__hint { margin: 8px 0 0; font-size: 12px; color: var(--muted); width: 100%; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 16px;
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  border-radius: var(--radius-control);
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-sm);
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.12s ease;
}

.btn:hover { background: var(--accent-deep); border-color: var(--accent-deep); }

.btn:active { transform: translateY(1px); }

.btn--ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line-strong);
  box-shadow: none;
}

.btn--ghost:hover { background: var(--accent-soft); color: var(--accent-deep); border-color: var(--accent); box-shadow: var(--shadow-sm); }

.btn--danger {
  background: var(--surface);
  color: var(--danger);
  border-color: var(--danger);
  box-shadow: none;
}

.btn--danger:hover { background: var(--danger); color: #fff; }

/* --------------------------------------------------------------------------
   仪表盘 KPI 卡片
   -------------------------------------------------------------------------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.kpi-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
}

.kpi-card__label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

.kpi-card__value {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  color: var(--accent-deep);
}

.kpi-card__hint {
  margin-top: 6px;
  font-size: 12px;
  color: var(--ink-2);
}

/* 进度条 */
.progress-list { display: flex; flex-direction: column; gap: 14px; }

.progress-item { display: grid; grid-template-columns: 150px 1fr 90px; align-items: center; gap: 14px; }

.progress-item__name { font-size: 13px; font-weight: 500; color: var(--ink); }

.progress-track { height: 10px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width 0.4s ease;
}

.progress-item__value { font-family: var(--font-mono); font-size: 12px; text-align: right; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   图表容器与 SVG 通用样式
   -------------------------------------------------------------------------- */
.chart-panel { min-height: 260px; display: flex; align-items: center; justify-content: center; }

.chart-panel svg { width: 100%; max-width: 460px; height: auto; display: block; }

.chart-panel .chart-title { font-size: 12px; fill: var(--muted); }

.chart-panel .chart-label { font-size: 10.5px; fill: var(--ink-2); }

.chart-panel .chart-axis { stroke: var(--line-strong); stroke-width: 1; }

.chart-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.analysis-grid .panel { margin-bottom: 0; }

.panel--wide { grid-column: 1 / -1; }

/* --------------------------------------------------------------------------
   SWOT 四象限
   -------------------------------------------------------------------------- */
.swot-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.swot-cell {
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  overflow: hidden;
  background: var(--surface);
}

.swot-cell__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  font-weight: 600;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}

.swot-cell__head code { font-family: var(--font-mono); font-size: 10px; font-weight: 400; letter-spacing: 0.1em; }

.swot-cell--s .swot-cell__head { background: var(--accent-soft); color: var(--accent-deep); }
.swot-cell--w .swot-cell__head { background: rgba(164, 119, 53, 0.12); color: var(--warning); }
.swot-cell--o .swot-cell__head { background: rgba(79, 157, 107, 0.12); color: var(--success); }
.swot-cell--t .swot-cell__head { background: rgba(176, 89, 75, 0.1); color: var(--danger); }

.swot-cell__body { padding: 12px 14px; }

.swot-cell__body ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }

.swot-cell__body li { font-size: 12.5px; line-height: 1.6; color: var(--ink-2); }

.swot-cell__body .empty { color: var(--muted); font-size: 12px; }

/* --------------------------------------------------------------------------
   TOWS 交叉策略
   -------------------------------------------------------------------------- */
.tows-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.tows-cell {
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.tows-cell__tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.tows-cell--so .tows-cell__tag { background: var(--accent-soft); color: var(--accent-deep); }
.tows-cell--wo .tows-cell__tag { background: rgba(79, 157, 107, 0.14); color: var(--success); }
.tows-cell--st .tows-cell__tag { background: rgba(164, 119, 53, 0.14); color: var(--warning); }
.tows-cell--wt .tows-cell__tag { background: rgba(176, 89, 75, 0.12); color: var(--danger); }

.tows-cell h4 { margin: 8px 0 6px; font-size: 13.5px; color: var(--ink); }

.tows-cell p { margin: 0; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }

/* --------------------------------------------------------------------------
   VRIO 清单
   -------------------------------------------------------------------------- */
.vrio-list { display: flex; flex-direction: column; gap: 10px; }

.vrio-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.vrio-item__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }

.vrio-item__name { font-size: 13px; font-weight: 600; color: var(--ink); }

.vrio-item__desc { font-size: 12px; color: var(--ink-2); line-height: 1.5; }

.vrio-item__verdict {
  flex: none;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.vrio-verdict--sustained { background: var(--accent-soft); color: var(--accent-deep); }
.vrio-verdict--temp { background: rgba(164, 119, 53, 0.14); color: var(--warning); }
.vrio-verdict--weak { background: rgba(176, 89, 75, 0.1); color: var(--danger); }

/* --------------------------------------------------------------------------
   报告（12 章）
   -------------------------------------------------------------------------- */
.report {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-md);
  padding: 44px 48px;
  line-height: 1.8;
  color: var(--ink);
  font-size: 14px;
}

.report__cover { text-align: center; padding: 24px 0 32px; border-bottom: 2px solid var(--accent); margin-bottom: 32px; }

.report__cover h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-deep);
}

.report__cover p { margin: 8px 0 0; color: var(--ink-2); font-size: 13px; }

.report h3.chapter {
  margin: 30px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  color: var(--accent-deep);
  counter-increment: chapter;
}

.report h3.chapter::before {
  content: counter(chapter, decimal-leading-zero) '. ';
  font-family: var(--font-mono);
  color: var(--accent);
}

.report h4 { margin: 16px 0 6px; font-size: 13.5px; color: var(--ink); }

.report p { margin: 0 0 10px; }

.report ul, .report ol { margin: 0 0 12px; padding-left: 22px; }

.report li { margin-bottom: 4px; }

.report table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0 16px;
  font-size: 12.5px;
}

.report th, .report td { border: 1px solid var(--line-strong); padding: 8px 10px; text-align: left; vertical-align: top; }

.report th { background: var(--surface-2); font-weight: 600; }

.report .muted { color: var(--muted); }

.report .kpi-strip {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 12px 0 16px;
}

.report .kpi-strip div {
  flex: 1;
  min-width: 130px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}

.report .kpi-strip strong { display: block; font-family: var(--font-display); font-size: 18px; color: var(--accent-deep); }

.report .kpi-strip span { font-size: 11.5px; color: var(--muted); }

/* --------------------------------------------------------------------------
   打印样式（报告导出 PDF）
   -------------------------------------------------------------------------- */
@media print {
  body::after { display: none; }
  .topbar, .tabs, .section-head, .toolbar { display: none !important; }
  .main { width: 100%; padding: 0; }
  .hero { display: none; }
  #view-report { display: block !important; }
  .report {
    border: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0;
    font-size: 12px;
  }
  .report h3.chapter { break-after: avoid; }
  .report table { break-inside: auto; }
  .report .kpi-strip div { break-inside: avoid; }
}

/* --------------------------------------------------------------------------
   响应式（规范 7）
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .analysis-grid { grid-template-columns: 1fr; }
  .report { padding: 28px 22px; }
  .progress-item { grid-template-columns: 110px 1fr 70px; }
}

@media (max-width: 720px) {
  .main { width: min(100% - 32px, 1120px); padding-top: 28px; }
  .topbar { padding: 12px 16px; }
  .topbar__meta .status { display: none; }
  .tabs { width: 100%; }
  .tab { flex: 1; justify-content: center; padding: 10px 8px; }
  .tab__code { display: none; }
  .swot-grid { grid-template-columns: 1fr; }
  .progress-item { grid-template-columns: 1fr; gap: 6px; }
  .progress-item__value { text-align: left; }
  .form-grid { grid-template-columns: 1fr; }
  .section-actions { width: 100%; }
  .section-actions .btn { flex: 1; }
}

@media (max-width: 560px) {
  body::after {
    background-image: url('/assets/botanical-frame-mobile-v2.png');
    background-position: center -38px;
    opacity: 0.28;
  }
}

/* --------------------------------------------------------------------------
   动效与无障碍（规范 6）
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
/* --------------------------------------------------------------------------
   轻提示 Toast
   -------------------------------------------------------------------------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  z-index: 80;
  max-width: min(420px, calc(100% - 40px));
  padding: 11px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
#toast.is-visible { opacity: 1; transform: translate(-50%, 0); }
/* --------------------------------------------------------------------------
   报告模板选项（分段控件 + 提示条）
   -------------------------------------------------------------------------- */
.template-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-sm);
}
.template-bar__hint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.seg {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
}
.seg__btn {
  padding: 8px 14px;
  border-radius: var(--radius-small);
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-2);
  transition: background 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.seg__btn:hover { color: var(--accent-deep); }
.seg__btn.is-active {
  background: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}
@media (max-width: 720px) {
  .template-bar { flex-direction: column; align-items: stretch; }
  .seg { width: 100%; }
  .seg__btn { flex: 1; }
}
