.maxHeight{
    max-height: 400px;
}
/* 全局样式与配色方案 */
:root {
    --primary-color: #8B0000; /* 深红色作为主色 */
    --secondary-color: #5D4037; /* 深褐色 */
    --background-color: #F5F5F0; /* 米色背景 */
    --text-color: #3E2723; /* 深褐色文字 */
    --light-accent: #D7CCC8; /* 浅米色 */
    --white: #FFFFFF;
}
a.no-underline {
    text-decoration: none;
    color: var(--text-color);
    font-weight: normal !important;
}
a.no-underline:hover {
    color: var(--text-color);
}
.book-card a{
    text-decoration: none;
    color: var(--text-color);
    font-weight: normal !important;
}
.book-card a:hover{
    color: var(--text-color);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

.bodyStyle {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 提高可访问性：焦点样式 */
a:focus, button:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* 跳过导航链接 - 为键盘用户优化 */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 8px;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* 导航栏 - 重构为移动友好型 */
header {
    background-color: var(--white);
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    max-width: 1400px;
    margin: 0 auto;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    order: 1;
}

.menu-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    order: 2;
    color: var(--text-color);
    margin-left: auto; /* 将按钮推到右侧 */
    padding: 0.5rem; /* 增加点击区域 */
}

.nav-links {
    display: flex;
    list-style: none;
    order: 4;
    width: 100%;
    flex-direction: column;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.nav-links.active {
    max-height: 500px;
    margin-top: 1rem;
}

.nav-links li {
    margin: 0.5rem 0;
}

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
    display: block;
    padding: 0.5rem 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

.search-bar {
    display: flex;
    order: 2;
    width: 100%;
    margin: 1rem 0 0 0;
    align-items: center; /* 新增：垂直居中 */
}

.search-bar input {
    padding: 0.7rem 0.5rem; /* 调整垂直padding */
    border: 1px solid var(--light-accent);
    border-radius: 4px 0 0 4px;
    outline: none;
    flex-grow: 1;
    height: 40px; /* 固定高度 */
    box-sizing: border-box; /* 确保padding不影响高度 */
    font-size: 1rem; /* 统一字体大小 */
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0 1rem; /* 调整padding */
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    height: 40px; /* 固定高度 */
    font-size: 1rem; /* 统一字体大小 */
    display: flex;
    align-items: center; /* 文字垂直居中 */
    justify-content: center; /* 文字水平居中 */
    min-width: 80px; /* 最小宽度 */
}

.headline{
    color: var(--text-color);;
}

/* 主要内容区 */
.container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 5%;
}


/* 面包屑导航 - 增强SEO */
.breadcrumb {
    padding: 0.5rem 5%;
    max-width: 1400px;
    margin: 0 auto 1rem;
    font-size: 0.9rem;
    background-color: var(--white);
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 0.5rem;
    color: #999;
}

.breadcrumb a {
    color: var(--text-color);
}

.breadcrumb a:hover {
    color: var(--primary-color);
}

.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 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.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);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.book-cover {
    height: 200px;
    overflow: hidden;
    margin-top: 10px;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.book-card:hover .book-cover img {
    transform: scale(1.05);
}

.book-info {
    padding: 1rem;
}

.book-title {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    font-weight: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 分类侧边栏 - 移动端优化 */
.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;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* 页脚 - 添加语义化标记 */
footer {
    background-color: var(--secondary-color);
    color: var(--light-accent);
    padding: 2rem 5%;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.footer-column h3 {
    color: var(--white);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-column ul {
    list-style: none;
}

.footer-column ul li {
    margin-bottom: 0.5rem;
}

.footer-column a {
    color: var(--light-accent);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-column a:hover {
    color: var(--white);
    text-decoration: underline;
}

.copyright {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.9rem;
}

/* 平板设备样式 */
@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));
    }

    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 桌面设备样式 */
@media (min-width: 992px) {

    .menu-toggle {
        display: none;
    }

    .nav-links {
        display: flex;
        flex-direction: row;
        max-height: none;
        width: auto;
        order: 2;
    }

    .nav-links li {
        margin-left: 1.5rem;
        margin-bottom: 0;
    }

    .search-bar {
        order: 3;
        width: auto;
        margin: 0 0 0 1.5rem;
    }



    .section-title {
        font-size: 2rem;
    }

    .main-content {
        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(220px, 1fr));
        gap: 2rem;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

a {
    text-decoration: none;
}

/* 鼠标悬停时也保持无下划线 */
a:hover {
    text-decoration: none;
}
