/* ===== 严论书阁 · 主样式 ===== */
:root {
    --bg: #F9F7F4;
    --card-bg: #FFFFFF;
    --primary: #5C4B37;
    --accent: #C45C4C;
    --text: #2C241A;
    --text-secondary: #6B5A48;
    --shadow: 0 4px 16px rgba(92, 75, 55, 0.06);
    --radius: 16px;
}

* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: 'Inter', -apple-system, 'Noto Serif SC', serif;
    background: var(--bg);
    color: var(--text);
    padding-bottom: 20px;
    -webkit-font-smoothing: antialiased;
}

/* ===== App 容器 ===== */
.app {
    max-width: 600px;
    margin: 0 auto;
    padding: 0 16px 20px;
}

/* ===== 顶部导航 ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0 12px;
    position: sticky;
    top: 0;
    background: var(--bg);
    z-index: 10;
}
.app-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary);
    font-family: 'Noto Serif SC', serif;
}
.app-header h1 i {
    color: var(--accent);
    margin-right: 6px;
}
.header-actions {
    display: flex;
    gap: 14px;
    font-size: 1.2rem;
    color: var(--text-secondary);
}
.header-actions a { color: var(--text-secondary); }

/* ===== 分类快捷入口 ===== */
.category-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 0 14px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.category-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    padding: 6px 16px;
    border-radius: 30px;
    background: white;
    font-size: 0.8rem;
    white-space: nowrap;
    color: var(--text-secondary);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow);
    text-decoration: none;
    flex-shrink: 0;
}

/* ===== Banner ===== */
.banner-carousel {
    border-radius: var(--radius);
    height: 140px;
    background: linear-gradient(135deg, #5C4B37, #8B7355);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

/* ===== 区块 ===== */
.section {
    margin-bottom: 28px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.section-header h2 {
    font-size: 1.1rem;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
}
.section-header a {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
}

/* ===== 书籍网格 ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}
.book-card {
    cursor: pointer;
    transition: 0.15s;
}
.book-card:active { transform: scale(0.96); }
.book-cover {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 2/3;
    background: #E5DFD7;
    box-shadow: var(--shadow);
}
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
}
.book-count {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.6rem;
    padding: 2px 8px;
    border-radius: 30px;
}
.book-info {
    padding: 8px 4px 0;
}
.book-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.book-info .book-author {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ===== 文集详情页 ===== */
.collection-banner {
    display: flex;
    gap: 16px;
    background: white;
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.collection-cover-large {
    flex-shrink: 0;
    width: 100px;
    height: 150px;
    border-radius: 12px;
    overflow: hidden;
    background: #E5DFD7;
}
.collection-cover-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cover-placeholder-large {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 700;
    color: rgba(255,255,255,0.85);
}
.collection-meta { flex: 1; }
.collection-meta h2 {
    font-size: 1.2rem;
    font-weight: 700;
    font-family: 'Noto Serif SC', serif;
    margin-bottom: 4px;
}
.collection-meta .author {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
.collection-meta .desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin: 6px 0;
    line-height: 1.4;
}
.meta-stats {
    display: flex;
    gap: 16px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin: 8px 0;
}
.btn-read-all {
    background: var(--accent);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}

/* ===== 章节列表 ===== */
.chapter-list {
    background: white;
    border-radius: var(--radius);
    padding: 4px 0;
    box-shadow: var(--shadow);
}
.chapter-list h3 {
    padding: 12px 16px 8px;
    font-size: 1rem;
    font-family: 'Noto Serif SC', serif;
}
.chapter-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(0,0,0,0.03);
    text-decoration: none;
    color: var(--text);
}
.chapter-item:active { background: #F5F1EB; }
.chapter-item .chapter-index {
    font-size: 0.7rem;
    color: var(--text-secondary);
    min-width: 24px;
}
.chapter-item .chapter-title {
    flex: 1;
    font-size: 0.9rem;
}
.chapter-item .chapter-meta {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.back-btn {
    font-size: 1.2rem;
    color: var(--text-secondary);
    text-decoration: none;
}
.shelf-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

/* ===== 响应式 ===== */
@media (max-width: 480px) {
    .book-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .collection-cover-large { width: 80px; height: 120px; }
    .collection-banner { padding: 12px; }
    .app { padding: 0 12px 20px; }
}
@media (min-width: 600px) {
    .book-grid { grid-template-columns: repeat(4, 1fr); }
}