/*
Theme Name: NovelReader
Theme URI: https://example.com
Description: 一个简约清爽的小说在线阅读WordPress主题
Version: 1.0
Author: YourName
Author URI: https://example.com
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: novelreader
*/

/* ===== 全局样式 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --text-color: #333;
    --bg-color: #fff;
    --border-color: #e0e0e0;
    --hover-bg: #f5f5f5;
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* 夜间模式 */
body.night-mode {
    --text-color: #d0d0d0;
    --bg-color: #1a1a1a;
    --border-color: #333;
    --hover-bg: #2a2a2a;
}

/* ===== 头部导航 ===== */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}

.site-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary-color);
    text-decoration: none;
}

.main-nav ul {
    display: flex;
    list-style: none;
    gap: 30px;
}

.main-nav a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-btn, .night-mode-toggle {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s;
}

.search-btn:hover, .night-mode-toggle:hover {
    color: var(--primary-color);
}

/* ===== 搜索框 ===== */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    align-items: flex-start;
    justify-content: center;
    padding-top: 100px;
}

.search-overlay.active {
    display: flex;
}

.search-box {
    background: var(--bg-color);
    padding: 30px;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
}

.search-box input {
    width: 100%;
    padding: 15px;
    font-size: 16px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    background: var(--bg-color);
    color: var(--text-color);
}

.search-close {
    position: absolute;
    top: 50px;
    right: 50px;
    font-size: 30px;
    color: #fff;
    cursor: pointer;
}

/* ===== 主内容区域 ===== */
.main-container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ===== 首页小说列表 ===== */
.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.novel-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.novel-card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
}

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

.novel-cover {
    width: 100%;
    height: 260px;
    object-fit: cover;
    background: #f0f0f0;
}

.novel-info {
    padding: 15px;
}

.novel-title {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.novel-author {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
}

.novel-meta {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #999;
}

/* ===== 小说详情页 ===== */
.novel-detail {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    margin-bottom: 40px;
}

.novel-detail-cover {
    width: 200px;
    height: 260px;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.novel-detail-info h1 {
    font-size: 28px;
    margin-bottom: 15px;
}

.novel-detail-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.novel-description {
    line-height: 1.8;
    margin-bottom: 20px;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

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

.btn-primary:hover {
    background: #357abd;
}

.btn-secondary {
    background: var(--hover-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--border-color);
}

/* ===== 章节列表 ===== */
.chapter-list {
    margin-top: 40px;
}

.chapter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 10px;
    margin-top: 20px;
}

.chapter-item {
    padding: 12px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    transition: all 0.3s;
}

.chapter-item a {
    color: var(--text-color);
    text-decoration: none;
    display: flex;
    justify-content: space-between;
}

.chapter-item:hover {
    background: var(--hover-bg);
    border-color: var(--primary-color);
}

.chapter-time {
    font-size: 12px;
    color: #999;
}

/* ===== 阅读页面 ===== */
.reading-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

.reading-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}

.reading-header h1 {
    font-size: 28px;
    margin-bottom: 10px;
}

.reading-header .chapter-info {
    font-size: 14px;
    color: #666;
}

.reading-controls {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.control-btn {
    padding: 8px 15px;
    background: var(--hover-bg);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.control-btn:hover {
    background: var(--border-color);
}

.reading-content {
    font-size: 18px;
    line-height: 2;
    text-align: justify;
    padding: 30px;
    background: var(--bg-color);
    border-radius: 8px;
    margin-bottom: 30px;
}

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

.reading-navigation {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin: 30px 0;
}

.nav-btn {
    flex: 1;
    padding: 15px;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: background 0.3s;
}

.nav-btn:hover {
    background: #357abd;
}

.nav-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== 页脚 ===== */
.site-footer {
    background: var(--hover-bg);
    border-top: 1px solid var(--border-color);
    padding: 30px 0;
    margin-top: 60px;
    text-align: center;
    color: #666;
}

/* ===== 响应式设计 ===== */
@media (max-width: 768px) {
    .header-container {
        flex-wrap: wrap;
        height: auto;
        padding: 15px 20px;
    }
    
    .main-nav ul {
        gap: 15px;
        font-size: 14px;
    }
    
    .novel-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 15px;
    }
    
    .novel-detail {
        grid-template-columns: 1fr;
    }
    
    .chapter-grid {
        grid-template-columns: 1fr;
    }
    
    .reading-content {
        font-size: 16px;
        padding: 20px;
    }
    
    .reading-navigation {
        flex-direction: column;
    }
}