/* 中国经典小说网站样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'SimSun', serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf9 100%);
    color: #333;
    line-height: 1.6;
}

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

.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: linear-gradient(45deg, #8e44ad, #3498db);
    color: white;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
}

.header h1 {
    font-size: 3.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.category {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.category h2 {
    color: #8e44ad;
    margin-bottom: 20px;
    font-size: 1.8em;
    border-bottom: 3px solid #3498db;
    padding-bottom: 10px;
}

.novels {
    list-style: none;
}

.novels li {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    transition: background-color 0.2s ease;
}

.novels li:hover {
    background-color: #f8f9fa;
    padding-left: 10px;
}

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

.novels li a {
    text-decoration: none;
    color: #34495e;
    font-size: 1.1em;
    display: block;
}

.novels li a:hover {
    color: #8e44ad;
    font-weight: bold;
}

.footer {
    text-align: center;
    padding: 30px 0;
    color: #7f8c8d;
    font-size: 0.9em;
    border-top: 2px solid #ecf0f1;
    margin-top: 40px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.5em;
    }
    
    .categories {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category {
        padding: 20px;
    }
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.category {
    animation: fadeInUp 0.6s ease forwards;
}

.category:nth-child(1) { animation-delay: 0.1s; }
.category:nth-child(2) { animation-delay: 0.2s; }
.category:nth-child(3) { animation-delay: 0.3s; }
.category:nth-child(4) { animation-delay: 0.4s; }

/* 特殊分类颜色 */
.category:nth-child(1) h2 { color: #e74c3c; border-bottom-color: #e74c3c; }
.category:nth-child(2) h2 { color: #2ecc71; border-bottom-color: #2ecc71; }
.category:nth-child(3) h2 { color: #f39c12; border-bottom-color: #f39c12; }
.category:nth-child(4) h2 { color: #9b59b6; border-bottom-color: #9b59b6; }

/* 主页卡片样式 */
.novels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.novel-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
}

.novel-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    border-color: #3498db;
}

.novel-card h3 {
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 1.2em;
}

.novel-card p {
    color: #7f8c8d;
    margin-bottom: 5px;
    font-size: 0.95em;
}

.novel-card .description {
    color: #555;
    font-size: 0.9em;
    line-height: 1.5;
}

/* 搜索框样式 */
.search-box {
    max-width: 500px;
    margin: 0 auto 30px auto;
    display: flex;
    gap: 10px;
}

.search-box input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.search-box input:focus {
    border-color: #3498db;
}

.search-box button {
    padding: 12px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s ease;
}

.search-box button:hover {
    background: #2980b9;
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #aaa;
    transition: color 0.3s ease;
}

.close:hover {
    color: #000;
}

.chapters ul {
    list-style: none;
    padding: 0;
}

.chapters li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: color 0.2s ease;
}

.chapters li:hover {
    color: #3498db;
}

/* 详细页面专用样式已在hongloumeng.html中定义 */

/* 移动端优化 */
@media (max-width: 480px) {
    .header h1 {
        font-size: 2em;
    }
    
    .novels-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .novel-card {
        padding: 15px;
    }
    
    .search-box {
        flex-direction: column;
    }
    
    .search-box button {
        width: 100%;
    }
    
    .modal-content {
        margin: 10% auto;
        padding: 20px;
        width: 95%;
    }
}