/* 中国历代王朝编年史 - 样式文件 */
@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #8B4513;
    --secondary-color: #DAA520;
    --accent-color: #CD853F;
    --text-color: #2F1B14;
    --bg-color: #FDF5E6;
    --card-bg: #FFFEF7;
    --border-color: #D2B48C;
    --shadow-color: rgba(139, 69, 19, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Serif SC', serif;
    background: linear-gradient(135deg, var(--bg-color) 0%, #F5E6D3 100%);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
}

/* 页面背景装饰 */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 80%, rgba(218, 165, 32, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 69, 19, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
}

header {
    text-align: center;
    padding: 3rem 2rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="75" cy="75" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="0.5" fill="rgba(255,255,255,0.05)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
    z-index: 0;
}

header h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

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

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dynasty-card {
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 15px;
    margin: 2rem 0;
    padding: 2rem;
    box-shadow: 0 8px 25px var(--shadow-color);
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

.dynasty-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color), var(--accent-color));
}

.dynasty-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(139, 69, 19, 0.15);
}

.dynasty-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.dynasty-name {
    font-size: 2.2rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.dynasty-period {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 500;
    background: rgba(218, 165, 32, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    border: 1px solid var(--secondary-color);
}

.dynasty-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-item {
    background: rgba(139, 69, 19, 0.05);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--secondary-color);
    text-align: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--accent-color);
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
}

.emperors-section {
    margin: 2rem 0;
}

.emperors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.emperor-card {
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.emperor-card:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.emperor-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.emperor-title::before {
    content: '👑';
    font-size: 1rem;
}

.emperor-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.8rem;
}

.emperor-description {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.8;
}

.section-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title::before {
    content: '📜';
    font-size: 1.2rem;
}

.fall-event {
    background: rgba(205, 133, 63, 0.1);
    border: 1px solid var(--accent-color);
    border-radius: 10px;
    padding: 1.5rem;
    margin: 1rem 0;
}

.fall-event h4 {
    color: var(--primary-color);
    font-size: 1.2rem;
    margin-bottom: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fall-event h4::before {
    content: '⚔️';
    font-size: 1rem;
}

.ranking-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--secondary-color), var(--accent-color));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.ranking-badge::before {
    content: '🏆';
    font-size: 0.9rem;
}

footer {
    text-align: center;
    padding: 2rem;
    background: var(--primary-color);
    color: white;
    margin-top: 3rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    header h1 {
        font-size: 2.2rem;
    }
    
    header .subtitle {
        font-size: 1rem;
    }
    
    main {
        padding: 1rem;
    }
    
    .dynasty-card {
        padding: 1.5rem;
    }
    
    .dynasty-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .dynasty-name {
        font-size: 1.8rem;
    }
    
    .dynasty-stats {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    .emperors-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    header {
        padding: 2rem 1rem;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .dynasty-stats {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 0.8rem;
    }
}

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

.dynasty-card {
    animation: fadeInUp 0.6s ease-out;
}

.dynasty-card:nth-child(even) {
    animation-delay: 0.1s;
}

.dynasty-card:nth-child(odd) {
    animation-delay: 0.2s;
}