/* ========== 响应式设计样式 ========== */
/* 专门负责所有移动端和响应式布局 */

/* 平板电脑适配 (992px) */
@media (max-width: 992px) {
    /* 导航菜单切换 */
    .main-nav {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    /* 书籍网格布局 */
    .book-item {
        width: 33.333%;
    }
    
    /* 书籍详情页布局 */
    .book-detail-header {
        flex-direction: column;
    }
    
    .book-detail-cover {
        margin-right: 0;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .book-detail-cover img {
        max-width: 200px;
    }
    
    /* 页脚布局调整 */
    .footer-content {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-logo {
        margin-bottom: 20px;
    }
    
    .footer-nav ul {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .footer-nav li {
        margin: 0 10px 10px;
    }
}

/* 手机端适配 (768px) */
@media (max-width: 768px) {
    /* 书籍网格布局 - 移动端每行2个封面，最小化间距 */
    .book-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 固定2列 */
        gap: 4px; /* 进一步减少间距到4px */
        justify-content: stretch; /* 拉伸填满容器 */
        padding: 5px; /* 最小化内边距到5px */
        margin: 0; /* 移除外边距 */
    }
    
    .book-item {
        width: 100%; /* 占满网格单元格 */
        display: flex;
        flex-direction: column;
        margin: 0; /* 移除item的边距 */
    }
    
    /* 书籍封面样式 - 最大化利用空间 */
    .book-cover-link {
        width: 100%;
        height: 200px; /* 增加高度到200px，给封面更多空间 */
        display: block;
        margin-bottom: 5px; /* 封面和文字间的小间距 */
    }
    
    .book-cover-link img {
        width: 100% !important;
        height: 200px !important; /* 对应调整图片高度 */
        object-fit: cover;
        border-radius: 4px; /* 添加圆角美化 */
    }
    
    /* 优化书籍信息区域 */
    .book-info {
        padding: 5px !important; /* 减少信息区域内边距 */
    }
    
    /* 书籍信息文字样式 */
    .book-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .book-author {
        font-size: 10px;
        margin-bottom: 4px;
    }
    
    .book-meta {
        font-size: 9px;
    }
    
    .book-status {
        font-size: 8px;
        padding: 2px 4px;
    }
    
    /* 章节内容样式 */
    .chapter-content {
        padding: 20px;
        font-size: 16px;
    }
    
    /* 章节导航布局 */
    .chapter-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 分页组件样式 */
    .pagination {
        margin: 30px 0;
        gap: 6px;
    }
    
    .pagination a {
        min-width: 40px;
        height: 40px;
        font-size: 13px;
    }
    
    .pagination .page-prev,
    .pagination .page-next {
        padding: 0 12px;
    }
    
    /* 书籍详情页章节列表标题行响应式样式 */
    .book-chapter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .book-chapter-header .chapter-last-update {
        font-size: 14px;
    }
    
    /* 搜索表单移动端优化 */
    .search-form {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .search-form input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 容器移动端调整 */
    .container {
        padding: 0 10px;
    }
    
    /* 站点内容移动端间距 */
    .site-content {
        padding: 20px 0;
    }
    
    /* 书籍详情移动端调整 */
    .book-detail {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    /* 章节列表移动端调整 */
    .chapter-list {
        padding: 15px;
    }
    
    /* 页面标题移动端调整 */
    .page-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    /* 最新章节列表移动端调整 */
    .latest-chapter-list {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .latest-chapter-list h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    /* 分类标题移动端调整 */
    .category-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    /* 首页分类移动端调整 */
    .home-category {
        margin-bottom: 30px;
    }
    
    .home-category-title {
        font-size: 18px;
    }
}

/* 小屏手机适配 (480px) */
@media (max-width: 480px) {
    /* 书籍网格进一步优化 */
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .book-cover-link {
        height: 160px;
    }
    
    .book-cover-link img {
        height: 160px !important;
    }
    
    /* 最新章节列表响应式样式 */
    .latest-chapter-list {
        grid-template-columns: 1fr;
    }
    
    /* 书籍详情页章节列表标题行响应式样式 */
    .book-chapter-header {
        gap: 8px;
    }
    
    .book-chapter-header .chapter-last-update {
        font-size: 12px;
    }
    
    /* 容器进一步缩小间距 */
    .container {
        padding: 0 8px;
    }
    
    /* 书籍详情进一步优化 */
    .book-detail {
        padding: 12px;
    }
    
    /* 章节列表进一步优化 */
    .chapter-list {
        padding: 12px;
    }
    
    /* 分页组件小屏优化 */
    .pagination a {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
        padding: 0 8px;
    }
    
    /* 页码跳转功能小屏优化 */
    .pagination .page-jump {
        height: 36px;
        padding: 0 8px;
        margin-left: 8px;
        gap: 4px;
    }
    
    .pagination .jump-label {
        font-size: 12px;
    }
    
    .pagination .jump-input {
        width: 40px;
        height: 28px;
        font-size: 12px;
        padding: 0 4px;
    }
    
    .pagination .jump-btn {
        height: 28px;
        padding: 0 8px;
        font-size: 12px;
    }
    
    /* 搜索表单小屏优化 */
    .search-form {
        margin: 0 8px;
    }
    
    /* 页面标题小屏优化 */
    .page-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    /* 书籍详情标题小屏优化 */
    .book-detail-title {
        font-size: 20px;
    }
    
    /* 章节标题小屏优化 */
    .chapter-title {
        font-size: 20px;
    }
    
    /* 移动菜单小屏优化 */
    .mobile-menu {
        width: 220px;
        padding: 12px;
    }
    
    /* 站点头部小屏优化 */
    .site-header {
        padding: 12px 0;
    }
    
    .logo a {
        font-size: 18px;
    }
}

/* 超小屏设备适配 (360px) */
@media (max-width: 360px) {
    /* 书籍网格超小屏优化 */
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .book-cover-link {
        height: 140px;
    }
    
    .book-cover-link img {
        height: 140px !important;
    }
    
    /* 容器超小屏优化 */
    .container {
        padding: 0 6px;
    }
    
    /* 书籍信息超小屏优化 */
    .book-title {
        font-size: 13px;
    }
    
    .book-author {
        font-size: 11px;
    }
    
    .book-meta {
        font-size: 10px;
    }
    
    /* 分页超小屏优化 */
    .pagination a {
        min-width: 32px;
        height: 32px;
        font-size: 11px;
        padding: 0 6px;
    }
    
    /* 页码跳转功能超小屏优化 */
    .pagination .page-jump {
        height: 32px;
        padding: 0 6px;
        margin-left: 6px;
        gap: 3px;
    }
    
    .pagination .jump-label {
        font-size: 11px;
    }
    
    .pagination .jump-input {
        width: 35px;
        height: 24px;
        font-size: 11px;
        padding: 0 3px;
    }
    
    .pagination .jump-btn {
        height: 24px;
        padding: 0 6px;
        font-size: 11px;
    }
    
    /* 移动菜单超小屏优化 */
    .mobile-menu {
        width: 200px;
        padding: 10px;
    }
    
    /* 搜索表单超小屏优化 */
    .search-form {
        margin: 0 6px;
    }
    
    .search-form input,
    .search-form button {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 横屏时的特殊优化 */
    .site-content {
        padding: 15px 0;
    }
    
    .book-detail {
        padding: 12px;
    }
    
    .chapter-content {
        padding: 15px;
        font-size: 15px;
    }
    
    /* 横屏时书籍网格调整 */
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .book-cover-link {
        height: 160px;
    }
    
    .book-cover-link img {
        height: 160px !important;
    }
}
@media screen and (max-width: 600px) {
    .site-footer p {
        font-size: 12px;
        padding: 10px;
        line-height: 1.4;
    }
}
/* 打印样式 */
@media print {
    /* 隐藏不必要的元素 */
    .site-header,
    .search-bar,
    .mobile-menu,
    .mobile-menu-toggle,
    .pagination,
    .chapter-navigation,
    .site-footer {
        display: none !important;
    }
    
    /* 优化打印布局 */
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .site-content {
        padding: 0;
    }
    
    .chapter-content {
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* 确保链接显示URL */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    /* 分页符 */
    .chapter-content {
        page-break-inside: avoid;
    }
}
/* 桌面端适配 (769px以上) */
@media (min-width: 769px) {
    /* 桌面端保持原有网格布局 */
    .book-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }
    
    .book-item {
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
    }
    
    /* 桌面端状态样式 */
    .book-status {
        position: absolute !important;
        bottom: 8px !important;
        right: 8px !important;
        top: auto !important;
        padding: 4px 10px !important;
        border-radius: 12px !important;
        font-size: 11px !important;
        color: white !important;
        font-weight: 500 !important;
        z-index: 2 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
        backdrop-filter: none !important;
        white-space: nowrap !important;
        min-width: auto !important;
        max-width: calc(100% - 16px) !important;
    }
    
    .category-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .category-block::before {
        display: none;
    }
}

/* 移动端横向滑动容器样式 - 修改为网格布局 */
@media (max-width: 768px) {
    /* 移动端2列网格布局 - 完全重写 */
    @media (max-width: 768px) {
        /* 移动端固定2列网格布局 */
        .book-grid {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            gap: 15px !important;
            padding: 10px 15px !important;
            margin-bottom: 20px !important;
            /* 确保不滑动 */
            overflow: visible !important;
            overflow-x: visible !important;
            overflow-y: visible !important;
            /* 移除所有滑动相关属性 */
            scroll-snap-type: none !important;
            -webkit-overflow-scrolling: auto !important;
            position: static !important;
            /* 移除背景效果 */
            background: none !important;
            background-image: none !important;
        }
    
        /* 完全移除伪元素 */
        .book-grid::before,
        .book-grid::after {
            display: none !important;
            content: none !important;
        }
    
        /* 书籍项目网格样式 */
        .book-item {
            display: block !important;
            flex: none !important;
            width: 100% !important;
            height: auto !important;
            /* 移除滑动相关属性 */
            scroll-snap-align: none !important;
            padding: 0 !important;
            margin: 0 !important;
            /* 确保正常显示 */
            position: relative !important;
        }
    
        /* 完全移除滚动条 */
        .book-grid::-webkit-scrollbar {
            display: none !important;
            width: 0 !important;
            height: 0 !important;
        }
    
        .book-grid::-webkit-scrollbar-track,
        .book-grid::-webkit-scrollbar-thumb {
            display: none !important;
        }
    
        /* 移动端图书状态样式 */
        .book-status {
            position: absolute !important;
            bottom: 8px !important;
            right: 8px !important;
            top: auto !important;
            padding: 4px 8px !important;
            border-radius: 12px !important;
            font-size: 10px !important;
            color: white !important;
            font-weight: 500 !important;
            z-index: 2 !important;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
            backdrop-filter: blur(4px) !important;
            white-space: nowrap !important;
            min-width: auto !important;
        }
    }
}

/* 移动端大图预览优化 */
@media (max-width: 768px) {
    .cover-preview .preview-image {
        min-width: 80vw !important;
        min-height: 80vh !important;
        max-width: 90vw !important;
        max-height: 90vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .cover-preview .preview-image-container {
        padding: 20px !important;
    }
}

/* 平板端大图预览优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .cover-preview .preview-image {
        max-width: 85vw !important;
        max-height: 85vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
}

/* 桌面端大图预览优化 */
@media (min-width: 1025px) {
    .cover-preview .preview-image {
        /* 桌面端不设置最小尺寸，让图片按原始尺寸显示 */
        max-width: 90vw !important;
        max-height: 90vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
}

/* 移动端菜单优化 - 新增样式 */
@media (max-width: 768px) {
    /* 隐藏桌面端登录链接 */
    .desktop-only {
        display: none !important;
    }
    
    /* 优化移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
        color: white;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .mobile-menu-toggle .menu-text {
        font-weight: 500;
        white-space: nowrap;
    }
    
    .mobile-menu-toggle svg {
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .mobile-menu-toggle.active svg {
        transform: rotate(180deg);
    }
    
    /* 下拉式菜单样式 */
    .mobile-menu-dropdown {
        position: absolute;
        top: 100%;
        right: 15px;
        width: 180px;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .mobile-menu-dropdown.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .mobile-menu-dropdown ul {
        list-style: none;
        margin: 0;
        padding: 8px 0;
    }
    
    .mobile-menu-dropdown ul li {
        margin: 0;
    }
    
    .mobile-menu-dropdown ul li a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        color: #333;
        text-decoration: none;
        font-size: 14px;
        transition: background-color 0.2s ease;
        border: none;
    }
    
    .mobile-menu-dropdown ul li a:hover {
        background-color: #f5f5f5;
        color: #2c5aa0;
    }
    
    .mobile-menu-dropdown ul li.active a {
        background-color: #e3f2fd;
        color: #1976d2;
        font-weight: 500;
    }
    
    .mobile-menu-dropdown ul li a svg {
        margin-right: 6px;
        flex-shrink: 0;
    }
    
    /* 确保header有相对定位 */
    .site-header {
        position: relative;
    }
    
    /* 隐藏原有的侧边菜单 */
    .mobile-menu {
        display: none !important;
    }
}

/* 桌面端保持原有样式 */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-menu-dropdown {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
    
    /* PC端图书详情页左右布局 */
    .book-detail-layout {
        display: flex !important;
        flex-direction: row !important;  /* PC端使用左右布局 */
        gap: 30px !important;
        align-items: flex-start !important;
    }
    
    .book-left-section {
        flex: 0 0 200px !important;  /* 固定宽度 */
        width: 200px !important;
    }
    
    .book-right-section {
        flex: 1 !important;  /* 占据剩余空间 */
    }
}

/* 手机端适配 (768px) */
@media (max-width: 768px) {
    /* 书籍网格布局 - 移动端每行2个封面，最小化间距 */
    .book-grid {
        display: grid;
        grid-template-columns: 1fr 1fr; /* 固定2列 */
        gap: 4px; /* 进一步减少间距到4px */
        justify-content: stretch; /* 拉伸填满容器 */
        padding: 5px; /* 最小化内边距到5px */
        margin: 0; /* 移除外边距 */
    }
    
    .book-item {
        width: 100%; /* 占满网格单元格 */
        display: flex;
        flex-direction: column;
        margin: 0; /* 移除item的边距 */
    }
    
    /* 书籍封面样式 - 最大化利用空间 */
    .book-cover-link {
        width: 100%;
        height: 200px; /* 增加高度到200px，给封面更多空间 */
        display: block;
        margin-bottom: 5px; /* 封面和文字间的小间距 */
    }
    
    .book-cover-link img {
        width: 100% !important;
        height: 200px !important; /* 对应调整图片高度 */
        object-fit: cover;
        border-radius: 4px; /* 添加圆角美化 */
    }
    
    /* 优化书籍信息区域 */
    .book-info {
        padding: 5px !important; /* 减少信息区域内边距 */
    }
    
    /* 书籍信息文字样式 */
    .book-title {
        font-size: 14px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .book-author {
        font-size: 12px;
        margin-bottom: 4px;
    }
    
    .book-meta {
        font-size: 11px;
    }
    
    .book-status {
        font-size: 10px;
        padding: 2px 4px;
    }
    
    /* 章节内容样式 */
    .chapter-content {
        padding: 20px;
        font-size: 16px;
    }
    
    /* 章节导航布局 */
    .chapter-navigation {
        flex-direction: column;
        gap: 10px;
    }
    
    /* 分页组件样式 */
    .pagination {
        margin: 30px 0;
        gap: 6px;
    }
    
    .pagination a {
        min-width: 40px;
        height: 40px;
        font-size: 13px;
    }
    
    .pagination .page-prev,
    .pagination .page-next {
        padding: 0 12px;
    }
    
    /* 书籍详情页章节列表标题行响应式样式 */
    .book-chapter-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .book-chapter-header .chapter-last-update {
        font-size: 14px;
    }
    
    /* 搜索表单移动端优化 */
    .search-form {
        max-width: 100%;
        margin: 0 10px;
    }
    
    .search-form input {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 容器移动端调整 */
    .container {
        padding: 0 10px;
    }
    
    /* 站点内容移动端间距 */
    .site-content {
        padding: 20px 0;
    }
    
    /* 书籍详情移动端调整 */
    .book-detail {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    /* 章节列表移动端调整 */
    .chapter-list {
        padding: 15px;
    }
    
    /* 页面标题移动端调整 */
    .page-title {
        font-size: 22px;
        margin-bottom: 15px;
    }
    
    /* 最新章节列表移动端调整 */
    .latest-chapter-list {
        padding: 15px;
        margin-bottom: 20px;
    }
    
    .latest-chapter-list h3 {
        font-size: 16px;
        margin-bottom: 12px;
    }
    
    /* 分类标题移动端调整 */
    .category-title {
        font-size: 20px;
        margin-bottom: 8px;
    }
    
    /* 首页分类移动端调整 */
    .home-category {
        margin-bottom: 30px;
    }
    
    .home-category-title {
        font-size: 18px;
    }
}

/* 小屏手机适配 (480px) */
@media (max-width: 480px) {
    /* 书籍网格进一步优化 */
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .book-cover-link {
        height: 160px;
    }
    
    .book-cover-link img {
        height: 160px !important;
    }
    
    /* 最新章节列表响应式样式 */
    .latest-chapter-list {
        grid-template-columns: 1fr;
    }
    
    /* 书籍详情页章节列表标题行响应式样式 */
    .book-chapter-header {
        gap: 8px;
    }
    
    .book-chapter-header .chapter-last-update {
        font-size: 12px;
    }
    
    /* 容器进一步缩小间距 */
    .container {
        padding: 0 8px;
    }
    
    /* 书籍详情进一步优化 */
    .book-detail {
        padding: 12px;
    }
    
    /* 章节列表进一步优化 */
    .chapter-list {
        padding: 12px;
    }
    
    /* 分页组件小屏优化 */
    .pagination a {
        min-width: 36px;
        height: 36px;
        font-size: 12px;
        padding: 0 8px;
    }
    
    /* 搜索表单小屏优化 */
    .search-form {
        margin: 0 8px;
    }
    
    /* 页面标题小屏优化 */
    .page-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    /* 书籍详情标题小屏优化 */
    .book-detail-title {
        font-size: 20px;
    }
    
    /* 章节标题小屏优化 */
    .chapter-title {
        font-size: 20px;
    }
    
    /* 移动菜单小屏优化 */
    .mobile-menu {
        width: 220px;
        padding: 12px;
    }
    
    /* 站点头部小屏优化 */
    .site-header {
        padding: 12px 0;
    }
    
    .logo a {
        font-size: 18px;
    }
}

/* 超小屏设备适配 (360px) */
@media (max-width: 360px) {
    /* 书籍网格超小屏优化 */
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
    
    .book-cover-link {
        height: 140px;
    }
    
    .book-cover-link img {
        height: 140px !important;
    }
    
    /* 容器超小屏优化 */
    .container {
        padding: 0 6px;
    }
    
    /* 书籍信息超小屏优化 */
    .book-title {
        font-size: 13px;
    }
    
    .book-author {
        font-size: 11px;
    }
    
    .book-meta {
        font-size: 10px;
    }
    
    /* 分页超小屏优化 */
    .pagination a {
        min-width: 32px;
        height: 32px;
        font-size: 11px;
        padding: 0 6px;
    }
    
    /* 移动菜单超小屏优化 */
    .mobile-menu {
        width: 200px;
        padding: 10px;
    }
    
    /* 搜索表单超小屏优化 */
    .search-form {
        margin: 0 6px;
    }
    
    .search-form input,
    .search-form button {
        padding: 8px 10px;
        font-size: 14px;
    }
}

/* 横屏模式优化 */
@media (max-width: 768px) and (orientation: landscape) {
    /* 横屏时的特殊优化 */
    .site-content {
        padding: 15px 0;
    }
    
    .book-detail {
        padding: 12px;
    }
    
    .chapter-content {
        padding: 15px;
        font-size: 15px;
    }
    
    /* 横屏时书籍网格调整 */
    .book-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .book-cover-link {
        height: 160px;
    }
    
    .book-cover-link img {
        height: 160px !important;
    }
}
@media screen and (max-width: 600px) {
    .site-footer p {
        font-size: 12px;
        padding: 10px;
        line-height: 1.4;
    }
}
/* 打印样式 */
@media print {
    /* 隐藏不必要的元素 */
    .site-header,
    .search-bar,
    .mobile-menu,
    .mobile-menu-toggle,
    .pagination,
    .chapter-navigation,
    .site-footer {
        display: none !important;
    }
    
    /* 优化打印布局 */
    body {
        background: white;
        color: black;
        font-size: 12pt;
        line-height: 1.4;
    }
    
    .container {
        max-width: none;
        padding: 0;
    }
    
    .site-content {
        padding: 0;
    }
    
    .chapter-content {
        padding: 0;
        box-shadow: none;
        border-radius: 0;
    }
    
    /* 确保链接显示URL */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 10pt;
        color: #666;
    }
    
    /* 分页符 */
    .chapter-content {
        page-break-inside: avoid;
    }
}
/* 桌面端适配 (769px以上) */
@media (min-width: 769px) {
    /* 桌面端保持原有网格布局 */
    .book-grid {
        display: grid !important;
        grid-template-columns: repeat(6, 1fr) !important;
        gap: 10px !important;
        margin-bottom: 20px !important;
    }
    
    .book-item {
        padding: 0 !important;
        margin: 0 !important;
        width: auto !important;
    }
    
    /* 桌面端状态样式 */
    .book-status {
        position: absolute !important;
        bottom: 8px !important;
        right: 8px !important;
        top: auto !important;
        padding: 4px 10px !important;
        border-radius: 12px !important;
        font-size: 11px !important;
        color: white !important;
        font-weight: 500 !important;
        z-index: 2 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.25) !important;
        backdrop-filter: none !important;
        white-space: nowrap !important;
        min-width: auto !important;
        max-width: calc(100% - 16px) !important;
    }
    
    .category-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }
    
    .category-block::before {
        display: none;
    }
}

/* 移动端横向滑动容器样式 - 修改为网格布局 */
@media (max-width: 768px) {
    /* 移动端2列网格布局 - 完全重写 */
    @media (max-width: 768px) {
        /* 移动端固定2列网格布局 */
        .book-grid {
            display: grid !important;
            grid-template-columns: 1fr 1fr !important;
            gap: 15px !important;
            padding: 10px 15px !important;
            margin-bottom: 20px !important;
            /* 确保不滑动 */
            overflow: visible !important;
            overflow-x: visible !important;
            overflow-y: visible !important;
            /* 移除所有滑动相关属性 */
            scroll-snap-type: none !important;
            -webkit-overflow-scrolling: auto !important;
            position: static !important;
            /* 移除背景效果 */
            background: none !important;
            background-image: none !important;
        }
    
        /* 完全移除伪元素 */
        .book-grid::before,
        .book-grid::after {
            display: none !important;
            content: none !important;
        }
    
        /* 书籍项目网格样式 */
        .book-item {
            display: block !important;
            flex: none !important;
            width: 100% !important;
            height: auto !important;
            /* 移除滑动相关属性 */
            scroll-snap-align: none !important;
            padding: 0 !important;
            margin: 0 !important;
            /* 确保正常显示 */
            position: relative !important;
        }
    
        /* 完全移除滚动条 */
        .book-grid::-webkit-scrollbar {
            display: none !important;
            width: 0 !important;
            height: 0 !important;
        }
    
        .book-grid::-webkit-scrollbar-track,
        .book-grid::-webkit-scrollbar-thumb {
            display: none !important;
        }
    
        /* 移动端图书状态样式 */
        .book-status {
            position: absolute !important;
            bottom: 8px !important;
            right: 8px !important;
            top: auto !important;
            padding: 4px 8px !important;
            border-radius: 12px !important;
            font-size: 10px !important;
            color: white !important;
            font-weight: 500 !important;
            z-index: 2 !important;
            box-shadow: 0 2px 4px rgba(0,0,0,0.2) !important;
            backdrop-filter: blur(4px) !important;
            white-space: nowrap !important;
            min-width: auto !important;
        }
    }
}

/* 移动端大图预览优化 */
@media (max-width: 768px) {
    .cover-preview .preview-image {
        min-width: 80vw !important;
        min-height: 80vh !important;
        max-width: 90vw !important;
        max-height: 90vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    .cover-preview .preview-image-container {
        padding: 20px !important;
    }
}

/* 平板端大图预览优化 */
@media (min-width: 769px) and (max-width: 1024px) {
    .cover-preview .preview-image {
        max-width: 85vw !important;
        max-height: 85vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
}

/* 桌面端大图预览优化 */
@media (min-width: 1025px) {
    .cover-preview .preview-image {
        /* 桌面端不设置最小尺寸，让图片按原始尺寸显示 */
        max-width: 90vw !important;
        max-height: 90vh !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
    }
}

/* 移动端菜单优化 - 新增样式 */
@media (max-width: 768px) {
    /* 隐藏桌面端登录链接 */
    .desktop-only {
        display: none !important;
    }
    
    /* 优化移动端菜单按钮 */
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        gap: 6px;
        padding: 8px 12px;
        background: rgba(255, 255, 255, 0.1);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 6px;
        cursor: pointer;
        transition: all 0.3s ease;
        font-size: 14px;
        color: white;
    }
    
    .mobile-menu-toggle:hover {
        background: rgba(255, 255, 255, 0.2);
        border-color: rgba(255, 255, 255, 0.3);
    }
    
    .mobile-menu-toggle .menu-text {
        font-weight: 500;
        white-space: nowrap;
    }
    
    .mobile-menu-toggle svg {
        transition: transform 0.3s ease;
        flex-shrink: 0;
    }
    
    .mobile-menu-toggle.active svg {
        transform: rotate(180deg);
    }
    
    /* 下拉式菜单样式 */
    .mobile-menu-dropdown {
        position: absolute;
        top: 100%;
        right: 15px;
        width: 180px;
        background: white;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
        transition: all 0.3s ease;
        max-height: 70vh;
        overflow-y: auto;
    }
    
    .mobile-menu-dropdown.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    .mobile-menu-dropdown ul {
        list-style: none;
        margin: 0;
        padding: 8px 0;
    }
    
    .mobile-menu-dropdown ul li {
        margin: 0;
    }
    
    .mobile-menu-dropdown ul li a {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        color: #333;
        text-decoration: none;
        font-size: 14px;
        transition: background-color 0.2s ease;
        border: none;
    }
    
    .mobile-menu-dropdown ul li a:hover {
        background-color: #f5f5f5;
        color: #2c5aa0;
    }
    
    .mobile-menu-dropdown ul li.active a {
        background-color: #e3f2fd;
        color: #1976d2;
        font-weight: 500;
    }
    
    .mobile-menu-dropdown ul li a svg {
        margin-right: 6px;
        flex-shrink: 0;
    }
    
    /* 确保header有相对定位 */
    .site-header {
        position: relative;
    }
    
    /* 隐藏原有的侧边菜单 */
    .mobile-menu {
        display: none !important;
    }
}

/* 桌面端保持原有样式 */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
    
    .mobile-menu-dropdown {
        display: none !important;
    }
    
    .desktop-only {
        display: block !important;
    }
    
    /* PC端图书详情页左右布局 */
    .book-detail-layout {
        display: flex !important;
        flex-direction: row !important;  /* PC端使用左右布局 */
        gap: 30px !important;
        align-items: flex-start !important;
    }
    
    .book-left-section {
        flex: 0 0 200px !important;  /* 固定宽度 */
        width: 200px !important;
    }
    
    .book-right-section {
        flex: 1 !important;  /* 占据剩余空间 */
    }
}

/* 移动端图书详情页布局优化 */
@media (max-width: 768px) {
    /* 图书详情页移动端布局 - 改为上下排列 */
    .book-detail-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 20px !important;
        align-items: stretch !important;
    }
    
    /* 左侧区域（封面区域）移动端样式 */
    .book-left-section {
        flex: none !important;
        width: 100% !important;
        order: 1 !important;
        text-align: center !important;
    }
    
    /* 右侧区域（主要内容）移动端样式 */
    .book-right-section {
        flex: none !important;
        width: 100% !important;
        order: 2 !important;
    }
    
    /* 移动端封面尺寸调整 */
    .book-cover-image {
        width: 160px !important;
        height: 160px !important;
        margin: 0 auto 15px auto !important;
    }
    
    /* 移动端图书标题调整 */
    .book-title {
        font-size: 24px !important;
        text-align: left !important;
        margin-bottom: 15px !important;
    }
    
    /* 移动端图书信息行调整 */
    .book-header-info > div {
        justify-content: center !important;
        text-align: center !important;
        flex-wrap: wrap !important;
        gap: 15px !important;
    }
    
    /* 移动端章节列表标题调整 */
    .book-chapter-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 10px !important;
        text-align: left !important;
    }
}