/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    line-height: 1.8;
    color: #333;
    background: #f5f5f5;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 头部 */
.site-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
}

.site-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.site-desc {
    opacity: 0.9;
    font-size: 1rem;
}

.back-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    margin-right: 20px;
    font-size: 0.9rem;
}

.back-link:hover {
    color: white;
}

/* 统计信息 */
.stats {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* 书籍列表 */
.book-list h2 {
    margin-bottom: 20px;
    color: #333;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.book-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.book-card h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: #333;
}

.book-card h3 a {
    color: inherit;
    text-decoration: none;
}

.book-card h3 a:hover {
    color: #667eea;
}

.book-card .author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.book-card .category {
    display: inline-block;
    background: #f0f0f0;
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 10px;
}

.book-card .synopsis {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card .meta {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #999;
}

/* 书籍详情页 */
.book-detail {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.book-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.book-title {
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.book-meta, .book-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.book-synopsis {
    margin-bottom: 30px;
}

.book-synopsis h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
}

.book-synopsis p {
    color: #555;
    line-height: 1.8;
    white-space: pre-wrap;
}

/* 章节列表 */
.chapter-list h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: #333;
}

.chapters {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.chapters li a {
    display: block;
    padding: 10px 15px;
    background: #f8f8f8;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.chapters li a:hover {
    background: #667eea;
    color: white;
}

/* 章节内容页 */
.chapter-content {
    background: white;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.chapter-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.chapter-header h1 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.chapter-meta {
    color: #999;
    font-size: 0.9rem;
}

.chapter-meta span {
    margin: 0 10px;
}

.content-text {
    font-size: 1.1rem;
    line-height: 2;
    color: #333;
    text-align: justify;
}

.content-text p {
    margin-bottom: 1.5em;
    text-indent: 2em;
}

.chapter-nav {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: center;
    gap: 20px;
}

.chapter-nav a {
    padding: 10px 25px;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    transition: background 0.2s;
}

.chapter-nav a:hover {
    background: #5a6fd6;
}

.chapter-nav a.disabled {
    background: #ccc;
    pointer-events: none;
}

/* 页脚 */
.site-footer {
    margin-top: 50px;
    padding: 30px 0;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

/* 响应式 */
@media (max-width: 600px) {
    .site-title {
        font-size: 1.5rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 10px;
    }
    
    .book-meta, .book-info {
        flex-direction: column;
        gap: 5px;
    }
    
    .chapters {
        grid-template-columns: 1fr;
    }
    
    .chapter-nav {
        flex-wrap: wrap;
    }
}
