﻿:root {
  --ink: #17211f;
  --muted: #66736f;
  --line: #dbe6e1;
  --paper: #fbfaf4;
  --card: #ffffff;
  --sidebar: #10241f;
  --sidebar-2: #17372f;
  --gold: #b9852e;
  --green: #16745f;
  --blue: #3f6f8f;
  --red: #a35a43;
  --policy: #3f6f8f;
  --industry: #5d8a55;
  --assets: #b9852e;
  --case: #a35a43;
  --reference: #71817c;
  --shadow: 0 18px 50px rgba(22, 33, 31, .12);
  --radius: 18px;
  --sidebar-w: 318px;
}

.article-toc{margin:20px 0;padding:0 20px;border:1px solid var(--border);border-radius:12px;background:#f8fafc}.article-toc summary{display:flex;align-items:center;justify-content:space-between;min-height:50px;cursor:pointer;font-weight:800}.article-toc summary span{font-size:.82rem;font-weight:400;color:var(--text-light)}.article-toc ol{margin:0 0 18px;padding-left:22px}.article-toc li{margin:7px 0}.article-toc a{color:var(--primary);text-decoration:none}.article-toc a:hover{text-decoration:underline}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Noto Serif SC", "Source Han Serif SC", "Microsoft YaHei", serif;
  line-height: 1.82;
  background:
    radial-gradient(circle at 8% 8%, rgba(31, 138, 112, .16), transparent 28%),
    radial-gradient(circle at 92% 0%, rgba(185, 133, 46, .12), transparent 30%),
    linear-gradient(135deg, #f7f2e7 0%, #eef5ef 52%, #e8efe9 100%);
}
a { color: inherit; text-decoration: none; }
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  overflow-y: auto;
  color: #edf7f2;
  background:
    radial-gradient(circle at 20% 0%, rgba(200, 145, 47, .22), transparent 26%),
    linear-gradient(180deg, var(--sidebar-2), var(--sidebar));
  border-right: 1px solid rgba(255,255,255,.1);
  z-index: 20;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.22); border-radius: 99px; }
.sidebar-logo { display: block; padding: 18px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.12); }
.logo-mark { width: 52px; height: 52px; display: grid; place-items: center; border: 1px solid rgba(255,255,255,.35); border-radius: 16px; color: #10241f; background: linear-gradient(135deg, #f0c36b, #f8efd3); font-weight: 900; letter-spacing: .08em; }
.sidebar-logo-text { font-size: 1rem; font-weight: 900; line-height: 1.45; letter-spacing: .01em; }
.sidebar-logo-text span { display: block; margin-top: 6px; color: rgba(237,247,242,.68); font-size: .72rem; font-weight: 500; line-height: 1.55; }
.sidebar-search { position: sticky; top: 0; z-index: 3; padding: 16px; background: rgba(16,36,31,.92); backdrop-filter: blur(12px); }
.search-input { width: 100%; border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: 12px 14px; color: #fff; outline: 0; background: rgba(255,255,255,.08); }
.search-input::placeholder { color: rgba(255,255,255,.5); }
.search-results { position: absolute; left: 16px; right: 16px; top: 68px; max-height: 58vh; overflow: auto; padding: 8px; border-radius: 14px; background: #fff; color: var(--ink); box-shadow: var(--shadow); }
.search-result { display: block; padding: 10px 12px; border-radius: 10px; }
.search-result:hover { background: #f4f0e4; }
.search-result-title { display: block; font-weight: 800; }
.search-result-path, .search-result-snippet { display: block; color: var(--muted); font-size: .82rem; line-height: 1.55; }
.search-empty { padding: 10px; color: var(--muted); line-height: 1.7; }
.search-empty span { display: block; margin-top: 4px; font-size: .78rem; color: #8a9692; }
.sidebar-nav { padding: 6px 12px 28px; }
.nav-section { margin: 14px 0; padding: 12px; border: 1px solid rgba(255,255,255,.1); border-radius: 18px; background: rgba(255,255,255,.045); }
.nav-section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-weight: 900; color: #fff; }
.nav-section-title b { min-width: 28px; height: 28px; display: grid; place-items: center; border-radius: 999px; background: rgba(255,255,255,.1); color: #f0c36b; font-size: .78rem; }
.nav-chapter { margin: 2px 0; }
.nav-chapter > summary { list-style: none; }
.nav-chapter > summary::-webkit-details-marker { display: none; }
.nav-item { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; border: 0; border-radius: 12px; padding: 9px 12px; color: rgba(237,247,242,.82); background: transparent; font: inherit; font-size: .9rem; line-height: 1.38; text-align: left; cursor: pointer; }
.nav-item:hover, .nav-item.active { color: #fff; background: rgba(255,255,255,.1); }
.nav-item.active::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px; border-radius: 99px; background: #79d3b5; box-shadow: 0 0 14px rgba(121,211,181,.46); }
.chapter-toggle strong { color: #f0c36b; font-size: .78rem; }
.sub-item { padding: 8px 10px 8px 12px; font-size: .86rem; color: rgba(237,247,242,.72); }
.sub-item em { color: #f0c36b; font-size: .72rem; font-style: normal; white-space: nowrap; }
.stage-risk { border-color: rgba(166,75,60,.35); }
.stage-flow { border-color: rgba(31,138,112,.35); }
.stage-entity { border-color: rgba(47,109,145,.35); }
.stage-logistics { border-color: rgba(200,145,47,.38); }
.stage-money { border-color: rgba(102,115,111,.35); }
.stage-platform { border-color: rgba(31,138,112,.28); }
.stage-tools { border-color: rgba(166,75,60,.26); }
.stage-overview { border-color: rgba(22,116,95,.34); }
.stage-policy { border-color: rgba(63,111,143,.42); }
.stage-industry { border-color: rgba(93,138,85,.42); }
.stage-assets { border-color: rgba(185,133,46,.48); }
.stage-case { border-color: rgba(163,90,67,.42); }
.stage-reference { border-color: rgba(113,129,124,.38); }
.main { margin-left: var(--sidebar-w); min-height: 100vh; }
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 30px; border-bottom: 1px solid rgba(23,33,31,.08); background: rgba(251,250,244,.82); backdrop-filter: blur(14px); }
.menu-toggle, .print-btn { border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; background: #fff; color: var(--ink); cursor: pointer; }
.print-btn:hover { border-color: rgba(22,116,95,.36); color: var(--green); }
.menu-toggle { display: none; }
.breadcrumb { flex: 1; display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .9rem; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.breadcrumb a { color: var(--green); font-weight: 800; }
#progress-bar { position: sticky; top: 64px; height: 3px; z-index: 9; background: transparent; }
#progress-bar .bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--green), var(--gold)); }
.content { padding: 34px; }
.content-inner { max-width: 1120px; margin: 0 auto; }
.hero { position: relative; overflow: hidden; padding: 58px; border: 1px solid rgba(23,33,31,.08); border-radius: 30px; background: linear-gradient(135deg, rgba(255,255,255,.96), rgba(235,246,239,.88)); box-shadow: var(--shadow); }
.hero::after { content: ""; position: absolute; right: -90px; top: -90px; width: 280px; height: 280px; border-radius: 50%; border: 48px solid rgba(31,138,112,.12); }
.hero-kicker { color: var(--green); font-weight: 900; letter-spacing: .08em; }
.hero h1 { margin: 14px 0 18px; font-size: clamp(2.3rem, 5vw, 5rem); line-height: 1.05; letter-spacing: -.06em; }
.hero p { max-width: 840px; color: #40504b; font-size: 1.08rem; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.hero-tags span { border: 1px solid rgba(31,138,112,.24); border-radius: 999px; padding: 7px 12px; background: rgba(255,255,255,.72); color: #1e5f50; font-weight: 800; font-size: .86rem; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin: 24px 0; }
.stats-grid div { padding: 22px; border-radius: 22px; background: rgba(255,255,255,.78); box-shadow: 0 8px 24px rgba(22,33,31,.07); }
.stats-grid strong { display: block; font-size: 2.2rem; line-height: 1; color: var(--green); }
.stats-grid span { color: var(--muted); font-weight: 800; }
.block-heading { margin: 36px 0 16px; }
.block-heading span { display: block; color: var(--gold); font-weight: 900; }
.block-heading strong { display: block; font-size: 1.4rem; }
.guide-panel { margin: 26px 0 34px; }
.guide-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.guide-card { display: block; position: relative; overflow: hidden; padding: 20px; border: 1px solid rgba(31,138,112,.18); border-radius: 22px; background: linear-gradient(135deg, rgba(255,255,255,.9), rgba(232,245,239,.86)); box-shadow: 0 10px 26px rgba(22,33,31,.07); }
.guide-card::after { content: ""; position: absolute; right: -36px; top: -36px; width: 110px; height: 110px; border-radius: 999px; background: rgba(200,145,47,.16); }
.guide-card:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(22,33,31,.11); }
.guide-card span { display: inline-block; margin-bottom: 10px; color: var(--gold); font-size: .86rem; font-weight: 900; }
.guide-card strong { display: block; position: relative; z-index: 1; font-size: 1.08rem; line-height: 1.45; color: #17372f; }
.loop-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.loop-card, .section-card { border: 1px solid rgba(23,33,31,.08); border-radius: 22px; background: rgba(255,255,255,.82); box-shadow: 0 10px 28px rgba(22,33,31,.07); }
.loop-card { padding: 20px; border-top: 4px solid rgba(22,116,95,.38); }
.loop-card span { color: var(--green); font-weight: 900; }
.loop-card h3 { margin: 8px 0; font-size: 1.08rem; }
.loop-card p { margin: 0; color: var(--muted); font-size: .92rem; }
.sections-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; margin-top: 28px; }
.section-card { overflow: hidden; border-top: 4px solid rgba(22,116,95,.35); }
.section-card.stage-policy { border-top-color: var(--policy); }
.section-card.stage-industry { border-top-color: var(--industry); }
.section-card.stage-assets { border-top-color: var(--assets); box-shadow: 0 16px 36px rgba(185,133,46,.16); }
.section-card.stage-case { border-top-color: var(--case); }
.section-card.stage-reference { border-top-color: var(--reference); }
.section-card-header { display: flex; align-items: center; gap: 12px; padding: 20px; border-bottom: 1px solid var(--line); background: linear-gradient(135deg, rgba(31,138,112,.08), rgba(200,145,47,.08)); }
.section-card-header span { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 14px; background: #15372f; color: #f0c36b; font-weight: 900; }
.section-card-header em { display: inline-flex; margin-bottom: 4px; padding: 3px 8px; border-radius: 999px; background: rgba(22,116,95,.09); color: var(--green); font-size: .72rem; font-style: normal; font-weight: 900; letter-spacing: .06em; }
.section-card-header h2 { margin: 0; font-size: 1.16rem; }
.section-card-body { padding: 12px; }
.section-card-summary { margin: 4px 8px 12px; color: var(--muted); font-size: .92rem; line-height: 1.65; }
.section-card-item { display: flex; justify-content: space-between; gap: 12px; padding: 11px 12px; border-radius: 12px; color: #293935; }
.section-card-item:hover { background: #f4f0e4; }
.section-card-item b { color: var(--green); font-size: .82rem; white-space: nowrap; }
.section-card-more { padding: 8px 12px 2px; color: var(--muted); font-size: .82rem; }
.chapter-header { padding: 34px 40px; border-radius: 28px; background: linear-gradient(135deg, #17372f, #255b4e); color: #fff; box-shadow: var(--shadow); }
.chapter-header div { color: #f0c36b; font-weight: 900; }
.chapter-header h1 { margin: 10px 0; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.16; letter-spacing: -.04em; }
.chapter-header p { margin: 0; color: rgba(255,255,255,.72); }
.article-content { margin-top: 24px; padding: 42px; border-radius: 26px; background: var(--card); box-shadow: var(--shadow); font-size: 1.04rem; }
.article-content h1, .article-content h2, .article-content h3 { line-height: 1.32; margin: 1.5em 0 .65em; }
.article-content h1:first-child, .article-content h2:first-child { margin-top: 0; }
.article-content h1 { font-size: 2rem; }
.article-content h2 { position: relative; padding: 0 0 10px 16px; border-bottom: 1px solid var(--line); font-size: 1.55rem; }
.article-content h2::before { content: ""; position: absolute; left: 0; top: .2em; bottom: .35em; width: 4px; border-radius: 99px; background: linear-gradient(180deg, var(--green), #8fc7a0); }
.article-content h3 { font-size: 1.18rem; color: #1e5f50; }
.article-content h3[id^="sec-"] { scroll-margin-top: 92px; padding: 3px 6px; border-radius: 8px; }
.article-content h3[id^="sec-"]:target { background: #eef8f3; box-shadow: inset 4px 0 0 var(--green); }
.article-content p, .article-content ul, .article-content ol, .article-content blockquote, .article-content table { margin: 1em 0; }
.article-content ul, .article-content ol { padding-left: 1.4em; }
.article-content blockquote { border: 1px solid rgba(22,116,95,.16); border-left: 5px solid var(--green); padding: 14px 18px; background: linear-gradient(135deg, #f4fbf7, #fffdf4); color: #40504b; border-radius: 16px; }
.article-content .wiki-link { display: inline-block; border-bottom: 1px solid rgba(31,138,112,.35); color: #14715e; font-weight: 800; }
.article-content .wiki-link:hover { color: #0f4f42; border-bottom-color: #0f4f42; }
.article-content .wiki-link.missing { color: #9a5a27; border-bottom-color: rgba(154,90,39,.35); }
.article-content code { padding: 2px 6px; border-radius: 6px; background: #eef5ef; color: #176553; }
.article-content pre { overflow: auto; padding: 18px; border-radius: 16px; background: #12221f; color: #effaf5; }
.article-content pre code { padding: 0; background: transparent; color: inherit; }
.article-content table { width: 100%; border-collapse: separate; border-spacing: 0; display: block; overflow-x: auto; border-radius: 14px; }
.article-content th, .article-content td { border: 1px solid var(--line); border-left: 0; border-top: 0; padding: 10px 12px; vertical-align: top; }
.article-content th:first-child, .article-content td:first-child { border-left: 1px solid var(--line); }
.article-content tr:first-child th { border-top: 1px solid var(--line); }
.article-content th { background: #edf7f1; color: #15372f; font-weight: 900; }
.article-content tr:nth-child(even) td { background: #fbfdf9; }
.mermaid-card { margin: 1.4em 0; overflow: hidden; border: 1px solid rgba(31,138,112,.2); border-radius: 22px; background: linear-gradient(135deg, #f4fbf7, #fffdf4); box-shadow: 0 14px 34px rgba(22,33,31,.09); }
.diagram-caption { padding: 14px 18px 12px; border-bottom: 1px solid rgba(31,138,112,.14); background: rgba(255,255,255,.72); }
.diagram-caption strong { display: block; color: #17372f; font-size: 1rem; line-height: 1.45; }
.diagram-caption span { display: block; margin-top: 4px; color: var(--muted); font-size: .9rem; line-height: 1.6; }
.diagram-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 16px; border-bottom: 1px solid rgba(31,138,112,.14); background: rgba(23,55,47,.08); }
.diagram-toolbar span { color: #1e5f50; font-size: .88rem; font-weight: 900; letter-spacing: .06em; }
.diagram-copy { display: none; border: 1px solid rgba(31,138,112,.28); border-radius: 999px; padding: 5px 11px; background: #fff; color: #1e5f50; font: inherit; font-size: .78rem; font-weight: 800; cursor: pointer; }
.mermaid-card.debug-tools .diagram-copy, .mermaid-card.render-failed .diagram-copy { display: inline-flex; align-items: center; }
.diagram-copy:hover { background: #eef8f3; }
.article-content .mermaid-card > pre.mermaid { margin: 0; min-height: 160px; padding: 24px; border-radius: 0; background: #fbfff9; color: #17372f; white-space: pre; }
.mermaid-viewer { overflow: auto; padding: 22px; background: #f7fcf8; text-align: center; }
.mermaid-viewer svg { max-width: 100%; height: auto; min-width: 720px; }
.diagram-source { border-top: 1px solid rgba(31,138,112,.12); background: rgba(255,255,255,.68); }
.diagram-source summary { padding: 10px 16px; color: var(--muted); font-size: .86rem; font-weight: 800; cursor: pointer; }
.article-content .diagram-source pre { margin: 0; border-radius: 0; max-height: 360px; }
.diagram-warning { margin: 14px 16px 0; padding: 10px 12px; border: 1px solid rgba(166,75,60,.25); border-radius: 12px; background: #fff3ee; color: #8f3c30; font-size: .9rem; font-weight: 800; }
.diagram-note { margin: 14px 16px 0; padding: 10px 12px; border: 1px solid rgba(31,138,112,.2); border-radius: 12px; background: #eef8f3; color: #1e5f50; font-size: .9rem; font-weight: 900; }
.article-content pre.mermaid-error { background: #fff7f4; color: #5f2e27; }
.diagram-fallback { padding: 0 16px 18px; background: #fffdf5; }
.radar-fallback { padding-bottom: 20px; }
.radar-chart-viewer { overflow-x: auto; padding: 18px; text-align: center; }
.radar-chart-viewer svg { width: min(100%, 620px); height: auto; min-width: 420px; }
.radar-title { fill: #17372f; font-size: 22px; font-weight: 900; }
.radar-grid-ring { fill: none; stroke: rgba(22,116,95,.18); stroke-width: 1.2; }
.radar-axis { stroke: rgba(23,33,31,.16); stroke-width: 1; }
.radar-area { fill: rgba(22,116,95,.22); stroke: none; }
.radar-line { fill: none; stroke: #16745f; stroke-width: 4; stroke-linejoin: round; }
.radar-dot { fill: #b9852e; stroke: #fff; stroke-width: 3; }
.radar-label { fill: #40504b; font-size: 14px; font-weight: 800; }
.radar-score-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; padding: 0 18px 2px; }
.radar-score-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid rgba(22,116,95,.14); border-radius: 12px; background: rgba(255,255,255,.72); }
.radar-score-row span { color: #40504b; font-weight: 800; }
.radar-score-row strong { color: #16745f; }
.fallback-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-top: 14px; }
.fallback-group { border: 1px solid rgba(31,138,112,.16); border-radius: 18px; background: rgba(255,255,255,.82); overflow: hidden; }
.fallback-group h4, .fallback-edges h4 { margin: 0; padding: 10px 13px; background: rgba(31,138,112,.08); color: #1e5f50; font-size: .92rem; }
.fallback-node-grid { display: grid; gap: 10px; padding: 12px; }
.fallback-node { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; padding: 11px 12px; border: 1px solid rgba(23,33,31,.08); border-radius: 14px; background: linear-gradient(135deg, #ffffff, #f7fbf7); box-shadow: 0 4px 12px rgba(22,33,31,.05); }
.fallback-node-id { min-width: 28px; height: 28px; display: inline-grid; place-items: center; border-radius: 999px; background: #17372f; color: #f0c36b; font-size: .78rem; font-weight: 900; }
.fallback-node strong { font-size: .92rem; line-height: 1.45; }
.fallback-edges { margin-top: 14px; border: 1px solid rgba(200,145,47,.22); border-radius: 18px; background: rgba(255,255,255,.76); overflow: hidden; }
.fallback-edges ol { margin: 0; padding: 12px 16px 14px 38px; max-height: 360px; overflow: auto; }
.fallback-edges li { margin: .28em 0; color: #44534f; font-size: .9rem; }
.diagram-error-detail { margin-top: 12px; color: var(--muted); font-size: .86rem; }
.diagram-error-detail summary { cursor: pointer; font-weight: 800; }
.article-content .diagram-error-detail pre { margin-top: 8px; max-height: 220px; border-radius: 12px; white-space: pre-wrap; }
.empty-doc { padding: 28px; border: 1px dashed var(--gold); border-radius: 18px; background: #fff8e7; }
.article-footer { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 24px; }
.footer-nav { display: block; padding: 18px; border-radius: 18px; background: rgba(255,255,255,.84); box-shadow: 0 8px 22px rgba(22,33,31,.07); }
.footer-nav.next { text-align: right; }
.footer-nav span { display: block; color: var(--muted); font-size: .86rem; }
.footer-nav strong { color: var(--green); }
.article-share-panel {
  margin: 28px 0 18px;
  padding: 18px;
  border: 1px solid rgba(185,133,46,.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at 100% 0%, rgba(22,116,95,.13), transparent 34%),
    linear-gradient(135deg, #fffaf0, #f3fbf6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 26px rgba(22,33,31,.07);
}
.article-share-panel strong { display: block; color: #17372f; font-size: 1rem; }
.article-share-panel p { margin: 4px 0 0; color: var(--muted); font-size: .88rem; line-height: 1.7; }
.share-wide-btn {
  border: none;
  border-radius: 999px;
  padding: 11px 18px;
  background: linear-gradient(135deg, var(--green), #105848);
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 10px 20px rgba(22,116,95,.18);
}
.share-wide-btn:hover { transform: translateY(-1px); }
.back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 16;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #17372f;
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity .2s ease, transform .2s ease;
}
.back-to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  max-width: min(420px, calc(100vw - 32px));
  padding: 12px 16px;
  border-radius: 999px;
  background: rgba(16,36,31,.94);
  color: #fff;
  font-size: .86rem;
  font-weight: 800;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 12px);
  transition: opacity .2s ease, transform .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.site-footer { padding: 22px 34px 36px; color: var(--muted); text-align: center; font-size: .88rem; }
.sidebar-overlay { display: none; }
@media (max-width: 1100px) {
  .loop-grid { grid-template-columns: repeat(2, 1fr); }
  .sections-grid, .stats-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { width: min(86vw, 320px); transform: translateX(-100%); box-shadow: 18px 0 42px rgba(0,0,0,.24); }
  .sidebar.open { transform: translateX(0); }
  .search-results { max-height: min(54vh, 430px); }
  .sidebar-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.38); z-index: 15; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-flex; }
  .content { padding: 18px; }
  .hero, .article-content, .chapter-header { padding: 20px; border-radius: 22px; }
  .loop-grid, .sections-grid, .stats-grid, .article-footer { grid-template-columns: 1fr; }
  .article-share-panel { align-items: stretch; flex-direction: column; }
  .share-wide-btn { width: 100%; }
  .mermaid-viewer svg { min-width: 640px; }
  .topbar { padding: 10px 12px; gap: 8px; overflow-x: auto; }
  .breadcrumb { min-width: 0; font-size: .82rem; }
  .print-btn { padding: 7px 10px; font-size: .82rem; white-space: nowrap; }
  .print-only { display: none; }
  .article-content { font-size: .96rem; line-height: 1.86; }
  .article-content h1 { font-size: 1.48rem; line-height: 1.35; }
  .article-content h2 { font-size: 1.22rem; line-height: 1.45; padding-left: 12px; }
  .article-content h3 { font-size: 1.05rem; }
  .article-content p, .article-content li { word-break: break-word; }
  .article-content blockquote { margin-left: 0; margin-right: 0; padding: 12px 14px; }
  .article-content pre { overflow-x: auto; padding: 14px; }
  .article-content table { white-space: nowrap; }
  .back-to-top { right: 14px; bottom: 18px; width: 40px; height: 40px; }
  .toast { bottom: 18px; border-radius: 16px; }
}
@media print {
  .sidebar, .topbar, .sidebar-overlay, #progress-bar, .article-footer, .article-share-panel, .back-to-top, .toast { display: none !important; }
  .main { margin-left: 0; }
  .content { padding: 0; }
  .article-content, .chapter-header { box-shadow: none; }
}
