/* ============================================
   Font: Microsoft YaHei
   Colors: #343a40 (primary), #6c757d (secondary)
   ============================================ */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Microsoft YaHei", 微软雅黑, 宋体, STXihei, 华文细黑, Arial, sans-serif;
    color: #343a40;
    background: #ffffff;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ============================================
   ARCHIVE (HOMEPAGE)
   ============================================ */

.archive-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 20px;
}

.archive-header h1 {
    font-size: 29.75px;
    font-weight: 500;
    margin-bottom: 8px;
}

.archive-header .tagline {
    font-size: 14px;
    color: #6c757d;
    margin-bottom: 40px;
}

/* Category Navigation */
.category-nav {
    margin-bottom: 40px;
    display: flex;
    gap: 8px;
}

.nav-item {
    display: inline-block;
    padding: 6px 7px;
    font-size: 14px;
    color: #6c757d;
    background: transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.nav-item:hover {
    background: #e9ecef;
    color: #343a40;
}

.nav-item.active {
    background: #e9ecef;
    color: #343a40;
}

/* Writing List */
.archive-list {
    list-style: none;
}

.archive-item {
    margin-bottom: 40px;
    cursor: pointer;
}

.archive-item:hover .archive-title {
    text-decoration: underline;
}

.archive-title {
    font-size: 30.09px;
    font-weight: 400;
    margin-bottom: 8px;
    display: inline;
}

.archive-date {
    display: inline;
    font-size: 14px;
    color: #6c757d;
    margin-left: 12px;
}

.archive-desc {
    font-size: 14px;
    color: #6c757d;
    margin-top: 8px;
    line-height: 1.7;
}

/* ============================================
   READER (GITBOOK STYLE)
   ============================================ */

.reader-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.book-summary {
    width: 300px;
    min-width: 300px;
    background: #fafafa;
    border-right: 1px solid #e8e8e8;
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
}

.book-summary .logo {
    font-size: 16px;
    font-weight: 500;
    color: #343a40;
    text-decoration: none;
    display: block;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e8e8e8;
}

.book-summary .logo:hover {
    color: #007bff;
}

.book-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.book-meta {
    font-size: 12px;
    color: #6c757d;
    margin-bottom: 20px;
}

.chapter-list {
    list-style: none;
}

.chapter-item {
    padding: 8px 0;
    font-size: 13px;
    color: #6c757d;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.15s;
}

.chapter-item:hover {
    color: #343a40;
}

.chapter-item.active {
    color: #007bff;
    font-weight: 500;
}

/* Main Content */
.book-body {
    margin-left: 300px;
    flex: 1;
    padding: 40px 80px;
    max-width: 900px;
}

.book-body h1 {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 30px;
    text-align: center;
}

.book-body h2 {
    font-size: 20px;
    font-weight: 500;
    margin: 30px 0 15px;
}

.book-body p {
    font-size: 16px;
    line-height: 1.8;
    margin-bottom: 20px;
    text-align: justify;
}

.book-body hr {
    border: none;
    border-top: 1px solid #e8e8e8;
    margin: 30px 0;
}

/* Navigation Arrows */
.navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #e8e8e8;
}

.nav-arrow {
    font-size: 14px;
    color: #6c757d;
    text-decoration: none;
    padding: 10px 20px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: #f8f9fa;
    color: #343a40;
}

.nav-arrow.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* Back to home link */
.back-home {
    display: block;
    margin-bottom: 20px;
    font-size: 14px;
    color: #6c757d;
    text-decoration: none;
}

.back-home:hover {
    color: #343a40;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .book-summary {
        display: none;
    }

    .book-body {
        margin-left: 0;
        padding: 20px;
    }

    .archive-container {
        padding: 30px 20px;
    }

    .archive-title {
        font-size: 22px;
    }

    .book-body h1 {
        font-size: 24px;
    }
}