
/* 全局变量定义 */
:root {
    --primary-color: #5e63b6; /* 沉稳紫蓝 */
    --secondary-color: #ff9f43; /* 活力橙 */
    --bg-color: #f4f5f7;
    --card-bg: #ffffff;
    --text-main: #333333;
    --text-sub: #666666;
    --text-light: #999999;
    --border-color: #e1e4e8;
    --font-serif: "Georgia", "Times New Roman", serif; /* 正文使用衬线体更有书香感 */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
}

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

a:hover {
    color: var(--primary-color);
}

ul, ol {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* 顶部导航 */
.top-nav {
    background-color: var(--card-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 70px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-serif);
    color: var(--primary-color);
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: bold;
}

.search-box {
    display: flex;
    background: #f0f2f5;
    border-radius: 20px;
    padding: 5px 15px;
    width: 400px;
}

.search-box input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    font-size: 0.9rem;
}

.btn-search {
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 1.1rem;
}

.user-menu {
    display: flex;
    gap: 20px;
    font-size: 0.95rem;
    font-weight: 500;
}

.btn-login {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px 15px;
    border-radius: 15px;
}

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

/* 分类导航 */
.category-bar {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 0;
    margin-bottom: 20px;
}

.cat-list {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

.cat-list a {
    font-size: 1rem;
    color: var(--text-sub);
    padding: 5px 10px;
    border-radius: 4px;
}

.cat-list a.active, .cat-list a:hover {
    color: var(--primary-color);
    background: rgba(94, 99, 182, 0.1);
    font-weight: bold;
}

/* Hero 推荐区 */
.hero-recommend {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.main-banner {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    height: 400px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.main-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    padding: 30px;
    color: white;
}

.tag-hot {
    background: var(--secondary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 10px;
    display: inline-block;
}

.banner-info h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    font-family: var(--font-serif);
}

.banner-info p {
    margin-bottom: 20px;
    opacity: 0.9;
    max-width: 600px;
}

.btn-read {
    background: var(--primary-color);
    color: white;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: bold;
    display: inline-block;
}

.btn-read:hover {
    background: #4a4e94;
    color: white;
}

.side-rank {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.side-rank h3 {
    border-bottom: 2px solid var(--bg-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.rank-list li {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px dashed var(--border-color);
}

.rank-list li:last-child {
    border-bottom: none;
}

.num {
    width: 25px;
    height: 25px;
    background: #ccc;
    color: white;
    text-align: center;
    line-height: 25px;
    border-radius: 4px;
    margin-right: 15px;
    font-weight: bold;
    font-size: 0.9rem;
}

.top1 { background: #ff4757; }
.top2 { background: #ffa502; }
.top3 { background: #2ed573; }

.book-meta h4 {
    font-size: 1rem;
    margin-bottom: 2px;
}

.book-meta span {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* 内容区块通用 */
.content-section, .update-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}

.section-header h3 {
    font-size: 1.4rem;
    color: var(--text-main);
}

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

/* 书籍网格 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 25px;
}

.book-card {
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.book-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

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

.cover-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.book-card:hover .cover-wrap img {
    transform: scale(1.05);
}

.badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    color: white;
    font-weight: bold;
}

.badge.finish { background: #2ed573; }
.badge.serial { background: var(--primary-color); }
.badge.new { background: var(--secondary-color); }
.badge.hot { background: #ff4757; }

.info-wrap {
    padding: 15px;
}

.book-title {
    font-size: 1.1rem;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.author {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 10px;
}

.intro {
    font-size: 0.85rem;
    color: var(--text-sub);
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.tags span {
    display: inline-block;
    background: #f0f2f5;
    color: var(--text-sub);
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75rem;
    margin-right: 5px;
}

/* 更新列表表格 */
.update-list-wrapper {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.update-table {
    width: 100%;
    border-collapse: collapse;
}

.update-table th {
    text-align: left;
    padding: 12px 15px;
    color: var(--text-light);
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
}

.update-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f2f5;
    font-size: 0.95rem;
}

.update-table tr:hover td {
    background: #f9fafb;
}

.col-book a {
    font-weight: bold;
    color: var(--text-main);
}

.col-chapter a {
    color: var(--text-sub);
}

.col-chapter a:hover {
    color: var(--primary-color);
}

.col-time {
    color: var(--text-light);
    font-size: 0.85rem;
}

/* 页脚 */
.site-footer {
    background: #2f3542;
    color: #dfe4ea;
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    text-align: center;
}

.footer-links {
    margin-bottom: 20px;
}

.footer-links a {
    margin: 0 15px;
    color: #ced6e0;
}

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

.copyright {
    font-size: 0.85rem;
    color: #747d8c;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .nav-wrapper {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
        gap: 10px;
    }
    
    .search-box {
        width: 100%;
    }
    
    .hero-recommend {
        grid-template-columns: 1fr;
    }
    
    .main-banner {
        height: 300px;
    }
    
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .update-table th:nth-child(3), 
    .update-table td:nth-child(3) {
        display: none;
    }
}
