/* =========================================
   chart-common.css (最终修复版：找回丢失的 Tooltip)
   ========================================= */

   :root {
    --bg-glass: rgba(15, 15, 20, 0.75);
    --border-glass: rgba(255, 255, 255, 0.15);
    --text-main: #e2e8f0;
    --accent-color: #00d4ff;
    --chart-radius: 16px;
    --font-family: "Inter", -apple-system, sans-serif;
}

/* --- 1. 左右分栏布局 (Scrolly Sections) --- */
.scrolly-mode {
    display: flex; 
    flex-direction: row; /* 默认：图左，文右 */
    align-items: flex-start;
    width: 100%; 
    padding-top: 20px;
    max-width: 1800px;
    margin: 0 auto;
}

/* 图表容器：占据 65% ~ 66% (2/3) */
.sticky-stage {
    width: 66% !important; /* 强制占 2/3 */
    margin-left: 20px;
    margin-right: 20px;
    
    /* 基础磨砂样式 (暗色默认) */
    position: sticky; top: 15vh; z-index: 10;
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    border: 1px solid var(--border-glass);
    border-radius: var(--chart-radius);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    
    display: flex; flex-direction: column;
    overflow: hidden; 
    height: 70vh; /* 固定高度 */
}

/* 文字容器：占据 30% ~ 33% (1/3) */
.scrolly-story-container {
    width: 30%; 
    padding-bottom: 20vh;
    padding-top: 0;
    z-index: 20;
    pointer-events: none; /* 容器穿透 */
}

/* 侧边标题块 */
.side-header-block {
    margin-bottom: 30px;
    pointer-events: auto;
    text-align: left;
    padding: 0 10px;
}

/* 故事步骤卡片 */
.story-step {
    min-height: 80vh; 
    margin-bottom: 10vh;
    padding: 0 10px;
    display: flex; 
    justify-content: flex-start;
    /* 防止卡片被拉伸 */
    align-items: center;
}

.story-card {
    width: 100%;
    max-width: 400px;
    /* 高度自适应内容 */
    height: fit-content;
    
    background: rgba(30, 30, 35, 0.85);
    backdrop-filter: blur(10px);
    padding: 20px 25px;
    border-radius: 12px;
    border-left: 4px solid var(--accent-color);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    pointer-events: auto;
}
.story-card h3 { color: #fff; margin: 0 0 10px 0; }
.story-card p { color: #cbd5e1; font-size: 0.95rem; margin: 0; line-height: 1.6; }

/* --- 2. 大标题样式 --- */
.grand-section-title {
    font-family: var(--font-family);
    font-size: 3.5rem; /* 侧边栏可以放大一点 */
    font-weight: 900;
    line-height: 1.1;
    margin: 0;
    
    background-color: #fff;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0,0,0,0.3));
    
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.8s ease-out;
}
.reveal.visible .grand-section-title {
    opacity: 1;
    transform: translateY(0);
}

/* --- 3. 【重点修复】通用 Tooltip 样式 (找回丢失的代码) --- */
.shared-tooltip,
.parallel-chart-tooltip {
    position: absolute; top: 0; left: 0; z-index: 99999 !important; 
    pointer-events: none !important; 
    
    /* 极深色背景，确保不透明 */
    background: rgba(10, 10, 15, 0.98) !important; 
    backdrop-filter: blur(12px) !important;
    
    color: #fff !important; 
    border: 2px solid rgba(255, 255, 255, 0.4) !important; 
    border-radius: 8px; padding: 12px; 
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8) !important; 
    font-size: 13px; line-height: 1.5; min-width: 200px; 
    
    /* 动画 */
    opacity: 0; 
    transition: opacity 0.1s ease; 
}
/* Tooltip 内部元素 */
.tooltip-title { 
    font-weight: bold; font-size: 14px; margin-bottom: 6px; 
    color: var(--accent-color) !important; 
    border-bottom: 1px solid rgba(255,255,255,0.2) !important; 
    padding-bottom: 4px; 
}
.tooltip-row span { color: #94a3b8 !important; }
.tooltip-row b { color: #ffffff !important; }


/* --- 4. 图例文字全局修复 (白色) --- */
#scatter-legend-container text,
.legend-group text,
.axis-title, .x-label, .y-label,
.scatter-chart-svg .axis text,
.parallel-chart-svg .axis text {
    fill: #ffffff !important;
    text-shadow: 0 0 3px rgba(0,0,0,0.8);
}

/* 移动端适配 */
@media (max-width: 1024px) {
    .scrolly-mode { flex-direction: column !important; }
    .sticky-stage, .scrolly-story-container { width: 100% !important; margin: 0; }
    .sticky-stage { position: relative; top: 0; height: 500px; margin-bottom: 20px; }
}

