/*
Theme Name: Book345 Replica V9
Description: 修复缓存与布局问题版
Author: AI Assistant
Version: 9.0
*/

:root {
    --primary-color: #333;
    --text-gray: #666;
    --text-light: #999;
    --bg-gray: #f5f5f5;
    --border-color: #eee;
    --red-accent: #b71c1c;
}

/* 基础重置 */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; color: var(--primary-color); font-size: 14px; line-height: 1.5; background: #fff; }
a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--red-accent); }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1332px; margin: 0 auto; padding: 0 15px; position: relative; }

/* 头部 Header */
.home-navbar { padding: 30px 0; display: flex; flex-direction: column; gap: 20px; align-items: center; }
.home-logo { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.home-logo img { width: 40px; height: 40px; }
.home-logo h1 { font-size: 24px; font-weight: bold; margin: 0; }
.home-search { width: 100%; max-width: 600px; }
.home-search input { width: 100%; background: var(--bg-gray); border: none; border-radius: 99px; padding: 12px 20px; text-align: center; outline: none; font-size: 14px; }
.home-search input:focus { background: #fff; box-shadow: 0 0 0 2px #eee; }
/* PC端默认隐藏“移动端搜索图标” */
.mobile-search-trigger {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
}
/* --- 内页顶部条 (固定在顶部) --- */
.topbar-wrapper { 
    position: fixed;       /* 核心：固定定位 */
    top: 0; 
    left: 0; 
    right: 0;              /* 撑满宽度 */
    height: 60px;          /* 固定高度 */
    background: #fff; 
    border-bottom: 1px solid #eee; 
    z-index: 1000;         /* 保证在最上层 */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* 加点阴影更有层次感 */
}

.topbar-inner { 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    height: 100%;          /* 继承高度 */
}

/* 顶部搜索框样式微调 */
.topbar-logo { display: flex; align-items: center; gap: 8px; font-weight: bold; font-size: 18px; }
.topbar-logo img { width: 30px; height: 30px; }
.topbar-search input { 
    background: var(--bg-gray); border: none; border-radius: 20px; 
    padding: 6px 15px; width: 200px; font-size: 12px; outline: none; 
}

/* 首页通用 */
.home-section { margin-bottom: 12px; }

/* 分类浏览模块样式 */
.home-section:nth-child(2) {
    background: #fff;
    padding: 8px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 10px;
    width: 100%;
    box-sizing: border-box;
}
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.section-header h2 { font-size: 20px; font-weight: bold; margin: 0; }
.section-header a { font-size: 13px; color: var(--text-light); }
.tag-section-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; }

/* --- 核心：大卡片 (Scroll & Grid) --- */
.book-item-grid { margin-bottom: 10px; }
.cover-grid { width: 100% !important; height: auto !important; background: transparent; border-radius: 4px; overflow: hidden; margin-bottom: 8px; display: block; aspect-ratio: 2/3; box-shadow: none !important; }
.cover-grid img { width: 100% !important; height: 100% !important; object-fit: cover; }
.book-title { font-size: 14px; font-weight: bold; line-height: 1.4; height: 40px; overflow: hidden; margin-bottom: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.book-meta { font-size: 12px; color: var(--text-light); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 布局模式 A: 横向滚动 (最近更新) */
.scroll-container { position: relative; overflow: hidden; }
.scroll-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.scroll-list::-webkit-scrollbar { display: none; }
.scroll-list .book-item-grid { scroll-snap-align: start; flex: 0 0 30%; max-width: 30%; }

/* 最近更新中的缩略图恢复原来的自适应设计 */
.scroll-list .book-item-grid .cover-grid {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 2/3;
}

.scroll-list .book-item-grid .cover-grid img {
    width: 100% !important;
    height: 100% !important;
}

/* 确保网格布局中的book-item-grid不受滚动布局样式的影响 */
.grid-container .book-item-grid {
    flex: none !important;
    max-width: 100% !important;
    width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    padding: 0;
}

/* 网格布局中的缩略图居中 */
.grid-container .book-item-grid .cover-grid {
    margin-left: auto;
    margin-right: auto;
    width: 90% !important;
}

/* 网格布局中的标题和文字居中 */
.grid-container .book-item-grid .book-title {
    text-align: center;
    width: 128px;
    margin-left: auto;
    margin-right: auto;
}

.grid-container .book-item-grid .book-meta {
    text-align: center;
    width: 128px;
    margin-left: auto;
    margin-right: auto;
}

/* 确保最新更新部分不吸顶 */
.home-section:first-child {
    position: static;
    background: none;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    margin-bottom: 8px;
}

/* =========================================
   布局模式 B: 网格 (文学 - 响应式布局)
   ========================================= */
.grid-container { 
    display: grid !important;
    
    /* 核心指令：固定显示3列 */
    grid-template-columns: repeat(3, 1fr) !important;
    
    /* 行间距 */
    row-gap: 12px !important; 
    
    /* 列间距 */
    column-gap: 8px !important; 
    
    /* 确保容器宽度为100% */
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 10px;
    box-sizing: border-box;
    overflow: hidden;
    margin: 0;
}

/* 在 Grid 模式下，不需要这个伪元素了，隐藏掉 */
.grid-container::after { 
    display: none; 
}

/* 确保内部卡片不会受到 flex 属性的干扰 */
.grid-container .book-item-grid {
    margin-bottom: 0; /* 间距由 row-gap 控制 */
    width: 100% !important; /* 填满网格单元 */
}

/* --- 核心：首页双栏小图列表 (Social & History) --- */

/* 1. 外层左右分栏 (保持不变) */
.home-split-layout {
    display: flex;
    gap: 40px; 
}
.split-col {
    flex: 1; 
    min-width: 0; /* 防止被内部宽内容撑大 */
}

/* 2. 内部 2列 x 3行 网格 (核心修改) */
.home-mini-grid {
    display: grid;
    /* 强制两列严格等宽 (50% 50%) */
    grid-template-columns: repeat(2, 1fr); 
    column-gap: 30px; /* 增加列间距，防止文字挨得太近 */
    row-gap: 25px;    /* 增加行间距 */
    margin-bottom: 15px;
}

/* 3. 列表单项 */
.book-item-home-list {
    display: flex;
    gap: 15px; /* 图片和文字的间距 */
    align-items: flex-start; /* 顶部对齐 */
    overflow: hidden; /* 确保不溢出格子 */
}

/* 小封面强制 64x92 */
.cover-home-list {
    width: 64px !important;
    height: 92px !important;
    flex-shrink: 0; /* 禁止缩小 */
    border-radius: 4px;
    overflow: hidden;
    background: #f0f0f0;
}
.cover-home-list img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 4. 文字区域 (核心修复点) */
.info-home-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center; /* 垂直居中 */
    height: 92px; /* 高度与图片一致 */
    
    /* ★★★ 关键：Flex子元素默认不会缩小到内容以下， */
    /* 设置 min-width: 0 才能让 text-overflow: ellipsis 生效 ★★★ */
    min-width: 0; 
}

/* 标题样式：单行 + 省略号 */
.info-home-list .book-title {
    font-size: 15px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
    
    /* 强制一行显示，超出变省略号 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

/* Meta样式：(作者/时间) */
.info-home-list .book-meta {
    font-size: 13px;
    color: #888;
    
    /* 同样限制为单行，超出省略 (如果想显示两行，改 -webkit-line-clamp: 2) */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* 查看全部按钮 */
.view-more-btn {
    display: block;
    text-align: center;
    background: #f9f9f9;
    color: #666;
    padding: 10px;
    border-radius: 4px;
    font-size: 13px;
    margin-top: 15px;
    transition: 0.2s;
}
.view-more-btn:hover {
    background: #eee;
    color: #b71c1c;
}

/* 标签云 */
.tags-list { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; }
.tags-list a { padding: 5px 15px; background: #f9f9f9; border-radius: 20px; color: #555; font-size: 13px; }
.tags-list a:hover { background: #333; color: #fff; }

/* 分类滑动容器 */
.category-scroll-container {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    padding: 0 15px;
}

.category-scroll-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    padding-bottom: 15px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    max-height: 120px; /* 两行的高度 */
    width: 100%;
}

.category-scroll-list::-webkit-scrollbar {
    height: 6px;
}

.category-scroll-list::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 3px;
}

/* 底部导航 */
.bottom-nav {
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: #fff;
    border-top: 1px solid #eee;
    padding: 6px 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: #666;
    text-decoration: none;
    padding: 3px 5px;
    transition: all 0.3s ease;
    flex: 1;
    text-align: center;
}

.nav-item:hover,
.nav-item.active {
    color: var(--red-accent);
    transform: translateY(-1px);
}

.nav-icon {
    width: 20px;
    height: 20px;
    stroke-width: 1.5;
}

.nav-text {
    font-size: 10px;
    font-weight: 500;
}

/* 页面内容样式 */
.page-content {
    padding: 30px 20px;
    max-width: 800px;
    margin: 0 auto;
    padding-bottom: 60px; /* 为底部导航留出空间 */
}

.page-title {
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 40px;
    color: var(--primary-color);
}

/* 联系页面样式 */
.contact-section {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
    text-align: center;
}

.contact-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--red-accent);
}

.contact-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.contact-item h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.contact-item p {
    margin-bottom: 15px;
    color: #666;
}

.qrcode {
    margin: 20px auto;
    width: 200px;
    height: 200px;
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
    border-radius: 8px;
}

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

.book-request-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.form-group {
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--red-accent);
    box-shadow: 0 0 0 2px rgba(255,0,0,0.1);
}

.submit-button {
    background: var(--red-accent);
    color: #fff;
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.submit-button:hover {
    background: #d00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 复制按钮样式 */
.copy-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
}

.copy-text {
    font-weight: 500;
    color: var(--primary-color);
}

.copy-button {
    background: var(--red-accent);
    color: #fff;
    padding: 4px 12px;
    border: none;
    border-radius: 15px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.copy-button:hover {
    background: #d00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* 流光效果 */
.copy-button::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% {
        transform: translateX(-100%) rotate(30deg);
    }
    100% {
        transform: translateX(100%) rotate(30deg);
    }
}

/* 复制成功状态 */
.copy-button.copy-success {
    background: #4CAF50;
    animation: pulse 0.5s ease-in-out;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* 关于页面样式 */
.about-section,
.disclaimer-section,
.contact-info-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    margin-bottom: 30px;
    transition: all 0.3s ease;
}

.about-section:hover,
.disclaimer-section:hover,
.contact-info-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--red-accent);
}

.about-section h2,
.disclaimer-section h2,
.contact-info-section h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--red-accent);
    padding-bottom: 10px;
}

.about-section p,
.disclaimer-section p,
.contact-info-section p {
    margin-bottom: 10px;
    color: #666;
    line-height: 1.6;
}

.disclaimer-section p {
    text-indent: 2em;
}

/* 搜索页面样式 */
.search-section {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.search-section:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: var(--red-accent);
}

.search-form {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
}

.search-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.search-field:focus {
    outline: none;
    border-color: var(--red-accent);
    box-shadow: 0 0 0 2px rgba(255,0,0,0.1);
}

.search-submit {
    background: var(--red-accent);
    color: #fff;
    padding: 0 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-submit:hover {
    background: #d00;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.search-results {
    margin-top: 30px;
}

.search-results h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    color: var(--primary-color);
    border-bottom: 2px solid var(--red-accent);
    padding-bottom: 10px;
}

.search-no-results {
    text-align: center;
    padding: 40px 0;
    color: #666;
}

.search-no-results h2 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
}

.search-no-results p {
    font-size: 14px;
}

/* 底部分类按钮 */
.footer-categories {
    margin-bottom: 30px;
    margin-top: 60px; /* 为底部导航留出空间 */
}

.footer-categories h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary-color);
}

.footer-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0 15px;
}

.footer-category-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f9f9f9;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 13px;
    border: 1px solid #eee;
    flex: 0 0 auto;
    scroll-snap-align: start;
}

.footer-category-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--red-accent);
    color: var(--red-accent);
}

.footer-category-button .category-icon {
    font-size: 16px;
    margin-bottom: 0;
}

.footer-category-button .category-icon-svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
    flex-shrink: 0;
}

.footer-category-button .category-name {
    font-size: 13px;
    margin-bottom: 0;
    font-weight: 500;
}

.footer-category-button .category-count {
    font-size: 12px;
    color: var(--text-gray);
    background: #fff;
    padding: 1px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 4px;
}

/* 分类按钮容器（保留旧样式，以备其他地方使用） */
.category-buttons-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 10px;
}

/* 分类按钮样式（保留旧样式，以备其他地方使用） */
.category-button {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #f9f9f9;
    border-radius: 8px;
    text-align: center;
    transition: all 0.3s ease;
    height: 60px;
    border: 1px solid #eee;
    position: relative;
    overflow: hidden;
}

.category-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.category-button:hover::before {
    left: 100%;
}

.category-button:hover {
    background: #f0f0f0;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
    border-color: var(--red-accent);
}

.category-button .category-icon {
    font-size: 20px;
    margin-right: 8px;
}

.category-button .category-name {
    font-size: 14px;
    font-weight: bold;
    color: var(--primary-color);
    flex: 1;
    text-align: left;
}

.category-button .category-count {
    font-size: 12px;
    color: var(--text-gray);
    background: #fff;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

/* 更多按钮样式（保留旧样式，以备其他地方使用） */
.category-button.more-button {
    background: #f0f0f0;
    border: 2px dashed #ddd;
}

.category-button.more-button:hover {
    background: #e0e0e0;
    border-color: var(--red-accent);
}

/* 查看更多容器 */
.view-more-container {
    display: flex;
    justify-content: center;
    margin-top: 8px;
    margin-bottom: 6px;
}

/* 查看更多按钮样式 */
.view-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--red-accent);
    color: white !important;
    padding: 8px 24px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.view-more-btn:hover {
    background: #a01717;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    color: white !important;
}

/* 列表容器 */
.list-container {
    padding: 0 15px;
}

/* 底部分类按钮 */
.footer-categories {
    margin-bottom: 30px;
}

.footer-categories h3 {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: center;
    color: var(--primary-color);
}

.footer-category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 0 15px;
}

.footer-category-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #f9f9f9;
    border-radius: 20px;
    text-align: center;
    transition: all 0.3s ease;
    font-size: 13px;
    border: 1px solid #eee;
}

.footer-category-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: var(--red-accent);
    color: var(--red-accent);
}

.footer-category-button .category-icon {
    font-size: 16px;
    margin-bottom: 0;
}

.footer-category-button .category-name {
    font-size: 13px;
    margin-bottom: 0;
    font-weight: 500;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    /* 分类滑动容器 */
    .category-scroll-container {
        padding: 0 10px;
    }
    
    .category-scroll-list {
        gap: 8px;
        max-height: 100px; /* 适合单行的高度 */
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 10px;
        width: 100%;
    }
    
    .footer-category-button {
        padding: 6px 12px;
        font-size: 12px;
        flex: 0 0 auto;
    }
    
    .footer-category-button .category-icon {
        font-size: 14px;
    }
    
    .footer-category-button .category-name {
        font-size: 12px;
    }
    
    .footer-category-button .category-count {
        font-size: 11px;
        padding: 1px 6px;
    }
    
    /* 小屏幕设备适配 */
    @media screen and (max-width: 480px) {
        .category-scroll-list {
            gap: 6px;
        }
        
        .footer-category-button {
            padding: 5px 10px;
            font-size: 11px;
        }
        
        .footer-category-button .category-icon {
            font-size: 12px;
        }
        
        .footer-category-button .category-name {
            font-size: 11px;
        }
        
        /* 页面内容适配 */
        .page-content {
            padding: 20px 15px;
        }
        
        .page-title {
            font-size: 24px;
            margin-bottom: 30px;
        }
        
        .contact-item,
        .about-section,
        .disclaimer-section,
        .contact-info-section {
            padding: 15px;
        }
        
        .contact-item h3,
        .about-section h2,
        .disclaimer-section h2,
        .contact-info-section h2 {
            font-size: 18px;
        }
        
        .qrcode {
            width: 150px;
            height: 150px;
        }
    }
    
    /* 小程序端适配 */
    @media screen and (max-width: 400px) {
        /* 网格容器调整 */
        .grid-container {
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 8px;
            padding: 0 10px;
            width: 100% !important;
            margin: 0;
            max-width: 100% !important;
        }
        
        .grid-container .book-item-grid {
            width: 100% !important;
            max-width: 100% !important;
            flex: none !important;
        }
    }
    
    @media screen and (max-width: 375px) {
        /* 微信小程序端：一行三列，等比例缩略图，对称白边 */
        .grid-container {
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 4px;
            padding: 0 8px;
            width: 100% !important;
            max-width: 100% !important;
            box-sizing: border-box;
        }
        
        .grid-container .book-item-grid {
            width: 100% !important;
            max-width: 100% !important;
            flex: none !important;
            padding: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
        }
        
        /* 微信小程序端缩略图：等比例，宽度自适应 */
        .grid-container .book-item-grid .cover-grid {
            width: 100% !important;
            max-width: 100px;
            height: auto !important;
            aspect-ratio: 2/3;
            margin: 0 auto 6px;
        }
        
        .grid-container .book-item-grid .cover-grid img {
            width: 100% !important;
            height: 100% !important;
            object-fit: cover;
        }
        
        /* 微信小程序端文字样式 */
        .grid-container .book-item-grid .book-title {
            font-size: 12px;
            line-height: 1.3;
            height: 32px;
            padding: 0 2px;
        }
        
        .grid-container .book-item-grid .book-meta {
            font-size: 11px;
            padding: 0 2px;
        }
        
        /* 分类滑动容器 */
        .category-scroll-container {
            padding: 0 10px;
        }
        
        .category-scroll-list {
            gap: 6px;
            max-height: 90px;
        }
        
        .footer-category-button {
            padding: 4px 8px;
            font-size: 10px;
        }
        
        .footer-category-button .category-icon {
            font-size: 12px;
        }
        
        .footer-category-button .category-name {
            font-size: 10px;
        }
        
        .footer-category-button .category-count {
            font-size: 9px;
            padding: 1px 4px;
        }
        
        /* 页面内容适配 */
        .page-content {
            padding: 15px 10px;
        }
        
        .page-title {
            font-size: 20px;
            margin-bottom: 20px;
        }
        
        .contact-item,
        .about-section,
        .disclaimer-section,
        .contact-info-section {
            padding: 12px;
        }
        
        .contact-item h3,
        .about-section h2,
        .disclaimer-section h2,
        .contact-info-section h2 {
            font-size: 16px;
        }
        
        .qrcode {
            width: 120px;
            height: 120px;
        }
        
        .form-group input {
            padding: 8px;
            font-size: 13px;
        }
        
        .submit-button {
            padding: 10px 16px;
            font-size: 14px;
        }
    }
    
    /* 分类按钮容器 */
    .category-buttons-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        padding: 0 10px;
    }
    
    .category-button {
        height: 50px;
        padding: 8px 10px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    
    .category-button .category-icon {
        font-size: 18px;
        margin-right: 6px;
        margin-bottom: 0;
    }
    
    .category-button .category-name {
        font-size: 13px;
        margin-bottom: 0;
        flex: 1;
        text-align: left;
    }
    
    .category-button .category-count {
        font-size: 11px;
        margin-left: 6px;
        padding: 2px 6px;
    }
    
    /* 网格容器调整 */
    .grid-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px;
        padding: 0 10px;
        margin: 0;
    }
    
    /* 书籍项目样式 */
    .book-item-grid {
        width: 100%;
    }
    
    /* 书名样式 */
    .book-title {
        font-size: 13px !important;
        line-height: 1.4;
        height: 40px;
        overflow: hidden;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        margin-bottom: 4px;
    }
    
    /* 列表容器 */
    .list-container {
        padding: 0 10px;
    }
    
    /* 底部分类按钮 */
    .footer-category-buttons {
        gap: 8px;
        padding: 0 10px;
    }
    
    .footer-category-button {
        padding: 6px 12px;
        font-size: 12px;
    }
    
    .footer-category-button .category-icon {
        font-size: 14px;
    }
    
    .footer-category-button .category-name {
        font-size: 12px;
    }
    
    /* 小屏幕设备适配 */
    @media screen and (max-width: 480px) {
        .category-buttons-container {
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        
        .category-button {
            height: 45px;
            padding: 6px 8px;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
        }
        
        .category-button .category-icon {
            font-size: 16px;
            margin-right: 5px;
            margin-bottom: 0;
        }
        
        .category-button .category-name {
            font-size: 12px;
            margin-bottom: 0;
            flex: 1;
            text-align: left;
        }
        
        .category-button .category-count {
            font-size: 10px;
            margin-left: 5px;
            padding: 2px 5px;
        }
        
        .grid-container {
            grid-template-columns: repeat(3, 1fr) !important;
            gap: 8px;
        }
        
        .book-title {
            font-size: 12px !important;
            height: 36px;
        }
    }
}

/* =========================================
   6. 列表页 (Archive Page) - 独立滚动布局
   ========================================= */

/* 1. 布局容器调整 */
.list-layout { 
    display: flex; 
    gap: 30px; 
    /* 顶部空间已删除，因为Header已移除 */
    padding-top: 20px; 
    /* 确保容器高度撑满，利于侧边栏定位 */
    min-height: 100vh; 
}

/* 2. 左侧侧边栏 (分类名称) - 独立滚动区域 */
.list-sidebar { 
    width: 160px; 
    flex-shrink: 0; 
    
    /* ★★★ 核心技术：粘性定位 ★★★ */
    position: sticky; 
    top: 20px;  /* 距离顶部的距离 (与padding-top保持一致) */
    
    /* 定义高度：屏幕高度 - 顶部偏移量 */
    height: calc(100vh - 20px); 
    
    /* 允许内部独立滚动 */
    overflow-y: auto; 
    
    /* 美化：隐藏侧边栏的滚动条，虽然能滚，但不显示丑陋的条 */
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE */
}
.list-sidebar::-webkit-scrollbar { 
    display: none; /* Chrome/Safari */
}

/* 侧边栏菜单样式 */
.sidebar-nav { list-style: none; padding-bottom: 20px; }
.sidebar-nav li a { 
    display: block; 
    padding: 10px 15px; 
    color: #333; 
    border-radius: 4px; 
    margin-bottom: 5px; 
    transition: 0.2s;
}
/* 选中及悬停状态 */
.sidebar-nav li.current-cat a, 
.sidebar-nav li a:hover { 
    background: #f0f0f0; 
    font-weight: bold; 
    color: var(--red-accent); 
}

/* 3. 右侧内容区域 */
.list-content { 
    flex: 1; 
    /* 右侧跟随页面主滚动条滚动，无需特殊设置，自然形成“独立”视觉差 */
}

/* 列表项样式 (保持之前的不变) */
.book-item-archive { 
    display: flex; 
    gap: 20px; 
    margin-bottom: 20px; 
    padding-bottom: 20px; 
    border-bottom: 1px solid #f5f5f5; 
}
.cover-archive { 
    width: 64px; 
    flex-shrink: 0; 
    border-radius: 4px; 
    overflow: hidden; 
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); 
}
.cover-archive img { width: 100%; height: auto; aspect-ratio: 64/92; object-fit: cover; }
.info-archive { flex: 1; padding-top: 5px; }
.info-archive .book-title { font-size: 16px; margin-bottom: 8px; font-weight: bold; }
.info-archive p { font-size: 13px; color: #666; margin-bottom: 5px; }
.desc-archive { color: #999; font-size: 12px; line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 10px; }

/* 详情页 Detail */
.detail-container { padding-top: 20px;  }

/* 新布局样式 - 居中封面图 */
.detail-cover-center {
    text-align: center;
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.detail-cover-center img {
    max-width: 200px;
    width: 100%;
    border-radius: 6px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin: 0 auto;
    display: block;
}

.detail-title-center {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
}

.detail-author-center {
    text-align: center;
    margin-bottom: 30px;
}

.detail-author-center a {
    color: var(--red-accent);
    font-size: 16px;
}

.detail-info-list {
    margin-bottom: 40px;
}

.detail-info-item {
    display: flex;
    margin-bottom: 12px;
    font-size: 14px;
    align-items: flex-start;
}

.detail-info-item .detail-label {
    color: #999;
    width: 80px;
    flex-shrink: 0;
}

.detail-info-item .detail-value {
    color: #333;
    flex: 1;
}

.detail-info-item .detail-score {
    margin-left: 10px;
    color: #666;
}

.detail-info-item .detail-tags a {
    color: var(--red-accent);
    margin-right: 10px;
}

.detail-stars { color: #f5a623; }
.detail-section-title { font-size: 18px; font-weight: bold; margin-bottom: 15px; border-left: 4px solid var(--red-accent); padding-left: 10px; }
.detail-content { line-height: 1.8; color: #444; margin-bottom: 40px; font-size: 15px; }
.download-btn { display: inline-flex; align-items: center; gap: 10px; background: var(--red-accent); color: white !important; padding: 10px 40px; border-radius: 30px; font-size: 14px; font-weight: bold; transition: 0.2s; }
.download-btn:hover { opacity: 0.9; }

/* 返回按钮样式 */
.back-button-container {
    margin-bottom: 20px;
}

.back-button {
    display: inline-block;
    background: var(--red-accent);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.back-button:hover {
    background: #d00;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: #fff;
}

/* Footer */
footer { text-align: center; color: #999; font-size: 12px; }
footer a { color: #999; margin: 0 5px; }

/* Footer 分类区域 - 与首页分类浏览一致 */
.footer-categories-section {
    background: #fff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    margin-bottom: 80px;
    width: 100%;
    box-sizing: border-box;
}

.footer-categories-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 15px;
}

.footer-categories-section .section-header h2 {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

.footer-categories-section .category-buttons-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    padding: 0 10px;
}

.footer-categories-section .category-button {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #f9f9f9;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.footer-categories-section .category-button:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.footer-categories-section .category-icon {
    font-size: 16px;
    color: var(--red-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.footer-categories-section .category-icon svg {
    width: 16px;
    height: 16px;
    color: var(--red-accent);
}

.footer-categories-section .category-info {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.footer-categories-section .category-name {
    font-size: 13px;
    font-weight: 500;
    color: #333;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.footer-categories-section .category-count {
    font-size: 11px;
    color: #999;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

/* 移动端适配 */
@media screen and (max-width: 768px) {
    .footer-categories-section .category-buttons-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .footer-categories-section .category-button {
        padding: 10px;
    }
    
    .footer-categories-section .category-icon {
        font-size: 16px;
        width: 24px;
        height: 24px;
    }
    
    .footer-categories-section .category-icon svg {
        width: 16px;
        height: 16px;
    }
    
    .footer-categories-section .category-name {
        font-size: 12px;
    }
    
    .footer-categories-section .category-count {
        font-size: 10px;
    }
}

/* 测试样式 - 用于检查样式是否加载 */
body {
    background-color: #f5f5f5;
}

/* 联系页面样式 */
.contact-page-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: calc(100vh - 60px);
    padding: 30px 0 50px;
}

.contact-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 页面头部 */
.contact-header {
    text-align: center;
    margin-bottom: 35px;
}

.header-icon {
    width: 70px;
    height: 70px;
    margin: 0 auto 15px;
    background: linear-gradient(135deg, var(--red-accent) 0%, #e74c3c 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(199, 30, 30, 0.3);
}

.header-icon svg {
    width: 35px;
    height: 35px;
    color: #fff;
}

.contact-header h1 {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.contact-header p {
    font-size: 14px;
    color: #888;
    margin: 0;
}

/* 联系方式卡片 */
.contact-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.contact-card {
    background: #fff;
    border-radius: 16px;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.contact-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    border-color: rgba(199, 30, 30, 0.1);
}

.card-icon {
    width: 55px;
    height: 55px;
    margin: 0 auto 15px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon.wechat {
    background: linear-gradient(135deg, #07c160 0%, #05a050 100%);
    box-shadow: 0 6px 15px rgba(7, 193, 96, 0.3);
}

.card-icon.qq {
    background: linear-gradient(135deg, #12b7f5 0%, #0a9bd8 100%);
    box-shadow: 0 6px 15px rgba(18, 183, 245, 0.3);
}

.card-icon svg {
    width: 28px;
    height: 28px;
    color: #fff;
}

.contact-card h3 {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.contact-card > p {
    font-size: 13px;
    color: #888;
    margin: 0 0 15px 0;
}

.qrcode-box {
    width: 140px;
    height: 140px;
    margin: 0 auto;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 10px;
    border: 1px solid #eee;
}

.qrcode-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}

.contact-info-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.info-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #555;
}

.info-item svg {
    width: 16px;
    height: 16px;
    color: var(--red-accent);
}

/* 找书表单区域 */
.book-request-section {
    background: #fff;
    border-radius: 16px;
    padding: 30px 25px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.06);
}

.section-header {
    text-align: center;
    margin-bottom: 25px;
}

.header-icon-small {
    width: 45px;
    height: 45px;
    margin: 0 auto 12px;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(243, 156, 18, 0.3);
}

.header-icon-small svg {
    width: 22px;
    height: 22px;
    color: #fff;
}

.section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin: 0 0 8px 0;
}

.section-header p {
    font-size: 13px;
    color: #888;
    margin: 0;
}

/* 表单样式 */
.book-request-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #444;
}

.form-group label svg {
    width: 16px;
    height: 16px;
    color: var(--red-accent);
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    background: #fafafa;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: var(--red-accent);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(199, 30, 30, 0.08);
}

.form-group input::placeholder {
    color: #aaa;
}

.submit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--red-accent) 0%, #e74c3c 100%);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 5px;
    box-shadow: 0 4px 15px rgba(199, 30, 30, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(199, 30, 30, 0.4);
}

.submit-btn svg {
    width: 18px;
    height: 18px;
}

/* 移动端适配 */
@media screen and (max-width: 600px) {
    .contact-page-wrapper {
        padding: 20px 0 40px;
    }
    
    .contact-header {
        margin-bottom: 25px;
    }
    
    .header-icon {
        width: 60px;
        height: 60px;
    }
    
    .header-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .contact-header h1 {
        font-size: 22px;
    }
    
    .contact-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .contact-card {
        padding: 20px 15px;
    }
    
    .card-icon {
        width: 50px;
        height: 50px;
    }
    
    .card-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .qrcode-box {
        width: 120px;
        height: 120px;
    }
    
    .book-request-section {
        padding: 25px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
}

/* 搜索页面样式 */
.search-page-wrapper {
    min-height: calc(100vh - 60px);
    padding: 20px 0 50px;
    background: #f5f5f5;
}

.search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

.search-header-section {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-title-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.search-icon {
    width: 24px;
    height: 24px;
    color: var(--red-accent);
}

.search-title-bar h1 {
    font-size: 20px;
    font-weight: bold;
    margin: 0;
    color: #333;
}

.search-keyword-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 8px;
}

.keyword-label {
    font-size: 14px;
    color: #666;
}

.keyword-text {
    font-size: 14px;
    font-weight: 500;
    color: var(--red-accent);
}

.search-stats {
    background: #fff;
    border-radius: 8px;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-result-card {
    display: flex;
    gap: 15px;
    background: #fff;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.result-cover {
    width: 80px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f0f0f0;
}

.result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 2/3;
}

.no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
}

.no-cover svg {
    width: 40%;
    height: 40%;
    color: var(--red-accent);
    opacity: 0.6;
}

.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    color: #333;
    line-height: 1.4;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-item svg {
    width: 16px;
    height: 16px;
    color: var(--red-accent);
}

.result-excerpt {
    font-size: 14px;
    color: #888;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.search-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.search-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0 2px;
    border-radius: 50%;
    background: #fff;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-pagination .page-numbers:hover,
.search-pagination .page-numbers.current {
    background: var(--red-accent);
    color: #fff;
}

.search-pagination .page-numbers.prev,
.search-pagination .page-numbers.next {
    width: auto;
    padding: 0 12px;
    border-radius: 20px;
}

.search-pagination .page-numbers.prev svg,
.search-pagination .page-numbers.next svg {
    width: 16px;
    height: 16px;
}

.no-results-box {
    background: #fff;
    border-radius: 12px;
    padding: 40px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.no-results-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.no-results-icon svg {
    width: 40px;
    height: 40px;
    color: var(--red-accent);
    opacity: 0.6;
}

.no-results-box h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 10px 0;
    color: #333;
}

.no-results-box p {
    font-size: 14px;
    color: #666;
    margin: 0 0 20px 0;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--red-accent);
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: #a01717;
    transform: translateY(-2px);
}

.back-home-btn svg {
    width: 16px;
    height: 16px;
}


/* 移动端适配 */
@media screen and (max-width: 768px) {
    
    /* --- 1. 基础容器修正 (解决空白问题) --- */
    .container { 
        max-width: 100%; 
        padding: 0 15px; 
        box-sizing: border-box;
    }
    
    /* 网格容器移动端三列 */
    .grid-container {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 10px;
        padding: 0 10px;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box;
    }
    
    .grid-container .book-item-grid {
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important;
    }
    
    /* 所有的页面顶部容器，只留出 Header 的高度 (约50-60px) */
    /* 之前设置 110px 导致了巨大的空白，现在改回 60px */
    .list-layout, 
    .detail-container { 
        padding-top: 20px !important; 
        margin-top: 0 !important;
        width: 100%;
        box-sizing: border-box;
    }

    /* --- 2. 顶部 Header (Logo居中 + 搜索图标) --- */
    .home-navbar { 
        padding: 20px 0; 
        width: 100%;
        box-sizing: border-box;
    }
    
    /* 内页顶部条 */
    .topbar-wrapper { 
        position: fixed;
        top: 0; left: 0; width: 100%;
        height: 60px; /* 固定高度 */
        background: #fff;
        z-index: 1000;
        border-bottom: 1px solid #eee;
        padding: 0; /* 清除内边距 */
        box-sizing: border-box;
    }
    
    .topbar-inner { 
        position: relative; 
        height: 100%; 
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0 15px;
        box-sizing: border-box;
    }
    
    /* Logo 绝对居中 */
    .topbar-logo { 
        font-size: 18px;
        display: flex;
        align-items: center;
        gap: 5px;
    }
    .topbar-logo img { width: 24px; height: 24px; }
    
    /* 搜索触发按钮 (放在最右侧) */
    .mobile-search-trigger {
        display: block;
        position: absolute;
        right: 15px; /* 距离右边 */
        top: 50%;
        transform: translateY(-50%);
        padding: 5px;
        z-index: 1002; /* 保证在最上层 */
        background: none; border: none;
    }

    /* --- 3. 搜索框 (美化 + 铺满) --- */
    .topbar-search {
        display: none; /* 默认隐藏 */
        position: absolute;
        top: 0; left: 0; width: 100%; height: 100%;
        background: #fff;
        z-index: 1001; /* 盖住Logo */
        padding: 10px 15px;
        align-items: center;
        box-sizing: border-box;
    }
    
    /* 激活时显示 (JS控制) */
    .topbar-search.active {
        display: flex !important;
    }
    
    .topbar-search form { width: 100%; display: flex; position: relative; }
    
    .topbar-search input {
        width: 100%;
        background: #f2f2f2; /* 灰色背景 */
        border: none;
        border-radius: 4px; /* 稍微圆角 */
        padding: 8px 40px 8px 15px; /*以此为准 */
        font-size: 14px;
        height: 40px;
        outline: none;
        text-align: left; /* 输入时文字靠左 */
        box-sizing: border-box;
    }
    
    /* 搜索框内的放大镜按钮 */
    .topbar-search .search-btn {
        position: absolute;
        right: 0; top: 0; height: 100%; width: 40px;
        display: flex; align-items: center; justify-content: center;
        background: none; border: none;
    }

    /* --- 4. 分类导航栏 (吸顶 + 加底色) --- */
    .list-sidebar { 
        width: 100%; 
        height: auto; 
        
        /* 核心：粘性定位 */
        position: sticky; 
        top: 0; /* 紧贴顶部 */
        
        /* 核心：加底色防止透明遮挡 */
        background: #fff; 
        z-index: 900; 
        
        padding: 10px 0; 
        border-bottom: 1px solid #eee;
        box-shadow: 0 4px 6px rgba(0,0,0,0.02); /* 加点阴影更明显 */
        
        /* 横向滚动 */
        overflow-x: auto; 
        overflow-y: hidden;
        white-space: nowrap;
        margin-bottom: 15px; /* 与下方内容的间距 */
        box-sizing: border-box;
    }
    
    .sidebar-nav { 
        display: inline-flex; /* 关键：防止换行 */
        gap: 10px; 
        padding: 0 15px; /* 两侧留白 */
        margin: 0;
        box-sizing: border-box;
    }
    
    .sidebar-nav li a { 
        background: #f5f5f5; 
        border-radius: 20px; 
        padding: 6px 16px; 
        font-size: 13px;
        color: #333;
        display: block;
    }
    
    /* 选中高亮 */
    .sidebar-nav li.current-cat a {
        background: #b71c1c; /* 红色背景 */
        color: #fff;
    }

    /* 1. 调整网格容器为一行三列 */
    .grid-container {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important; /* 强制三列 */
        gap: 15px 10px; /* 上下间距15px，左右间距10px */
        padding: 10px;
        width: 100%;
        box-sizing: border-box;
        margin: 0 auto;
    }

    /* 2. 书籍项目容器样式 */
    .book-item-grid {
        display: flex;
        flex-direction: column;
        align-items: flex-start; /* 左对齐 */
        width: 100%;
        box-sizing: border-box;
    }

    /* 3. 图片（封面）样式：增加圆角和阴影，保持比例 */
    .cover-grid {
        width: 100%;
        margin-bottom: 8px;
        display: block;
        box-sizing: border-box;
    }

    .cover-grid img {
        width: 100%;
        height: auto;
        aspect-ratio: 3 / 4; /* 锁定书籍封面的高度比例，防止封面不齐 */
        object-fit: cover;
        border-radius: 6px; /* 圆角 */
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* 阴影效果 */
        display: block;
        box-sizing: border-box;
    }

    /* 4. 书名样式 */
    .book-title {
        font-size: 13px !important;
        line-height: 1.3;
        color: #333;
        font-weight: 500;
        margin-bottom: 4px;
        /* 以下代码实现两行文字截断，防止书名过长撑乱布局 */
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        text-align: left;
        width: 100%;
        box-sizing: border-box;
    }

    /* 5. 作者（Meta信息）样式 */
    .book-meta {
        font-size: 11px !important;
        color: #888;
        text-align: left;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        width: 100%;
        box-sizing: border-box;
    }

    /* 6. 调整标题栏样式 (文学 / 查看全部) */
    .section-header {
        padding: 0 10px;
        margin-bottom: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    .section-header h2 {
        font-size: 18px;
    }
	
    /* --- 5. 列表内容适配 --- */
    .list-layout { 
        flex-direction: column; 
        gap: 0; 
        width: 100%;
        box-sizing: border-box;
    }
    .cover-archive { 
        width: 64px; 
        box-sizing: border-box;
    } /* 移动端列表图大小 */
    
    /* --- 6. 首页双栏适配 --- */
    .home-split-layout { 
        flex-direction: column; 
        gap: 30px; 
        width: 100%;
        box-sizing: border-box;
    }
    .home-mini-grid { 
        grid-template-columns: 1fr; 
        gap: 15px; 
        width: 100%;
        box-sizing: border-box;
    } /* 单列 */
    .book-item-home-list { 
        border-bottom: 1px solid #f9f9f9; 
        padding-bottom: 15px;
        width: 100%;
        box-sizing: border-box;
    }
    
    /* --- 7. 分类按钮容器适配 --- */
    .category-buttons-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
        width: 100%;
        box-sizing: border-box;
        padding: 0 10px;
    }
    
    .category-button {
        height: 100px;
        padding: 15px;
        box-sizing: border-box;
    }
    
    .category-name {
        font-size: 14px;
    }
    
    .category-count {
        font-size: 12px;
    }
    
    /* --- 8. 滚动容器适配 --- */
    .scroll-container {
        width: 100%;
        box-sizing: border-box;
        padding: 0 10px;
    }
    
    .scroll-list {
        gap: 15px;
        padding-bottom: 15px;
        box-sizing: border-box;
    }
    
    /* --- 9. 首页区块适配 --- */
    .home-section {
        width: 100%;
        box-sizing: border-box;
        padding: 0;
    }
    
    /* --- 10. 修复小屏幕设备的显示问题 --- */
    @media screen and (max-width: 480px) {
        .grid-container {
            grid-template-columns: repeat(3, 1fr) !important; /* 在小屏幕上也显示三列 */
            gap: 8px;
        }
        
        .category-buttons-container {
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
        }
        
        .category-button {
            height: 40px;
            padding: 5px 6px;
            flex-direction: row;
            align-items: center;
            justify-content: space-between;
        }
        
        .category-button .category-icon {
            font-size: 14px;
            margin-right: 4px;
            margin-bottom: 0;
        }
        
        .category-button .category-name {
            font-size: 11px;
            margin-bottom: 0;
            flex: 1;
            text-align: left;
        }
        
        .category-button .category-count {
            font-size: 9px;
            margin-left: 4px;
            padding: 1px 4px;
        }
        
        .section-header {
            padding: 0 5px;
        }
        
        .scroll-container {
            padding: 0 5px;
        }
        
        .scroll-list {
            gap: 10px;
        }
    }
}
	
	
	
/* =========================================
   搜索页面样式 (优化版)
   ========================================= */

/* 搜索页面外层 */
.search-page-wrapper {
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    min-height: calc(100vh - 60px);
    padding: 20px 0 40px;
}

.search-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 搜索头部区域 */
.search-header-section {
    background: #fff;
    border-radius: 12px;
    padding: 25px 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.search-title-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
}

.search-title-bar .search-icon {
    width: 28px;
    height: 28px;
    color: var(--red-accent);
}

.search-title-bar h1 {
    font-size: 22px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.search-keyword-box {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid var(--red-accent);
}

.keyword-label {
    font-size: 14px;
    color: #666;
}

.keyword-text {
    font-size: 15px;
    color: #333;
    font-weight: 500;
}

/* 结果统计 */
.search-stats {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
    padding: 0 5px;
}

.search-stats strong {
    color: var(--red-accent);
    font-weight: 600;
}

/* 搜索结果列表 */
.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* 搜索结果卡片 */
.search-result-card {
    display: flex;
    gap: 18px;
    background: #fff;
    border-radius: 12px;
    padding: 18px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid transparent;
}

.search-result-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: rgba(199, 30, 30, 0.1);
}

/* 封面图 */
.result-cover {
    width: 100px;
    height: 140px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.result-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-cover .no-cover {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

.result-cover .no-cover svg {
    width: 40px;
    height: 40px;
}

/* 信息区 */
.result-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.result-title {
    font-size: 17px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 元信息 */
.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 12px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #666;
}

.meta-item svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.meta-item.author {
    color: #555;
}

.meta-item.category {
    color: var(--red-accent);
}

.meta-item.rating {
    color: #f5a623;
}

/* 简介 */
.result-excerpt {
    font-size: 13px;
    color: #888;
    line-height: 1.6;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* 分页 */
.search-pagination {
    margin-top: 30px;
    display: flex;
    justify-content: center;
}

.search-pagination .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 8px;
    font-size: 14px;
    color: #666;
    text-decoration: none;
    background: #fff;
    transition: all 0.2s ease;
}

.search-pagination .page-numbers:hover {
    background: #f0f0f0;
    color: #333;
}

.search-pagination .page-numbers.current {
    background: var(--red-accent);
    color: #fff;
}

.search-pagination .page-numbers svg {
    width: 18px;
    height: 18px;
}

/* 无结果提示 */
.no-results-box {
    text-align: center;
    padding: 60px 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}

.no-results-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    color: #ddd;
}

.no-results-icon svg {
    width: 100%;
    height: 100%;
}

.no-results-box h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
    font-weight: 500;
}

.no-results-box p {
    font-size: 14px;
    color: #888;
    margin-bottom: 25px;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--red-accent);
    color: #fff;
    text-decoration: none;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: #a01818;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(199, 30, 30, 0.3);
}

.back-home-btn svg {
    width: 18px;
    height: 18px;
}

/* 移动端适配 */
@media (max-width: 600px) {
    .search-page-wrapper {
        padding: 15px 0 30px;
    }
    
    .search-header-section {
        padding: 20px;
        margin-bottom: 15px;
    }
    
    .search-title-bar h1 {
        font-size: 18px;
    }
    
    .search-result-card {
        padding: 15px;
        gap: 15px;
    }
    
    .result-cover {
        width: 80px;
        height: 110px;
    }
    
    .result-title {
        font-size: 15px;
        margin-bottom: 8px;
    }
    
    .result-meta {
        gap: 10px;
        margin-bottom: 8px;
    }
    
    .meta-item {
        font-size: 12px;
    }
    
    .meta-item svg {
        width: 12px;
        height: 12px;
    }
    
    .result-excerpt {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
}
