/* --- 全局与字体设置 --- */
:root {
    --color-primary: #42a8b2; /* 青绿色 */
    --color-secondary: #7a647f; /* 灰紫色 */
    --color-highlight: #e43f77; /* 粉色，用于强调 */
    --color-background: #FFFEFC;
    --color-text: #333;
    --color-light-gray: #f8f9fa;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", "Noto Sans CJK SC", Arial, sans-serif;
    line-height: 1.9;
    color: var(--color-text);
    background-color: var(--color-background);
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth; /* 让锚点跳转和JS滚动更平滑 */
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    position: relative; /* 为进度条计算提供参考 */
    background-color: var(--color-background); /* 确保内容区有背景色，遮挡下方元素 */
}

/* --- 顶部细banner --- */
#top-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 40px; /* 细banner高度 */
    background: rgba(255,255,255,0.85);
    backdrop-filter: saturate(140%) blur(6px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    z-index: 1100;
    display: flex;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-100%);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    padding-top: env(safe-area-inset-top);
}
#top-banner.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
#top-banner .banner-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
#top-banner .banner-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a; /* 深色文本 */
    letter-spacing: 0.1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 阅读进度条样式 --- */
#progress-nav {
    position: fixed;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);
    width: 2px;
    height: 200px; /* 调整高度以适应圆点数量 */
    background-color: #e9ecef;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

#progress-nav.visible {
    opacity: 1;
    visibility: visible;
}

#progress-bar {
    width: 100%;
    height: 0; /* JS控制高度 */
    background-color: var(--color-primary);
    transition: height 0.1s linear;
}
#progress-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
#progress-nav li {
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    width: 12px;
    height: 12px;
}
#progress-nav li a {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #ced4da;
    border-radius: 50%;
    transition: background-color 0.3s ease, transform 0.3s ease;
}
#progress-nav li a:hover {
    transform: scale(1.3);
}
#progress-nav li a.active {
    background-color: var(--color-primary);
    transform: scale(1.3);
}

/* --- 标题与文本样式 --- */
.main-header {
    background-color: transparent;
    padding: 20px;
    margin-bottom: 0;
}

.main-header h1 {
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
    margin-bottom: 0;
    font-size: 60px;
    line-height: 1.2;
}

.header-image-container {
    width: 100%;
    height: 100vh;
    background-image: url('images/Passport-with-approved-stamp-and-China-flag.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: -1; 
    transition: opacity 0.5s ease-out;
}

h2, h3, h4 {
    font-weight: 600;
    color: var(--color-secondary);
    line-height: 1.4;
    margin-top: 2.2em;
    margin-bottom: 1.2em;
}
h2 {
    font-size: 2em;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--color-primary);
    text-align: center;
}
h3 {
    font-size: 1.5em;
    color: var(--color-primary);
    text-align: center;
}
h4 {
    font-size: 1.2em;
}
p {
    margin-bottom: 2em;
    font-size: 1.05em;
    text-align: justify;
}
.text-center { text-align: center; }
.text-left { text-align: left; }
.subtitle {
    text-align: center;
    font-size: 1.2em;
    color: #666;
    margin-top: -1em;
    margin-bottom: 2.5em;
}

/* --- 首字下沉效果 --- */
.drop-cap {
    float: left;
    font-size: 2.8em;
    line-height: 0.8;
    padding-top: 0.1em;
    padding-right: 0.1em;
    font-weight: 700;
    color: var(--color-primary);
}

/* --- 模块化布局 --- */
.content-module {
    padding: 40px 0;
    border-bottom: 1px solid #eee;
    position: relative;
    /* 【修改】移除了不再需要的 transition 属性 */
    scroll-margin-top: 64px; /* 避免固定banner遮挡锚点跳转位置 */
}
.content-module:last-of-type { border-bottom: none; }

/* --- 图表与说明 --- */
.chart-container, .native-chart-wrapper {
    margin: 40px auto 50px;
    padding: 20px;
    background-color: var(--color-light-gray);
    border: 1px solid #e9ecef;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.chart-container img, .chart-container .chart-content {
    width: 100%;
    height: auto;
    display: block;
    border: none;
}
.native-chart-wrapper .chart-content{ width: 100%; }
.flourish-embed {
    width: 100%;
    height: 500px;
    border: none;
    background: transparent !important;
}
.image-caption, .chart-toggle-prompt {
    font-size: 0.9em;
    color: #888;
    margin-top: 15px;
    text-align: center;
    margin-bottom: 0;
}
.chart-toggle-prompt { margin-bottom: 15px; margin-top: -5px; }
.data-source {
    font-size: 0.9em;
    color: #888;
    font-style: italic;
    text-align: right;
    clear: both;
}
.data-source.left-aligned { text-align: left; font-style: normal; }
.chart-interpretation { font-size: 1em; text-align: justify; }

/* --- Part 2 特效 --- */
.special-highlight {
    color: var(--color-highlight);
    font-weight: 600;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.special-highlight.visible { opacity: 1; transform: translateY(0); }
.key-findings { list-style: none; padding-left: 0; }
.finding-item {
    background-color: var(--color-light-gray);
    padding: 15px;
    margin-bottom: 10px;
    border-left: 4px solid var(--color-primary);
    border-radius: 0 4px 4px 0;
    opacity: 0;
    transform: translateX(-20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.finding-item:nth-child(2) { transition-delay: 0.2s; }
.finding-item.visible { opacity: 1; transform: translateX(0); }

#part2 .chart-container {
    width: 65%;
    margin-left: auto;
    margin-right: auto;
}

/* --- Part 3 数据卡片与折叠 --- */
.stats-cards { display: flex; justify-content: space-around; gap: 20px; margin: 50px 0; text-align: center; }
.card { background-color: white; border-radius: 8px; padding: 20px; flex: 1; border: 1px solid #e9ecef; transition: transform 0.3s ease, box-shadow 0.3s ease; }
.card:hover { transform: translateY(-5px); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1); }
.card h4 { color: var(--color-secondary); margin: 0 0 10px 0; font-size: 1em; }
.stat-number { font-size: 2.5em; font-weight: 700; color: var(--color-primary); margin: 0; text-align: center}
.stat-number span { font-size: 0.5em; font-weight: 400; color: var(--color-secondary); margin-left: 5px; }
.collapsible-section { text-align: center; margin-top: 30px; }
.collapsible-trigger { background-color: #f7f5f8; color: var(--color-secondary); cursor: pointer; padding: 15px 20px; width: 100%; border: none; text-align: center; outline: none; font-size: 1.1em; font-weight: 600; border-radius: 5px; display: flex; justify-content: center; align-items: center; gap: 10px; transition: background-color 0.3s; }
.collapsible-trigger:hover { background-color: #efebf0; }
.collapsible-trigger .arrow { transition: transform 0.3s ease; }
.collapsible-trigger.active .arrow { transform: rotate(180deg); }
.collapsible-content { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.5s ease-out, padding 0.5s ease-out; background-color: #fdfcff; border-radius: 0 0 5px 5px; border: 1px solid #f0f0f0; border-top: none; text-align: left; }
.collapsible-content p { margin-top: 15px; }

/* --- 模块结论浮现效果 --- */
.part-conclusion {
    text-align: center;
    font-size: 1.15em;
    font-weight: 600;
    color: var(--color-highlight);
    padding: 20px;
    margin-top: 40px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.part-conclusion.visible { opacity: 1; transform: translateY(0); }

/* --- Part 6 结论图片样式 --- */
.conclusion-images {
    position: relative;
    width: 100%;
    height: 350px;
    margin: 50px 0;
    display: flex;
    justify-content: center;
    align-items: center;
}
.conclusion-images img {
    position: absolute;
    width: 50%;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}
.conclusion-images img:hover {
    transform: scale(1.05) !important;
    z-index: 10;
}
.conclusion-img-1 {
    transform: translateX(-200px) rotate(-5deg);
    z-index: 2;
}
.conclusion-img-2 {
    transform: translateX(+150px) rotate(15deg);
    z-index: 1;
}

/* --- 页脚 --- */
.main-footer { background-color: #333; color: #ccc; padding: 30px 20px; text-align: center; margin-top: 50px; }
.main-footer h3 { color: white; margin-top: 0; margin-bottom: 10px; }
.main-footer p { font-size: 0.9em; max-width: 600px; margin: 10px auto 0; text-align: center; line-height: 1.6; }

/* === Part 2 原生嵌入图表样式 (无修改) === */
#part2-chart * { box-sizing: border-box; }

#part2-chart.dashboard-container {
    width: 100%;
    max-width: 820px;
    margin: 0 auto; 
    display: flex;
    flex-direction: column;
    gap: 30px;
}
#part2-chart .chart-header {
    width: 100%;
    margin-bottom: 10px;
    text-align: center;
}
#part2-chart .chart-header h2 {
    font-size: 20px;
    font-weight: 900;
    color: #111827;
    margin-bottom: 12px;
    letter-spacing: 0.5px;
    border-bottom: none;
    margin-top: 0;
    text-align: center; 
}
#part2-chart .chart-header p {
    font-size: 15px;
    color: #6b7280;
    line-height: 1.6;
    margin-bottom: 0;
    text-align: center; 
}
#part2-chart .content-wrapper {
    display: flex;
    gap: 25px;
    align-items: stretch;
    justify-content: center;
}
#part2-chart .sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding-top: 140px;
    gap: 35px;
    flex-shrink: 0;
    width: 110px;
}
#part2-chart .stat-group { text-align: center; }
#part2-chart .stat-label {
    font-size: 14px;
    color: #888888;
    margin-bottom: 8px;
    font-weight: bold;
    letter-spacing: 0.5px;
}
#part2-chart .stat-value {
    font-size: 26px;
    font-weight: 900;
    color: #111827;
}
#part2-chart .color-korea { color: #e43f77 !important; }
#part2-chart .vertical-toggle {
    position: relative;
    display: inline-block;
    width: 32px;
    height: 64px;
}
#part2-chart .vertical-toggle input { opacity: 0; width: 0; height: 0; }
#part2-chart .slider {
    position: absolute; cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: #078fa1; 
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 32px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.06);
}
#part2-chart .slider:before {
    position: absolute; content: "";
    height: 24px; width: 24px; left: 4px; bottom: 4px;
    background-color: white;
    transition: .4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
#part2-chart input:checked + .slider { background-color: #e43f77; }
#part2-chart input:checked + .slider:before { transform: translateY(-32px); }
#part2-chart .main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
#part2-chart .chart-stage {
    position: relative;
    height: 500px;
    width: 100%;
    margin-top: 40px; 
}
#part2-chart .svg-layer {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    pointer-events: none;
    z-index: 1;
}
#part2-chart .center-axis {
    position: absolute;
    left: 50%;
    top: -35px; 
    bottom: 40px;
    width: 1px;
    background-color: #e5e7eb;
    z-index: 2;
}
#part2-chart .black-badge {
    position: absolute;
    top: -45px; 
    left: 50%;
    transform: translate(-50%, 0);
    background-color: #1f2937;
    color: #ffffff;
    padding: 10px 18px;
    text-align: center;
    border-radius: 4px;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    white-space: nowrap;
}
#part2-chart .black-badge .badge-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 4px;
    letter-spacing: 1px;
}
#part2-chart .black-badge .badge-date {
    font-size: 12px;
    color: #d1d5db;
}
#part2-chart .bar-column {
    position: absolute;
    bottom: 50px;
    width: 115px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end; 
    align-items: center;
    z-index: 10;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1); 
}
#part2-chart .col-2024 { right: calc(50% + 65px); }
#part2-chart .col-2025 { left: calc(50% + 65px); }
#part2-chart .bar-number {
    position: absolute;
    top: -35px;
    font-size: 20px;
    font-weight: 900;
    color: #111827;
    width: 100%;
    text-align: center;
    transition: color 0.4s ease;
}
#part2-chart .segment { 
    width: 100%; 
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease; 
}
#part2-chart .seg-korea { background-color: #e43f77; }
#part2-chart .seg-other { background-color: #078fa1; }
#part2-chart .year-label {
    position: absolute;
    bottom: -40px;
    width: 150%;
    text-align: center;
    font-size: 18px;
    font-weight: 900;
    color: #111827;
}
#part2-chart .center-badge {
    position: absolute;
    transform: translate(-50%, -50%);
    background-color: #ffffff;
    padding: 4px 12px;
    border-radius: 20px;
    border: 1.5px solid;
    font-size: 15px;
    font-weight: 900;
    z-index: 4;
    white-space: nowrap;
    transition: color 0.4s ease, border-color 0.4s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
#part2-chart .sub-badge {
    position: absolute;
    transform: translate(-50%, 0);
    font-size: 13px;
    font-weight: 900;
    z-index: 4;
    white-space: nowrap;
    transition: opacity 0.4s ease, color 0.4s ease;
}
#part2-chart .legend-area {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f1f5f9;
}
#part2-chart .legend-item { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: bold; }
#part2-chart .color-box { width: 18px; height: 18px; border-radius: 4px; }
#part2-chart .color-box.korea { background-color: #e43f77; }
#part2-chart .color-box.other { background-color: #078fa1; }
#part2-chart .text-korea { color: #e43f77; }
#part2-chart .text-other { color: #078fa1; }