/* ===================
全局设置 Global Styles
=================== */
body {
    margin: 0;
    padding: 0;
    font-family: 'EB Garamond', serif;
    background-color: #271b27;
    color: white;
    overflow: hidden;
}

/* ===================
封面 Cover Section
=================== */
.cover {
    position: fixed;
    width: 100vw;
    height: 100vh;
    background-color: #0d080d;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 999;
    text-align: center;
    padding: 2rem;

    background-image: url('./assets/images/cover_bg.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.cover h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.cover h2 {
    font-size: 1.5rem;
    font-weight: normal;
    color: #ddd;
    margin: 0;
}

.small-quote {
    font-style: italic;
    width: 50vw;
    margin: 5em auto 0;
    font-size: 0.9em;
    font-weight: normal;
}

#cover-arrow {
    font-size: 3rem;
    margin-top: 2rem;
    animation: bounce 2s infinite;
    cursor: pointer;
}

@keyframes bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(10px);
    }
}

/* ==========================
PART 1 - 背景图 Backgrounds
========================== */
#backgrounds {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
}

.bg-img {
    position: absolute;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

.bg-img.active {
    opacity: 1;
}

/* ==========================
PART 1 - 文字内容 Story
========================== */
#story {
    position: relative;
    z-index: 10;
}

.step {
    padding: 50vh 0;
    max-width: 90vw;
    margin: 0 auto;
    opacity: 0.3;
    transform: translateY(50px);
    transition: opacity 0.5s ease, transform 0.8s ease;
    /* text-align: center; */
    white-space: pre-line;
}

.step.story {
    text-align: center;
}

.step-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.step.active {
    opacity: 1;
    transform: translateY(0);
}

.step h3 {
    font-size: 2rem;
    font-weight: normal;
    max-width: 90vw;
    margin: 0 auto 1rem;
    line-height: 1.6;
}

.step.text h3,
.step.interview h3 {
    text-align: center;
}
.step.interview p {
    text-align: center;
}

.step.text p {
    max-width: 60vw;
}

.step p {
    font-size: 1.25rem;
    line-height: 1.6;
    margin: 0 auto;
    max-width: 90%;
}

.step.intro {
    opacity: 0;
    transform: translateY(80px);
}

.step.intro.show {
    opacity: 1;
    transform: translateY(0);
    transition: all 1.2s ease;
}

/* ===================
导航箭头 Navigation Arrows
=================== */
#nav-arrows {
    position: fixed;
    width: 100%;
    z-index: 10000;
    pointer-events: none;
    display: none;
}

#arrow-up {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

#arrow-down {
    position: absolute;
    top: 1rem;
    right: 1rem;
}

#nav-arrows button {
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    opacity: 0.3;
    transition: all 0.3s ease;
    cursor: pointer;
    pointer-events: auto;
}

#nav-arrows button:hover {
    opacity: 1;
    transform: scale(1.2);
}

/* ==========================
PART 2 - 地图 + 文字 Map Layout
========================== */
.split-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 20vh 5vw;
    gap: 2rem;
}

.split-left h3,
.split-left p {
    max-width: 40vw;
    margin: 0;
    text-align: left;
}

.step.split-left .step-inner {
    display: flex;
    height: 100vh;
}

.quote {
    font-style: italic;
    margin: 1em 0;
    padding-left: 1.2em;
    border-left: 3px solid #999;
    color: #d3d3d3;
    font-size: 0.95em;
}

#map {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    display: none;
    transition: opacity 1s ease;
    pointer-events: none;
    z-index: 9999;
}

.mapboxgl-marker:hover {
    cursor: pointer;
}

#decade-slider-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999999;
    background: rgba(20, 20, 20, 0.8);
    padding: 10px;
    border-radius: 8px;
    color: white;
}

#decade-slider {
    width: 18vw;
}

/* ==========================
PART 3.0 认知地图 Cog Map
========================== */
.cogmap-grid-container {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    width: 50vw;
    padding: auto 0;
    align-content: center;
    z-index: 99999;
    display: block;
}

.cogmap-grid {
    display: grid;
    grid-template-columns: auto auto auto;
    gap: 3vw 6vw;
    padding: 0 5vw 0 2vw;
    justify-items: center;
    align-items: center;
}

.cogmap-card {
    background-color: transparent;
    border-radius: 12px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    max-width: 25vw;
    position: relative;
    background-color: transparent;
}

/* .cogmap-card:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
} */
.cogmap-card img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    border-radius: 5%;
    border: 2px solid #FF0EFF;
    box-sizing: border-box;
}

/* .cogmap-card:hover img {
  transform: scale(1.05);
} */
.cogmap-card .hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    color: #fff;
    visibility: hidden;
}

.cogmap-card:hover .hint {
    visibility: visible;
}

.cogmap-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 20, 30, 0.95);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.cogmap-popup .popup-content {
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    width: 60%;
    background-color: #1e1e1e;
    padding: 2rem;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
}

/* 滚动条样式 */
.cogmap-popup .popup-content::-webkit-scrollbar {
    width: 8px;
}

.cogmap-popup .popup-content::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 4px;
}

.cogmap-popup .popup-content::-webkit-scrollbar-thumb:hover {
    background: #777;
}

.cogmap-popup .popup-content h2 {
    margin: 0 0 10px;
    font-size: 1.5em;
    color: #FF0EFF;
}

.cogmap-popup .popup-content img {
    max-width: 100%;
    height: auto;
    margin: 10px 0;
    border-radius: 4px;
}

.cogmap-popup .popup-content p {
    font-size: 1em;
    color: #999;
    line-height: 1.5;
}

.cogmap-popup .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.5em;
    color: #999;
    cursor: pointer;
    transition: color 0.2s ease;
}

.cogmap-popup .close-btn:hover {
    color: #333;
}

/* ==========================
PART 3 - 人物采访 Interview Section
========================== */
.interview-grid {
    display: grid;
    grid-template-columns: auto auto auto auto auto;
    padding: 3rem 5vw;
    justify-items: center;
    align-items: start;
    color: #fff;
}

.interview-card {
    background-color: transparent;
    padding: 1rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    max-width: 250px;
}

.interview-card:hover {
    transform: scale(1.25);
}

.interview-card img {
    width: 100%;
    max-width: 150px;
    height: auto;
}

.interview-card h4 {
    margin: -0.5rem 0 0.2rem;
    font-size: 1.1rem;
}

/* 弹出采访详情 Popup */
.interviewee-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(30, 20, 30, 0.95);
    /* 半透明背景 */
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-in-out;
}

.interviewee-popup .popup-content {
    max-width: 80vw;
    width: 90%;
    background-color: #1e1e1e;
    padding: 2rem;
    border-radius: 12px;
    position: relative;
    box-shadow: 0 8px 20px rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: row;
    gap: 2rem;
    color: #fff;
    white-space: pre-line;
}

.interviewee-popup .popup-content .close-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #fff;
    cursor: pointer;
    transition: color 0.2s ease;
}

.interviewee-popup .popup-content .close-btn:hover {
    color: #FF0EFF;
}

.interviewee-popup .popup-content-inner {
    display: flex;
    flex-direction: row;
    width: 100%;
    gap: 2rem;
}

.interviewee-popup .basic-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 1rem;
}

.interviewee-popup .basic-info .avatar {
    width: auto;
    height: 15vh;
}

.interviewee-popup .basic-info .map {
    width: auto;
    height: 30vh;
    margin-top: 2vh;
}

.interviewee-popup .basic-info h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #FF0EFF;
}

.interviewee-popup .basic-info p {
    margin: 0;
    font-size: 1.2rem;
    color: #ccc;
    line-height: 1.5;
}

.interviewee-popup .text {
    flex: 2;
    overflow-y: auto;
    /* 支持滚动 */
    max-height: 70vh;
    /* 限制高度 */
    padding-right: 1rem;
    /* 添加内边距，避免文字贴边 */
}

.interviewee-popup .text h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #FF0EFF;
}

.interviewee-popup .text p {
    font-size: 1.1rem;
    line-height: 1.7;
    color: #ddd;
    margin: 0 0 1rem;
}

.interviewee-popup .text .quotes {
    font-size: 1rem;
    white-space: normal;
}

/* 滚动条样式 */
.interviewee-popup .text::-webkit-scrollbar {
    width: 8px;
}

.interviewee-popup .text::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.interviewee-popup .text::-webkit-scrollbar-thumb:hover {
    background: #777;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ==========================
Footer 页脚部分
========================== */
.step#footer {
    padding-top: 15vh;
    padding-bottom: 10vh;
    max-width: 60vw;
}

.step#footer h3 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.step#footer ul {
    text-align: left;
    margin: 1em auto;
    padding-left: 2em;
    list-style-type: disc;
    max-width: 800px;
    white-space: normal;
}

.footer-section {
    text-align: center;
    padding: 40px 20px;
    color: #ccc;
    font-size: 0.9rem;
    background: #271b27;
    border-top: 1px solid #444;
}

.footer-section p {
    margin: 0;
    line-height: 1.5;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.footer-section p:hover {
    opacity: 1;
}

.footer-content {
    text-align: center;
    font-size: 0.85rem;
    color: #ccc;
    padding: 2rem;
}

/* ==========================
图片对比
========================== */
.compare-container {
    margin: 0 5vw;
    padding: 0;
    position: fixed;
    height: 100vh;
    width: 40vw;
    top: 0;
    right: 0;
    z-index: 99999;
}

.compare {
    --mask-width: 50%;
    --handle-size: 32px;

    position: absolute;
    top: 50%;
    transform: translate(0, -50%);
    width: 100%;
    height: auto;
}

.compare__separator {
    position: absolute;
    top: 0;
    height: 100%;
    left: var(--mask-width);
    width: 2px;
    margin-left: -1px;
    background: black;
    z-index: 1;
    pointer-events: none;
}

.compare__image-one {
    height: auto;
    width: 100%;
    display: block;
}

.compare__mask {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1;
    background: white;
    overflow: hidden;
    width: var(--mask-width);
}

.compare__image-two {
    height: 100%;
    width: auto;
}

.compare__input {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    top: 0;
    left: calc(var(--handle-size) / -2);
    width: calc(100% + var(--handle-size));
    height: 100%;
    opacity: 0;
    z-index: 2;
    cursor: col-resize;
    background-color: transparent;
}

/* Firefox */
.compare__input::-moz-range-track {
    height: 100%;
}

.compare__input::-moz-range-thumb {
    height: 100%;
    border-radius: 0;
    width: var(--handle-size);
    border: none;
}

/* Webkit */
.compare__input::-webkit-slider-runnable-track {
    height: 100%;
}

.compare__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
    border-radius: 0;
    width: var(--handle-size);
    border: none;
}

.compare__icon {
    position: absolute;
    z-index: 2;
    color: #333;
    width: var(--handle-size);
    height: var(--handle-size);
    top: 50%;
    left: var(--mask-width);
    transform: translate(-50%, -50%);
    padding: 6px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: rgba(255, 255, 255, 1);
}

.compare__icon path {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2px;
}

.compare__note {
    font-size: 0.9em;
    position: relative;
    top: calc(50% + 15vw);
    left: 0;
    width: 100%;
}

/* Dynamic Image Comparison Slider inside story chapters */
.step.full-compare {
    text-align: center;
}
.big-compare-container {
    position: relative;
    width: 30vw;
    margin: 0 auto;
    height: auto;
}

.big-compare-container__inner {
    position: relative;
    width: 100%;
}

.big-compare {
    --mask-width: 50%;
    --handle-size: 32px;

    position: relative;
    white-space: normal;
}

.big-compare__separator {
    position: absolute;
    top: 0;
    height: 100%;
    left: var(--mask-width);
    width: 2px;
    margin-left: -1px;
    background: black;
    z-index: 1;
    pointer-events: none;
}

.big-compare__image-one {
    width: 100%;
    display: block;
}

.big-compare__mask {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    z-index: 1;
    background: white;
    overflow: hidden;
    width: var(--mask-width);
}

.big-compare__image-two {
    height: 100%;
    width: auto;
}

.big-compare__input {
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
    position: absolute;
    top: 0;
    left: calc(var(--handle-size) / -2);
    width: calc(100% + var(--handle-size));
    height: 100%;
    opacity: 0;
    z-index: 2;
    cursor: col-resize;
    background-color: transparent;
}

/* Firefox */
.big-compare__input::-moz-range-track {
    height: 100%;
}

.big-compare__input::-moz-range-thumb {
    height: 100%;
    border-radius: 0;
    width: var(--handle-size);
    border: none;
}

/* Webkit */
.big-compare__input::-webkit-slider-runnable-track {
    height: 100%;
}

.big-compare__input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    height: 100%;
    border-radius: 0;
    width: var(--handle-size);
    border: none;
}

.big-compare__icon {
    position: absolute;
    z-index: 2;
    color: #333;
    width: var(--handle-size);
    height: var(--handle-size);
    top: 50%;
    left: var(--mask-width);
    transform: translate(-50%, -50%);
    padding: 6px;
    border: 2px solid currentColor;
    border-radius: 50%;
    background: rgba(255, 255, 255, 1);
}

.big-compare__icon path {
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2px;
}

/* ==========================
PART 4 - Map Image Overlay
========================== */

.image-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 50vw;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.image-container .image {
    max-width: 90%;
    max-height: 90%;
    text-align: center;
}

.image-container .image img {
    max-width: 100%;
    max-height: 100%;
}

/* ==========================
Legend
=========================== */
#legend {
    position: fixed; /* Fix the legend to the viewport */
    top: 20px; /* Distance from the top of the screen */
    left: 51%; /* Position it in the left part of the right half of the screen */
    width: auto; /* Set a fixed width */
    background-color: rgba(0, 0, 0, 0.3); /* Semi-transparent white background */
    border: 2px solid #ccc; /* Light gray border */
    border-radius: 12px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Subtle shadow for depth */
    padding: 15px; /* Inner padding for content */
    font-family: 'EB Garamond', serif; /* Match the font style */
    color: #333; /* Text color */
    z-index: 999999;
}

/* Legend item container */
.legend-item {
    display: flex; /* Use flexbox for alignment */
    align-items: center; /* Vertically align items */
    margin-bottom: 8px; /* Add spacing between items */
}

/* Color box styling */
.legend-item .color-box {
    width: 20px; /* Fixed width for the color box */
    height: 20px; /* Fixed height for the color box */
    border-radius: 4px; /* Slightly rounded corners */
    margin-right: 10px; /* Space between the color box and label */
    border: 1px solid #aaa; /* Add a border for better visibility */
}

/* Label styling */
.legend-item .label {
    font-size: 0.9em; /* Slightly smaller font size */
    color: white; /* Subtle text color */
}

#decade-slider-container input[type='range']{
    accent-color: #FF0EFF;
}