/* =====================================
   华夏文脉 - 中华优秀传统文化网站
   样式表
   ===================================== */

/* --- CSS 变量 / 主题 --- */
:root {
    --primary: #c0392b;
    --primary-dark: #a93226;
    --primary-light: #e74c3c;
    --gold: #d4a017;
    --gold-light: #f0c040;
    --dark: #1a1a2e;
    --darker: #0f0f1a;
    --text: #2c3e50;
    --text-light: #666;
    --bg: #fdf6ec;
    --bg-card: #fff;
    --bg-dark: #1a1a2e;
    --shadow: 0 4px 20px rgba(0,0,0,0.1);
    --shadow-hover: 0 8px 35px rgba(192,57,43,0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    line-height: 1.8;
    overflow-x: hidden;
}
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
ul { list-style: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* --- 导航栏 --- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(15,15,26,0.95);
    backdrop-filter: blur(10px);
    padding: 0 20px;
    border-bottom: 1px solid rgba(212,160,23,0.2);
}
.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold-light);
}
.logo-icon { font-size: 1.8rem; }
.nav-links {
    display: flex;
    gap: 35px;
}
.nav-links a {
    color: #ccc;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
    padding: 5px 0;
}
.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
}
.nav-links a:hover, .nav-links a.active {
    color: var(--gold-light);
}
.nav-links a:hover::after, .nav-links a.active::after {
    width: 100%;
}
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 5px;
}
.hamburger span {
    width: 25px;
    height: 2px;
    background: var(--gold-light);
    transition: var(--transition);
}

/* --- Hero Section --- */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: linear-gradient(135deg, var(--darker) 0%, #2c1810 50%, var(--darker) 100%);
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(212,160,23,0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(192,57,43,0.08) 0%, transparent 50%);
}
.overlay {
    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" opacity="0.03"><path d="M50 0 L61 35 L98 35 L68 57 L79 91 L50 70 L21 91 L32 57 L2 35 L39 35 Z" fill="%23f0c040"/></svg>') repeat;
    background-size: 100px;
}
.hero-content {
    position: relative;
    z-index: 2;
    padding: 20px;
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 800;
    background: linear-gradient(135deg, var(--gold-light), #fff, var(--gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 20px;
    letter-spacing: 4px;
}
.hero-subtitle {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    color: var(--gold);
    margin-bottom: 15px;
    letter-spacing: 2px;
}
.hero-desc {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto 40px;
}
.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}
.btn {
    display: inline-block;
    padding: 14px 40px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    letter-spacing: 1px;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    box-shadow: 0 4px 15px rgba(192,57,43,0.4);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(192,57,43,0.5);
}
.btn-secondary {
    background: transparent;
    color: var(--gold-light);
    border: 2px solid var(--gold);
}
.btn-secondary:hover {
    background: rgba(212,160,23,0.15);
    transform: translateY(-3px);
}

/* --- 通用 Section --- */
.section {
    padding: 100px 0;
}
.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 15px;
    position: relative;
}
.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--gold));
    margin: 15px auto 0;
    border-radius: 2px;
}
.section-subtitle {
    text-align: center;
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 60px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 卡片网格 (首页文化精髓) --- */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
}
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 40px 30px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(212,160,23,0.1);
}
.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: rgba(212,160,23,0.3);
}
.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
}
.card h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 12px;
}
.card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* --- 名句引用 --- */
.quotes { background: linear-gradient(135deg, #1a1a2e, #2c1810); }
.quotes .section-title { color: var(--gold-light); }
.quotes .section-title::after { background: var(--gold); }
.quote-slider {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.quote-card {
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(212,160,23,0.2);
    border-radius: var(--radius);
    padding: 35px 30px;
    text-align: center;
    transition: var(--transition);
}
.quote-card:hover {
    border-color: var(--gold);
    background: rgba(212,160,23,0.08);
}
.quote-card blockquote {
    font-size: 1.1rem;
    color: #e0d5c1;
    font-style: italic;
    line-height: 1.8;
    margin-bottom: 15px;
    quotes: "「" "」";
}
.quote-card blockquote::before { content: "「"; }
.quote-card blockquote::after { content: "」"; }
.quote-card cite {
    color: var(--gold);
    font-style: normal;
    font-size: 0.9rem;
}

/* --- 时间线 (节日 / 文化脉络) --- */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 0;
}
.timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--gold));
    transform: translateX(-50%);
}
.timeline-item {
    position: relative;
    margin-bottom: 50px;
    display: flex;
    align-items: flex-start;
}
.timeline-item:nth-child(odd) {
    flex-direction: row;
}
.timeline-item:nth-child(even) {
    flex-direction: row-reverse;
}
.timeline-date {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary), var(--gold));
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
    white-space: nowrap;
}
.timeline-content {
    width: 45%;
    background: var(--bg-card);
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(212,160,23,0.1);
    transition: var(--transition);
}
.timeline-content:hover {
    box-shadow: var(--shadow-hover);
}
.timeline-item:nth-child(odd) .timeline-content {
    margin-right: auto;
}
.timeline-item:nth-child(even) .timeline-content {
    margin-left: auto;
}
.timeline-content h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}
.timeline-content p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* --- 节日的交替时间线适配 --- */
.festivals .timeline-item:first-child .timeline-date { top: -10px; }

/* --- Page Banner (资源/关于页) --- */
.page-banner {
    position: relative;
    min-height: 45vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding-top: 70px;
}
.resources-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #2c1810 50%, #1a1a2e 100%);
}
.about-banner {
    background: linear-gradient(135deg, #1a1a2e 0%, #2c1810 50%, #1a1a2e 100%);
}
.banner-content {
    position: relative;
    z-index: 2;
    color: #fff;
}
.banner-content h1 {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 15px;
    letter-spacing: 3px;
}
.banner-content h1::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--gold);
    margin: 15px auto 0;
}
.banner-content p {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.7);
    max-width: 500px;
    margin: 0 auto;
}

/* --- 媒体网格 (资源页视频) --- */
.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 30px;
}
.media-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid rgba(212,160,23,0.1);
}
.media-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}
.video-wrapper {
    position: relative;
    width: 100%;
    background: #000;
}
.video-wrapper video {
    width: 100%;
    display: block;
    max-height: 320px;
    object-fit: cover;
}
.media-info {
    padding: 20px;
}
.media-info h3 {
    color: var(--dark);
    font-size: 1.1rem;
    margin-bottom: 8px;
}
.media-info p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* --- 图片画廊 --- */
.gallery-section { background: #fff; }
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}
.gallery-item {
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 3/2;
    transition: var(--transition);
}
.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}
.gallery-item:hover img {
    transform: scale(1.1);
}
.gallery-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 30px 15px 15px;
    opacity: 0;
    transition: var(--transition);
}
.gallery-item:hover .gallery-overlay {
    opacity: 1;
}
.gallery-overlay span {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

/* --- Lightbox --- */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 40px;
}
.lightbox.active {
    display: flex;
}
.lightbox img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 3rem;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 2001;
    transition: var(--transition);
}
.lightbox-close:hover { color: var(--primary-light); }

/* --- 关于页 --- */
.about-intro {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: center;
}
.about-text h2 {
    font-size: 2rem;
    color: var(--dark);
    margin-bottom: 20px;
}
.about-text p {
    color: var(--text-light);
    font-size: 1.05rem;
    margin-bottom: 15px;
    line-height: 1.9;
}
.about-image {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.about-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.values-section { background: #fff; }
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 30px;
}
.value-card {
    text-align: center;
    padding: 40px 25px;
    border-radius: var(--radius);
    background: var(--bg);
    transition: var(--transition);
    border: 1px solid transparent;
}
.value-card:hover {
    border-color: var(--gold);
    background: #fdf6ec;
    transform: translateY(-5px);
}
.value-number {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}
.value-card h3 {
    font-size: 1.3rem;
    color: var(--dark);
    margin-bottom: 10px;
}
.value-card p {
    color: var(--text-light);
    font-size: 0.9rem;
}
.cta-section {
    background: linear-gradient(135deg, var(--darker), #2c1810);
}
.cta-box {
    text-align: center;
    padding: 60px 40px;
    border-radius: var(--radius);
    border: 1px solid rgba(212,160,23,0.3);
    background: rgba(255,255,255,0.03);
}
.cta-box h2 {
    font-size: 2rem;
    color: var(--gold-light);
    margin-bottom: 15px;
}
.cta-box p {
    color: rgba(255,255,255,0.7);
    font-size: 1.05rem;
}

/* --- 页脚 --- */
.footer {
    background: var(--darker);
    color: #999;
    padding: 60px 0 20px;
    border-top: 1px solid rgba(212,160,23,0.15);
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}
.footer-col h4 {
    color: var(--gold-light);
    margin-bottom: 20px;
    font-size: 1.1rem;
    position: relative;
}
.footer-col h4::after {
    content: '';
    display: block;
    width: 30px;
    height: 2px;
    background: var(--gold);
    margin-top: 8px;
}
.footer-col p {
    font-size: 0.9rem;
    line-height: 1.8;
}
.footer-col ul li {
    margin-bottom: 10px;
}
.footer-col ul li a {
    color: #888;
    font-size: 0.9rem;
    transition: var(--transition);
}
.footer-col ul li a:hover {
    color: var(--gold-light);
    padding-left: 5px;
}
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 20px;
    text-align: center;
    font-size: 0.85rem;
    color: #666;
}

/* --- 滚动动画 --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        background: rgba(15,15,26,0.98);
        flex-direction: column;
        padding: 30px;
        gap: 20px;
        text-align: center;
        border-bottom: 1px solid rgba(212,160,23,0.2);
    }
    .nav-links.open {
        display: flex;
    }
    .hamburger {
        display: flex;
    }
    .timeline::before {
        left: 20px;
    }
    .timeline-item,
    .timeline-item:nth-child(even) {
        flex-direction: row !important;
        padding-left: 40px;
    }
    .timeline-date {
        left: 20px !important;
        transform: translateX(-50%);
        font-size: 0.8rem;
        padding: 6px 15px;
        top: 0 !important;
    }
    .timeline-content {
        width: 100% !important;
        margin: 0 !important;
    }
    .media-grid {
        grid-template-columns: 1fr;
    }
    .about-intro {
        grid-template-columns: 1fr;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    }
}
