/* ========== 开篇仪式全屏层 ========== */
.opening-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: var(--bg-deep);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 1.5s var(--ease-smooth), visibility 1.5s;
}

.opening-screen.fade-out {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.opening-text {
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 0;
}

.opening-line {
    font-family: var(--font-title);
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 1.2s var(--ease-smooth) forwards;
    letter-spacing: 6px;
}

/* 前两行：文明底色，偏冷白 */
.line-civilization {
    font-size: 28px;
    color: var(--text-white);
    margin-bottom: 14px;
}

/* 分隔线：两段叙事之间的停顿 */
.opening-divider {
    width: 60px;
    height: 1px;
    margin: 30px auto;
    background: var(--border-strong);
    opacity: 0;
    animation: fadeIn 1s var(--ease-smooth) 2.8s forwards;
}

/* 第三行：转折过渡，灰度 */
.line-era {
    font-size: 30px;
    color: var(--text-gray);
    margin-bottom: 16px;
}

/* 第四行：核心落点，鎏金色，分量最重 */
.line-hero {
    font-size: 36px;
    color: var(--gold-primary);
    font-weight: 600;
}



/* 中央时间轴主线 */
.timeline-axis {
    position: fixed;
    left: var(--timeline-center);
    top: 0;
    width: 2px;
    height: 100vh;
    height: 100dvh;
    transform: translateX(-50%);
    z-index: 10;
    pointer-events: none;
}

.timeline-line {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gold-primary) 10%,
        var(--gold-primary) 90%,
        transparent 100%
    );
    opacity: 0.3;
}

/* ========== 新增：年份数字正确定位 ========== */
.timeline-year {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: 120px;
    color: var(--gold-primary);
    opacity: 0.35;
    letter-spacing: 4px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 1;
    transition: opacity var(--duration-normal);
}

/* 人物卡片容器 */
.hero-container {
    position: relative;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 100px 0;
    /* 绝对定位子元素无法撑高，由JS动态设置height，此处给兜底 */
    min-height: 2000px;
}


/* 逐行动画延迟 */
.line-1 { animation-delay: 0.8s; }
.line-2 { animation-delay: 1.8s; }
.line-3 { animation-delay: 3.0s; }
.line-4 { animation-delay: 4.2s; }

/* 时间光带：从顶部垂落，上端虚化，末端带光晕 */
.opening-timeline {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 0;
    /* 上端透明、下端实心，模拟光从深处延伸出来 */
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--gold-primary) 100%
    );
    box-shadow: 0 0 12px var(--gold-glow), 0 0 24px var(--gold-glow);
    opacity: 0;
    z-index: 1;
    animation: timelineFlow 2.5s cubic-bezier(0.16, 1, 0.3, 1) 2.8s forwards;
}

.enter-btn {
    position: relative;
    z-index: 2;
    margin-top: 80px;
    padding: 12px 48px;
    border: 1px solid var(--border-strong);
    color: var(--gold-primary);
    font-family: var(--font-title);
    font-size: 18px;
    letter-spacing: 6px;
    opacity: 0;
    animation: fadeUp 1s var(--ease-smooth) 5.5s forwards;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.enter-btn:hover {
    background: var(--gold-primary);
    color: var(--bg-deep);
    box-shadow: 0 0 30px var(--gold-glow);
}

/* ========== 顶部导航栏 ========== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    padding: 0 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 初始状态：完全透明，融入开篇背景 */
    background: rgba(10, 14, 23, 0);
    border-bottom: 1px solid transparent;
    z-index: 50;
    transition: all var(--duration-normal) var(--ease-smooth);
}

/* 滚动后的实底状态：毛玻璃 + 细金边 */
.navbar.scrolled {
    background: rgba(10, 14, 23, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-light);
}

.nav-title {
    font-family: var(--font-title);
    font-size: 20px;
    color: var(--gold-primary);
    letter-spacing: 3px;
    /* 初始稍暗，滚动后亮起 */
    opacity: 0.7;
    transition: opacity var(--duration-normal);
}

.navbar.scrolled .nav-title {
    opacity: 1;
}

.nav-actions {
    display: flex;
    gap: 20px;
}

.nav-btn {
    padding: 6px 16px;
    border: 1px solid var(--border-light);
    color: var(--text-gray);
    font-size: 14px;
    background: transparent;
    white-space: nowrap;
    transition: all var(--duration-fast) var(--ease-smooth);
}

.nav-btn:hover {
    border-color: var(--gold-primary);
    color: var(--gold-primary);
    box-shadow: 0 0 12px var(--gold-glow);
}

/* 氛围音开启态 */
.nav-btn.on {
    border-color: var(--gold-primary);
    color: var(--bg-deep);
    background: var(--gold-primary);
}


/* 分期标题节点 */
.period-section {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.period-title {
    text-align: center;
    position: relative;
}

/* 标题左右装饰线，增强仪式感 */
.period-title::before,
.period-title::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 80px;
    height: 1px;
    background: var(--border-strong);
}
.period-title::before { left: -120px; }
.period-title::after { right: -120px; }

.period-title h2 {
    font-family: var(--font-title);
    font-size: 42px;
    color: var(--gold-primary);
    letter-spacing: 10px;
    margin-bottom: 12px;
    font-weight: normal;
}

.period-title span {
    font-family: var(--font-mono);
    font-size: 18px;
    color: var(--text-gray);
    letter-spacing: 4px;
    opacity: 0.8;
}

/* ========== 底部致敬墙 ========== */
.tribute-wall {
    position: relative;
    width: 100%;
    padding: 200px 20px 150px;
    text-align: center;
    background: linear-gradient(to bottom, transparent 0%, var(--bg-deep) 40%);
    margin-top: 100px;
}

.tribute-text {
    font-family: var(--font-title);
    color: var(--text-gray);
    letter-spacing: 4px;
    line-height: 2;
}
.tribute-text:first-child {
    font-size: 22px;
    margin-bottom: 8px;
    color: var(--text-muted);
}
.tribute-text:last-of-type {
    font-size: 26px;
    color: var(--text-gray);
}

.tribute-stars {
    margin: 80px auto 0;
    width: 60%;
    height: 120px;
    background: radial-gradient(ellipse at center, var(--gold-glow) 0%, transparent 70%);
    opacity: 0.4;
}

/* ========== 移动端适配（≤768px） ========== */
@media (max-width: 1024px) {
    .opening-screen {
        height: 100vh;
        height: 100dvh;
        padding: 0 20px;
    }

    .opening-line {
        letter-spacing: 3px;
    }

    .line-civilization {
        font-size: 22px;
        margin-bottom: 10px;
    }

    .line-era {
        font-size: 24px;
        margin-bottom: 12px;
    }

    .line-hero {
        font-size: 27px;
    }

    .opening-divider {
        margin: 22px auto;
    }

    .enter-btn {
        margin-top: 40px;
        padding: 10px 32px;
        font-size: 16px;
        letter-spacing: 3px;
    }

    /* 顶部导航收口 */
    .navbar {
        height: 52px;
        padding: 0 12px;
    }

    .nav-title {
        font-size: 15px;
        letter-spacing: 1px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .nav-actions {
        gap: 6px;
    }

    .nav-btn {
        padding: 5px 8px;
        font-size: 11px;
    }

    /* 中轴移到左侧，卡片靠右单列排列 */
    .timeline-axis {
        left: 20px;
    }

    .timeline-year {
        font-size: 44px;
        letter-spacing: 2px;
        left: 20px;
        transform: translateY(-50%);
    }

    .hero-container {
        padding: 60px 0;
        min-height: 0;
    }

    .period-title h2 {
        font-size: 26px;
        letter-spacing: 4px;
        margin-bottom: 8px;
    }

    .period-title span {
        font-size: 14px;
        letter-spacing: 2px;
    }

    .period-title::before,
    .period-title::after {
        width: 28px;
    }

    .period-title::before { left: -40px; }
    .period-title::after { right: -40px; }

    .tribute-wall {
        padding: 100px 16px 80px;
        margin-top: 40px;
    }

    .tribute-text:first-child {
        font-size: 16px;
    }

    .tribute-text:last-of-type {
        font-size: 18px;
    }
}

/* ========== 左侧大纲 / 筛选面板 ========== */
.side-panel {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    width: 280px;
    height: calc(100vh - var(--nav-height));
    height: calc(100dvh - var(--nav-height));
    background: var(--bg-overlay);
    border-right: 1px solid var(--border-light);
    z-index: 40;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform var(--duration-normal) var(--ease-smooth);
}

.side-panel.open {
    transform: translateX(0);
}

.panel-head {
    padding: 12px 12px 8px;
}

.panel-search {
    width: 100%;
    padding: 8px 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    color: var(--text-white);
    font-size: 13px;
    outline: none;
}

.panel-search:focus {
    border-color: var(--gold-primary);
}

.panel-search::placeholder {
    color: var(--text-muted);
}

.panel-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px 12px 8px;
}

.filter-chip {
    padding: 4px 10px;
    font-size: 12px;
    color: var(--text-gray);
    border: 1px solid var(--border-light);
    background: transparent;
    cursor: pointer;
}

.filter-chip.on {
    color: var(--bg-deep);
    background: var(--gold-primary);
    border-color: var(--gold-primary);
}

.panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 12px 16px;
}

.outline-group {
    margin-bottom: 14px;
}

.outline-group-title {
    font-family: var(--font-title);
    color: var(--gold-primary);
    font-size: 14px;
    letter-spacing: 2px;
    margin: 10px 0 6px;
    display: flex;
    justify-content: space-between;
}

.outline-count {
    color: var(--text-muted);
    font-size: 12px;
}

.outline-item {
    padding: 8px 10px;
    border: 1px solid transparent;
    border-left: 2px solid transparent;
    cursor: pointer;
}

.outline-item:hover {
    border-color: var(--border-light);
    border-left-color: var(--gold-primary);
    background: var(--bg-card);
}

.outline-item-name {
    font-size: 15px;
    color: var(--text-white);
    margin-bottom: 2px;
}

.outline-item-meta {
    font-size: 12px;
    color: var(--text-gray);
}

.outline-item-years {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

.outline-empty,
.outline-result-count {
    color: var(--text-muted);
    font-size: 13px;
    padding: 10px 2px;
}

.panel-mask {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 23, 0.5);
    z-index: 39;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal);
}

.panel-mask.open {
    opacity: 1;
    visibility: visible;
}

@media (max-width: 1024px) {
    .side-panel {
        width: 82vw;
        max-width: 300px;
    }
}