/* ===========================
   锦绣书屋 - 电子书分享网站
   样式表
   =========================== */

/* ===== 基础重置 ===== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* 主色调 - 温暖的读书氛围 */
    --primary: #c0392b;
    --primary-dark: #a93226;
    --primary-light: #e74c3c;
    --primary-bg: #fdf6f4;

    /* 辅助色 */
    --accent: #e67e22;
    --accent-light: #f0a050;
    --gold: #f39c12;

    /* 中性色 */
    --text-primary: #2c2c2c;
    --text-secondary: #666;
    --text-muted: #999;
    --border: #e8e8e8;
    --border-light: #f0f0f0;
    --bg-body: #faf8f6;
    --bg-card: #ffffff;
    --bg-hover: #f9f9f9;

    /* 豆瓣评分色 */
    --rating-bg: #2c9d46;

    /* 分类标签色 */
    --cat-novel: #3498db;
    --cat-study: #e67e22;
    --cat-minguo: #8B5A2B;
    --cat-humanities: #1abc9c;
    --cat-history: #c0392b;
    --cat-guji: #654321;
    --cat-english: #607d8b;
    --cat-paid: #9b59b6;
    --cat-academic: #00695c;

    /* 尺寸 */
    --max-width: 1200px;
    --header-height: 64px;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 6px 20px rgba(0, 0, 0, 0.12);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

img {
    display: block;
    max-width: 100%;
}

ul {
    list-style: none;
}

/* ===== 顶部导航栏 ===== */
.header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--bg-card);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.header-inner {
    max-width: var(--max-width);
    height: var(--header-height);
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 20px;
    font-weight: bold;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
}

.logo-text span {
    color: var(--text-primary);
}

/* 导航菜单 */
.nav-menu {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.nav-menu a {
    padding: 8px 14px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-weight: 500;
}

.nav-menu a:hover,
.nav-menu a.active {
    color: var(--primary);
    background: var(--primary-bg);
}

/* 搜索框 */
.search-box {
    flex: 1;
    max-width: 400px;
    margin-left: auto;
    position: relative;
}

.search-box input {
    width: 100%;
    height: 38px;
    padding: 0 40px 0 16px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 14px;
    background: var(--bg-body);
    transition: var(--transition);
    outline: none;
}

.search-box input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.search-box .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 30px;
    height: 30px;
    border: none;
    background: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    border-radius: 50%;
    transition: var(--transition);
}

.search-box .search-btn:hover {
    color: var(--primary);
    background: var(--primary-bg);
}

/* 移动端菜单按钮 */
.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
    padding: 8px;
}

.menu-toggle span {
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

/* ===== 主内容区 ===== */
.main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 24px 20px 48px;
}

/* ===== Section 通用 ===== */
.section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.section-title::before {
    content: "";
    width: 4px;
    height: 22px;
    background: linear-gradient(180deg, var(--primary), var(--accent));
    border-radius: 2px;
}

/* 分类筛选标签 */
.filter-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 5px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
}

.filter-tab:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.filter-tab.active {
    color: #fff;
    background: var(--primary);
    border-color: var(--primary);
}

/* ===== 主搜索区 ===== */
.hero-search {
    text-align: center;
    padding: 48px 20px 36px;
    background: linear-gradient(135deg, rgba(192,57,43,0.06), rgba(192,57,43,0.02));
    border-radius: var(--radius);
    margin-bottom: 24px;
}

.hero-search-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.hero-search-sub {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.hero-search-box {
    display: flex;
    max-width: 600px;
    margin: 0 auto 16px;
    gap: 0;
}

.hero-search-box input {
    flex: 1;
    height: 50px;
    padding: 0 20px;
    border: 2px solid var(--border);
    border-right: none;
    border-radius: 25px 0 0 25px;
    font-size: 16px;
    outline: none;
    background: #fff;
    transition: var(--transition);
}

.hero-search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.hero-search-box button {
    height: 50px;
    padding: 0 28px;
    border: none;
    border-radius: 0 25px 25px 0;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.hero-search-box button:hover {
    background: #a93226;
}

.hero-search-hot {
    font-size: 13px;
    color: var(--text-muted);
}

.hero-search-hot .hot-label {
    margin-right: 4px;
}

.hero-search-hot a {
    display: inline-block;
    padding: 3px 12px;
    margin: 0 4px;
    border-radius: 14px;
    background: rgba(255,255,255,0.7);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

.hero-search-hot a:hover {
    background: var(--primary);
    color: #fff;
}

/* 搜索无结果时的找书按钮 */
.btn-go-findbook {
    margin-top: 16px;
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    background: var(--primary);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.btn-go-findbook:hover {
    background: #a93226;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.25);
}

/* ===== 书籍网格 ===== */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
}

/* 书籍卡片 */
.book-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.book-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

.book-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f0eb, #e8ddd0);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

/* 分类标签 */
.book-cat {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    color: #fff;
    border-radius: 3px;
    font-weight: 500;
    backdrop-filter: blur(4px);
}

.cat-novel { background: rgba(52, 152, 219, 0.9); }
.cat-study { background: rgba(230, 126, 34, 0.9); }
.cat-minguo { background: rgba(139, 90, 43, 0.9); }
.cat-humanities { background: rgba(26, 188, 156, 0.9); }
.cat-history { background: rgba(192, 57, 43, 0.9); }
.cat-guji { background: rgba(101, 67, 33, 0.9); }
.cat-english { background: rgba(96, 125, 139, 0.9); }
.cat-paid { background: rgba(155, 89, 182, 0.9); }
.cat-academic { background: rgba(0, 105, 92, 0.9); }

/* 豆瓣评分 */
.book-rating {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 2px 8px;
    font-size: 12px;
    color: #fff;
    background: rgba(44, 157, 70, 0.9);
    border-radius: 3px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 3px;
}

.book-rating::before {
    content: "★";
    font-size: 10px;
}

/* 书籍信息 */
.book-info {
    padding: 10px 12px 14px;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    line-height: 1.4;
}

.book-card:hover .book-title {
    color: var(--primary);
}

.book-author {
    font-size: 12px;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ===== 推荐书籍区 - 固定6列网格 ===== */
.recommend-scroll {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.recommend-scroll .book-card {
    width: 100%;
}

/* ===== 页脚 ===== */
.footer {
    background: #2c2c2c;
    color: #aaa;
    padding: 32px 20px 20px;
    margin-top: 40px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-brand {
    flex: 1;
    min-width: 200px;
}

.footer-brand .logo-text {
    color: #fff;
}

.footer-brand p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.8;
    color: #888;
}

.footer-links {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-col h4 {
    color: #ddd;
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 600;
}

.footer-col a {
    display: block;
    font-size: 13px;
    color: #888;
    padding: 3px 0;
    transition: var(--transition);
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: var(--max-width);
    margin: 24px auto 0;
    padding-top: 16px;
    border-top: 1px solid #444;
    text-align: center;
    font-size: 12px;
    color: #666;
}

/* ===== 书籍详情页 ===== */
.book-detail {
    max-width: 900px;
    margin: 0 auto;
    padding: 24px 20px;
}

.breadcrumb {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb span {
    color: var(--text-secondary);
}

.book-detail-main {
    display: flex;
    gap: 30px;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.book-detail-cover {
    flex-shrink: 0;
    width: 200px;
}

.book-detail-cover img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-hover);
}

.book-detail-info {
    flex: 1;
}

.book-detail-info h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.book-detail-author {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.book-detail-author a {
    color: var(--primary);
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.book-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.book-meta-item .label {
    color: var(--text-muted);
}

.book-meta-item .value {
    color: var(--text-primary);
    font-weight: 500;
}

.book-meta-item .rating-badge {
    padding: 2px 10px;
    background: var(--rating-bg);
    color: #fff;
    border-radius: 4px;
    font-weight: 600;
    font-size: 14px;
}

.book-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.book-tag {
    padding: 4px 12px;
    font-size: 12px;
    border-radius: 4px;
    font-weight: 500;
}

.format-tag {
    background: var(--primary-bg);
    color: var(--primary);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

/* 下载按钮 */
.download-section {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-radius: var(--radius-sm);
    transition: var(--transition);
    cursor: pointer;
    border: none;
    text-decoration: none;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.4);
}

.download-btn.secondary {
    background: linear-gradient(135deg, #555, #777);
}

.download-btn.secondary:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.download-btn.disabled {
    background: linear-gradient(135deg, #aaa, #ccc);
    cursor: not-allowed;
    opacity: 0.7;
}

.download-btn.disabled:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* 网盘下载卡片 */
.netdisk-card {
    margin-top: 20px;
    padding: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.netdisk-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 20px;
    background: linear-gradient(135deg, #f0f6ff, #e8f4ff);
    border-bottom: 1px solid var(--border);
    flex-wrap: wrap;
}

.netdisk-type {
    font-size: 15px;
    font-weight: 700;
    color: #1a73e8;
    display: flex;
    align-items: center;
    gap: 6px;
}

.netdisk-type::before {
    content: "☁";
    font-size: 18px;
}

.netdisk-go-btn {
    text-decoration: none;
    white-space: nowrap;
}

.netdisk-body {
    display: flex;
    gap: 24px;
    padding: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.netdisk-qr {
    text-align: center;
    flex-shrink: 0;
}

.netdisk-qr img {
    width: 160px;
    height: 160px;
    border-radius: 8px;
    border: 1px solid var(--border);
    display: block;
}

.qr-tip {
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.netdisk-info {
    flex: 1;
    min-width: 200px;
}

.netdisk-extract {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: #fff8e1;
    border: 1px dashed #ffc107;
    border-radius: 8px;
    margin-bottom: 12px;
}

.extract-label {
    font-size: 14px;
    font-weight: 600;
    color: #e65100;
}

.extract-code {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    letter-spacing: 2px;
    font-family: monospace;
    user-select: all;
}

.copy-extract-btn {
    margin-left: auto;
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: #ff9800;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: var(--transition);
}

.copy-extract-btn:hover {
    background: #f57c00;
}

.netdisk-hint {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0 0 8px 0;
}

.netdisk-url-preview {
    font-size: 12px;
    color: var(--text-muted);
    word-break: break-all;
    background: var(--bg-body);
    padding: 8px 12px;
    border-radius: 6px;
    margin: 0;
    font-family: monospace;
}

/* 未登录锁定状态 */
.netdisk-card.locked {
    text-align: center;
    padding: 32px 20px;
}

.netdisk-locked-icon {
    font-size: 40px;
    margin-bottom: 8px;
}

.netdisk-locked-text {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
}

/* 空状态 */
.netdisk-card.empty {
    text-align: center;
    padding: 24px 20px;
}

.netdisk-empty-text {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
}

/* 详情页内容区 */
.book-content-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.book-content-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 14px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    color: var(--text-primary);
}

.book-content-section p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.9;
    margin-bottom: 10px;
    text-indent: 2em;
}

/* 相关推荐 */
.related-books {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px 30px;
    box-shadow: var(--shadow);
}

.related-books h2 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 18px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 16px;
}

/* ===== 空状态 ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.empty-state p {
    font-size: 15px;
}

/* ===== 返回顶部按钮 ===== */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: var(--shadow-hover);
    z-index: 999;
    border: none;
    font-size: 20px;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .nav-menu {
        display: none;
    }

    .menu-toggle {
        display: flex;
    }

    .search-box {
        max-width: none;
    }

    .book-detail-main {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .book-detail-cover {
        width: 160px;
    }

    .book-meta {
        justify-content: center;
    }

    .book-tags {
        justify-content: center;
    }

    .download-section {
        justify-content: center;
    }

    .recommend-scroll {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 600px) {
    .header-inner {
        gap: 12px;
        padding: 0 12px;
    }

    .logo-text {
        font-size: 16px;
    }

    .main {
        padding: 16px 12px 32px;
    }

    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 12px;
    }

    .recommend-scroll {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
    }

    .filter-tab {
        flex-shrink: 0;
    }

    .book-content-section,
    .book-detail-main {
        padding: 20px 16px;
    }

    .footer-inner {
        flex-direction: column;
    }
}

/* ===========================
   用户系统样式
   =========================== */

/* 用户区域 */
.user-area {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    margin-left: 8px;
}

.btn-login,
.btn-register {
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 18px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    white-space: nowrap;
}

.btn-login {
    color: var(--primary);
    background: var(--primary-bg);
    border: 1px solid rgba(192, 57, 43, 0.2);
}

.btn-login:hover {
    background: var(--primary);
    color: #fff;
}

.btn-register {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
}

.btn-register:hover {
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.4);
    transform: translateY(-1px);
}

/* 用户头像下拉菜单 */
.user-menu {
    position: relative;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #fff;
    box-shadow: var(--shadow);
    transition: var(--transition);
    user-select: none;
}

.user-avatar:hover {
    transform: scale(1.05);
}

.user-dropdown {
    position: absolute;
    top: 48px;
    right: 0;
    min-width: 200px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 1001;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown-header {
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 4px;
}

.user-dropdown-header .username {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-dropdown-header .role {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.user-dropdown-header .role.admin {
    color: var(--primary);
    font-weight: 600;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.user-dropdown a:hover {
    background: var(--primary-bg);
    color: var(--primary);
}

.user-dropdown a .icon {
    width: 18px;
    text-align: center;
    font-size: 15px;
}

.user-dropdown .divider {
    height: 1px;
    background: var(--border-light);
    margin: 4px 0;
}

/* ===== 弹窗通用 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(4px);
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #fff;
    border-radius: 12px;
    padding: 32px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: var(--transition);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-overlay.show .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 24px;
}

/* 表单 */
.form-group {
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 6px;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
    background: var(--bg-body);
    font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

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

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.btn-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    margin-top: 6px;
}

.btn-submit:hover {
    box-shadow: 0 4px 14px rgba(192, 57, 43, 0.4);
    transform: translateY(-1px);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.modal-switch {
    text-align: center;
    margin-top: 18px;
    font-size: 13px;
    color: var(--text-muted);
}

.modal-switch a {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
}

/* 找回密码结果 */
.recover-success {
    margin-top: 20px;
    padding: 24px;
    background: linear-gradient(135deg, rgba(72, 160, 72, 0.08), rgba(72, 160, 72, 0.03));
    border: 1px solid rgba(72, 160, 72, 0.2);
    border-radius: var(--radius-sm);
    text-align: center;
}

.recover-success .recover-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 12px;
    background: #48a048;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
}

.recover-success .recover-text {
    font-size: 16px;
    font-weight: 700;
    color: #48a048;
    margin-bottom: 14px;
}

.recover-success .recover-info {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.6;
}

.recover-success .recover-info strong {
    color: var(--primary);
    font-size: 16px;
    letter-spacing: 1px;
}

.recover-success .recover-tip {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.6;
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border: none;
    background: var(--bg-body);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-muted);
    transition: var(--transition);
}

.modal-close:hover {
    background: var(--border-light);
    color: var(--text-primary);
}

.modal {
    position: relative;
}

.form-error {
    color: var(--primary);
    font-size: 13px;
    margin-bottom: 12px;
    padding: 8px 12px;
    background: var(--primary-bg);
    border-radius: var(--radius-sm);
    display: none;
}

.form-error.show {
    display: block;
}

/* ===== Toast 提示 ===== */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    background: #333;
    color: #fff;
    padding: 12px 24px;
    border-radius: var(--radius);
    font-size: 14px;
    z-index: 3000;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #27ae60;
}

.toast.error {
    background: var(--primary);
}

/* ===== 管理后台 ===== */
.admin-section {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 24px 30px;
    box-shadow: var(--shadow);
    margin-bottom: 24px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.admin-header h2 {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.admin-header h2::before {
    content: "⚙";
    font-size: 22px;
}

.btn-add-book {
    padding: 9px 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 6px;
}

.btn-add-book:hover {
    box-shadow: 0 3px 10px rgba(192, 57, 43, 0.4);
    transform: translateY(-1px);
}

/* 管理书籍表格 */
.admin-book-list {
    overflow-x: auto;
}

.admin-book-row {
    display: grid;
    grid-template-columns: 40px 50px 1fr 120px 80px 80px 100px;
    gap: 12px;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    transition: var(--transition);
}

.admin-book-row:hover {
    background: var(--bg-hover);
}

.admin-book-row.header {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 13px;
    border-bottom: 2px solid var(--border);
}

.admin-book-row .book-thumb {
    width: 36px;
    height: 48px;
    border-radius: 3px;
    object-fit: cover;
}

.admin-book-row .row-actions {
    display: flex;
    gap: 8px;
}

.admin-book-row .row-actions button {
    padding: 4px 10px;
    font-size: 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    cursor: pointer;
    transition: var(--transition);
    color: var(--text-secondary);
}

.admin-book-row .row-actions .btn-edit:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.admin-book-row .row-actions .btn-delete:hover {
    color: var(--primary);
    border-color: var(--primary);
}

/* 管理工具栏 */
.admin-toolbar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
}

/* 批量删除按钮 */
.btn-batch-delete {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
}

.btn-batch-delete:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(231, 76, 60, 0.4);
}

/* 批量信息提示 */
.batch-info {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

/* 复选框样式 */
.admin-book-row input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary);
}

.admin-book-row.header input[type="checkbox"] {
    accent-color: var(--accent);
}

/* ===== 管理后台标签页 ===== */
.admin-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    padding: 4px;
    background: var(--bg-body);
    border-radius: 8px;
}

/* ===== 分类文件夹导航 ===== */
.admin-folder-nav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
    padding: 12px;
    background: var(--bg-body);
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
}

.admin-folder {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
    user-select: none;
    font-size: 13px;
}

.admin-folder:hover {
    border-color: var(--primary);
    background: var(--primary-bg);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.admin-folder.active {
    border-color: var(--primary);
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 3px 10px rgba(192,57,43,0.25);
}

.admin-folder.active .admin-folder-name,
.admin-folder.active .admin-folder-count,
.admin-folder.active .admin-folder-icon {
    color: #fff;
}

.admin-folder-icon {
    font-size: 16px;
    line-height: 1;
}

.admin-folder-name {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

/* 分类文件夹底色（类别色作为背景，文字显示在底色上层） */
.admin-folder.cat-novel { background: rgba(52, 152, 219, 0.12); border-color: rgba(52, 152, 219, 0.35); }
.admin-folder.cat-study { background: rgba(230, 126, 34, 0.12); border-color: rgba(230, 126, 34, 0.35); }
.admin-folder.cat-minguo { background: rgba(139, 90, 43, 0.12); border-color: rgba(139, 90, 43, 0.35); }
.admin-folder.cat-humanities { background: rgba(26, 188, 156, 0.12); border-color: rgba(26, 188, 156, 0.35); }
.admin-folder.cat-history { background: rgba(192, 57, 43, 0.12); border-color: rgba(192, 57, 43, 0.35); }
.admin-folder.cat-guji { background: rgba(101, 67, 33, 0.12); border-color: rgba(101, 67, 33, 0.35); }
.admin-folder.cat-english { background: rgba(96, 125, 139, 0.12); border-color: rgba(96, 125, 139, 0.35); }
.admin-folder.cat-paid { background: rgba(155, 89, 182, 0.12); border-color: rgba(155, 89, 182, 0.35); }
.admin-folder.cat-academic { background: rgba(0, 105, 92, 0.12); border-color: rgba(0, 105, 92, 0.35); }

.admin-folder.cat-novel:hover { background: rgba(52, 152, 219, 0.18); }
.admin-folder.cat-study:hover { background: rgba(230, 126, 34, 0.18); }
.admin-folder.cat-minguo:hover { background: rgba(139, 90, 43, 0.18); }
.admin-folder.cat-humanities:hover { background: rgba(26, 188, 156, 0.18); }
.admin-folder.cat-history:hover { background: rgba(192, 57, 43, 0.18); }
.admin-folder.cat-guji:hover { background: rgba(101, 67, 33, 0.18); }
.admin-folder.cat-english:hover { background: rgba(96, 125, 139, 0.18); }
.admin-folder.cat-paid:hover { background: rgba(155, 89, 182, 0.18); }
.admin-folder.cat-academic:hover { background: rgba(0, 105, 92, 0.18); }

.admin-folder.active,
.admin-folder.active:hover {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border-color: var(--primary);
}

.admin-folder-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 20px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    background: var(--bg-body);
    border-radius: 10px;
}

.admin-folder.active .admin-folder-count {
    background: rgba(255,255,255,0.25);
    color: #fff;
}

/* 当前分类标题 */
.admin-folder-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 14px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.admin-folder-title-icon {
    font-size: 20px;
}

@media (max-width: 768px) {
    .admin-folder-nav {
        gap: 6px;
        padding: 8px;
    }

    .admin-folder {
        padding: 6px 10px;
        font-size: 12px;
    }

    .admin-folder-name {
        font-size: 12px;
    }
}

.admin-tab {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.admin-tab:hover {
    color: var(--text);
    background: rgba(0, 0, 0, 0.04);
}

.admin-tab.active {
    color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3);
}

/* ===== 下载统计卡片 ===== */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: var(--transition);
}

.stat-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.stat-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ===== 统计区块 ===== */
.stats-section {
    margin-bottom: 24px;
}

.stats-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stats-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stats-section-header .stats-section-title {
    margin-bottom: 0;
}

.btn-clear-logs {
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.3);
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

.btn-clear-logs:hover {
    background: rgba(231, 76, 60, 0.15);
    border-color: #e74c3c;
}

/* ===== 下载排行 ===== */
.ranking-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
}

.ranking-item:last-child {
    border-bottom: none;
}

.ranking-rank {
    width: 32px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.ranking-info {
    flex: 1;
    min-width: 0;
}

.ranking-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ranking-bar {
    height: 6px;
    background: var(--bg-body);
    border-radius: 3px;
    overflow: hidden;
}

.ranking-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    border-radius: 3px;
    transition: width 0.6s ease;
}

.ranking-count {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===== 下载清单表格 ===== */
.download-log-table {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.download-log-row {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 12px;
    padding: 10px 16px;
    align-items: center;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.download-log-row:last-child {
    border-bottom: none;
}

.download-log-row.header {
    background: var(--bg-body);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 12px;
}

.download-log-row .log-book-title {
    font-weight: 600;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.download-log-row .log-user {
    color: var(--text-secondary);
}

.download-log-row .log-time {
    color: var(--text-muted);
    font-size: 12px;
    text-align: right;
}

.download-log-row.header .log-time {
    text-align: left;
}

@media (max-width: 768px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }

    .ranking-item {
        padding: 10px 12px;
        gap: 8px;
    }

    .download-log-row {
        grid-template-columns: 2fr 1fr;
        gap: 8px;
        padding: 8px 12px;
    }

    .download-log-row .hide-mobile {
        display: none;
    }
}

/* ===== 收藏页面 ===== */
.fav-section .book-grid {
    margin-top: 16px;
}

/* ===== 书籍卡片收藏按钮 ===== */
.book-fav-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
    backdrop-filter: blur(4px);
    z-index: 5;
}

.book-fav-btn:hover {
    transform: scale(1.15);
    background: #fff;
}

.book-fav-btn.active {
    color: var(--primary);
}

/* ===== 登录后下载按钮 ===== */
.download-locked {
    position: relative;
}

.download-locked::after {
    content: "🔒 登录后下载";
}

/* ===== 响应式补充 ===== */
@media (max-width: 900px) {
    .user-area {
        margin-left: 0;
    }

    .btn-login,
    .btn-register {
        padding: 6px 12px;
        font-size: 12px;
    }

    .admin-book-row {
        grid-template-columns: 28px 40px 1fr 80px 70px;
    }

    .admin-book-row .hide-mobile {
        display: none;
    }
}

@media (max-width: 600px) {
    .btn-login,
    .btn-register {
        padding: 5px 10px;
        font-size: 11px;
    }

    .modal {
        padding: 24px 20px;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* ===== 图片上传区域 ===== */
.image-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-body);
}

.image-upload-area:hover,
.image-upload-area.dragover {
    border-color: var(--primary);
    background: rgba(192, 57, 43, 0.04);
}

.image-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.image-upload-placeholder .upload-icon {
    font-size: 32px;
}

.image-upload-placeholder .upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 图片预览列表 */
.image-preview-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
    align-items: flex-start;
}

.image-preview-item {
    position: relative;
    width: 100px;
    height: 130px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.image-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-preview-actions {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    padding: 4px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.5), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.image-preview-item:hover .image-preview-actions {
    opacity: 1;
}

.image-preview-actions button {
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 3px;
    width: 22px;
    height: 22px;
    font-size: 11px;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.image-preview-actions .img-remove {
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
}

.cover-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 10px;
    color: #fff;
    background: rgba(192, 57, 43, 0.8);
    padding: 2px 0;
}

.image-count {
    font-size: 12px;
    color: var(--text-muted);
    align-self: center;
    padding: 4px 8px;
}

/* ===== 详情页图片画廊 ===== */
.book-detail-cover-wrap {
    flex-shrink: 0;
    width: 200px;
}

.book-detail-cover-wrap .book-detail-cover {
    width: 100%;
}

.book-gallery-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.gallery-thumb {
    position: relative;
    width: 48px;
    height: 64px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition);
}

.gallery-thumb:hover {
    border-color: var(--accent);
}

.gallery-thumb.active {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(192, 57, 43, 0.3);
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumb .thumb-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    font-size: 9px;
    color: #fff;
    text-align: center;
    background: rgba(0,0,0,0.5);
    padding: 1px 0;
}

@media (max-width: 600px) {
    .book-detail-cover-wrap,
    .book-detail-cover {
        width: 140px;
    }

    .gallery-thumb {
        width: 40px;
        height: 54px;
    }

    .image-preview-item {
        width: 80px;
        height: 104px;
    }
}

/* ===========================
   付费阅读 & 在线阅读器样式
   =========================== */

/* ===== 付费书籍标记 ===== */
.book-paid-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    padding: 2px 8px;
    font-size: 11px;
    color: #fff;
    background: rgba(155, 89, 182, 0.95);
    border-radius: 3px;
    font-weight: 700;
    z-index: 5;
    backdrop-filter: blur(4px);
}

/* 导航栏付费阅读链接高亮 */
.nav-paid-link {
    color: #9b59b6 !important;
    font-weight: 700 !important;
}

/* ===== 付费阅读卡片（详情页） ===== */
.paid-reading-card {
    margin-top: 20px;
    padding: 20px 24px;
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.06), rgba(155, 89, 182, 0.02));
    border: 1px solid rgba(155, 89, 182, 0.25);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.paid-reading-card.purchased {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.08), rgba(39, 174, 96, 0.03));
    border-color: rgba(39, 174, 96, 0.3);
}

.paid-reading-card.locked {
    text-align: center;
    justify-content: center;
    flex-direction: column;
}

.paid-reading-card .paid-reading-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.paid-reading-card .paid-reading-info {
    flex: 1;
    min-width: 200px;
}

.paid-reading-card .paid-reading-price {
    font-size: 15px;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 4px;
}

.paid-reading-card .pay-amount {
    font-size: 22px;
    font-weight: 700;
    color: #9b59b6;
}

.paid-reading-card .paid-reading-status {
    font-size: 16px;
    font-weight: 700;
    color: #27ae60;
    margin-bottom: 4px;
}

.paid-reading-card .paid-reading-desc {
    font-size: 13px;
    color: var(--text-secondary);
}

.paid-read-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

.paid-read-btn:hover {
    box-shadow: 0 4px 14px rgba(155, 89, 182, 0.4) !important;
}

/* ===== 文件上传区域 ===== */
.file-upload-area {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--bg-body);
}

.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: #9b59b6;
    background: rgba(155, 89, 182, 0.04);
}

.file-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
}

.file-upload-placeholder .upload-icon {
    font-size: 32px;
}

.file-upload-placeholder .upload-hint {
    font-size: 12px;
    color: var(--text-secondary);
}

/* 文件信息显示 */
.file-info {
    margin-top: 12px;
}

.file-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(155, 89, 182, 0.06);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
}

.file-info-existing {
    padding: 10px 14px;
    background: rgba(155, 89, 182, 0.06);
    border: 1px solid rgba(155, 89, 182, 0.2);
    border-radius: var(--radius-sm);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-type-badge {
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #9b59b6;
    border-radius: 3px;
    text-transform: uppercase;
}

.file-type-badge.pdf {
    background: #e74c3c;
}

.file-type-badge.epub {
    background: #3498db;
}

.file-name {
    flex: 1;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.file-remove-btn {
    width: 24px;
    height: 24px;
    border: none;
    background: rgba(231, 76, 60, 0.9);
    color: #fff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

/* 付费字段区域 */
.paid-book-fields {
    padding: 16px;
    background: rgba(155, 89, 182, 0.04);
    border: 1px solid rgba(155, 89, 182, 0.15);
    border-radius: var(--radius);
    margin-bottom: 18px;
}

/* ===== 微信收款码管理 ===== */
.wechat-qr-section {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.wechat-qr-desc {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0 0 16px 0;
    line-height: 1.6;
}

.wechat-qr-manage {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.wechat-qr-preview {
    width: 200px;
    height: 200px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--bg-body);
}

.wechat-qr-preview .wechat-qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.wechat-qr-preview .wechat-qr-loading,
.wechat-qr-preview .wechat-qr-empty {
    font-size: 13px;
    color: var(--text-muted);
}

.wechat-qr-actions {
    flex: 1;
    min-width: 200px;
}

.wechat-qr-upload {
    max-width: 300px;
    padding: 20px;
}

/* ===== 付费统计 ===== */
.paid-log-row {
    grid-template-columns: 2fr 1fr 1fr 1fr;
}

.paid-log-row .log-amount {
    color: #9b59b6;
    font-weight: 600;
}

@media (max-width: 768px) {
    .paid-log-row {
        grid-template-columns: 2fr 1fr;
    }

    .paid-log-row .hide-mobile {
        display: none;
    }

    .wechat-qr-preview {
        width: 160px;
        height: 160px;
    }
}

/* ===== 在线阅读器页面 ===== */
.reader-title-bar {
    flex: 1;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 12px;
}

.reader-nav-info {
    flex-shrink: 0;
    font-size: 12px;
}

.reader-status {
    padding: 3px 10px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 12px;
}

.reader-status.trial {
    background: rgba(243, 156, 18, 0.15);
    color: #e67e22;
}

.reader-status.purchased {
    background: rgba(39, 174, 96, 0.15);
    color: #27ae60;
}

.reader-main {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    min-height: 70vh;
}

.reader-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    color: var(--text-muted);
    gap: 16px;
}

.reader-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* PDF 查看器 */
.pdf-viewer {
    width: 100%;
    min-height: 500px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.pdf-viewer canvas {
    max-width: 100%;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border-radius: 4px;
    margin: 0 auto;
}

.pdf-page-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px;
    color: var(--text-muted);
    gap: 12px;
}

/* 阅读器底部工具栏 */
.reader-toolbar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.08);
    z-index: 100;
}

.reader-tool-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.reader-tool-btn:hover:not(:disabled) {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.reader-tool-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.reader-page-info {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 80px;
    text-align: center;
}

/* ===== 付费弹窗 ===== */
.pay-modal-content {
    max-width: 420px;
    text-align: center;
}

.pay-modal-icon {
    font-size: 48px;
    margin-bottom: 8px;
}

.pay-qr-area {
    margin: 20px auto;
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.pay-qr-area .pay-qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pay-qr-area .pay-qr-placeholder {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    padding: 20px;
}

.pay-price {
    margin-bottom: 16px;
}

.pay-amount {
    font-size: 28px;
    font-weight: 700;
    color: #9b59b6;
}

.pay-instructions {
    text-align: left;
    padding: 12px 16px;
    background: var(--bg-body);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.pay-instructions p {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    line-height: 1.6;
}

.pay-confirm-btn {
    background: linear-gradient(135deg, #9b59b6, #8e44ad) !important;
}

.pay-confirm-btn:hover {
    box-shadow: 0 4px 14px rgba(155, 89, 182, 0.4) !important;
}

/* ===== 响应式：阅读器 ===== */
@media (max-width: 600px) {
    .reader-title-bar {
        font-size: 13px;
        padding: 0 6px;
    }

    .reader-nav-info {
        display: none;
    }

    .reader-main {
        padding: 12px 8px 80px;
    }

    .reader-toolbar {
        padding: 10px 12px;
        gap: 8px;
    }

    .reader-tool-btn {
        padding: 6px 14px;
        font-size: 13px;
    }

    .reader-page-info {
        font-size: 12px;
        min-width: 60px;
    }

    .pay-qr-area {
        width: 160px;
        height: 160px;
    }

    .wechat-qr-manage {
        flex-direction: column;
    }
}

/* ===== 付费阅读专区 ===== */
.paid-section {
    background: linear-gradient(135deg, rgba(155, 89, 182, 0.04), rgba(142, 68, 173, 0.06));
    border: 1px solid rgba(155, 89, 182, 0.12);
    border-radius: var(--radius);
    padding: 24px 28px;
    margin-bottom: 32px;
}

.paid-section .section-title {
    color: #7d3c98;
}

.paid-section .section-title::before {
    background: linear-gradient(180deg, #9b59b6, #8e44ad);
}

.paid-section-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border-radius: 12px;
    margin-left: 4px;
}

.section-more-link {
    font-size: 14px;
    font-weight: 600;
    color: #9b59b6;
    text-decoration: none;
    transition: var(--transition);
    white-space: nowrap;
}

.section-more-link:hover {
    color: #7d3c98;
    text-decoration: underline;
}

/* ===== 找书专区 ===== */
.find-book-section {
    background: #fff5f5;
    border-radius: 16px;
    padding: 20px 16px;
    margin: 8px 0 24px;
}

.find-book-card {
    max-width: 680px;
    margin: 0 auto;
    background: #fff5f5;
    border: 1px solid #ffd6d6;
    border-radius: 16px;
    padding: 32px 28px;
    box-shadow: 0 2px 16px rgba(231, 76, 60, 0.06);
}

.find-book-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.find-book-icon {
    font-size: 28px;
    line-height: 1;
}

.find-book-title {
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0;
}

.find-book-notice {
    background: linear-gradient(135deg, #fff3e0, #fff8e1);
    border-left: 4px solid #ff9800;
    border-radius: 8px;
    padding: 14px 18px;
    font-size: 14px;
    color: #5d4037;
    line-height: 1.7;
    margin-bottom: 24px;
}

.find-book-notice strong {
    color: #e65100;
    font-size: 16px;
}

.find-book-form .form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.find-book-form .form-group {
    flex: 1;
    margin-bottom: 14px;
}

.find-book-form label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.find-book-form input,
.find-book-form textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.find-book-form input:focus,
.find-book-form textarea:focus {
    outline: none;
    border-color: #9b59b6;
    box-shadow: 0 0 0 3px rgba(155, 89, 182, 0.1);
}

.find-book-form textarea {
    resize: vertical;
    min-height: 60px;
}

.btn-findbook-submit {
    display: block;
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #9b59b6, #8e44ad);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 4px;
}

.btn-findbook-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(155, 89, 182, 0.3);
}

.btn-findbook-submit:active {
    transform: translateY(0);
}

/* ===== 找书请求后台管理 ===== */
.request-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.request-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 16px 18px;
    transition: border-color 0.2s;
}

.request-item.req-status-pending {
    border-left: 4px solid #ff9800;
}

.request-item.req-status-processing {
    border-left: 4px solid #2196f3;
}

.request-item.req-status-done {
    border-left: 4px solid #4caf50;
}

.request-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.request-item-title {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.request-book-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
}

.request-book-author {
    font-size: 13px;
    color: #888;
}

.request-status-badge {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
}

.request-status-badge.req-status-pending {
    background: #fff3e0;
    color: #e65100;
}

.request-status-badge.req-status-processing {
    background: #e3f2fd;
    color: #1565c0;
}

.request-status-badge.req-status-done {
    background: #e8f5e9;
    color: #2e7d32;
}

.request-item-body {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #666;
}

.request-detail {
    line-height: 1.6;
}

.request-label {
    font-weight: 600;
    color: #999;
}

.request-item-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-req-process,
.btn-req-done,
.btn-req-revert,
.btn-req-delete {
    font-size: 12px;
    padding: 5px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-req-process {
    background: #e3f2fd;
    color: #1565c0;
}

.btn-req-done {
    background: #e8f5e9;
    color: #2e7d32;
}

.btn-req-revert {
    background: #fff3e0;
    color: #e65100;
}

.btn-req-delete {
    background: #ffebee;
    color: #c62828;
}

.btn-req-process:hover,
.btn-req-done:hover,
.btn-req-revert:hover,
.btn-req-delete:hover {
    opacity: 0.8;
}

/* 找书专区导航链接 */
.nav-findbook-link {
    color: #ff6f00 !important;
    font-weight: 700 !important;
}

@media (max-width: 600px) {
    .find-book-card {
        padding: 24px 16px;
    }

    .find-book-form .form-row {
        flex-direction: column;
        gap: 0;
    }

    .request-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .request-item-body {
        flex-direction: column;
        gap: 4px;
    }
}

/* 主搜索区移动端适配 */
@media (max-width: 600px) {
    .hero-search {
        padding: 32px 16px 24px;
    }

    .hero-search-title {
        font-size: 22px;
    }

    .hero-search-box {
        flex-direction: column;
        gap: 10px;
    }

    .hero-search-box input {
        border-radius: 25px;
        border-right: 2px solid var(--border);
        text-align: center;
    }

    .hero-search-box button {
        border-radius: 25px;
    }

    .hero-search-hot a {
        margin: 2px;
    }
}
