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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Noto Serif SC', serif;
    line-height: 1.6;
    color: #2c1810;
    background: linear-gradient(135deg, #f5f5dc 0%, #fff8dc 100%);
    overflow-x: hidden;
}

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

/* 页面头部样式 */
.header {
    background: linear-gradient(135deg, #8b0000 0%, #b22222 50%, #dc143c 100%);
    color: #f4d03f;
    text-align: center;
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(244,208,63,0.1)"/><circle cx="80" cy="20" r="2" fill="rgba(244,208,63,0.1)"/><circle cx="50" cy="50" r="3" fill="rgba(244,208,63,0.1)"/><circle cx="20" cy="80" r="2" fill="rgba(244,208,63,0.1)"/><circle cx="80" cy="80" r="2" fill="rgba(244,208,63,0.1)"/></svg>');
    animation: twinkle 3s infinite;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.main-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.header-decoration {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(45deg, #f4d03f 0%, #d4af37 50%, #f4d03f 100%);
    clip-path: polygon(0 0, 100% 0, 90% 100%, 10% 100%);
}

/* 导航样式 */
.navigation {
    background: #2c1810;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: #f4d03f;
    margin: 3px 0;
    transition: 0.3s;
}

.nav-list {
    display: flex;
    list-style: none;
    justify-content: center;
    align-items: center;
}

.nav-list li {
    margin: 0 30px;
    position: relative;
}

.nav-list a {
    color: #f4d03f;
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 10px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
    display: block;
}

.nav-list a:hover {
    background: #d4af37;
    color: #2c1810;
    transform: translateY(-2px);
}

/* 下拉菜单 */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #2c1810;
    border: 2px solid #d4af37;
    border-radius: 8px;
    min-width: 250px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    border-bottom: 1px solid #444;
}

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

.dropdown-menu a {
    margin: 0;
    padding: 12px 20px;
    border-radius: 0;
    font-size: 0.95rem;
}

/* 简介部分 */
.introduction {
    padding: 80px 0;
    background: linear-gradient(135deg, #fff8dc 0%, #f5f5dc 100%);
    position: relative;
}

.introduction::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 200"><path d="M100 20 L120 80 L180 80 L135 115 L155 175 L100 140 L45 175 L65 115 L20 80 L80 80 Z" fill="rgba(212,175,55,0.1)" transform="rotate(45 100 100)"/></svg>');
    background-size: 400px 400px;
    opacity: 0.3;
}

.intro-content {
    position: relative;
    z-index: 1;
}

.intro-content h2 {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: #8b0000;
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.intro-content h2::after {
    content: '';
    display: block;
    width: 100px;
    height: 3px;
    background: linear-gradient(90deg, transparent, #d4af37, transparent);
    margin: 20px auto;
}

.intro-text {
    max-width: 800px;
    margin: 0 auto 60px;
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
}

.intro-text p {
    margin-bottom: 20px;
    color: #444;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 60px;
    margin-top: 40px;
}

.stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255,255,255,0.8);
    border-radius: 15px;
    border: 2px solid #d4af37;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-5px);
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #8b0000;
    font-family: 'Ma Shan Zheng', cursive;
}

.stat-label {
    display: block;
    font-size: 1rem;
    color: #666;
    margin-top: 5px;
}

/* 故事展示区样式 */
.stories-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #f5f5dc 0%, #fff8dc 100%);
}

.section-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2.5rem;
    color: #8b0000;
    text-align: center;
    margin-bottom: 20px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 60px;
}

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

/* 故事卡片样式 */
.story-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 2px solid transparent;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.story-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: var(--category-color, #d4af37);
    transition: height 0.3s ease;
}

.story-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    border-color: var(--category-color, #d4af37);
}

.story-card:hover::before {
    height: 100%;
    opacity: 0.05;
}

.story-number {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--category-color, #d4af37);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.1rem;
}

.story-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 1.5rem;
    color: #8b0000;
    margin-bottom: 15px;
    padding-right: 60px;
}

.story-characters {
    margin-bottom: 15px;
}

.story-characters strong {
    color: #d4af37;
    font-weight: 600;
}

.character-tag {
    display: inline-block;
    background: var(--category-color, #d4af37);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.85rem;
    margin: 2px;
}

.story-summary {
    color: #555;
    line-height: 1.7;
    margin-bottom: 20px;
    text-align: justify;
}

.story-category {
    display: inline-block;
    background: rgba(212,175,55,0.1);
    color: var(--category-color, #d4af37);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid var(--category-color, #d4af37);
}

.read-more {
    display: inline-block;
    margin-top: 15px;
    color: var(--category-color, #d4af37);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.read-more:hover {
    color: #8b0000;
    transform: translateX(5px);
}

.read-more::after {
    content: ' →';
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #8b0000;
    color: #f4d03f;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #d4af37;
    color: #2c1810;
    transform: translateY(-3px);
}

/* 模态框样式 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    background: #ffffff;
    border-radius: 15px;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 20px;
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 1;
}

.close:hover {
    color: #8b0000;
}

.modal-body {
    padding: 40px;
}

.modal-title {
    font-family: 'Ma Shan Zheng', cursive;
    font-size: 2rem;
    color: #8b0000;
    margin-bottom: 20px;
    padding-right: 40px;
}

.modal-characters {
    margin-bottom: 20px;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section h4 {
    color: #d4af37;
    font-size: 1.2rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.modal-section p {
    line-height: 1.8;
    color: #555;
    text-align: justify;
}

/* 页脚样式 */
.footer {
    background: #2c1810;
    color: #f4d03f;
    text-align: center;
    padding: 40px 0;
    border-top: 3px solid #d4af37;
}

.footer p {
    margin-bottom: 10px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-list {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: #2c1810;
        border-top: 2px solid #d4af37;
    }
    
    .nav-list.active {
        display: flex;
    }
    
    .nav-list li {
        margin: 0;
        border-bottom: 1px solid #444;
    }
    
    .main-title {
        font-size: 2.5rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .stats {
        flex-direction: column;
        gap: 20px;
        align-items: center;
    }
    
    .stories-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .story-card {
        padding: 20px;
    }
    
    .story-title {
        font-size: 1.3rem;
        padding-right: 50px;
    }
    
    .story-number {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-title {
        font-size: 1.5rem;
        padding-right: 30px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 40px 0;
    }
    
    .main-title {
        font-size: 2rem;
    }
    
    .introduction {
        padding: 60px 0;
    }
    
    .stories-section {
        padding: 60px 0;
    }
    
    .section-title {
        font-size: 2rem;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #d4af37;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #b8941f;
}

/* 打印样式 */
@media print {
    .navigation,
    .back-to-top,
    .modal {
        display: none !important;
    }
    
    .header {
        background: #8b0000 !important;
        color: #f4d03f !important;
    }
    
    .story-card {
        break-inside: avoid;
        margin-bottom: 20px;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
