/* ═══════════════════════════════════════════
   卒中康复聚合报告 — 共享样式
   ═══════════════════════════════════════════ */
.icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
:root {
  --page-bg: #fafbfc;
  --paper-bg: #ffffff;
  --text-body: #2c3e50;
  --text-heading: #1e3a5f;
  --text-secondary: #5a6c7d;
  --text-muted: #8a9aa8;
  --border-light: #dfe9f3;
  --border-table: #c8d8e8;
  --accent: #2d5a8a;
  --accent-light: #e8f1f8;
  --accent-dark: #1e3a5f;
  --green: #2d7a6a;
  --green-bg: #e6f4f1;
  --amber: #8a6e2e;
  --amber-bg: #faf3e0;
  --red: #a63d3d;
  --red-bg: #fbe8e8;
  --gray-bg: #f5f7f9;
  --insight-bg: #eaf1f7;
  --insight-border: #8ab4e0;
  --evidence-bg: #f9f9f7;
  --nav-w: 260px;
  --tab-h: 48px;
  --font-serif: 'Source Serif 4', 'Noto Serif SC', 'Georgia', serif;
  --font-sans: 'Noto Sans SC', -apple-system, 'Segoe UI', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ── TOP NAVBAR ── */
.top-navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  z-index: 1000;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-family: 'Inter', -apple-system, 'Segoe UI', sans-serif;
}
.top-navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-heading);
  font-weight: 700;
  font-size: 18px;
}
.top-navbar-brand:hover { color: var(--accent); }
.top-navbar-logo {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--accent), var(--green));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  font-weight: 700;
}
.top-navbar-links {
  margin-left: auto;
  display: flex;
  gap: 24px;
  list-style: none;
}
.top-navbar-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.top-navbar-links a:hover { color: var(--accent); }
.top-navbar-links a.active { color: var(--accent); font-weight: 600; }

/* Adjust body to account for top navbar */
body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text-body);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  height: calc(100vh - 56px);
  overflow: hidden;
  margin-top: 56px;
}

body {
  font-family: var(--font-sans);
  background: var(--page-bg);
  color: var(--text-body);
  line-height: 1.8;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── SIDEBAR ── */
.sidebar {
  width: var(--nav-w);
  min-width: var(--nav-w);
  height: 100vh;
  background: var(--paper-bg);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  flex-shrink: 0;
  transition: transform 0.3s ease;
  z-index: 100;
}
.sidebar-brand {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-heading);
  text-decoration: none;
}
.sidebar-brand:hover { color: var(--accent); }
.sidebar-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
}
.sidebar-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.sidebar-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border-table); border-radius: 2px; }

.sidebar-section { margin-bottom: 4px; }
.sidebar-section-title {
  display: block;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.sidebar-section-title:hover { color: var(--text-heading); background: var(--gray-bg); }
.sidebar-section-title.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  font-weight: 700;
}
.sidebar-badge {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 4px;
}
.sidebar-group-list {
  list-style: none;
  padding: 0;
}
.sidebar-item a {
  display: block;
  padding: 4px 20px 4px 32px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.15s, background 0.15s;
}
.sidebar-item a:hover { color: var(--accent); background: var(--accent-light); }
.sidebar-count {
  font-size: 11px;
  color: var(--text-muted);
  float: right;
  margin-right: 4px;
}

/* ── MAIN ── */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── TAB BAR ── */
.tab-bar {
  display: flex;
  background: var(--paper-bg);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab-btn {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  padding: 0 24px;
  height: var(--tab-h);
  line-height: var(--tab-h);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  position: relative;
  transition: color 0.15s;
}
.tab-btn:hover { color: var(--text-heading); }
.tab-btn.active { color: var(--accent); font-weight: 600; }
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0; left: 12px; right: 12px;
  height: 3px;
  background: var(--accent);
  border-radius: 3px 3px 0 0;
}

/* ── CONTENT ── */
.content {
  flex: 1;
  overflow-y: auto;
  scroll-behavior: smooth;
}
.content::-webkit-scrollbar { width: 8px; }
.content::-webkit-scrollbar-thumb { background: var(--border-table); border-radius: 4px; }
.content-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 48px 80px;
}

/* ── OVERVIEW ── */
.overview-hero { text-align: center; padding: 48px 0 32px; }
.overview-title {
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  color: var(--text-heading);
  line-height: 1.4;
  margin-bottom: 12px;
}
.overview-subtitle {
  font-size: 16px;
  color: var(--text-secondary);
  font-weight: 400;
  margin-bottom: 16px;
}
.overview-meta { font-size: 13px; color: var(--text-muted); line-height: 2; }
.overview-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px;
  margin: 28px 0;
}
.stat-card {
  background: var(--paper-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 20px 14px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.05);
  transition: all 0.2s;
}
.stat-card:hover {
  box-shadow: 0 4px 14px rgba(30, 58, 95, 0.09);
  transform: translateY(-2px);
}
.stat-card .stat-num {
  font-family: var(--font-serif);
  font-size: 34px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1.2;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

.framework-note {
  background: var(--accent-light);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: 0 8px 8px 0;
  margin: 28px 0;
}
.framework-note h3 { font-family: var(--font-serif); font-size: 15px; color: var(--accent-dark); margin-bottom: 6px; }
.framework-note p { font-size: 14px; line-height: 1.8; color: var(--text-body); margin-bottom: 4px; }
.com-b-tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.com-b-tag-inline { font-size: 12px; padding: 3px 10px; border-radius: 3px; font-weight: 500; }
.tag-capability { background: #e8f1f8; color: #2d5a8a; }
.tag-motivation { background: #ede8f4; color: #5a4a7c; }
.tag-opportunity { background: #e6f4f1; color: #2d7a6a; }
.tag-cross { background: #f5efe0; color: #8a6e2e; }

.dim-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin: 28px 0; }
.dim-card {
  background: var(--paper-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.05);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.dim-card:hover { box-shadow: 0 4px 14px rgba(30, 58, 95, 0.09); border-color: var(--accent); }
.dim-card-icon { font-size: 28px; flex-shrink: 0; }
.dim-card-body h3 { font-family: var(--font-serif); font-size: 16px; font-weight: 600; color: var(--text-heading); margin-bottom: 3px; }
.dim-card-badge {
  font-size: 11px; padding: 1px 8px; border-radius: 3px;
  display: inline-block; margin-bottom: 4px;
}
.dim-card-body p { font-size: 13px; color: var(--text-muted); line-height: 1.5; }

/* ── DIM HEADER ── */
.dim-header {
  background: var(--paper-bg);
  border-left: 5px solid var(--accent);
  border-radius: 0 10px 10px 0;
  padding: 22px 26px;
  margin-bottom: 36px;
  box-shadow: 0 1px 3px rgba(30, 58, 95, 0.05);
}
.dim-heading { font-family: var(--font-serif); font-size: 24px; font-weight: 700; color: var(--text-heading); margin-bottom: 4px; }
.dim-subtitle { font-size: 14px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 10px; }
.dim-stats { display: flex; gap: 8px; flex-wrap: wrap; }
.dim-stat { font-size: 12px; padding: 3px 10px; border-radius: 12px; font-weight: 500; }

/* ── CHAPTER ── */
.chapter { margin-bottom: 44px; padding-bottom: 32px; border-bottom: 1px solid var(--border-light); }
.chapter:last-child { border-bottom: none; }
.chapter h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--text-heading);
  margin-bottom: 6px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}
.com-b-tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 3px;
  font-weight: 600; margin-left: 8px; vertical-align: middle;
}
.chapter-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 18px; margin-top: 4px; }

/* ── DETAILS / SUMMARY ── */
details {
  margin: 16px 0;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s;
}
details[open] { box-shadow: 0 2px 8px rgba(30, 58, 95, 0.07); }
details + details { margin-top: -1px; }
summary {
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-heading);
  padding: 12px 18px;
  background: var(--gray-bg);
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.15s;
}
summary:hover { background: #eef2f5; }
summary::before {
  content: '▸';
  font-size: 13px;
  color: var(--accent);
  transition: transform 0.2s;
  display: inline-block;
  width: 16px;
}
details[open] > summary::before { transform: rotate(90deg); }
details > *:not(summary) { padding: 0 18px 14px; }

/* ── INSIGHT BOX ── */
.insight-box {
  background: var(--insight-bg);
  border: 1px solid var(--insight-border);
  border-radius: 10px;
  padding: 16px 20px;
  margin: 12px 18px 18px;
}
.insight-marker { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); margin-bottom: 4px; }
.insight-box p { font-size: 14px; line-height: 1.8; color: var(--text-body); }
.summary-box p { margin-bottom: 4px; }

/* ── DATA TABLE ── */
.data-table { width: 100%; border-collapse: collapse; margin: 6px 0 4px; font-size: 13px; }
.data-table thead th {
  background: var(--gray-bg); padding: 8px 12px; font-weight: 600; font-size: 12px;
  text-align: left; color: var(--text-secondary); border-top: 2px solid var(--text-heading);
  border-bottom: 1px solid var(--border-table);
}
.data-table tbody td { padding: 8px 12px; border-bottom: 1px solid var(--border-light); vertical-align: top; line-height: 1.55; }
.data-table tbody tr:hover { background: #eef2f5; }
.row-num { color: var(--text-muted); text-align: center; font-size: 12px; }
.center { text-align: center; }
.sol-name { font-weight: 500; }
.pro-text { color: var(--green); font-size: 12px; }
.con-text { color: var(--amber); font-size: 12px; }
.pain-desc { font-weight: 500; }
.pain-freq { white-space: nowrap; font-size: 12px; color: var(--text-secondary); }
.pain-quote { font-size: 12px; color: var(--text-secondary); }

.tag { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 3px; font-weight: 500; white-space: nowrap; }
.tag-positive { background: var(--green-bg); color: var(--green); }
.tag-neutral { background: var(--amber-bg); color: var(--amber); }
.tag-negative { background: var(--red-bg); color: var(--red); }
.tag-muted { background: var(--gray-bg); color: var(--text-muted); }

/* ── FINDINGS ── */
.findings-list { display: flex; flex-direction: column; gap: 14px; }
.finding-block { background: var(--paper-bg); border: 1px solid var(--border-light); border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(30, 58, 95, 0.04); }
.finding-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.finding-num { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.finding-title { font-family: var(--font-serif); font-size: 15px; font-weight: 600; color: var(--text-heading); line-height: 1.5; }
.finding-body { font-size: 14px; color: var(--text-body); line-height: 1.8; margin-bottom: 6px; }
.finding-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }

/* ── QUOTES ── */
blockquote.evidence {
  background: var(--evidence-bg); border-left: 3px solid var(--border-table);
  padding: 10px 14px; margin: 0; font-size: 12px; font-style: italic;
  color: var(--text-secondary); line-height: 1.7;
}
.quotes-section { display: flex; flex-direction: column; gap: 12px; }
.quote-block {
  padding: 14px 18px; border-left: 3px solid var(--accent);
  background: var(--gray-bg); border-radius: 0 10px 10px 0;
}
.quote-block blockquote {
  font-family: var(--font-serif); font-size: 14px; font-style: italic;
  color: var(--text-body); line-height: 1.8; margin-bottom: 8px;
  background: none; border: none; padding: 0;
}
.quote-attribution { font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.quote-context { color: var(--text-muted); }
.quote-insight { font-size: 12px; color: var(--accent-dark); margin: 0; }

.empty { color: var(--text-muted); font-style: italic; padding: 10px 0; font-size: 14px; }

/* ── FOOTER ── */
.footer {
  text-align: center; padding: 28px 0; margin-top: 32px;
  border-top: 2px solid var(--accent); font-size: 12px; color: var(--text-muted); line-height: 2;
}

/* ── BACK TOP ── */
.back-top {
  position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px;
  background: var(--accent); color: #fff; border: none; border-radius: 50%;
  font-size: 18px; cursor: pointer; box-shadow: 0 2px 8px rgba(30, 58, 95, 0.2);
  transition: opacity 0.2s, transform 0.2s; opacity: 0; transform: translateY(10px); z-index: 200;
}
.back-top.visible { opacity: 1; transform: translateY(0); }

/* ── MOBILE ── */
.mobile-toggle {
  display: none; position: fixed; top: 12px; left: 12px; z-index: 110;
  width: 36px; height: 36px; background: var(--paper-bg); border: 1px solid var(--border-light);
  border-radius: 6px; cursor: pointer; font-size: 18px; line-height: 36px; text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.3); z-index: 99; }
.sidebar-overlay.visible { display: block; }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 20px rgba(0,0,0,0.15); }
  .mobile-toggle { display: block; }
  .main { width: 100%; }
  .content-inner { padding: 24px 20px 60px; }
  .dim-cards { grid-template-columns: 1fr; }
  .overview-stats { grid-template-columns: repeat(2, 1fr); }
  .overview-title { font-size: 22px; }
  .dim-heading { font-size: 20px; }
  .chapter h2 { font-size: 18px; }
  .data-table { font-size: 12px; }
  .data-table thead th, .data-table tbody td { padding: 6px 8px; }
  .tab-btn { padding: 0 14px; font-size: 13px; }
}

@media print {
  .sidebar, .tab-bar, .back-top, .mobile-toggle { display: none !important; }
  body { display: block; height: auto; overflow: visible; }
  .main { display: block; }
  .content { overflow: visible; }
  .content-inner { max-width: 100%; padding: 0; }
  .chapter { page-break-inside: avoid; }
  .data-table { font-size: 10pt; }
}
