/* 全局样式与配色方案 */
:root {
    --primary-color: #8B0000; /* 深红色作为主色 */
    --secondary-color: #5D4037; /* 深褐色 */
    --background-color: #F5F5F0; /* 米色背景 */
    --text-color: #3E2723; /* 深褐色文字 */
    --light-accent: #D7CCC8; /* 浅米色 */
    --white: #FFFFFF;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Noto Sans SC', 'Microsoft YaHei', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
}

/* 导航栏 - 响应式设计 */
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);
    text-decoration: none;
}

.search-bar {
    display: flex;
    order: 2;
    width: 100%;
    margin: 1rem 0 0 0;
}

.search-bar input {
    padding: 0.5rem;
    border: 1px solid var(--light-accent);
    border-radius: 4px 0 0 4px;
    outline: none;
    flex-grow: 1;
}

.search-bar button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
}

/* 面包屑导航 - 增强SEO */
.breadcrumb {
    padding: 0.5rem 5%;
    max-width: 1400px;
    margin: 0 auto;
    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);
}

/* 主要内容区 */
.container {
    max-width: 1400px;
    margin: 1rem auto;
    padding: 0 5%;
    overflow-x: hidden; /* 隐藏水平溢出的内容 */
}

img, video, iframe, object, embed {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 书籍详情主区域 */
.book-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 3rem;
}

/* 书籍封面区域 */
.book-cover-container {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.book-cover-main {
    max-width: 300px;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.book-cover-main img {
    width: 100%;
    height: auto;
    display: block;
}

.book-thumbnails {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
    margin-top: 1rem;
}

.book-thumbnail {
    width: 50px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s;
}

.book-thumbnail:hover, .book-thumbnail.active {
    border-color: var(--primary-color);
}

.book-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* 书籍信息区域 */
.book-info {
    background-color: var(--white);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.book-title {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    line-height: 1.3;
}

.book-isbn {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.book-author {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.book-author a {
    color: var(--primary-color);
}

.book-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.meta-item {
    margin-bottom: 0.5rem;
}

.meta-label {
    color: #666;
    font-size: 0.9rem;
    display: block;
}

.meta-value {
    font-weight: 500;
}

.book-price {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin: 1.5rem 0;
    font-weight: 700;
}

.price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 1.2rem;
    margin-left: 0.5rem;
    font-weight: normal;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    border-radius: 4px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    flex-grow: 1;
}

.btn-primary:hover {
    background-color: #6B0000;
    text-decoration: none;
}

.btn-secondary {
    background-color: var(--light-accent);
    color: var(--text-color);
    flex-grow: 1;
}

.btn-secondary:hover {
    background-color: #C8BDB8;
    text-decoration: none;
}

.book-description {
    margin-bottom: 2rem;
}

.book-description h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
    border-bottom: 2px solid var(--light-accent);
    padding-bottom: 0.5rem;
}

.book-description p {
    margin-bottom: 1rem;
    text-align: justify;
    line-height: 1.8;
}

/* 书籍详情标签页 */
.book-tabs {
    margin-bottom: 3rem;
}

.tab-header {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid var(--light-accent);
    margin-bottom: 1.5rem;
}

.tab-btn {
    padding: 0.8rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: var(--text-color);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: var(--primary-color);
}

.tab-content {
    display: none;
    padding: 1rem;
    background-color: var(--white);
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
    color: var(--secondary-color);
}

.tab-content p, .tab-content ul, .tab-content ol {
    margin-bottom: 1rem;
    line-height: 1.8;
}

.tab-content ul, .tab-content ol {
    padding-left: 1.5rem;
}

/* 相关书籍推荐 */
.related-books h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    position: relative;
    padding-bottom: 0.5rem;
}

.related-books h2::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-card .book-cover {
    height: 200px;
    overflow: hidden;
}

.book-card .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-card .book-info {
    padding: 1rem;
}

.book-card .book-title {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card .book-author {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card .book-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.95rem;
}

/* 页脚 */
footer {
    background-color: var(--secondary-color);
    color: var(--light-accent);
    padding: 2rem 5%;
}

.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) {
    .book-detail {
        grid-template-columns: 300px 1fr;
    }

    .book-cover-container {
        position: sticky;
        /*top: 100px;*/
        align-self: start;
    }

    .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;
    }

    .book-title {
        font-size: 2rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 2rem;
    }

    .book-card .book-cover {
        height: 300px;
    }

    .footer-content {
        grid-template-columns: repeat(4, 1fr);
    }
}

.review-box {
    background:  var(--background-color);;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    margin-bottom: 15px;
}
/* 默认状态（无下划线） */
a {
    text-decoration: none;
}

/* 鼠标悬停时也保持无下划线 */
a:hover {
    text-decoration: none;
}
