/* ============================================
   人工智能通识读本 - 全站样式表
   ============================================ */

/* --- CSS 变量 --- */
:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #dbeafe;
    --accent: #f59e0b;
    --accent-light: #fef3c7;
    --success: #10b981;
    --success-light: #d1fae5;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #6366f1;
    --info-light: #e0e7ff;

    --text: #1f2937;
    --text-light: #6b7280;
    --text-lighter: #9ca3af;
    --bg: #ffffff;
    --bg-soft: #f9fafb;
    --bg-card: #ffffff;
    --border: #e5e7eb;
    --border-light: #f3f4f6;

    --sidebar-w: 280px;
    --content-max: 820px;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -2px rgba(0,0,0,.04);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.08), 0 4px 6px -4px rgba(0,0,0,.04);

    --font-sans: "Noto Sans CJK SC", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
    --font-mono: "JetBrains Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
}

/* --- 基础重置 --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-sans);
    color: var(--text);
    background: var(--bg-soft);
    line-height: 1.85;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }

/* --- 侧边栏 --- */
.sidebar {
    position: fixed;
    top: 0; left: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--bg);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    z-index: 100;
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem 1.5rem 1rem;
    border-bottom: 1px solid var(--border-light);
}

.sidebar-header .book-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
}

.sidebar-header .book-subtitle {
    font-size: .8rem;
    color: var(--text-light);
    margin-top: .25rem;
}

.sidebar-nav {
    flex: 1;
    padding: .75rem 0;
}

.sidebar-nav .part-label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--text-lighter);
    padding: .75rem 1.5rem .35rem;
}

.sidebar-nav .chapter-link {
    display: flex;
    align-items: baseline;
    gap: .6rem;
    padding: .5rem 1.5rem;
    font-size: .875rem;
    color: var(--text-light);
    transition: all .2s;
    border-left: 3px solid transparent;
}

.sidebar-nav .chapter-link:hover {
    background: var(--bg-soft);
    color: var(--primary);
}

.sidebar-nav .chapter-link.active {
    background: var(--primary-light);
    color: var(--primary-dark);
    border-left-color: var(--primary);
    font-weight: 600;
}

.sidebar-nav .chapter-num {
    font-size: .75rem;
    color: var(--text-lighter);
    min-width: 1.5rem;
    font-variant-numeric: tabular-nums;
}

.sidebar-nav .chapter-link.active .chapter-num { color: var(--primary); }

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    font-size: .75rem;
    color: var(--text-lighter);
}

/* --- 主内容区 --- */
.main-wrapper {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    transition: margin .3s ease;
}

.content {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: 3rem 2rem 5rem;
}

/* --- 移动端顶栏 --- */
.mobile-header {
    display: none;
    position: sticky;
    top: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: .75rem 1rem;
    z-index: 50;
    align-items: center;
    gap: 1rem;
}

.mobile-header .menu-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--text);
    padding: .25rem;
    line-height: 1;
}

.mobile-header .menu-title {
    font-size: .9rem;
    font-weight: 600;
    color: var(--text);
}

/* --- 章节头部 --- */
.chapter-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--border-light);
}

.chapter-header .part-badge {
    display: inline-block;
    font-size: .78rem;
    font-weight: 600;
    color: var(--primary);
    background: var(--primary-light);
    padding: .25rem .75rem;
    border-radius: 20px;
    margin-bottom: .75rem;
}

.chapter-header h1 {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text);
    letter-spacing: -.01em;
}

.chapter-header .lead {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-top: .75rem;
    line-height: 1.7;
}

/* --- 正文排版 --- */
.chapter-body h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--text);
    padding-left: .75rem;
    border-left: 4px solid var(--primary);
}

.chapter-body h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 2rem 0 .75rem;
    color: var(--text);
}

.chapter-body h4 {
    font-size: 1.05rem;
    font-weight: 600;
    margin: 1.5rem 0 .5rem;
    color: var(--text);
}

.chapter-body p {
    margin-bottom: 1rem;
    color: var(--text);
}

.chapter-body strong { font-weight: 600; color: var(--text); }

.chapter-body ul, .chapter-body ol {
    margin: .75rem 0 1.25rem;
    padding-left: 1.5rem;
}

.chapter-body li {
    margin-bottom: .4rem;
    color: var(--text);
}

.chapter-body blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    background: var(--bg-soft);
    border-left: 4px solid var(--accent);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text);
}

.chapter-body blockquote p:last-child { margin-bottom: 0; }

/* --- 提示框 --- */
.callout {
    margin: 1.5rem 0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid;
    display: flex;
    gap: .75rem;
    align-items: flex-start;
}

.callout .callout-icon { font-size: 1.25rem; flex-shrink: 0; line-height: 1.5; }
.callout .callout-content { flex: 1; }
.callout .callout-title { font-weight: 700; margin-bottom: .25rem; font-size: .9rem; }
.callout .callout-body { font-size: .9rem; line-height: 1.7; }
.callout .callout-body p:last-child { margin-bottom: 0; }

.callout.tip { background: var(--success-light); border-color: #a7f3d0; }
.callout.tip .callout-icon, .callout.tip .callout-title { color: #065f46; }

.callout.note { background: var(--info-light); border-color: #c7d2fe; }
.callout.note .callout-icon, .callout.note .callout-title { color: #3730a3; }

.callout.warn { background: var(--accent-light); border-color: #fde68a; }
.callout.warn .callout-icon, .callout.warn .callout-title { color: #92400e; }

.callout.danger { background: var(--danger-light); border-color: #fecaca; }
.callout.danger .callout-icon, .callout.danger .callout-title { color: #991b1b; }

/* --- 卡片网格 --- */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s;
}

.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.card .card-icon { font-size: 2rem; margin-bottom: .5rem; }
.card .card-title { font-size: 1rem; font-weight: 700; margin-bottom: .35rem; color: var(--text); }
.card .card-desc { font-size: .875rem; color: var(--text-light); line-height: 1.65; }

/* --- 对比框 --- */
.compare-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 1.5rem 0;
}

.compare-col {
    padding: 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.compare-col.left { background: #eff6ff; border-color: #bfdbfe; }
.compare-col.right { background: #fefce8; border-color: #fde68a; }

.compare-col h4 {
    margin-top: 0;
    margin-bottom: .75rem;
    font-size: .95rem;
    font-weight: 700;
}

.compare-col.left h4 { color: #1e40af; }
.compare-col.right h4 { color: #92400e; }

.compare-col ul { margin-bottom: 0; }

/* --- 表格 --- */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
    background: var(--bg);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow);
}

table th {
    background: var(--primary);
    color: #fff;
    font-weight: 600;
    padding: .75rem 1rem;
    text-align: left;
    white-space: nowrap;
}

table td {
    padding: .65rem 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text);
}

table tr:nth-child(even) td { background: var(--bg-soft); }
table tr:hover td { background: var(--primary-light); }

/* --- 时间线 --- */
.timeline { position: relative; padding-left: 2rem; margin: 2rem 0; }
.timeline::before {
    content: '';
    position: absolute;
    left: .5rem; top: 0; bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary), var(--primary-light));
}

.timeline-item { position: relative; margin-bottom: 1.75rem; }
.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.65rem; top: .35rem;
    width: 12px; height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 3px solid var(--bg);
    box-shadow: 0 0 0 2px var(--primary);
}

.timeline-item .timeline-year {
    font-size: .8rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: .2rem;
}

.timeline-item .timeline-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: .3rem;
}

.timeline-item .timeline-desc {
    font-size: .875rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* --- 图表占位 --- */
.chart-placeholder {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
}

.chart-placeholder .chart-title {
    font-size: .85rem;
    color: var(--text-light);
    margin-top: .5rem;
}

/* --- 内联代码 --- */
code {
    font-family: var(--font-mono);
    font-size: .85em;
    background: var(--border-light);
    padding: .15em .4em;
    border-radius: 4px;
    color: var(--primary-dark);
}

pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    overflow-x: auto;
    margin: 1.25rem 0;
    font-size: .85rem;
    line-height: 1.6;
}

pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* --- 图注 --- */
.figure {
    margin: 1.5rem 0;
    text-align: center;
}

.figure img, .figure svg {
    max-width: 100%;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

.figure figcaption {
    font-size: .82rem;
    color: var(--text-light);
    margin-top: .5rem;
}

/* --- 表注（表格下方的说明文字，与图注同款小字浅色） --- */
.table-caption {
    font-size: .82rem;
    color: var(--text-light);
    margin-top: .5rem;
    margin-bottom: 0;
    line-height: 1.6;
}

/* --- 章节导航 --- */
.chapter-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3.5rem;
    padding-top: 1.5rem;
    border-top: 2px solid var(--border-light);
    gap: 1rem;
}

.chapter-nav a {
    display: flex;
    flex-direction: column;
    padding: .75rem 1.25rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--bg);
    transition: all .2s;
    min-width: 120px;
}

.chapter-nav a:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.chapter-nav a.prev { text-align: left; }
.chapter-nav a.next { text-align: right; }
.chapter-nav a.toc { text-align: center; min-width: auto; }

.chapter-nav .nav-label {
    font-size: .72rem;
    color: var(--text-lighter);
    text-transform: uppercase;
    letter-spacing: .05em;
}

.chapter-nav .nav-title {
    font-size: .875rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: .15rem;
}

/* --- 首页特殊样式 --- */
.home-hero {
    text-align: center;
    padding: 4rem 2rem 3rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    margin-bottom: 3rem;
}

.home-hero h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: .5rem;
    letter-spacing: -.02em;
}

.home-hero .subtitle {
    font-size: 1.1rem;
    opacity: .9;
    margin-bottom: 1.5rem;
}

.home-hero .tags {
    display: flex;
    justify-content: center;
    gap: .75rem;
    flex-wrap: wrap;
}

.home-hero .tag {
    font-size: .8rem;
    padding: .3rem .8rem;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 20px;
}

.home-hero .intro {
    max-width: 600px;
    margin: 1.5rem auto 0;
    font-size: .95rem;
    opacity: .85;
    line-height: 1.8;
}

.parts-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.part-section h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: .5rem;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    gap: .5rem;
}

.part-section h2 .part-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px; height: 28px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    font-size: .85rem;
    font-weight: 700;
}

.chapter-card {
    display: flex;
    gap: 1rem;
    padding: 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: .75rem;
    transition: all .2s;
    text-decoration: none;
    color: inherit;
}

.chapter-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.chapter-card .ch-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-light);
    min-width: 3rem;
    text-align: right;
    line-height: 1;
}

.chapter-card:hover .ch-num { color: var(--primary); }

.chapter-card .ch-info h3 {
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: .2rem;
    color: var(--text);
}

.chapter-card .ch-info p {
    font-size: .85rem;
    color: var(--text-light);
    margin: 0;
}

/* --- 页脚 --- */
.site-footer {
    text-align: center;
    padding: 2rem;
    font-size: .8rem;
    color: var(--text-lighter);
    border-top: 1px solid var(--border-light);
    margin-top: 2rem;
}

/* --- 遮罩 --- */
.overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    z-index: 99;
}

.overlay.show { display: block; }

/* --- 响应式 --- */
@media (max-width: 900px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .mobile-header { display: flex; }
    .content { padding: 1.5rem 1.25rem 4rem; }
    .chapter-header h1 { font-size: 1.6rem; }
    .chapter-body h2 { font-size: 1.3rem; }
    .compare-box { grid-template-columns: 1fr; }
    .home-hero h1 { font-size: 1.8rem; }
    .home-hero { padding: 2.5rem 1.5rem 2rem; }
    .card-grid { grid-template-columns: 1fr; }
    .chapter-nav { flex-wrap: wrap; }
    .chapter-nav a { min-width: 100px; }
}

@media (max-width: 480px) {
    .content { padding: 1rem 1rem 3rem; }
    .chapter-header h1 { font-size: 1.4rem; }
    .chapter-body h2 { font-size: 1.15rem; }
    .chapter-body h3 { font-size: 1.05rem; }
    .home-hero h1 { font-size: 1.5rem; }
}

/* --- 封面页 --- */
.book-cover {
    position: relative;
    width: 100%;
    min-height: calc(100vh - 120px);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.cover-img {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: auto;
    object-fit: contain;
    z-index: 1;
    min-height: inherit;
}
.cover-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 3rem 2rem 4rem;
    background: linear-gradient(to top, rgba(255,255,255,.88) 0%, rgba(255,255,255,.45) 40%, transparent 70%);
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}
.cover-kicker {
    font-size: .85rem;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: .6rem;
}
.cover-title {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.25;
    color: #1f2937;
    margin-bottom: 1rem;
}
.cover-sub {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 2rem;
}
.cover-btn {
    display: inline-block;
    padding: .75rem 2.25rem;
    background: #4a7dff;
    color: #fff;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: transform .2s ease, box-shadow .2s ease;
}
.cover-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(74,125,255,.35);
}

@media (max-width: 768px) {
    .book-cover { min-height: calc(100vh - 56px); }
    .cover-title { font-size: 1.5rem; }
    .cover-sub { font-size: .92rem; }
    .cover-btn { padding: .6rem 1.75rem; font-size: .9rem; }
}

/* --- 打印 --- */
@media print {
    .sidebar, .mobile-header, .chapter-nav, .overlay { display: none !important; }
    .main-wrapper { margin: 0; }
    .content { max-width: 100%; padding: 0; }
    body { background: #fff; }
}

/* ============================================
   少年友好化组件（v2 · 依据初中生审读意见新增）
   ============================================ */

/* --- ① 章首"读前小抄"：术语前置，读到哪查到哪 --- */
.cheatsheet {
    margin: 0 0 2.5rem;
    padding: 1.25rem 1.5rem 1.35rem;
    background: linear-gradient(180deg, #fffdf5 0%, #fffaf0 100%);
    border: 1px solid #fde68a;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.cheatsheet-head {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: .35rem;
}

.cheatsheet-head .cs-icon { font-size: 1.15rem; line-height: 1; }

.cheatsheet-head .cs-title {
    font-size: .98rem;
    font-weight: 800;
    color: #92400e;
    letter-spacing: .01em;
}

.cheatsheet .cs-hint {
    font-size: .82rem;
    color: #a16207;
    margin-bottom: .9rem;
    line-height: 1.7;
}

.cheat-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: .55rem .9rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cheat-list li {
    margin: 0;
    padding: .5rem .7rem;
    background: rgba(255,255,255,.75);
    border: 1px solid #fef3c7;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    line-height: 1.65;
}

.cheat-list .ci-abbr {
    font-family: var(--font-mono);
    font-weight: 700;
    color: #b45309;
    font-size: .875rem;
}

.cheat-list .ci-cn {
    font-weight: 700;
    color: var(--text);
    margin-left: .35rem;
}

.cheat-list .ci-plain {
    display: block;
    color: var(--text-light);
    font-size: .84rem;
    margin-top: .1rem;
}

/* --- ② 打比方框：本书最核心的讲解装置 --- */
.metaphor {
    position: relative;
    margin: 1.5rem 0;
    padding: 1rem 1.25rem 1rem 1.25rem;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    border-left: 4px solid #8b5cf6;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.metaphor .mp-title {
    display: flex;
    align-items: center;
    gap: .45rem;
    font-size: .9rem;
    font-weight: 700;
    color: #6d28d9;
    margin-bottom: .35rem;
}

.metaphor .mp-body { font-size: .92rem; line-height: 1.8; color: var(--text); }
.metaphor .mp-body p { margin-bottom: .5rem; }
.metaphor .mp-body p:last-child { margin-bottom: 0; }
.metaphor .mp-body ul { margin: .4rem 0 0; }
.metaphor .mp-body li { margin-bottom: .3rem; }

/* --- ③ 行内"人话注"：缩写首次出现时的白话括注 --- */
.plain {
    color: var(--text-light);
    font-size: .93em;
}

.plain::before { content: "（"; }
.plain::after { content: "）"; }

/* 术语首现高亮：虚线下划，鼠标悬停看全称 */
abbr.term {
    text-decoration: none;
    border-bottom: 1px dashed var(--text-lighter);
    cursor: help;
    font-family: var(--font-mono);
    font-size: .92em;
    color: var(--primary-dark);
}

/* --- ④ 难度徽章：章首明示"这章要不要硬啃" --- */
.level-badge {
    display: inline-flex;
    align-items: center;
    gap: .3rem;
    font-size: .76rem;
    font-weight: 700;
    padding: .22rem .7rem;
    border-radius: 20px;
    margin-left: .5rem;
    vertical-align: middle;
}

.level-badge.easy { background: var(--success-light); color: #065f46; }
.level-badge.mid  { background: var(--primary-light); color: var(--primary-dark); }
.level-badge.hard { background: var(--danger-light); color: #991b1b; }

/* --- ⑤ 深读可选块：告诉少年读者"跳过不影响后文" --- */
.optional {
    position: relative;
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem .9rem;
    background: var(--bg-soft);
    border: 1px dashed #cbd5e1;
    border-radius: var(--radius-sm);
}

.optional::before {
    content: "深读可选 · 跳过不影响后文";
    position: absolute;
    top: -.62rem;
    left: 1rem;
    background: var(--bg);
    border: 1px solid #cbd5e1;
    border-radius: 20px;
    padding: 0 .6rem;
    font-size: .7rem;
    font-weight: 700;
    color: var(--text-light);
    letter-spacing: .02em;
}

.optional > :last-child { margin-bottom: 0; }

/* --- ⑥ 真实 / 前瞻 标签：区分已发生与预测 --- */
.fact-tag {
    display: inline-block;
    font-size: .68rem;
    font-weight: 700;
    line-height: 1.5;
    padding: .05rem .42rem;
    border-radius: 4px;
    margin-left: .25rem;
    vertical-align: .08em;
    white-space: nowrap;
}

.fact-tag.real     { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.fact-tag.forecast { background: var(--accent-light);  color: #92400e; border: 1px solid #fde68a; }

/* --- ⑦ 名词速查网格：治"名字动物园" --- */
.quickref {
    margin: 1.5rem 0;
    padding: 1.1rem 1.25rem 1.25rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.quickref .qr-head {
    font-size: .92rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: .2rem;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.quickref .qr-hint {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: .85rem;
}

.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: .6rem .9rem;
}

.qr-item {
    padding: .55rem .75rem;
    background: var(--bg-soft);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--primary);
    font-size: .86rem;
    line-height: 1.65;
}

.qr-item .qr-name { font-weight: 700; color: var(--text); }
.qr-item .qr-desc { color: var(--text-light); display: block; font-size: .84rem; }

.qr-item.accent { border-left-color: var(--accent); }
.qr-item.success { border-left-color: var(--success); }
.qr-item.info { border-left-color: var(--info); }

/* --- ⑧ 图谱：SVG 示意图容器 --- */
.figure svg { background: var(--bg); display: block; margin: 0 auto; }

.figure.plain-figure svg { box-shadow: none; border: 1px solid var(--border); }

/* --- ⑨ 响应式补充 --- */
@media (max-width: 900px) {
    .cheat-list { grid-template-columns: 1fr; }
    .qr-grid { grid-template-columns: 1fr; }
    .cheatsheet { padding: 1rem 1.1rem 1.15rem; }
}

@media print {
    .cheatsheet, .metaphor, .quickref, .optional { break-inside: avoid; }
}
