/* =============================================
   《人生复利》— Notion 风格排版
   参考 Notion 的设计语言：
   大字体、宽行距、充分留白、极简装饰
   所有字号使用 px + !important 防止被覆盖
   ============================================= */

/* === 全局变量 === */
:root {
    --content-max-width: 900px;
    --sidebar-width: 300px;
}

/* ============================================
   封面书名 — 高级质感
   ============================================ */
.book-cover {
    text-align: center;
    padding: 60px 0 40px;
    margin-bottom: 10px;
}

.book-cover .book-title {
    font-size: 52px !important;
    font-weight: 700 !important;
    letter-spacing: 0.15em !important;
    color: #1a1a1a !important;
    font-family: "Noto Serif SC", "Source Han Serif SC", "SimSun", "Songti SC", Georgia, "Times New Roman", serif !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.4 !important;
    border-bottom: none !important;
}

.book-cover .book-subtitle {
    font-size: 18px !important;
    font-weight: 400 !important;
    color: #9b9a97 !important;
    letter-spacing: 0.12em;
    margin-top: 12px !important;
    margin-bottom: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif !important;
}

.book-cover .book-author {
    font-size: 17px !important;
    font-weight: 400 !important;
    color: #666 !important;
    letter-spacing: 0.18em;
    margin-top: 24px !important;
    margin-bottom: 0 !important;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif !important;
}

/* 暗色主题封面 */
.navy .book-cover .book-title,
.coal .book-cover .book-title,
.ayu .book-cover .book-title {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navy .book-cover .book-author,
.coal .book-cover .book-author,
.ayu .book-cover .book-author {
    color: rgba(255, 255, 255, 0.5) !important;
}

.navy .book-cover .book-subtitle,
.coal .book-cover .book-subtitle,
.ayu .book-cover .book-subtitle {
    color: rgba(255, 255, 255, 0.4) !important;
}

html {
    font-size: 22px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === 正文：衬线字体 + 书籍质感 === */
.content {
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif !important;
    font-size: 20px !important;
    line-height: 1.9 !important;
    letter-spacing: 0.04em;
    color: #2c2c2c !important;
    padding: 0 2rem;
}

.content main {
    padding-top: 10px;
    padding-bottom: 80px;
}

.content p {
    font-size: 20px !important;
    line-height: 1.9 !important;
    margin-bottom: 22px;
}

/* === H1 — 衬线大标题 === */
.content h1 {
    font-size: 36px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    border-bottom: none !important;
    margin-top: 48px;
    margin-bottom: 24px;
    padding-bottom: 0;
    padding-top: 12px;
    letter-spacing: 0.06em;
    line-height: 1.35;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif !important;
}

/* === H2 — 衬线二级标题 === */
.content h2 {
    font-size: 30px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin-top: 42px;
    margin-bottom: 18px;
    padding-bottom: 0;
    border-bottom: none !important;
    line-height: 1.35;
    letter-spacing: 0.04em;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif !important;
}

/* === H3 — 衬线三级标题 === */
.content h3 {
    font-size: 25px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    margin-top: 34px;
    margin-bottom: 14px;
    line-height: 1.4;
    letter-spacing: 0.03em;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif !important;
}

/* === 引用块 — 左边线 + 斜体衬线 === */
.content blockquote {
    border-left: 3px solid #2c2c2c;
    background: transparent !important;
    padding: 2px 0 2px 22px;
    margin: 24px 0;
    border-radius: 0;
    font-size: 19px !important;
    color: #555 !important;
    line-height: 1.9 !important;
    font-style: italic;
}

.content blockquote p {
    font-size: 19px !important;
    margin-bottom: 12px;
    color: #555 !important;
}

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

/* === 分隔线 — Notion 极简 === */
.content hr {
    border: none !important;
    height: 1px;
    background-color: #e9e9e7;
    margin: 36px 0;
}

/* === 列表 — Notion 风格 === */
.content ul, .content ol {
    padding-left: 28px;
    margin-bottom: 20px;
    font-size: 20px !important;
}

.content li {
    font-size: 20px !important;
    margin-bottom: 7px;
    line-height: 1.9 !important;
    color: #2c2c2c !important;
}

/* === Checkbox — Notion 待办清单 === */
.content input[type="checkbox"] {
    margin-right: 10px;
    width: 16px;
    height: 16px;
    accent-color: #2eaadc;
    vertical-align: middle;
    cursor: pointer;
}

/* === 加粗 === */
.content strong {
    color: #1a1a1a !important;
    font-weight: 700;
}

/* === 斜体 === */
.content em {
    color: #2c2c2c;
}

/* === 行内代码 — Notion 红色小块 === */
.content code {
    background: rgba(135, 131, 120, 0.15);
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 18px !important;
    color: #eb5757;
    font-family: "SFMono-Regular", Menlo, Consolas, "PT Mono", "Liberation Mono", Courier, monospace;
}

/* === 链接 — 低调下划线 === */
.content a {
    color: #2c2c2c !important;
    text-decoration: underline;
    text-decoration-color: rgba(44, 44, 44, 0.35);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.15s ease;
}

.content a:hover {
    text-decoration-color: #2c2c2c;
}

/* === 表格 — Notion 简洁表格 === */
.content table {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0;
    font-size: 19px !important;
}

.content table th {
    background: transparent;
    font-weight: 600;
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid #e9e9e7;
    color: #9b9a97;
    font-size: 17px !important;
}

.content table td {
    padding: 10px 14px;
    border-bottom: 1px solid #f1f1ef;
    color: #37352f !important;
    font-size: 19px !important;
}

/* === 侧边栏 — 衬线质感 === */
.sidebar {
    font-size: 15px !important;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", Georgia, serif !important;
}

.sidebar .sidebar-scrollbox {
    padding: 16px 12px;
    font-size: 15px !important;
}

.sidebar .chapter li {
    margin-bottom: 2px;
    line-height: 1.55;
}

.sidebar .chapter li a {
    font-size: 15px !important;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.15s ease;
    display: block;
    color: #3d3d3d !important;
    letter-spacing: 0.03em;
    font-weight: 500;
}

.sidebar .chapter li a:hover {
    background-color: rgba(44, 44, 44, 0.05);
    color: #1a1a1a !important;
}

.sidebar .chapter li.active a,
.sidebar .chapter li a.active {
    color: #1a1a1a !important;
    font-weight: 700;
    background-color: rgba(44, 44, 44, 0.06);
}

/* 侧边栏章节分组标题 — 小号无衬线，与正文形成对比 */
.sidebar .chapter li.part-title {
    font-size: 12px !important;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #666 !important;
    margin-top: 24px;
    margin-bottom: 6px;
    padding-left: 10px;
    text-transform: none;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", sans-serif !important;
}

/* === 导航箭头 === */
.nav-chapters {
    opacity: 0.3;
    transition: opacity 0.15s ease;
}

.nav-chapters:hover {
    opacity: 0.8;
}

/* === 顶部菜单栏 === */
.menu-bar {
    font-size: 15px !important;
}

.menu-bar .menu-title {
    font-size: 18px !important;
    font-weight: 600 !important;
    letter-spacing: 0.1em !important;
    font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif !important;
    color: #1a1a1a !important;
}

/* ============================================
   Light 主题 — Notion 默认白底
   ============================================ */
.light .content,
.rust .content {
    color: #2c2c2c !important;
}

.light .sidebar,
.rust .sidebar {
    background: #fbfbfa;
    border-right: 1px solid #f1f1ef;
}

/* ============================================
   Navy / Coal 暗色主题适配
   ============================================ */
.navy .content,
.coal .content,
.ayu .content {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navy .content h1, .navy .content h2, .navy .content h3,
.coal .content h1, .coal .content h2, .coal .content h3,
.ayu .content h1, .ayu .content h2, .ayu .content h3 {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navy .content p, .coal .content p, .ayu .content p,
.navy .content li, .coal .content li, .ayu .content li {
    color: rgba(255, 255, 255, 0.9) !important;
}

.navy .content strong, .coal .content strong, .ayu .content strong {
    color: rgba(255, 255, 255, 0.95) !important;
}

.navy .content blockquote, .coal .content blockquote, .ayu .content blockquote {
    border-left-color: rgba(255, 255, 255, 0.4);
    color: rgba(255, 255, 255, 0.8) !important;
}

.navy .content hr, .coal .content hr, .ayu .content hr {
    background-color: rgba(255, 255, 255, 0.1);
}

.navy .content a, .coal .content a, .ayu .content a {
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration-color: rgba(255, 255, 255, 0.3);
}

.navy .content a:hover, .coal .content a:hover, .ayu .content a:hover {
    text-decoration-color: rgba(255, 255, 255, 0.7);
}

.navy .content table th, .coal .content table th, .ayu .content table th {
    color: rgba(255, 255, 255, 0.5);
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

.navy .content table td, .coal .content table td, .ayu .content table td {
    border-bottom-color: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85) !important;
}

.navy .sidebar .chapter li a, .coal .sidebar .chapter li a {
    color: rgba(255, 255, 255, 0.5);
}

.navy .sidebar .chapter li a:hover, .coal .sidebar .chapter li a:hover {
    color: rgba(255, 255, 255, 0.9);
    background-color: rgba(255, 255, 255, 0.06);
}

.navy .sidebar .chapter li.active a, .coal .sidebar .chapter li.active a,
.navy .sidebar .chapter li a.active, .coal .sidebar .chapter li a.active {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 700;
}

.navy .sidebar .chapter li.part-title, .coal .sidebar .chapter li.part-title {
    color: rgba(255, 255, 255, 0.3);
}

.navy .menu-bar .menu-title, .coal .menu-bar .menu-title, .ayu .menu-bar .menu-title {
    color: rgba(255, 255, 255, 0.9) !important;
}

/* ============================================
   移动端适配
   ============================================ */
@media (max-width: 768px) {
    html {
        font-size: 20px !important;
    }
    .content {
        font-size: 18px !important;
        padding: 0 16px;
    }
    .content p,
    .content li,
    .content blockquote,
    .content blockquote p {
        font-size: 18px !important;
    }
    .content h1 {
        font-size: 30px !important;
    }
    .content h2 {
        font-size: 26px !important;
    }
    .content h3 {
        font-size: 22px !important;
    }
}

/* ============================================
   打印优化
   ============================================ */
@media print {
    .content, .content p, .content li {
        font-size: 12pt !important;
        line-height: 1.7;
        color: #000 !important;
    }
    .content a {
        color: #000 !important;
    }
}
