/* OligoHub design system: offline-first, responsive, accessible */
:root {
  --bg-main: #f4f7fa;
  --bg-card: #ffffff;
  --bg-subtle: #ebf1f6;
  --bg-elevated: rgba(255, 255, 255, 0.95);
  --text-main: #0c1821;
  --text-muted: #334553;
  --text-light: #526677;
  --primary: #0d6b63;
  --primary-strong: #08524c;
  --primary-soft: #e2f2ef;
  --secondary: #1e4b94;
  --secondary-soft: #e4edf8;
  --purple: #5c3eb3;
  --purple-soft: #ede8f9;
  --warning: #995200;
  --warning-soft: #fff0d4;
  --danger: #a81c28;
  --danger-soft: #fce8ea;
  --success: #0f6e40;
  --success-soft: #e2f4ea;
  --border: #ccd8e2;
  --border-strong: #b2c3d1;
  --shadow-sm: 0 1px 3px rgba(15, 35, 50, 0.08);
  --shadow-md: 0 8px 24px rgba(15, 35, 50, 0.09);
  --shadow-lg: 0 24px 60px rgba(15, 35, 50, 0.14);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 8px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", Arial, sans-serif;
  --font-code: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --max-width: 1540px;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg-main: #09131b;
  --bg-card: #101f2a;
  --bg-subtle: #172a37;
  --bg-elevated: rgba(16, 31, 42, 0.9);
  --text-main: #edf5f8;
  --text-muted: #a8bac6;
  --text-light: #8398a5;
  --primary: #51c4b7;
  --primary-strong: #78d9ce;
  --primary-soft: rgba(49, 166, 153, 0.18);
  --secondary: #8bb6f3;
  --secondary-soft: rgba(65, 111, 185, 0.2);
  --purple: #b29af0;
  --purple-soft: rgba(115, 82, 188, 0.2);
  --warning: #efb45f;
  --warning-soft: rgba(192, 116, 15, 0.18);
  --danger: #fa8d98;
  --danger-soft: rgba(180, 35, 47, 0.2);
  --success: #6ed39a;
  --success-soft: rgba(19, 122, 72, 0.2);
  --border: #29404d;
  --border-strong: #3b5665;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.22);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.22);
  --shadow-lg: 0 28px 70px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
a { color: var(--secondary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--primary); }
img, svg { max-width: 100%; }
code, kbd, pre { font-family: var(--font-code); }

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.skip-link {
  position: fixed;
  z-index: 9999;
  top: 8px;
  left: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  background: var(--text-main);
  color: var(--bg-card);
  transform: translateY(-140%);
  transition: transform 0.15s ease;
}
.skip-link:focus { transform: translateY(0); }
.reset-button, .link-button, .nav-link, .cat-nav-item { border: 0; background: transparent; }
.link-button { padding: 0; color: var(--secondary); cursor: pointer; }
.link-button:hover { color: var(--primary); }

.app-container { min-height: 100vh; display: flex; flex-direction: column; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-width);
  min-height: 76px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand-logo { display: inline-flex; align-items: center; gap: 11px; cursor: pointer; flex: 0 0 auto; padding: 0; text-align: left; }
.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #fff;
  font-weight: 850;
  font-size: 23px;
  background: linear-gradient(140deg, #0f766e, #2859a5);
  box-shadow: 0 8px 20px rgba(15, 118, 110, 0.23);
}
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 20px; letter-spacing: 0; }
.brand-text small { margin-top: 4px; color: var(--text-muted); font-size: 11px; font-weight: 600; }

.header-search { flex: 1 1 360px; min-width: 190px; max-width: 450px; }
.search-input-wrap { position: relative; }
.search-input-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 42px;
  border: 1px solid var(--border);
  border-radius: 999px;
  outline: none;
  background: var(--bg-main);
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.search-input-wrap input:focus { border-color: var(--primary); background: var(--bg-card); box-shadow: 0 0 0 4px var(--primary-soft); }
.search-icon { position: absolute; left: 16px; top: 50%; transform: translateY(-52%); color: var(--text-muted); font-size: 19px; }
.search-shortcut { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 7px; color: var(--text-light); background: var(--bg-card); font-size: 11px; }

.main-nav { display: flex; align-items: center; gap: 2px; flex: 0 1 auto; }
.nav-link {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.nav-link:hover, .nav-link.active { color: var(--primary); background: var(--primary-soft); }
.header-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.icon-btn:hover { border-color: var(--primary); background: var(--primary-soft); }
.icon-btn:active { transform: scale(0.96); }
.mobile-nav-toggle { display: none; }

.btn {
  min-height: 40px;
  padding: 9px 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 750;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background 0.15s, border-color 0.15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-strong); box-shadow: 0 7px 18px rgba(15, 118, 110, 0.2); }
.btn-outline { border-color: var(--border); background: var(--bg-card); color: var(--text-main); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.btn-small { min-height: 34px; padding: 6px 13px; font-size: 12px; }

.main-viewport { width: 100%; max-width: var(--max-width); margin: 0 auto; padding: 30px 24px 48px; flex: 1; }
.two-column-layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 28px; align-items: start; }
.left-sidebar { position: sticky; top: 105px; }
.center-content { min-width: 0; outline: none; }
.card {
  margin-bottom: 22px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-md);
}
.sidebar-card { padding: 15px; margin-bottom: 15px; box-shadow: var(--shadow-sm); }
.card-title { margin: 0 0 12px; display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 800; }
.cat-nav-item {
  width: 100%;
  min-height: 42px;
  padding: 8px 11px;
  margin: 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.cat-nav-item:hover, .cat-nav-item.active { background: var(--primary-soft); color: var(--primary); font-weight: 750; }
.count { padding: 2px 8px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); font-size: 10px; font-weight: 800; }
.source-status-card { border-left: 3px solid var(--primary); }
.mini-status-list { margin: 0; }
.mini-status-list > div { display: grid; gap: 2px; padding: 8px 3px; border-top: 1px solid var(--border); }
.mini-status-list > div:first-child { border-top: 0; }
.mini-status-list dt { color: var(--text-light); font-size: 11px; font-weight: 750; }
.mini-status-list dd { margin: 0; color: var(--text-muted); font-size: 12px; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin: 31px 0 14px; }
.home-directory-heading { margin-top: 0; }
.section-heading h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.section-heading p { margin: 4px 0 0; color: var(--text-muted); font-size: 13px; }
.section-heading .section-meta { color: var(--text-light); font-size: 12px; }
.pillar-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.pillar-card {
  min-height: 184px;
  padding: 21px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.17s, box-shadow 0.17s, border-color 0.17s;
}
.pillar-card:hover { transform: translateY(-3px); border-color: var(--primary); box-shadow: var(--shadow-md); }
.pillar-card .icon-box { width: 45px; height: 45px; display: grid; place-items: center; border-radius: var(--radius-md); background: var(--primary-soft); font-size: 22px; }
.pillar-card h3 { margin: 13px 0 6px; font-size: 16px; }
.pillar-card .chapter-label { display: block; margin-bottom: 4px; color: var(--primary); font-size: 12px; font-weight: 850; }
.pillar-card p { margin: 0; color: var(--text-muted); font-size: 13px; line-height: 1.55; }
.pillar-card .card-link { display: inline-block; margin-top: 10px; color: var(--primary); font-size: 12px; font-weight: 800; }

.notice-grid, .metric-grid, .tool-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.notice-card { padding: 18px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); }
.notice-card strong { display: block; margin-bottom: 5px; }
.notice-card p { margin: 0; color: var(--text-muted); font-size: 13px; }
.notice-card.warning { background: var(--warning-soft); border-color: color-mix(in srgb, var(--warning) 28%, var(--border)); }
.notice-card.success { background: var(--success-soft); border-color: color-mix(in srgb, var(--success) 28%, var(--border)); }
.notice-card.info { background: var(--secondary-soft); border-color: color-mix(in srgb, var(--secondary) 28%, var(--border)); }

.view-header { margin-bottom: 19px; }
.view-header-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.view-header h1 { margin: 0; font-size: 29px; line-height: 1.25; letter-spacing: 0; }
.view-header p { max-width: 860px; margin: 8px 0 0; color: var(--text-muted); }
.view-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.filter-bar { display: grid; grid-template-columns: minmax(200px, 1fr) repeat(2, minmax(150px, 220px)); gap: 10px; margin-bottom: 16px; }
.filter-bar .form-control { margin: 0; }
.filter-bar .tag-row { display: flex; grid-column: 1 / -1; flex-wrap: wrap; gap: 6px; }
.tag-chip {
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-card);
  color: var(--text-muted);
  font: inherit;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }

.article-list { display: grid; gap: 13px; }
.article-card { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.article-card:hover { border-color: var(--primary); }
.article-card-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.article-card h2 { margin: 8px 0 7px; font-size: 18px; line-height: 1.35; }
.article-card h2 button { padding: 0; border: 0; background: none; color: var(--text-main); font-weight: 800; text-align: left; cursor: pointer; }
.article-card h2 button:hover { color: var(--primary); }
.article-card p { margin: 0; color: var(--text-muted); font-size: 13px; }
.article-card-footer { display: flex; justify-content: space-between; gap: 14px; align-items: center; margin-top: 13px; color: var(--text-light); font-size: 11px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); font-size: 10px; font-weight: 700; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 9px; border-radius: 999px; background: var(--bg-subtle); color: var(--text-muted); font-size: 11px; font-weight: 800; white-space: nowrap; }
.badge-primary { background: var(--primary-soft); color: var(--primary); }
.badge-secondary { background: var(--secondary-soft); color: var(--secondary); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-purple { background: var(--purple-soft); color: var(--purple); }

.article-view-content { padding: 35px clamp(22px, 5vw, 58px); }
.article-header { padding-bottom: 23px; border-bottom: 1px solid var(--border); }
.article-header h1 { max-width: 960px; margin: 11px 0 14px; font-size: 36px; line-height: 1.28; letter-spacing: 0; }
.article-lead { max-width: 940px; margin: 0; color: var(--text-muted); font-size: 16px; }
.article-meta { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 18px; color: var(--text-light); font-size: 12px; }
.article-evidence-box { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 18px 0 0; }
.article-evidence-box > div { padding: 11px 13px; border-radius: var(--radius-sm); background: var(--bg-subtle); }
.article-evidence-box small { display: block; color: var(--text-light); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; }
.article-evidence-box strong { display: block; margin-top: 3px; font-size: 12px; }
.article-body { margin-top: 30px; }

.prose { color: var(--text-main); font-size: 16px; line-height: 1.82; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 34px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border); font-size: 23px; line-height: 1.35; }
.prose h3 { margin: 28px 0 9px; font-size: 19px; line-height: 1.4; }
.prose h4 { margin: 22px 0 8px; font-size: 16px; }
.prose p { margin: 10px 0 16px; }
.prose ul, .prose ol { margin: 10px 0 18px; padding-left: 24px; }
.prose li { margin: 5px 0; }
.prose strong { font-weight: 800; }
.prose code { padding: 2px 6px; border-radius: 5px; background: var(--bg-subtle); color: var(--purple); font-size: 0.88em; }
.prose pre { max-width: 100%; overflow: auto; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-subtle); font-size: 13px; line-height: 1.6; }
.prose blockquote { margin: 19px 0; padding: 13px 17px; border-left: 4px solid var(--primary); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--primary-soft); color: var(--text-muted); }
.prose .formula,
.math-inline {
  display: inline-block;
  max-width: 100%;
  overflow-x: auto;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-main);
  font-family: Georgia, "Times New Roman", "Noto Serif CJK SC", serif;
  font-size: 0.98em;
  line-height: 1.45;
  vertical-align: -0.18em;
  white-space: nowrap;
}
.math-display {
  display: block;
  max-width: 100%;
  margin: 16px 0 20px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--bg-card), var(--bg-subtle));
  overflow-x: auto;
  text-align: center;
}
.math-formula {
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  min-width: max-content;
  color: var(--text-main);
  font-family: Georgia, "Times New Roman", "Noto Serif CJK SC", serif;
  font-size: 1.08em;
  line-height: 1.7;
  white-space: nowrap;
}
.math-text,
.math-op {
  font-family: var(--font-sans);
  font-style: normal;
}
.math-op { margin: 0 0.08em; }
.math-cal {
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
  letter-spacing: 0.02em;
}
.math-arrow-label {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  margin: 0 0.18em;
  line-height: 1.05;
}
.math-arrow-label > span:first-child {
  font-size: 0.68em;
  line-height: 1;
}
.math-inline sup,
.math-inline sub,
.math-formula sup,
.math-formula sub {
  position: relative;
  font-size: 0.72em;
  line-height: 0;
}
.math-inline sup,
.math-formula sup { top: -0.45em; }
.math-inline sub,
.math-formula sub { bottom: -0.22em; }
.math-frac {
  display: inline-grid;
  grid-template-rows: auto auto;
  align-items: center;
  justify-items: center;
  min-width: 1.8em;
  margin: 0 0.15em;
  vertical-align: middle;
}
.math-frac-num,
.math-frac-den {
  display: block;
  width: 100%;
  padding: 0 0.22em;
  text-align: center;
}
.math-frac-num { border-bottom: 1px solid currentColor; }
.math-frac-den { padding-top: 0.08em; }
.math-root {
  display: inline-flex;
  align-items: stretch;
  gap: 0.05em;
}
.math-root-body {
  display: inline-block;
  padding: 0 0.2em;
  border-top: 1px solid currentColor;
}
.prose .citation-link { vertical-align: super; font-size: 10px; font-weight: 800; text-decoration: none; }
.compact-prose { font-size: 14px; line-height: 1.7; }
.table-wrap { width: 100%; overflow-x: auto; margin: 16px 0 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.prose table, .data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.prose th, .prose td, .data-table th, .data-table td { padding: 11px 13px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose th, .data-table th { background: var(--bg-subtle); font-size: 12px; font-weight: 850; }
.prose td, .data-table td { font-size: 13px; }
.prose tr:last-child td, .data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: var(--primary-soft); }

.references-section { margin-top: 38px; padding-top: 25px; border-top: 1px solid var(--border); }
.references-section h2 { margin: 0 0 8px; font-size: 20px; }
.references-intro { margin: 0 0 14px; color: var(--text-muted); font-size: 12px; }
.reference-list { margin: 0; padding-left: 23px; }
.reference-item { padding: 8px 0 10px 4px; color: var(--text-muted); font-size: 12.5px; }
.reference-item:target { border-radius: var(--radius-sm); background: var(--warning-soft); }
.reference-links { display: inline-flex; flex-wrap: wrap; gap: 5px; margin-left: 7px; }
.reference-link { display: inline-flex; padding: 2px 7px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); font-family: var(--font-code); font-size: 10px; text-decoration: none; }
.source-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.source-chip { display: inline-flex; align-items: center; gap: 3px; padding: 3px 8px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg-card); font-size: 10px; text-decoration: none; }
.source-chip.official { background: var(--secondary-soft); color: var(--secondary); }
.source-chip.peer-reviewed { background: var(--primary-soft); color: var(--primary); }
.svg-diagram-card { position: relative; margin: 25px 0; padding: 15px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-sm); overflow-x: auto; }
.svg-diagram-card[data-figure-number]::before {
  content: "图 " attr(data-figure-number);
  position: absolute;
  top: 24px;
  right: 26px;
  z-index: 2;
  padding: 4px 8px;
  border: 1px solid color-mix(in srgb, var(--primary) 35%, var(--border));
  border-radius: var(--radius-xs);
  background: color-mix(in srgb, var(--bg-card) 92%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
  pointer-events: none;
}
.svg-diagram-card svg { display: block; width: 100%; height: auto; max-width: 100%; }
.diagram-caption {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  margin-top: 11px;
  margin-bottom: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
}
.figure-caption-index {
  flex: none;
  padding: 2px 6px;
  border: 1px solid color-mix(in srgb, var(--primary) 30%, var(--border));
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
  white-space: nowrap;
}
.figure-caption-text { max-width: 72ch; }
.teaching-caption .figure-caption-text { display: grid; gap: 3px; }
.teaching-caption .figure-caption-text strong { color: var(--text-main); }
.teaching-caption .figure-caption-text small { color: var(--text-light); font-family: var(--font-code); font-size: 10px; font-weight: 600; }
.teaching-figure { border-left: 3px solid var(--primary); }

.evidence-figure-card {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
}
.evidence-image-wrap {
  position: relative;
  display: flex;
  min-height: 220px;
  max-height: 650px;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  border-bottom: 1px solid var(--border);
  background: #fff;
}
.evidence-figure-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 610px;
  object-fit: contain;
}
.evidence-figure-index {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  padding: 4px 8px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: rgba(255, 255, 255, 0.94);
  color: #1c5164;
  font-size: 11px;
  font-weight: 850;
}
.evidence-figure-caption {
  display: grid;
  gap: 7px;
  padding: 14px 16px 16px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}
.evidence-figure-caption strong { color: var(--text-main); font-weight: 750; }
.evidence-relevance { color: var(--text-muted); }
.evidence-relevance b { color: var(--text-main); }
.evidence-source-title { color: var(--text-main); font-weight: 650; }
.evidence-source-line { font-family: var(--font-code); font-size: 10.5px; }
.evidence-original-caption { border-top: 1px solid var(--border); padding-top: 7px; }
.evidence-original-caption summary { color: var(--primary); font-size: 11px; font-weight: 750; cursor: pointer; }
.evidence-original-caption p { margin: 7px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.6; }
.evidence-source-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.evidence-source-actions a,
.evidence-source-actions span,
.evidence-register-links a,
.evidence-json-link {
  display: inline-flex;
  align-items: center;
  min-height: 27px;
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--bg-subtle);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 750;
  text-decoration: none;
}
.evidence-source-actions a:hover,
.evidence-register-links a:hover,
.evidence-json-link:hover { border-color: var(--primary); color: var(--primary); }

.evidence-register {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 2px solid var(--border-strong);
}
.evidence-register-header {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  justify-content: space-between;
}
.evidence-register-header h2 { margin: 2px 0 7px; font-size: 22px; }
.evidence-register-header p { max-width: 72ch; margin: 0; color: var(--text-muted); font-size: 12px; line-height: 1.6; }
.evidence-register-summary { display: grid; min-width: 148px; gap: 3px; text-align: right; }
.evidence-register-summary strong { font-size: 22px; color: var(--text-main); }
.evidence-register-summary span { color: var(--text-muted); font-size: 10.5px; line-height: 1.5; }
.evidence-register-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin: 18px 0 14px; }
.evidence-register-grid .evidence-image-wrap { min-height: 260px; height: 320px; padding: 12px; }
.evidence-register-grid .evidence-figure-image { width: 100%; height: 100%; max-height: 100%; object-fit: contain; }
.evidence-register-list li { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 14px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.evidence-register-index {
  width: 58px;
  height: 34px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-xs);
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 850;
  cursor: pointer;
}
.evidence-register-body { min-width: 0; }
.evidence-register-body > strong { color: var(--text-main); font-size: 13px; }
.evidence-register-body > p { margin: 4px 0 9px; color: var(--text-muted); font-size: 12px; }
.evidence-register-body dl { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 9px; }
.evidence-register-body dl div { display: flex; min-width: 0; gap: 6px; font-size: 10.5px; }
.evidence-register-body dt { color: var(--text-light); font-weight: 800; }
.evidence-register-body dd { max-width: 48ch; margin: 0; overflow-wrap: anywhere; color: var(--text-muted); }
.evidence-register-links { display: flex; flex-wrap: wrap; gap: 6px; }
.evidence-json-link { margin-top: 2px; }

.database-card { padding: 0; overflow: hidden; }
.database-card .view-header { padding: 25px 25px 0; }
.database-card .filter-bar { padding: 0 25px; }
.database-table-wrap { overflow-x: auto; border-top: 1px solid var(--border); }
.data-table { min-width: 980px; margin: 0; }
.data-table td { line-height: 1.55; }
.record-title { font-weight: 850; color: var(--text-main); }
.record-subtitle { display: block; margin-top: 2px; color: var(--text-muted); font-size: 11px; }
.detail-disclosure { border-top: 1px solid var(--border); }
.detail-disclosure summary { cursor: pointer; font-weight: 750; }
.empty-state { padding: 45px 25px; text-align: center; color: var(--text-muted); }
.snapshot-note { margin: 0 25px 18px; padding: 11px 13px; border-radius: var(--radius-sm); background: var(--warning-soft); color: var(--warning); font-size: 12px; }

.form-group { margin-bottom: 17px; }
.form-group label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 800; }
.form-control {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  background: var(--bg-main);
  color: var(--text-main);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
textarea.form-control { resize: vertical; }
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); background: var(--bg-card); }
.form-help { margin: -6px 0 14px; color: var(--text-light); font-size: 11px; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.input-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.input-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.tool-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 18px; }
.tool-tabs { display: grid; align-content: start; gap: 7px; }
.tool-tab { width: 100%; padding: 12px 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); color: var(--text-main); font-weight: 750; text-align: left; cursor: pointer; }
.tool-tab:hover, .tool-tab.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.tool-workspace { min-width: 0; padding: 25px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-sm); }
.tool-workspace h2 { margin: 0 0 7px; font-size: 22px; }
.tool-workspace .tool-description { margin: 0 0 20px; color: var(--text-muted); font-size: 13px; }
.result-panel { margin-top: 20px; padding: 17px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); }
.result-panel.error { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.result-panel.warning { border-color: var(--warning); background: var(--warning-soft); }
.result-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.result-metric { padding: 12px; border-radius: var(--radius-sm); background: var(--bg-card); }
.result-metric small { display: block; color: var(--text-light); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.result-metric strong { display: block; margin-top: 4px; font-size: 18px; overflow-wrap: anywhere; }
.result-metric code { font-size: 13px; }
.result-copy-block { margin-top: 14px; padding: 13px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); }
.result-copy-block label { display: block; margin-bottom: 7px; color: var(--text-light); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.warning-list { margin: 13px 0 0; padding-left: 21px; color: var(--warning); font-size: 12px; }
.sequence-preview { max-width: 100%; overflow-x: auto; padding: 11px; border-radius: var(--radius-sm); background: var(--bg-card); font-family: var(--font-code); font-size: 12px; white-space: nowrap; }

.synthesis-map-wrapper, .ms-helper-wrapper { padding: 26px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); box-shadow: var(--shadow-md); }
.synthesis-map-header h1, .ms-helper-header h1 { margin: 0; font-size: 27px; }
.synthesis-map-header p, .ms-helper-header p { color: var(--text-muted); }
.synthesis-map-flow { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 22px 0; }
.synthesis-step { position: relative; min-height: 150px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-subtle); cursor: pointer; transition: transform 0.15s, border-color 0.15s; }
.synthesis-step:hover, .synthesis-step.active { transform: translateY(-2px); border-color: var(--primary); background: var(--primary-soft); }
.step-number { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 850; }
.synthesis-step h3 { margin: 12px 0 4px; font-size: 15px; }
.synthesis-step p { margin: 0; color: var(--text-muted); font-size: 11px; }
.step-detail-panel { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-card); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.detail-item { padding: 13px; border-radius: var(--radius-sm); background: var(--bg-subtle); }
.detail-item.full-width { grid-column: 1 / -1; }
.detail-item.warning { background: var(--warning-soft); }
.detail-item strong { display: block; margin-bottom: 5px; }
.detail-item p { margin: 0; color: var(--text-muted); font-size: 12px; }

.search-results-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.search-section { margin-top: 23px; }
.search-section h2 { margin: 0 0 9px; font-size: 18px; }
.search-result-item { padding: 13px 0; border-top: 1px solid var(--border); }
.search-result-item:first-of-type { border-top: 0; }
.search-result-item button { padding: 0; border: 0; background: none; color: var(--text-main); font-weight: 800; text-align: left; cursor: pointer; }
.search-result-item button:hover { color: var(--primary); }
.search-result-item p { margin: 4px 0 0; color: var(--text-muted); font-size: 12px; }
.search-highlight { padding: 0 2px; border-radius: 3px; background: var(--warning-soft); color: inherit; }

.site-footer { margin-top: 35px; padding: 25px 24px; border-top: 1px solid var(--border); background: var(--bg-card); }
.footer-inner { max-width: var(--max-width); margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 15px; color: var(--text-muted); font-size: 12px; }
.footer-inner p { margin: 0; }
.footer-links { display: flex; align-items: center; gap: 9px; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(4, 15, 22, 0.64);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-overlay[hidden] { display: none; }
.modal-card { width: min(650px, 100%); max-height: 88vh; overflow-y: auto; padding: 27px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--bg-card); box-shadow: var(--shadow-lg); }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding-bottom: 13px; border-bottom: 1px solid var(--border); }
.modal-header h2 { margin: 0; font-size: 20px; }
.modal-content { margin-top: 17px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 20px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 1100; max-width: 370px; padding: 12px 15px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-card); box-shadow: var(--shadow-lg); font-size: 13px; }

@media (max-width: 1320px) {
  .header-inner { flex-wrap: wrap; gap: 9px 14px; }
  .brand-logo { order: 1; }
  .header-search { order: 2; max-width: none; }
  .header-actions { order: 3; }
  .main-nav { order: 4; width: 100%; overflow-x: auto; padding-bottom: 2px; }
  .site-header { position: relative; }
  .left-sidebar { top: 24px; }
}

@media (max-width: 1040px) {
  .two-column-layout { grid-template-columns: 1fr; }
  .center-content { order: 1; }
  .left-sidebar { position: static; order: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .left-sidebar .sidebar-card { margin: 0; }
  .pillar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-evidence-box { grid-template-columns: 1fr; }
  .synthesis-map-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .header-inner { padding: 10px 16px; }
  .brand-text small { display: none; }
  .header-search { order: 4; flex-basis: 100%; }
  .mobile-nav-toggle { display: inline-grid; order: 2; margin-left: auto; }
  .header-actions { order: 3; }
  .main-nav { display: none; order: 5; padding: 8px 0 4px; flex-wrap: wrap; }
  .main-nav.open { display: flex; }
  .compact-action { display: none; }
  .main-viewport { padding: 20px 15px 36px; }
  .left-sidebar { grid-template-columns: 1fr 1fr; }
  .left-sidebar .source-status-card { grid-column: 1 / -1; }
  .notice-grid, .metric-grid, .tool-grid { grid-template-columns: 1fr; }
  .filter-bar { grid-template-columns: 1fr; }
  .tool-layout { grid-template-columns: 1fr; }
  .tool-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .input-grid.three, .input-grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 590px) {
  body { font-size: 14px; }
  .brand-icon { width: 39px; height: 39px; }
  .brand-text strong { font-size: 18px; }
  .header-actions { gap: 5px; }
  .icon-btn { width: 38px; height: 38px; }
  .left-sidebar { grid-template-columns: 1fr; }
  .left-sidebar .source-status-card { grid-column: auto; }
  .pillar-grid { grid-template-columns: 1fr; }
  .article-header h1 { font-size: 28px; }
  .article-view-content { padding: 23px 17px; }
  .article-meta { display: grid; gap: 5px; }
  .view-header-row { display: block; }
  .article-card-footer { align-items: flex-start; flex-direction: column; }
  .input-grid, .input-grid.three, .input-grid.four { grid-template-columns: 1fr; }
  .tool-tabs { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .synthesis-map-flow, .detail-grid { grid-template-columns: 1fr; }
  .detail-item.full-width { grid-column: auto; }
  .modal-card { padding: 20px; }
}

@media print {
  .site-header, .left-sidebar, .site-footer, .filter-bar, .modal-overlay { display: none !important; }
  .main-viewport { max-width: none; padding: 0; }
  .two-column-layout { display: block; }
  .card, .article-view-content { box-shadow: none; border-color: #bbb; }
  a { color: #000; }
}

/* v4 knowledge-and-evidence redesign */
:root {
  --bg-main: #fbfcfd;
  --bg-card: #ffffff;
  --bg-subtle: #f3f6f8;
  --bg-elevated: #ffffff;
  --text-main: #111b28;
  --text-muted: #536273;
  --text-light: #718092;
  --primary: #0b706b;
  --primary-strong: #075b57;
  --primary-soft: #e8f3f2;
  --border: #dce4ea;
  --border-strong: #c3cfd8;
  --shadow-sm: 0 1px 2px rgba(16, 33, 48, 0.05);
  --shadow-md: 0 4px 16px rgba(16, 33, 48, 0.06);
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --max-width: 1720px;
}

body { background: var(--bg-main); }
.site-header { backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none; }
.header-inner { max-width: none; min-height: 82px; padding: 12px 18px; gap: 14px; }
.brand-logo { min-width: 190px; }
.brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: #0b706b;
  box-shadow: none;
}
.brand-text strong { font-size: 21px; }
.brand-text small { max-width: 140px; line-height: 1.25; }
.header-search { flex: 1 1 330px; max-width: 470px; }
.search-input-wrap input { height: 46px; border-radius: 7px; background: var(--bg-card); }
.search-icon { font-size: 19px; }
.main-nav { justify-content: center; }
.nav-link { padding: 10px 9px; border-radius: 4px; font-size: 13px; }
.nav-link:hover { background: var(--bg-subtle); }
.nav-link.active { position: relative; background: transparent; }
.nav-link.active::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 2px; height: 2px; background: var(--primary); }
.header-actions { gap: 7px; }
.header-actions .btn { min-height: 38px; padding: 8px 12px; border-radius: 7px; font-size: 12px; }
.icon-btn { border-radius: 7px; }

.main-viewport { max-width: none; padding: 0 24px 0 0; }
.two-column-layout { grid-template-columns: 226px minmax(0, 1fr); gap: 38px; }
.left-sidebar {
  position: sticky;
  top: 82px;
  min-height: calc(100vh - 82px);
  padding: 28px 14px 38px;
  border-right: 1px solid var(--border);
  background: var(--bg-card);
}
.center-content { padding: 36px 0 56px; }
.sidebar-group { padding-bottom: 22px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.sidebar-group-title { margin: 0 10px 12px; color: var(--text-light); font-size: 11px; font-weight: 800; letter-spacing: .12em; }
.cat-nav-item { min-height: 42px; padding: 8px 10px; border-radius: 6px; }
.cat-nav-item > span:first-child { display: inline-flex; align-items: center; gap: 10px; }
.cat-nav-item .ph { width: 20px; font-size: 18px; color: var(--primary); }
.cat-nav-item:hover { background: var(--bg-subtle); }
.cat-nav-item.active { background: var(--primary-soft); color: var(--primary-strong); }
.sidebar-status { padding: 4px 10px 0; border-left: 0; }
.sidebar-status .card-title { font-size: 13px; }
.mini-status-list > div { padding: 8px 0; }

.home-map-view { max-width: 1460px; }
.home-map-header { min-height: 126px; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 4px 0 26px; border-bottom: 1px solid var(--border); }
.home-map-header h1 { margin: 5px 0 6px; font-size: clamp(30px, 3vw, 42px); line-height: 1.18; letter-spacing: -.03em; }
.home-map-header > div > p:last-child { margin: 0; color: var(--text-muted); font-size: 16px; }
.view-eyebrow { margin: 0; color: var(--primary); font-size: 10px; font-weight: 850; letter-spacing: .13em; text-transform: uppercase; }
.home-snapshot { margin-top: 55px; display: inline-flex; align-items: center; gap: 5px; color: var(--text-light); font-size: 12px; white-space: nowrap; }
.home-map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 28px; padding-top: 30px; }
.home-map-main { min-width: 0; }
.knowledge-map { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-bottom: 1px solid var(--border); }
.knowledge-map-item { min-height: 340px; padding: 0 22px 24px; display: flex; flex-direction: column; align-items: flex-start; text-align: left; border-right: 1px solid var(--border); cursor: pointer; }
.knowledge-map-item:first-child { padding-left: 10px; }
.knowledge-map-item:last-child { border-right: 0; }
.knowledge-map-number { color: var(--primary); font-size: 26px; font-weight: 600; line-height: 1; }
.knowledge-map-icon { width: 54px; height: 54px; margin: 30px 0 22px; display: grid; place-items: center; color: var(--primary); font-size: 40px; }
.knowledge-map-item > strong { font-size: 19px; line-height: 1.25; }
.knowledge-map-item > span:not(.knowledge-map-number):not(.knowledge-map-icon):not(.knowledge-map-link) { margin-top: 16px; color: var(--text-muted); font-size: 13px; line-height: 1.8; }
.knowledge-map-link { margin-top: auto; display: inline-flex; align-items: center; gap: 6px; color: var(--primary); font-size: 13px; font-weight: 750; }
.knowledge-map-item small { margin-top: 12px; color: var(--text-light); }
.knowledge-map-item:hover .knowledge-map-link { color: var(--primary-strong); }
.knowledge-map-item:focus-visible { outline: 3px solid var(--primary-soft); outline-offset: -2px; }

.evidence-status-panel { padding: 20px 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.evidence-status-panel h2 { margin: 0 0 8px; font-size: 15px; }
.status-definition { display: grid; grid-template-columns: 28px 1fr; gap: 9px; padding: 15px 0; border-bottom: 1px solid var(--border); }
.status-definition > .ph { margin-top: 2px; font-size: 23px; }
.status-definition strong, .status-definition span { display: block; }
.status-definition strong { font-size: 13px; }
.status-definition span { margin-top: 3px; color: var(--text-light); font-size: 11px; line-height: 1.55; }
.status-checked > .ph, .status-checked strong { color: var(--primary); }
.status-update > .ph, .status-update strong { color: var(--warning); }
.status-unchecked > .ph, .status-unchecked strong { color: var(--text-muted); }
.recent-review-list { padding-top: 18px; }
.recent-review-list h3 { margin: 0 0 8px; font-size: 13px; }
.recent-review-item { width: 100%; padding: 9px 0; display: grid; gap: 2px; text-align: left; cursor: pointer; }
.recent-review-item span { color: var(--primary-strong); font-size: 11px; line-height: 1.5; }
.recent-review-item small { color: var(--text-light); font-size: 10px; }

.featured-review { margin-top: 28px; }
.featured-review-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.featured-review-heading h2 { margin: 2px 0 0; font-size: 18px; }
.featured-review-heading .link-button { display: inline-flex; align-items: center; gap: 4px; }
.featured-article { width: 100%; display: grid; grid-template-columns: 46px minmax(0, 1fr) minmax(120px, 180px) 110px; gap: 18px; align-items: center; padding: 18px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); text-align: left; cursor: pointer; }
.featured-article:hover { border-color: var(--primary); }
.featured-article-icon { width: 38px; height: 38px; display: grid; place-items: center; color: var(--primary); background: var(--primary-soft); border-radius: 6px; font-size: 22px; }
.featured-article-copy { display: grid; gap: 3px; min-width: 0; }
.featured-article-copy small { color: var(--primary); font-size: 10px; font-weight: 800; }
.featured-article-copy strong { font-size: 14px; }
.featured-article-copy span { color: var(--text-light); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.featured-article-meta { padding-left: 18px; border-left: 1px solid var(--border); }
.featured-article-meta small, .featured-article-meta strong { display: block; }
.featured-article-meta small { color: var(--text-light); font-size: 10px; }
.featured-article-meta strong { margin-top: 4px; font-size: 11px; line-height: 1.45; }

.article-view-content { max-width: 1320px; padding: 0; border: 0; background: transparent; box-shadow: none; }
.article-header { padding: 28px 34px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.article-reading-layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 28px; margin-top: 26px; }
.article-toc { position: sticky; top: 108px; align-self: start; max-height: calc(100vh - 140px); overflow: auto; padding: 16px 12px; border-left: 2px solid var(--border); }
.article-toc > strong { display: block; margin: 0 8px 8px; font-size: 12px; }
.article-toc nav { display: grid; }
.article-toc-link { padding: 7px 8px; display: grid; grid-template-columns: 24px 1fr; gap: 5px; border: 0; background: transparent; color: var(--text-muted); font-size: 11px; line-height: 1.45; text-align: left; cursor: pointer; }
.article-toc-link span { color: var(--primary); font-size: 9px; }
.article-toc-link:hover { color: var(--primary); background: var(--primary-soft); }
.article-reading-main { min-width: 0; padding: 30px 38px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.article-body h2 { scroll-margin-top: 110px; }
.article-body.prose { max-width: 78ch; }
.article-list { gap: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-card); }
.article-card { margin: 0; padding: 20px 22px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.article-card:last-child { border-bottom: 0; }
.card, .database-card { box-shadow: none; }

.site-footer { border-top: 1px solid var(--border); background: var(--bg-card); }
.footer-inner { max-width: none; }

@media (max-width: 1440px) {
  .header-inner { flex-wrap: wrap; }
  .brand-logo { min-width: auto; }
  .header-search { max-width: 420px; }
  .main-nav { order: 4; width: 100%; overflow-x: auto; justify-content: flex-start; }
  .left-sidebar { top: 132px; }
}

@media (max-width: 1120px) {
  .main-viewport { padding-right: 20px; }
  .two-column-layout { grid-template-columns: 1fr; gap: 0; }
  .left-sidebar { position: static; min-height: 0; padding: 16px 20px; border-right: 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
  .sidebar-group { margin: 0; padding: 0; border: 0; }
  .sidebar-status { display: none; }
  .center-content { padding: 28px 20px 46px; }
  .home-map-layout { grid-template-columns: 1fr; }
  .evidence-status-panel { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
  .evidence-status-panel > h2, .recent-review-list { grid-column: 1 / -1; }
  .status-definition { border-bottom: 0; }
  .recent-review-list { border-top: 1px solid var(--border); }
}

@media (max-width: 820px) {
  .header-inner { min-height: 70px; padding: 10px 14px; }
  .brand-text small { display: none; }
  .header-search { order: 5; width: 100%; max-width: none; flex-basis: 100%; }
  .header-actions .compact-action { display: none; }
  .main-nav { display: none; order: 6; }
  .main-nav.open { display: flex; }
  .left-sidebar { display: none; }
  .main-viewport { padding: 0; }
  .center-content { padding: 24px 16px 42px; }
  .home-map-header { min-height: 0; display: block; }
  .home-snapshot { margin-top: 16px; }
  .knowledge-map { grid-template-columns: 1fr; }
  .knowledge-map-item, .knowledge-map-item:first-child { min-height: 0; padding: 20px 8px; display: grid; grid-template-columns: 42px 46px 1fr; gap: 4px 10px; border-right: 0; border-bottom: 1px solid var(--border); }
  .knowledge-map-number { grid-row: 1 / span 3; font-size: 20px; }
  .knowledge-map-icon { grid-row: 1 / span 3; width: 38px; height: 38px; margin: 0; font-size: 28px; }
  .knowledge-map-item > strong { grid-column: 3; font-size: 16px; }
  .knowledge-map-item > span:not(.knowledge-map-number):not(.knowledge-map-icon):not(.knowledge-map-link) { grid-column: 3; margin-top: 3px; }
  .knowledge-map-link { grid-column: 3; margin-top: 8px; }
  .knowledge-map-item small { display: none; }
  .evidence-status-panel { grid-template-columns: 1fr; }
  .evidence-status-panel > h2, .recent-review-list { grid-column: auto; }
  .status-definition { border-bottom: 1px solid var(--border); }
  .featured-article { grid-template-columns: 42px 1fr; }
  .featured-article-meta { display: none; }
  .article-reading-layout { grid-template-columns: 1fr; }
  .article-toc { position: static; max-height: none; border: 1px solid var(--border); border-radius: 6px; }
  .article-reading-main { padding: 22px 18px; }
  .article-header { padding: 22px 18px; }
}

@media (max-width: 590px) {
  .brand-icon { width: 42px; height: 42px; }
  .home-map-header h1 { font-size: 28px; }
  .home-map-header > div > p:last-child { font-size: 14px; }
  .evidence-status-panel { padding: 16px; }
}

/* Content-system refinements */
.notice-card.warning { border-color: var(--warning); }
.notice-card.success { border-color: var(--success); }
.notice-card.info { border-color: var(--secondary); }
.compact-list { margin: 0; padding-left: 18px; }
.compact-list li { margin: 3px 0; }
.detail-disclosure { margin-top: 9px; padding-top: 7px; }
.detail-disclosure summary { color: var(--primary); font-size: 11px; }
.detail-disclosure p { margin: 7px 0 0; color: var(--text-muted); font-size: 11px; }
.synthesis-step { color: var(--text-main); text-align: left; }
.synthesis-step small { display: block; margin-top: 10px; color: var(--text-muted); font-size: 11px; line-height: 1.45; }
.step-detail-panel h2 { margin: 7px 0 15px; }
.step-detail-panel h2 small { color: var(--text-muted); font-size: 0.58em; font-weight: 650; }
.embedded-component { padding: 0; border: 0; box-shadow: none; }
.tool-workspace > .embedded-component { margin: -4px; }
.ms-helper-wrapper .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ms-helper-wrapper .card { margin-bottom: 16px; box-shadow: var(--shadow-sm); }
.svg-diagram-card figcaption.diagram-caption { margin: 10px 0 0; }
.article-card .source-chips { margin-top: 12px; }
.database-table-wrap .source-chips { min-width: 120px; }
.database-table-wrap .badge { white-space: normal; line-height: 1.35; }
.search-section .tag-row { margin-top: 7px; }
.tool-workspace .source-chips, .synthesis-map-wrapper > .source-chips, .ms-helper-wrapper > .source-chips { margin-top: 18px; }
.tool-workspace .table-wrap, .ms-helper-wrapper .table-wrap { background: var(--bg-card); }

/* Figure Cards & Lightbox Modal System */
.figure-card {
  margin: 24px 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.figure-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary);
}
.figure-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  object-fit: contain;
}

/* Lightbox Modal */
.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(10, 20, 30, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.lightbox-overlay.active {
  opacity: 1;
  pointer-events: auto;
}
.lightbox-container {
  max-width: 1100px;
  width: 95%;
  max-height: 90vh;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--border);
}
.lightbox-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
}
.lightbox-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}
.lightbox-close {
  background: transparent;
  border: none;
  font-size: 24px;
  line-height: 1;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
}
.lightbox-close:hover {
  background: var(--danger-soft);
  color: var(--danger);
}
.lightbox-body {
  padding: 20px;
  overflow-y: auto;
  text-align: center;
  flex: 1;
}
.lightbox-body svg, .lightbox-body img {
  max-width: 100%;
  max-height: 65vh;
  height: auto;
  margin: 0 auto;
}
.lightbox-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-subtle);
  font-size: 13px;
  color: var(--text-muted);
  text-align: left;
}

/* Figures Gallery Grid Layout */
.figures-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px;
  margin-top: 20px;
}
.figure-gallery-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.figure-gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.figure-preview-wrap {
  padding: 12px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.figure-preview-wrap > .svg-diagram-card {
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
}
.figure-preview-wrap > .svg-diagram-card[data-figure-number]::before { top: 10px; right: 10px; }
.figure-preview-wrap > .svg-diagram-card .diagram-caption { padding: 10px 4px 0; }
.figure-gallery-info {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.figure-gallery-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 8px;
}
.figure-gallery-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 12px;
  flex: 1;
}
.evidence-gallery-image { width: 100%; height: 260px; object-fit: contain; background: #fff; }

@media (max-width: 820px) {
  .ms-helper-wrapper .tool-grid { grid-template-columns: 1fr; }
  .article-body .semantic-diagram svg, .lightbox-body .semantic-diagram svg { min-width: 720px; }
  .article-body .teaching-figure svg { min-width: 760px; }
  .lightbox-body .teaching-figure { width: 760px; max-width: none; }
  .lightbox-body .teaching-figure svg { width: 760px; min-width: 760px; max-width: none; }
  .svg-diagram-card[data-figure-number]::before { top: 14px; right: 14px; }
  .evidence-image-wrap { min-height: 180px; max-height: 520px; padding: 10px; }
  .evidence-figure-image { max-height: 500px; }
  .evidence-register-header { display: grid; gap: 12px; }
  .evidence-register-summary { min-width: 0; text-align: left; }
  .evidence-register-grid { grid-template-columns: 1fr; }
  .evidence-register-grid .evidence-image-wrap { height: auto; min-height: 220px; max-height: 520px; }
  .evidence-register-list li { grid-template-columns: 52px minmax(0, 1fr); gap: 10px; }
  .evidence-register-index { width: 50px; }
  .figures-gallery-grid { grid-template-columns: 1fr; }
}

@media (max-width: 590px) {
  .lightbox-header { padding: 12px 14px; }
  .lightbox-title { font-size: 13px; line-height: 1.5; }
  .lightbox-body { padding: 10px; overflow: auto; text-align: left; }
}
