:root {
    --primary-color: #1a56db;
    --secondary-color: #2563eb;
    --light-bg: #f8fafc;
    --dark-bg: #0f172a;
    --text-color: #1e293b;
    --light-text: #64748b;
    --border-color: #e2e8f0;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    --hover-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f1f5f9;
    color: var(--text-color);
    line-height: 1.6;
    padding-bottom: 60px; /* 为移动端分类按钮留空间 */
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    gap: 10px;
}

/* 头部样式 */
header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-bg));
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo i {
    font-size: 2.2rem;
    color: #ffd43b;
}

/* 左侧分类导航 */
.sidebar {
    flex: 0 0 260px;
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
    height: fit-content;
    transition: all 0.3s ease;
    /*max-height: 90vh;*/
    /*overflow-y: auto;*/
}

.sidebar h2 {
    font-size: 1.4rem;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.categories {
    list-style: none;
}

.categories li {
    margin-bottom: 12px;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border-color);
}

.categories a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    padding: 6px 12px;
    border-radius: 6px;
}

.categories a:hover, .categories a.active {
    background-color: var(--light-bg);
    color: var(--primary-color);
    transform: translateX(5px);
}

.categories i {
    width: 24px;
    text-align: center;
    color: var(--light-text);
}

/* 右侧内容区 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 搜索区域 */
.search-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--card-shadow);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.search-header h2 {
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-box {
    display: flex;
    height: 50px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-box input {
    flex: 1;
    border: none;
    padding: 0 20px;
    font-size: 1rem;
    background: var(--light-bg);
}

.search-box input:focus {
    outline: none;
    background: white;
}

.search-box button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0 25px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: background 0.3s;
}

.search-box button:hover {
    background: var(--secondary-color);
}

.filter-options {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--light-bg);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 图书列表 */
.books-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

.book-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--hover-shadow);
}

.book-cover {
    height: 280px;
    background: linear-gradient(45deg, #dbeafe, #bfdbfe);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.book-cover img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.book-details {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.book-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark-bg);
}

.book-author {
    color: var(--light-text);
    font-size: 0.95rem;
    margin-bottom: 15px;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    color: var(--light-text);
    font-size: 0.9rem;
}

.book-price {
    color: #e53e3e;
    font-weight: 700;
    font-size: 1.2rem;
}

.book-rating {
    color: #f59e0b;
}

/* 页脚 */
footer {
    background: var(--dark-bg);
    color: white;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 40px;
}

.footer-section {
    flex: 1;
    min-width: 250px;
}

.footer-section h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    text-align: center;
    padding-top: 30px;
    margin-top: 30px;
    border-top: 1px solid #334155;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        flex: 0 0 auto;
        width: 100%;
        max-height: 0;
        opacity: 0;
        padding: 0 25px;
        overflow: hidden;
        margin-bottom: 0;
    }

    .sidebar.sidebar-active {
        max-height: 1000px;
        opacity: 1;
        padding: 25px;
        margin-bottom: 20px;
    }

    .books-container {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-wrap: wrap;
    }

    .logo h1 {
        font-size: 1.4rem;
    }

    .search-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .books-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .book-cover {
        height: 220px;
    }

    .filter-options {
        gap: 10px;
    }

    .filter-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .books-container {
        grid-template-columns: 1fr;
    }

    .book-cover {
        height: 200px;
    }

    .logo h1 {
        font-size: 1.2rem;
    }

    nav {
        display: none;
    }
}

/* 移动端分类切换按钮 */
.mobile-category-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 30px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-category-toggle:hover {
    background: var(--secondary-color);
    transform: translateX(-50%) scale(1.05);
}

@media (max-width: 992px) {
    .mobile-category-toggle {
        display: block;
    }
}

/* 分类标题上的关闭按钮 */
.close-sidebar {
    display: none;
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--light-text);
    cursor: pointer;
}

@media (max-width: 992px) {
    .close-sidebar {
        display: block;
    }
}
/*logo*/
.logo img {
    width: 45%;
}
.book-footer {
    text-align: center;
    font-size: 14px;
    padding: 10px;
}
.book-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--card-shadow);
}
.cate-crumbs{
    background: white;
    border-radius: 12px;
    padding: 10px;
    box-shadow: var(--card-shadow);
}
.cate-crumbs a{
    text-decoration: none;
    color: var(--text-color);
}
b, em, i, u, strong {
    font-weight: normal;
    /* font-style: normal; */
    text-decoration: none;
}
