* { margin: 0; padding: 0; box-sizing: border-box; }
 
body {
    font-family: "Noto Serif SC", "STSong", "SimSun", serif;
    background-color: #faf8f5;
    color: #3a3a3a;
    line-height: 1.8;
    min-height: 100vh;
}
 
.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
 
header { text-align: center; margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #e0dcd5; }
header h1 { font-size: 1.7rem; font-weight: 600; color: #2c2c2c; letter-spacing: 2px; text-align: center; }
.subtitle { margin-top: 8px; font-size: 0.9rem; color: #999; }

.header-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 16px; text-align: left; flex-wrap: wrap; }
.back-btn { display: inline-block; font-size: 0.9rem; color: #8b6f4e; text-decoration: none; white-space: nowrap; }
.back-btn:hover { color: #5a3e28; }
.header-catalog { display: inline-block; font-size: 0.9rem; color: #8b6f4e; text-decoration: none; padding: 4px 16px; border: 1px solid #d5cfc6; border-radius: 6px; background: #fff; white-space: nowrap; }
.header-catalog:hover { background: #8b6f4e; color: #fff; border-color: #8b6f4e; }

.font-size-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.font-btn {
    min-width: 36px; height: 34px; padding: 0 10px;
    border: 1px solid #d5cfc6; border-radius: 6px; background: #fff; color: #5a3e28;
    font-size: 0.85rem; cursor: pointer;
}
.font-btn:active { background: #8b6f4e; color: #fff; }
.font-size-label { font-size: 0.8rem; color: #999; min-width: 40px; text-align: center; }
 
#file-list, #chapter-list { flex: 1; }
.file-item {
    display: block; padding: 16px 22px; margin-bottom: 12px; background: #fff;
    border: 1px solid #e8e4de; border-radius: 8px; text-decoration: none; color: #3a3a3a;
    font-size: 1.05rem;
}
.file-item:hover { border-color: #8b6f4e; }
.file-icon { margin-right: 8px; }
.has-audio { font-size: 0.75rem; color: #8b6f4e; background: #f5f0ea; padding: 2px 8px; border-radius: 10px; margin-left: 10px; }
.chapter-count { font-size: 0.75rem; color: #999; margin-left: 10px; }
 
.chapter-nav { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 18px; padding: 6px 0; }
.chapter-nav a { color: #8b6f4e; text-decoration: none; font-size: 0.9rem; padding: 6px 16px; border: 1px solid #e0dcd5; border-radius: 6px; white-space: nowrap; }
.chapter-nav a:hover { background: #8b6f4e; color: #fff; border-color: #8b6f4e; }
.chapter-nav .nav-catalog { font-weight: 600; }
.chapter-nav .nav-catalog:hover { background: #8b6f4e; color: #fff; border-color: #8b6f4e; }
.chapter-nav .nav-placeholder { flex: 1; }

.search-box { margin-bottom: 20px; }
.search-box input {
    width: 100%; padding: 12px 18px; font-size: 1rem;
    border: 1px solid #d5cfc6; border-radius: 8px; background: #fff;
    color: #3a3a3a; outline: none; font-family: inherit;
}
.search-box input:focus { border-color: #8b6f4e; box-shadow: 0 0 0 2px rgba(139,111,78,0.1); }
.search-box input::placeholder { color: #bbb; }

.search-result-group { margin-bottom: 16px; }
.search-group-title { font-size: 0.85rem; color: #8b6f4e; margin-bottom: 8px; padding-left: 4px; font-weight: 600; }
.search-no-result { text-align: center; color: #999; padding: 30px 0; font-size: 0.95rem; }

.bottom-nav {
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; margin-top: 24px; padding: 14px 10px;
    background: #fff; border: 1px solid #e8e4de; border-radius: 8px;
    position: sticky; bottom: 10px;
}
.bottom-nav-btn {
    flex: 1; text-align: center; padding: 10px 6px;
    color: #8b6f4e; text-decoration: none; font-size: 0.88rem;
    border: 1px solid #e0dcd5; border-radius: 6px; background: #faf8f5;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.bottom-nav-btn:hover { background: #8b6f4e; color: #fff; border-color: #8b6f4e; }
.bottom-nav-btn.disabled { color: #ccc; pointer-events: none; border-color: #eee; background: #f5f5f5; }

.pagination {
    display: flex; justify-content: center; align-items: center; flex-wrap: wrap;
    gap: 10px; margin-top: 24px; padding: 14px 10px;
    background: #fff; border: 1px solid #e8e4de; border-radius: 8px;
}
.page-btn {
    padding: 6px 14px; font-size: 0.88rem; color: #8b6f4e;
    text-decoration: none; border: 1px solid #e0dcd5; border-radius: 6px; background: #faf8f5;
}
.page-btn:hover { background: #8b6f4e; color: #fff; border-color: #8b6f4e; }
.page-btn.disabled { color: #ccc; border-color: #eee; background: #f5f5f5; pointer-events: none; }
.page-info { font-size: 0.85rem; color: #999; }
.page-size { font-size: 0.85rem; color: #999; display: flex; align-items: center; gap: 4px; }
.page-size-link { color: #8b6f4e; text-decoration: none; padding: 2px 6px; border-radius: 4px; }
.page-size-link:hover { background: #f5f0ea; }
.page-size-active { color: #5a3e28; font-weight: 600; padding: 2px 6px; }
.page-size-sep { color: #ddd; }
 
.audio-box { background: #fff; border: 1px solid #e8e4de; border-radius: 8px; padding: 14px 18px; margin-bottom: 24px; text-align: center; }
.audio-box audio { width: 100%; max-width: 500px; }
 
#content-container { flex: 1; }
.text-content {
    background: #fff; border: 1px solid #e8e4de; border-radius: 8px; padding: 26px;
    font-size: 18px; line-height: 2; letter-spacing: 0.5px;
    text-align: left;
}
.text-para {
    text-indent: 2em;
    margin-bottom: 0.8em;
}
.text-para:last-child { margin-bottom: 0; }
 
footer { margin-top: 50px; padding-top: 20px; border-top: 1px solid #e0dcd5; text-align: center; font-size: 0.8rem; color: #aaa; }
.loading { text-align: center; color: #999; padding: 40px 0; }
.error { text-align: center; color: #c0392b; padding: 30px 0; }
 
@media (max-width: 600px) {
    .container { padding: 16px 12px; }
    header { margin-bottom: 20px; padding-bottom: 14px; }
    header h1 { font-size: 1.25rem; letter-spacing: 1px; }

    /* 顶部按钮区：两行布局 */
    .header-top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 12px;
    }
    .header-top .back-btn,
    .header-top .header-catalog {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    .header-nav {
        flex-wrap: wrap;
        gap: 8px;
    }
    .header-nav .back-btn {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    .font-size-controls {
        justify-content: center;
        gap: 6px;
    }
    .font-btn {
        min-width: 32px;
        height: 30px;
        padding: 0 8px;
        font-size: 0.8rem;
    }
    .font-size-label {
        font-size: 0.75rem;
        min-width: 36px;
    }

    /* 章节导航：三按钮等宽 */
    .chapter-nav {
        gap: 6px;
        margin-bottom: 14px;
        padding: 4px 0;
    }
    .chapter-nav a {
        flex: 1;
        text-align: center;
        font-size: 0.82rem;
        padding: 8px 6px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* 底部导航：四按钮等宽，缩小文字 */
    .bottom-nav {
        gap: 6px;
        padding: 10px 8px;
        bottom: 8px;
    }
    .bottom-nav-btn {
        font-size: 0.78rem;
        padding: 8px 4px;
    }

    /* 文件列表项：减小padding */
    .file-item {
        padding: 12px 14px;
        font-size: 0.95rem;
        margin-bottom: 8px;
    }
    .has-audio, .chapter-count {
        font-size: 0.7rem;
        padding: 1px 6px;
        margin-left: 6px;
    }

    /* 正文：减小padding和字体 */
    .text-content {
        padding: 16px 14px;
        font-size: 16px;
        line-height: 1.9;
    }

    /* 音频框 */
    .audio-box {
        padding: 10px 12px;
        margin-bottom: 16px;
    }

    /* 目录页布局：移动端隐藏侧边栏 */
    .chapter-layout {
        flex-direction: column;
        gap: 16px;
    }
    .chapter-sidebar {
        display: none !important;
    }

    /* 分页控件 */
    .pagination {
        gap: 6px;
        padding: 10px 8px;
        margin-top: 16px;
    }
    .page-btn {
        padding: 5px 10px;
        font-size: 0.8rem;
    }
    .page-info, .page-size {
        font-size: 0.78rem;
    }

    /* 搜索框 */
    .search-box input {
        padding: 10px 14px;
        font-size: 0.95rem;
    }

    /* 页脚 */
    footer {
        margin-top: 30px;
        padding-top: 14px;
        font-size: 0.72rem;
    }
}

/* ===== 顶部导航按钮组 ===== */
.header-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.header-nav .back-btn { margin: 0; }

/* ===== 面包屑地址栏 ===== */
.breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 0.85rem; color: #8b6f4e; margin: 10px 0; padding: 8px 14px; background: #f8f6f2; border-radius: 6px; border: 1px solid #e8e4dc; }
.breadcrumb a { color: #8b6f4e; text-decoration: none; }
.breadcrumb a:hover { color: #5a3e28; text-decoration: underline; }
.breadcrumb .separator { color: #c0b8a8; }
.breadcrumb .current { color: #5a3e28; font-weight: 500; }

/* ===== 目录页布局（侧边栏+主内容） ===== */
.chapter-layout { display: flex; gap: 24px; align-items: flex-start; }
.chapter-sidebar {
    width: 220px; flex-shrink: 0;
    background: #fff; border: 1px solid #e8e4de; border-radius: 8px;
    padding: 16px; position: sticky; top: 16px;
}
.chapter-main { flex: 1; min-width: 0; }

/* ===== 侧边栏样式 ===== */
.sidebar-title {
    font-size: 0.95rem; font-weight: 600; color: #5a3e28;
    padding-bottom: 10px; margin-bottom: 10px;
    border-bottom: 1px solid #e8e4de;
}
.sidebar-list { display: flex; flex-direction: column; gap: 4px; }
.sidebar-item {
    display: block; padding: 8px 10px; font-size: 0.88rem;
    color: #666; text-decoration: none; border-radius: 5px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-item:hover { background: #f5f0e8; color: #5a3e28; }
.sidebar-item.active { background: #8b6f4e; color: #fff; font-weight: 500; }

/* 备案号（低调样式） */
.beian {
    font-size: 10px;
    color: #ccc;
    margin-top: 6px;
    line-height: 1.4;
}
.beian a {
    color: #ccc;
    text-decoration: none;
}
.beian a:hover {
    color: #999;
    text-decoration: underline;
}

/* ===== 在线反馈区域样式 ===== */
.feedback-section {
    margin-top: 40px;
    padding: 25px;
    background: #fdf8f0;
    border: 1px solid #e0d5c1;
    border-radius: 12px;
}

.feedback-title {
    color: #6b4423;
    font-size: 20px;
    margin-bottom: 8px;
    text-align: center;
}

.feedback-hint {
    color: #8b7355;
    font-size: 13px;
    text-align: center;
    margin-bottom: 20px;
}

.feedback-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 15px;
}

.form-input,
.form-textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d4c4a8;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    background: #fff;
    color: #3a2a1a;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: #6b4423;
    box-shadow: 0 0 0 3px rgba(107, 68, 35, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-submit {
    padding: 12px 30px;
    background: #6b4423;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-submit:hover {
    background: #5a3a1a;
}

.btn-submit:disabled {
    background: #a09080;
    cursor: not-allowed;
}

.feedback-status {
    font-size: 14px;
    color: #6b4423;
}

/* 移动端反馈区域适配 */
@media (max-width: 600px) {
    .feedback-section {
        padding: 20px 15px;
        margin-top: 25px;
    }

    .feedback-title {
        font-size: 18px;
    }

    .form-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-submit {
        width: 100%;
    }

    .feedback-status {
        text-align: center;
    }
}
