
/* 全局变量与重置 */
:root {
    --primary-color: #5e72e4; /* 主题蓝紫 */
    --secondary-color: #f7fafc; /* 背景灰白 */
    --text-dark: #2d3748;
    --text-light: #718096;
    --accent-red: #e53e3e;
    --card-bg: #ffffff;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --radius: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--secondary-color);
    color: var(--text-dark);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

/* 头部导航 */
.main-header {
    background: var(--card-bg);
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary-color);
}

.main-header nav a {
    margin-left: 2rem;
    font-weight: 500;
    color: var(--text-light);
}

.main-header nav a:hover {
    color: var(--primary-color);
}

/* 英雄区域 */
.hero-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3rem 5%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 2rem;
    gap: 2rem;
}

.hero-content {
    flex: 1;
    max-width: 600px;
}

.badge-hot {
    background: var(--accent-red);
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    margin-bottom: 1rem;
    display: inline-block;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.author {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 1rem;
}

.intro {
    margin-bottom: 2rem;
    opacity: 0.8;
    line-height: 1.8;
}

.hero-actions {
    display: flex;
    gap: 1rem;
}

.btn-primary, .btn-secondary {
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: bold;
    transition: transform 0.2s ease;
}

.btn-primary {
    background: white;
    color: var(--primary-color);
}

.btn-secondary {
    border: 2px solid white;
    color: white;
}

.btn-primary:hover, .btn-secondary:hover {
    transform: translateY(-2px);
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    border-radius: var(--radius);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
}

/* 通用标题 */
.section-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    margin-bottom: 1.5rem;
}

.section-title h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
}

.more-link {
    color: var(--primary-color);
    font-size: 0.9rem;
}

/* 书籍网格 */
.update-list-section {
    padding-bottom: 3rem;
}

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    padding: 0 5%;
}

.book-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.book-cover {
    position: relative;
    height: 280px;
    overflow: hidden;
}

.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);
}

.update-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    backdrop-filter: blur(4px);
}

.book-info {
    padding: 1rem;
}

.book-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chapter {
    color: var(--primary-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: var(--text-light);
}

.genre {
    background: #edf2f7;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}

/* 分类滚动 */
.category-scroll-section {
    padding: 2rem 5%;
    background: white;
    margin-top: 2rem;
}

.category-container {
    display: flex;
    overflow-x: auto;
    gap: 1.5rem;
    padding-bottom: 1rem;
    scrollbar-width: none; /* Firefox */
}

.category-container::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.cat-item {
    min-width: 100px;
    height: 100px;
    background: var(--secondary-color);
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background 0.2s ease;
}

.cat-item:hover {
    background: #e2e8f0;
}

.cat-icon {
    font-size: 2rem;
}

/* 页脚 */
footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 5%;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-links a {
    margin-left: 1.5rem;
    color: #a0aec0;
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .hero-section {
        flex-direction: column;
        text-align: center;
    }
    
    .hero-actions {
        justify-content: center;
    }
    
    .main-header nav {
        display: none; /* 简化移动端，实际项目可加汉堡菜单 */
    }
    
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
