:root {
    /* 科技感深色主题配色 (同步 page4) */
    --bg-dark: #0b0c10;
    --panel-bg: #1f2833;
    --text-main: #c5c6c7;
    --text-muted: #66fcf1;
    --accent-blue: #45a29e;
    --accent-yellow: #ffc107;
    --grid-color: rgba(102, 252, 241, 0.05);
    --shadow-primary: 0 4px 15px rgba(0, 0, 0, 0.5);
}

body {
    margin: 0;
    padding: 0;
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* --- 顶部导航 --- */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 30px;
    background: linear-gradient(to bottom, rgba(31, 40, 51, 0.95), rgba(11, 12, 16, 0.95));
    border-bottom: 1px solid var(--accent-blue);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5);
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-title {
    font-size: 20px;
    font-weight: bold;
    color: var(--text-muted);
    letter-spacing: 2px;
}

.nav-btn {
    background: transparent;
    border: 1px solid var(--accent-blue);
    color: var(--text-muted);
    padding: 6px 15px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    font-size: 14px;
}

.nav-btn:hover {
    background: rgba(69, 162, 158, 0.2);
    box-shadow: 0 0 10px rgba(69, 162, 158, 0.5);
}

/* --- 主体布局 --- */
.main-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    gap: 15px;
    overflow-y: auto;
}

.top-row {
    display: flex;
    gap: 15px;
    height: 450px;
    /* 固定上层高度 */
}

.panel {
    background-color: var(--panel-bg);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid rgba(69, 162, 158, 0.2);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
}

.info-panel {
    flex: 6;
}

.chart-panel {
    flex: 4;
}

.timeline-panel-full {
    flex: none;
    width: 100%;
    min-height: 350px;
}

h2 {
    margin-top: 0;
    font-size: 16px;
    color: var(--text-main);
    border-left: 4px solid var(--accent-blue);
    padding-left: 10px;
    margin-bottom: 15px;
}

.viz-container {
    flex: 1;
    background-color: #0d1115;
    border-radius: 6px;
    position: relative;
    overflow: hidden;
    border: 1px solid #2b3540;
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 25px 25px;
}

/* --- 参数卡片网格 --- */
.info-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    padding: 15px;
}

.info-card-item {
    background: rgba(31, 40, 51, 0.6);
    border: 1px solid rgba(102, 252, 241, 0.1);
    border-radius: 6px;
    padding: 20px 10px;
    text-align: center;
    transition: all 0.3s ease;
}

.info-card-item:hover {
    background: rgba(69, 162, 158, 0.15);
    border-color: var(--text-muted);
    transform: translateY(-3px);
}

.card-number {
    font-size: 2.2rem;
    font-weight: bold;
    color: var(--text-muted);
    font-family: 'Courier New', monospace;
}

.card-number span {
    font-size: 0.9rem;
    margin-left: 3px;
    opacity: 0.7;
}

.card-desc {
    font-size: 0.85rem;
    color: var(--text-main);
    margin-top: 5px;
    opacity: 0.8;
}

/* --- 全宽时间轴展示区 --- */
.timeline-display-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 10;
}

.story-display-area {
    display: flex;
    gap: 30px;
    background: rgba(13, 17, 21, 0.4);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid rgba(102, 252, 241, 0.1);
    align-items: center;
    backdrop-filter: blur(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.5s ease;
}

.story-display-area:hover {
    border-color: rgba(102, 252, 241, 0.3);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(102, 252, 241, 0.05);
}

.story-image {
    width: 280px;
    height: 180px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid var(--accent-blue);
    box-shadow: 0 0 15px rgba(69, 162, 158, 0.3);
    transition: opacity 0.5s ease;
}

.story-text-content {
    flex: 1;
    transition: opacity 0.5s ease;
}

.story-text-content h3 {
    margin: 0 0 15px;
    color: var(--text-muted);
    font-size: 1.4rem;
    letter-spacing: 1px;
}

.story-text-content p {
    margin: 0;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--text-main);
}

/* --- 交互时间轴 --- */
.timeline-viz {
    position: relative;
    height: 60px;
    margin: 10px 40px 30px;
}

.timeline-line {
    position: absolute;
    top: 50%;
    width: 100%;
    height: 2px;
    background: rgba(102, 252, 241, 0.2);
    transform: translateY(-50%);
}

.timeline-event {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--bg-dark);
    border: 3px solid var(--accent-blue);
    cursor: pointer;
    transition: all 0.3s;
}

.timeline-event .event-year {
    position: absolute;
    top: 25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 12px;
    color: var(--text-main);
    opacity: 0.6;
    white-space: nowrap;
}

.timeline-event:hover,
.timeline-event.active {
    background: var(--text-muted);
    transform: translateY(-50%) scale(1.4);
    box-shadow: 0 0 15px var(--text-muted);
}

.timeline-event.active .event-year {
    color: var(--text-muted);
    opacity: 1;
    font-weight: bold;
}

/* --- Tooltip --- */
.vis-tooltip {
    position: fixed;
    background: rgba(11, 12, 16, 0.95);
    color: white;
    padding: 12px 18px;
    border-radius: 4px;
    font-size: 13px;
    pointer-events: none;
    z-index: 2000;
    display: none;
    max-width: 250px;
    border: 1px solid rgba(102, 252, 241, 0.3);
    border-left: 4px solid var(--text-muted);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

@keyframes pulse-btn {
    0% { transform: scale(1); box-shadow: 0 0 20px rgba(102, 252, 241, 0.5); }
    50% { transform: scale(1.05); box-shadow: 0 0 40px rgba(102, 252, 241, 0.8); }
    100% { transform: scale(1); box-shadow: 0 0 20px rgba(102, 252, 241, 0.5); }
}

.next-step-pulse {
    animation: pulse-btn 2s infinite;
}

.clickable {
    cursor: help;
}

@media (max-width: 1200px) {
    .top-row {
        flex-direction: column;
        height: auto;
    }

    .story-display-area {
        flex-direction: column;
        text-align: center;
    }

    .story-image {
        width: 100%;
        max-width: 400px;
    }
}