@charset "UTF-8";
/* === 100问 Base Styles === */
:root {
    --primary: #1a73e8;
    --text: #1a1a1a;
    --text-light: #555;
    --bg: #fff;
    --bg-light: #f8f9fa;
    --border: #e8e8e8;
    --radius: 8px;
    --max-width: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: var(--text);
    background: var(--bg);
}

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* === Header === */
.site-header {
    border-bottom: 1px solid var(--border);
    padding: 16px 0;
}

.site-header nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
}

.logo {
    font-size: 18px;
    font-weight: 600;
    text-decoration: none;
    color: var(--text);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 24px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-light);
    font-size: 14px;
}

.nav-links a:hover { color: var(--primary); }

/* === Homepage === */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero h1 {
    font-size: 2.4em;
    margin-bottom: 12px;
}

.tagline {
    font-size: 1.3em;
    color: var(--primary);
    margin-bottom: 16px;
}

.desc {
    color: var(--text-light);
    margin-bottom: 32px;
}

.cta-button {
    display: inline-block;
    padding: 12px 32px;
    background: var(--primary);
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 500;
}

.cta-button:hover { opacity: 0.9; }

.highlights { padding: 40px 0 80px; }
.highlights h2 { text-align: center; margin-bottom: 32px; }

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.card {
    padding: 24px;
    background: var(--bg-light);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.card h3 { margin-bottom: 8px; font-size: 1.1em; }
.card p { color: var(--text-light); font-size: 14px; }

/* === TOC Page === */
.toc-page { padding: 40px 0 80px; }
.toc-page h1 { margin-bottom: 8px; }
.subtitle { color: var(--primary); margin-bottom: 4px; }
.intro { color: var(--text-light); margin-bottom: 40px; }

.chapter-title {
    margin-top: 40px;
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.chapter-desc {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 12px;
}

.question-list {
    padding-left: 24px;
    margin-bottom: 20px;
}

.question-list li {
    margin-bottom: 6px;
}

.question-list a {
    text-decoration: none;
    color: var(--text);
}

.question-list a:hover {
    color: var(--primary);
}

/* === Question Page === */
.question-page { padding: 32px 0 80px; }

.breadcrumb {
    font-size: 13px;
    color: var(--text-light);
    margin-bottom: 24px;
}

.breadcrumb a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumb a:hover { color: var(--primary); }

.question-page h1 {
    font-size: 1.8em;
    margin-bottom: 16px;
    line-height: 1.4;
}

.meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 32px;
    font-size: 13px;
    color: var(--text-light);
}

.chapter-badge {
    background: var(--bg-light);
    padding: 2px 10px;
    border-radius: 4px;
}

.content {
    margin-bottom: 48px;
}

.content h2 {
    margin-top: 36px;
    margin-bottom: 12px;
    font-size: 1.3em;
}

.content h3 {
    margin-top: 24px;
    margin-bottom: 8px;
}

.content p {
    margin-bottom: 16px;
}

.content ul, .content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.content li { margin-bottom: 6px; }

.content blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 16px;
    color: var(--text-light);
    margin: 20px 0;
}

.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 14px;
}

.content th, .content td {
    border: 1px solid var(--border);
    padding: 10px 12px;
    text-align: left;
}

.content th { background: var(--bg-light); }

/* === Navigation === */
.question-nav {
    display: flex;
    justify-content: space-between;
    padding: 20px 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
}

.question-nav a {
    text-decoration: none;
    color: var(--primary);
    font-size: 14px;
}

.series-note {
    font-size: 13px;
    color: var(--text-light);
    text-align: center;
}

.series-note a { color: var(--primary); }

/* === Footer === */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    text-align: center;
    font-size: 13px;
    color: var(--text-light);
}

.site-footer .footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 16px;
    margin-bottom: 10px;
}

.site-footer .footer-links a {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
}

.site-footer .footer-links a:hover { color: var(--primary); }

.site-footer .visit-stats {
    margin-bottom: 6px;
}

/* === Book Layout（左侧书目录） === */
.book-layout {
    display: flex;
    gap: 32px;
    align-items: flex-start;
}

.book-sidebar {
    width: 280px;
    flex-shrink: 0;
    position: sticky;
    top: 84px;
    max-height: calc(100vh - 104px);
    overflow-y: auto;
    border-right: 1px solid var(--border);
    padding-right: 16px;
    background: var(--bg);
}

/* 移动端隐藏的控件，桌面默认不显示 */
.sidebar-toggle,
.sidebar-overlay,
.sidebar-close { display: none; }

.question-page {
    flex: 1;
    min-width: 0;
}

.sidebar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px 12px;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 1;
}

.sidebar-title { font-weight: 600; font-size: 15px; }

.sidebar-close {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--text-light);
}

.book-toc { font-size: 14px; }

.toc-chapter { margin-bottom: 4px; }

.toc-chapter-title {
    cursor: pointer;
    list-style: none;
    user-select: none;
    padding: 8px 4px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 6px;
}

.toc-chapter-title::-webkit-details-marker { display: none; }
.toc-chapter-title::before {
    content: "▸";
    font-size: 11px;
    color: var(--text-light);
    transition: transform .2s;
}

.toc-chapter[open] > .toc-chapter-title::before { transform: rotate(90deg); }

.toc-questions {
    list-style: none;
    padding: 0 0 8px 14px;
    margin: 0;
}

.toc-questions li { margin-bottom: 2px; }

.toc-questions a {
    display: block;
    padding: 5px 8px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--text-light);
    font-size: 13.5px;
    line-height: 1.5;
}

.toc-questions a:hover {
    background: var(--bg-light);
    color: var(--primary);
}

.toc-questions li.active a {
    background: var(--primary);
    color: #fff;
    font-weight: 500;
}

.toc-questions li.active a:hover { color: #fff; }

/* 移动端：左侧目录收成抽屉 */
@media (max-width: 991px) {
    .book-layout { display: block; }

    .book-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 84%;
        max-width: 320px;
        transform: translateX(-100%);
        transition: transform .25s ease;
        z-index: 1100;
        border-right: 1px solid var(--border);
        padding: 16px;
        box-shadow: 2px 0 12px rgba(0,0,0,.15);
        max-height: 100vh;
    }

    .book-sidebar.open { transform: translateX(0); }

    .sidebar-close { display: block; }

    .sidebar-toggle {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: fixed;
        left: 14px;
        bottom: 76px;
        z-index: 1050;
        background: var(--primary);
        color: #fff;
        border: none;
        border-radius: 22px;
        padding: 10px 16px;
        font-size: 14px;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0,0,0,.2);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.4);
        z-index: 1090;
    }

    .sidebar-overlay.show { display: block; }
}

/* === Mobile === */
@media (max-width: 640px) {
    .hero h1 { font-size: 1.8em; }
    .question-page h1 { font-size: 1.4em; }
    .cards { grid-template-columns: 1fr; }
    .question-nav { flex-direction: column; gap: 12px; }
}

/* === 返回顶部 & 关注二维码（浮动） === */
.back-to-top {
    position: fixed;
    right: calc((100vw - 1200px) / 2 - 54px);
    bottom: 20px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 44px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}
.back-to-top.show { opacity: 1; }
.back-to-top:hover { background: #1557b0; }

.qrcode-float {
    position: fixed;
    right: calc((100vw - 1200px) / 2 - 110px);
    bottom: 20px;
    margin-bottom: 54px;
    width: 100px;
    text-align: center;
    z-index: 1000;
}
.qrcode-float img {
    width: 90px;
    height: 90px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.qrcode-float .qr-label {
    font-size: 12px;
    color: #666;
    margin-top: 6px;
}

/* 窄屏：浮动元素贴边显示，避免算出负值跑出屏幕 */
@media (max-width: 1200px) {
    .back-to-top { right: 14px; }
    .qrcode-float { right: 8px; }
}
