
/* 全局变量 - 古典水墨风格 */
:root {
    --primary-color: #8b0000; /* 深红/朱砂色 */
    --secondary-color: #d4af37; /* 金色/帝王黄 */
    --bg-color: #f5f5f0; /* 宣纸白 */
    --surface-color: #ffffff;
    --text-main: #2c2c2c; /* 墨黑 */
    --text-light: #666666; /* 淡墨 */
    --border-radius: 2px; /* 直角或微圆角，更显庄重 */
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    --font-family: 'KaiTi', 'STKaiti', 'SimSun', serif; /* 楷体或宋体，增强历史感 */
}

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

body {
    font-family: var(--font-family);
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.8;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI0IiBoZWlnaHQ9IjQiPgo8cmVjdCB3aWR0aD0iNCIgaGVpZ2h0PSI0IiBmaWxsPSIjZjVmNWYwIi8+CjxyZWN0IHdpZHRoPSIxIiBoZWlnaHQ9IjEiIGZpbGw9IiNlZWVlZTgiLz4KPC9zdmc+'); /* 细微纹理 */
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

ul {
    list-style: none;
}

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

/* 顶部导航 */
.history-header {
    background: var(--surface-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px double var(--primary-color); /* 双线边框，古典味 */
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary-color);
    letter-spacing: 2px;
}

.nav-links a {
    margin: 0 20px;
    font-weight: 500;
    color: var(--text-main);
    font-size: 1.1rem;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s;
}

.nav-links a:hover::after, .nav-links a.active::after {
    width: 80%;
}

.btn-search {
    background: var(--primary-color);
    color: var(--white);
    padding: 10px 25px;
    border-radius: var(--border-radius);
    font-size: 1rem;
    border: 1px solid var(--primary-color);
}

.btn-search:hover {
    background: transparent;
    color: var(--primary-color);
}

/* 英雄区域 */
.hero-banner {
    padding: 100px 0;
    background: linear-gradient(to right, #e8e8e8, #f5f5f0);
    border-bottom: 1px solid #dcdcdc;
}

.hero-content {
    display: flex;
    align-items: center;
    gap: 60px;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 3.5rem;
    color: var(--primary-color);
    margin-bottom: 20px;
    line-height: 1.2;
    font-weight: normal;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.1);
}

.subtitle {
    font-size: 1.4rem;
    color: var(--text-light);
    margin-bottom: 40px;
    font-style: italic;
}

.hero-btns {
    display: flex;
    gap: 20px;
}

.btn-primary {
    padding: 15px 40px;
    background: var(--primary-color);
    color: var(--white);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    letter-spacing: 2px;
    border: 1px solid var(--primary-color);
}

.btn-primary:hover {
    background: transparent;
    color: var(--primary-color);
}

.btn-secondary {
    padding: 15px 40px;
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    letter-spacing: 2px;
}

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

.hero-img-box {
    flex: 1;
}

.hero-img-box img {
    width: 100%;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    border: 5px solid var(--white);
    outline: 1px solid #ddd;
}

/* 通用区块 */
.section-area {
    padding: 80px 0;
}

.bg-paper {
    background: #f9f9f9;
}

.bg-white {
    background: #ffffff;
}

.bg-ink {
    background: #2c2c2c;
    color: #f5f5f0;
}

.section-head {
    text-align: center;
    margin-bottom: 60px;
}

.section-head h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    color: var(--primary-color);
    font-weight: normal;
    position: relative;
    display: inline-block;
}

.section-head h2::before, .section-head h2::after {
    content: '✦';
    color: var(--secondary-color);
    margin: 0 15px;
    font-size: 1.5rem;
}

.section-head p {
    color: var(--text-light);
    font-size: 1.1rem;
}

.section-head.light h2 {
    color: var(--secondary-color);
}

.section-head.light p {
    color: #aaa;
}

/* 时间轴 */
.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -2px;
}

.timeline-item {
    padding: 10px 40px;
    position: relative;
    background-color: inherit;
    width: 50%;
}

.timeline-item::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -10px;
    background-color: var(--bg-color);
    border: 4px solid var(--secondary-color);
    top: 15px;
    border-radius: 50%;
    z-index: 1;
}

.left {
    left: 0;
}

.right {
    left: 50%;
}

.right::after {
    left: -10px;
}

.content {
    padding: 20px 30px;
    background-color: var(--surface-color);
    position: relative;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border-left: 5px solid var(--primary-color);
}

.content h3 {
    color: var(--primary-color);
    margin-bottom: 5px;
}

.date {
    display: block;
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-bottom: 10px;
    font-weight: bold;
}

/* 朝代卡片 */
.dynasty-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}

.dynasty-card {
    background: var(--surface-color);
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s;
}

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

.card-img {
    position: relative;
    height: 180px;
    overflow: hidden;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(20%); /* 轻微复古感 */
    transition: filter 0.3s;
}

.dynasty-card:hover .card-img img {
    filter: grayscale(0%);
}

.dynasty-tag {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: var(--white);
    padding: 5px 10px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 2px;
}

.card-body {
    padding: 20px;
}

.card-body h3 {
    font-size: 1.4rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 人物列表 */
.figure-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.figure-item {
    background: #3a3a3a;
    padding: 20px;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 20px;
    border: 1px solid #444;
}

.figure-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--secondary-color);
    object-fit: cover;
}

.figure-info h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.title {
    color: #aaa;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-style: italic;
}

.bio {
    color: #ccc;
    font-size: 0.95rem;
}

/* 页脚 */
.site-footer {
    background: #1a1a1a;
    color: #888;
    padding: 60px 0 30px;
    border-top: 5px solid var(--primary-color);
}

.footer-layout {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 50px;
    margin-bottom: 50px;
}

.footer-col h4 {
    color: var(--white);
    margin-bottom: 25px;
    font-size: 1.3rem;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a:hover {
    color: var(--secondary-color);
}

.copyright {
    text-align: center;
    padding-top: 30px;
    border-top: 1px solid #333;
    font-size: 0.85rem;
}

/* 响应式适配 */
@media (max-width: 768px) {
    .header-flex {
        flex-direction: column;
        height: auto;
        padding: 15px 0;
        gap: 15px;
    }

    .nav-links {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 10px;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero-btns {
        justify-content: center;
    }

    .timeline-container::after {
        left: 31px;
    }

    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

    .timeline-item::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }

    .figure-item {
        flex-direction: column;
        text-align: center;
    }

    .footer-layout {
        grid-template-columns: 1fr;
        text-align: center;
    }
}
