/* 全局样式优化 */
.maxHeight {
    max-height: 400px;
}

/* 链接样式优化 */
a.no-underline {
    text-decoration: none;
    color: var(--text-color);
    font-weight: normal !important;
    transition: color var(--transition-duration, 0.3s);
}

a.no-underline:hover {
    color: var(--primary-color);
}

.book-card a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: normal !important;
    transition: color var(--transition-duration, 0.3s);
}

.book-card a:hover {
    color: var(--primary-color);
}

/* 懒加载图片样式 */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
    background-color: var(--light-accent, #f0f0f0);
}

img.lazy.loaded,
img:not(.lazy) {
    opacity: 1;
}

img.lazy.error {
    opacity: 0.5;
    background-color: #ffebee;
}

/* 可访问性优化 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* 焦点样式增强 */
a:focus, 
button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
    border-radius: 2px;
}



/* 主要内容区优化 */
.container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 5%;
}

/* 轮播图区域优化 */
.hero-section {
    position: relative;
    margin-bottom: 30px;
}

.swiper {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.swiper-slide img {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

/* Swiper 组件样式优化 */
.swiper-pagination-bullet {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
    transition: background 0.3s;
}

.swiper-pagination-bullet-active {
    background: var(--primary-color, #8B0000);
}

.swiper-button-prev,
.swiper-button-next {
    color: var(--primary-color, #8B0000);
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    margin-top: -22px;
    transition: all 0.3s;
}

.swiper-button-prev:hover,
.swiper-button-next:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 18px;
    font-weight: bold;
}




.btn {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
}

.btn:hover {
    background-color: #6B0000;
    text-decoration: none;
}

/* 书籍展示区优化 */
.section-title {
    position: relative;
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color, #8B0000), var(--secondary-color, #5D4037));
    border-radius: 2px;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.book-card {
    background-color: var(--white, #ffffff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.book-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.book-card:focus-within {
    transform: translateY(-4px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
}

.book-cover {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-info {
    padding: 1.2rem;
}

.book-title {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-color, #333);
}

.book-author {
    font-size: 0.85rem;
    color: var(--secondary-color, #666);
    margin-bottom: 0.3rem;
    font-style: italic;
}

.book-publisher,
.book-publishDate {
    font-size: 0.8rem;
    color: var(--text-light, #999);
    margin-bottom: 0.2rem;
}

.book-publishDate {
    font-family: 'Courier New', monospace;
}

/* 分类侧边栏 - 移动端优化 */
.sidebar-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    z-index: 200;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.sidebar-container.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    background-color: var(--white);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    overflow-y: auto;
    transition: left 0.3s;
    z-index: 201;
}

.sidebar.active {
    left: 0;
}

.sidebar-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.sidebar-title {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--light-accent);
    padding-bottom: 0.5rem;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 0.8rem;
}

.category-list a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    display: block;
    padding: 0.3rem 0;
}

.category-list a:hover {
    color: var(--primary-color);
}

.sidebar-toggle {
    display: block;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    cursor: pointer;
    width: 100%;
    text-align: center;
}

/* 主内容布局 */
.main-content {
    display: grid;
    gap: 2rem;
}



/* 平板设备样式 */
@media (min-width: 576px) {
    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* 桌面设备样式 */
@media (min-width: 992px) {

    .menu-toggle {
        display: none;
    }
    .section-title {
        font-size: 2rem;
    }


    .main-content-sidebarLeft {
        grid-template-columns:  300px 1fr;
    }

    .main-content-sidebarRight {
        grid-template-columns:  1fr 300px ;
    }

    .sidebar-container {
        display: none !important;
    }

    .sidebar {
        position: static;
        width: auto;
        height: auto;
        left: auto;
    }

    .sidebar-close {
        display: none;
    }

    .sidebar-toggle {
        display: none;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 2rem;
    }

}

a {
    text-decoration: none;
}

/* 鼠标悬停时也保持无下划线 */
a:hover {
    text-decoration: none;
}

/* ===== 标签云筛选条样式 ===== */
.tag-cloud-bar {
    background-color: var(--white, #ffffff);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.tag-cloud-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.tag-cloud-item {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--background-color, #F5F5F0);
    color: var(--text-color, #3E2723);
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--light-accent, #D7CCC8);
}

.tag-cloud-item:hover {
    background-color: var(--primary-color, #8B0000);
    color: var(--white, #ffffff);
    border-color: var(--primary-color, #8B0000);
    transform: translateY(-2px);
    box-shadow: 0 3px 8px rgba(139, 0, 0, 0.2);
}

/* ===== 新书速递样式 ===== */
.new-books-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.new-book-item {
    border-bottom: 1px solid var(--light-accent, #D7CCC8);
    padding-bottom: 0.8rem;
}

.new-book-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.new-book-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-color, #3E2723);
    transition: color 0.3s;
}

.new-book-link:hover {
    color: var(--primary-color, #8B0000);
}

.new-book-link:hover .new-book-cover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.new-book-cover {
    width: 45px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    transition: transform 0.3s, box-shadow 0.3s;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.new-book-title {
    font-size: 0.88rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-weight: 500;
}

/* ===== 本站简介样式 ===== */
.site-intro-content {
    font-size: 0.9rem;
    line-height: 1.8;
    color: var(--text-color, #3E2723);
}

.site-intro-content p {
    margin: 0;
    text-indent: 2em;
}


