* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Comic Sans MS', 'Arial Rounded MT Bold', 'Tahoma', 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.tagline {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 1.5rem;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.mode-btn {
    padding: 0.7rem 1.2rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.mode-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
}

.mode-btn.active {
    background: rgba(255, 255, 255, 0.3);
    border-color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mode-btn .icon {
    margin-right: 0.5rem;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative;
}

/* Main Content */
.main-content {
    background: white;
    border-radius: 15px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    padding: 2rem;
    min-height: 600px;
}

.view {
    display: none;
    animation: fadeIn 0.4s ease;
}

.view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* River Timeline */
.timeline-container {
    height: auto;
    padding: 2rem 0;
    background: linear-gradient(180deg, rgba(135, 206, 235, 0.1) 0%, rgba(100, 180, 220, 0.08) 100%);
    border-radius: 15px;
    position: relative;
}

.river-welcome {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.8rem 2rem;
    margin-bottom: 2rem;
    background: linear-gradient(135deg, rgba(255, 182, 193, 0.2) 0%, rgba(173, 216, 230, 0.2) 100%);
    border-radius: 18px;
    border: 2px solid rgba(102, 126, 234, 0.18);
    animation: welcomeFloat 3s ease-in-out infinite;
}

@keyframes welcomeFloat {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-6px);
    }
}

.welcome-mascot {
    font-size: 3.5rem;
    flex-shrink: 0;
    animation: mascotBounce 2s ease-in-out infinite;
}

@keyframes mascotBounce {
    0%, 100% {
        transform: rotate(0deg);
    }
    25% {
        transform: rotate(-8deg);
    }
    75% {
        transform: rotate(8deg);
    }
}

.welcome-text {
    flex: 1;
}

.welcome-text h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.welcome-text p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}


.timeline-river {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    position: relative;
    padding: 1rem;
}

/* 河道中线 - 蓝色波浪感 */
.timeline-river::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 6px;
    background: linear-gradient(180deg,
        #667eea 0%,
        #764ba2 25%,
        #4facfe 50%,
        #764ba2 75%,
        #667eea 100%);
    transform: translateX(-50%);
    border-radius: 10px;
    opacity: 0.6;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* 河岸装饰水波 */
.timeline-river::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    height: 8px;
    background:
        repeating-linear-gradient(90deg, transparent, transparent 10px, rgba(102, 126, 234, 0.2) 10px, rgba(102, 126, 234, 0.2) 20px);
    opacity: 0.5;
}

.timeline-node {
    display: flex;
    gap: 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    align-items: flex-start;
    position: relative;
    margin-bottom: 0.5rem;
}

.timeline-node:hover {
    transform: translateX(5px);
}

.timeline-node.even {
    flex-direction: row-reverse;
}

.timeline-node.pulse .node-marker {
    animation: nodePulse 2.4s ease-in-out infinite;
}

@keyframes nodePulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), 0 0 0 0 rgba(102, 126, 234, 0.25), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }
    50% {
        transform: scale(1.06);
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24), 0 0 0 14px rgba(102, 126, 234, 0), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    }
}

.celebration-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 120;
}

.sparkle {
    position: absolute;
    font-size: 1.2rem;
    animation: sparkleBurst 900ms ease-out forwards;
}

@keyframes sparkleBurst {
    0% {
        opacity: 0;
        transform: translate(0, 0) scale(0.5) rotate(0deg);
    }
    20% {
        opacity: 1;
        transform: translate(var(--dx), var(--dy)) scale(1.15) rotate(90deg);
    }
    100% {
        opacity: 0;
        transform: translate(calc(var(--dx) * 1.4), calc(var(--dy) * 1.6)) scale(0.8) rotate(220deg);
    }
}


/* 河岸连接线 */
.timeline-node::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 40px;
    width: 30px;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.4), transparent);
    transform: translateX(-50%);
}

.timeline-node.even::before {
    transform: translateX(-50%) scaleX(-1);
}

.node-marker {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.8rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
    position: relative;
    border: 3px solid white;
}

.timeline-node:hover .node-marker {
    transform: scale(1.15);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3), inset 0 2px 4px rgba(255, 255, 255, 0.3);
}

.node-content {
    flex: 1;
    padding: 1.2rem;
    background: white;
    border-radius: 12px;
    border-left: 5px solid #667eea;
    border-top: 2px solid transparent;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.timeline-node.divided .node-content {
    background: linear-gradient(135deg, #fafbff 0%, #f5f8ff 100%);
    border-left-color: #764ba2;
    border-top-color: #764ba2;
}

.timeline-node.transition .node-content {
    background: linear-gradient(135deg, #fffbf0 0%, #fff9f5 100%);
    border-left-color: #fa709a;
    border-top-color: #fa709a;
}

.timeline-node.branch .node-marker {
    border-width: 4px;
}

.timeline-node:hover .node-content {
    border-left-color: #764ba2;
    border-top-color: #764ba2;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-2px);
}

.node-topline {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.8rem;
    font-size: 0.75rem;
    align-items: center;
}

.node-type {
    display: inline-block;
    padding: 0.35rem 0.8rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f8ff 100%);
    color: #667eea;
    border-radius: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.node-type.divided {
    background: linear-gradient(135deg, #fde7f3 0%, #fdecf7 100%);
    color: #764ba2;
}

.node-type.transition {
    background: linear-gradient(135deg, #fde7c8 0%, #fdecd8 100%);
    color: #d97706;
}

.node-duration {
    display: inline-block;
    color: #999;
    font-size: 0.7rem;
    align-self: center;
    font-weight: 500;
}

.node-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
    letter-spacing: 0.3px;
}

.node-summary {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 0.8rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.node-scene {
    font-size: 0.9rem;
    color: #888;
    font-style: italic;
    margin-bottom: 0.8rem;
    line-height: 1.5;
    padding: 0.6rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 6px;
}

.node-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.trait-tag {
    display: inline-block;
    padding: 0.5rem 0.9rem;
    background: linear-gradient(135deg, #f0f4ff 0%, #f5f8ff 100%);
    color: #667eea;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(102, 126, 234, 0.2);
    transition: all 0.2s ease;
}

.trait-tag:hover {
    background: linear-gradient(135deg, #e8edff 0%, #f0f5ff 100%);
    border-color: rgba(102, 126, 234, 0.4);
}

/* Train View */
.train-container {
    padding: 3rem 1rem 4rem;
    text-align: center;
    min-height: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(180deg, #d7ecff 0%, #fff0da 55%, #f8d7a8 100%);
    border-radius: 18px;
    position: relative;
    overflow: hidden;
}

.train-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 82px;
    height: 10px;
    background: linear-gradient(90deg, #7a5c3e 0%, #5f4630 100%);
    box-shadow: 0 18px 0 #5f4630;
}

.train-container::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 66px;
    height: 4px;
    background: repeating-linear-gradient(90deg, #402b1e 0 18px, transparent 18px 48px);
    opacity: 0.75;
}

.train-track {
    width: 100%;
    position: relative;
}

.train {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    align-items: flex-end;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 2rem 1rem 6rem;
}

.train::-webkit-scrollbar {
    height: 10px;
}

.train::-webkit-scrollbar-thumb {
    background: rgba(122, 92, 62, 0.35);
    border-radius: 999px;
}

.train-car {
    width: 130px;
    min-width: 130px;
    height: 126px;
    background: linear-gradient(180deg, #ff7f7f 0%, #ef4444 100%);
    border-radius: 18px 18px 12px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.18);
    color: white;
    font-weight: bold;
    text-align: center;
    padding: 0.8rem 0.7rem 1.3rem;
    font-size: 0.85rem;
    position: relative;
    border: 3px solid rgba(255, 255, 255, 0.75);
}

.train-car::before,
.train-car::after {
    content: '';
    position: absolute;
    bottom: -22px;
    width: 26px;
    height: 26px;
    background: radial-gradient(circle at 35% 35%, #f5f5f5 0 18%, #475569 20% 55%, #111827 56% 100%);
    border-radius: 50%;
    box-shadow: 0 2px 0 rgba(255, 255, 255, 0.3) inset;
}

.train-car::before {
    left: 18px;
}

.train-car::after {
    right: 18px;
}

.train-car:not(:last-child) .train-link {
    position: absolute;
    right: -20px;
    bottom: 18px;
    width: 20px;
    height: 8px;
    background: #6b7280;
    border-radius: 999px;
}

.train-car:nth-child(odd) {
    background: linear-gradient(180deg, #60a5fa 0%, #2563eb 100%);
}

.train-car.engine {
    width: 160px;
    min-width: 160px;
    height: 146px;
    background: linear-gradient(180deg, #374151 0%, #111827 100%);
    border-radius: 28px 22px 14px 14px;
    padding-top: 1.2rem;
}

.train-car.engine .train-car-icon {
    font-size: 2.2rem;
}

.train-car.engine .train-engine-top {
    position: absolute;
    top: -24px;
    left: 28px;
    width: 54px;
    height: 34px;
    background: linear-gradient(180deg, #4b5563 0%, #1f2937 100%);
    border-radius: 12px 12px 0 0;
    border: 3px solid rgba(255, 255, 255, 0.65);
    border-bottom: none;
}

.train-car.engine .train-engine-front {
    position: absolute;
    right: -18px;
    bottom: 24px;
    width: 28px;
    height: 54px;
    background: linear-gradient(180deg, #9ca3af 0%, #4b5563 100%);
    border-radius: 0 16px 16px 0;
}

.train-car:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 18px 30px rgba(0, 0, 0, 0.24);
}

.train-car-icon {
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

.train-car-name {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.train-car-year {
    font-size: 0.72rem;
    opacity: 0.9;
}

/* Steps View */
.steps-container {
    position: relative;
    padding: 2rem 1rem 3rem;
    min-height: 760px;
    background: linear-gradient(180deg, #eef7ff 0%, #f8fbff 40%, #fff7ef 100%);
    border-radius: 18px;
    overflow: hidden;
}

.steps-intro {
    position: relative;
    z-index: 11;
    max-width: 900px;
    margin: 0 auto 2.5rem;
    text-align: center;
    padding: 1.8rem 1.5rem;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.15);
}

.steps-intro h2 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.8rem;
}

.steps-intro p {
    font-size: 0.95rem;
    color: #555;
    line-height: 1.8;
    margin: 0;
}


.mountain-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 430px;
    opacity: 0.45;
    z-index: 0;
}

.mountain-svg {
    width: 100%;
    height: 100%;
}

.steps-list {
    position: relative;
    z-index: 10;
    max-width: 980px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1.4rem;
    padding-top: 1rem;
}

.step-item {
    display: flex;
    gap: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
    border-radius: 18px;
    align-items: stretch;
    position: relative;
}

.step-item:nth-child(odd) {
    margin-left: 0;
    margin-right: 18%;
}

.step-item:nth-child(even) {
    margin-left: 18%;
    margin-right: 0;
    flex-direction: row-reverse;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90px;
    height: 10px;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.18), rgba(59, 130, 246, 0.18));
    border-radius: 999px;
    transform: translate(-50%, -50%);
    z-index: -1;
}

.step-item:hover {
    transform: translateY(-4px);
}

.step-number {
    flex-shrink: 0;
    width: 88px;
    height: 88px;
    border-radius: 26px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    font-weight: 800;
    box-shadow: 0 14px 24px rgba(102, 126, 234, 0.28);
    position: relative;
}

.step-number::after {
    content: '⛰️';
    position: absolute;
    top: -14px;
    right: -10px;
    font-size: 1.3rem;
}

.step-content {
    flex: 1;
    background: linear-gradient(180deg, #ffffff 0%, #fffdf8 100%);
    padding: 1.1rem 1.2rem;
    border-radius: 18px;
    border-left: 6px solid #667eea;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.08);
    position: relative;
}

.step-content::before {
    content: '登山路线';
    position: absolute;
    top: -12px;
    left: 18px;
    padding: 0.18rem 0.7rem;
    border-radius: 999px;
    background: #ffffff;
    color: #667eea;
    font-size: 0.72rem;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.12);
}

.step-title {
    font-size: 1.18rem;
    font-weight: 800;
    color: #333;
    margin-bottom: 0.4rem;
}

.step-description {
    font-size: 0.92rem;
    color: #666;
    margin-bottom: 0.7rem;
    line-height: 1.6;
}

.step-badge {
    display: inline-block;
    padding: 0.45rem 0.9rem;
    background: linear-gradient(135deg, #fff3cd 0%, #ffe39f 100%);
    color: #7c5b00;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.6);
}

.step-unlock {
    font-size: 0.82rem;
    color: #7a7a7a;
    margin-top: 0.55rem;
    line-height: 1.5;
}

/* Detail Panel */
.detail-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.46);
    backdrop-filter: blur(2px);
    z-index: 90;
}

.detail-overlay.active {
    display: block;
}

.detail-panel {
    position: fixed;
    right: -560px;
    top: 0;
    width: 560px;
    max-width: 94vw;
    height: 100vh;
    background: linear-gradient(180deg, #fffdfc 0%, #f9fbff 100%);
    box-shadow: -12px 0 28px rgba(15, 23, 42, 0.18);
    z-index: 100;
    overflow-y: auto;
    transition: right 0.4s ease;
    padding: 2rem 1.4rem 2.5rem;
}

.detail-panel.active {
    right: 0;
}

.close-btn {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 1.8rem;
    cursor: pointer;
    color: #667085;
    transition: all 0.3s ease;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.close-btn:hover {
    color: #111827;
    transform: rotate(90deg);
}

.detail-content {
    padding-top: 0.8rem;
}

.detail-header {
    margin-bottom: 1.4rem;
    padding: 1.4rem 1.2rem;
    border-radius: 22px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.14) 0%, rgba(118, 75, 162, 0.14) 100%);
    position: relative;
    overflow: hidden;
}

.detail-header::after {
    content: '🎨';
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 2rem;
    opacity: 0.3;
}

.detail-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.45rem;
}

.detail-subtitle {
    font-size: 0.98rem;
    color: #667eea;
    font-weight: 700;
    line-height: 1.5;
}

.detail-hero-card {
    margin-bottom: 1.2rem;
    padding: 1rem 1.1rem;
    border-radius: 20px;
    background: linear-gradient(135deg, #fff7ed 0%, #fef3c7 100%);
    box-shadow: 0 10px 22px rgba(245, 158, 11, 0.12);
}

.detail-hero-top {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    margin-bottom: 0.8rem;
}

.detail-hero-icon {
    width: 68px;
    height: 68px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
}

.detail-hero-text {
    flex: 1;
}

.detail-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.detail-chip {
    padding: 0.4rem 0.85rem;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid rgba(255,255,255,0.65);
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #7c5b00;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.detail-section {
    margin-bottom: 1rem;
    background: white;
    border-radius: 18px;
    padding: 1rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(102, 126, 234, 0.08);
}

.detail-section.highlight {
    background: linear-gradient(180deg, #fffdf8 0%, #fff7ed 100%);
}

.detail-section-title {
    font-size: 1.02rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.8rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px dashed rgba(102, 126, 234, 0.22);
}

.detail-section-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
}

.detail-list {
    list-style: none;
}

.detail-list li {
    margin-bottom: 0.75rem;
    padding: 0.9rem 0.9rem 0.9rem 2.2rem;
    position: relative;
    background: linear-gradient(180deg, #f8fbff 0%, #f5f8ff 100%);
    border-radius: 14px;
}

.detail-list li::before {
    content: '▸';
    position: absolute;
    left: 0.9rem;
    top: 0.92rem;
    color: #667eea;
    font-weight: bold;
}

.figure-card {
    background: linear-gradient(180deg, #ffffff 0%, #faf7ff 100%);
    padding: 0.95rem;
    border-left: 4px solid #764ba2;
    margin-bottom: 0.9rem;
    border-radius: 16px;
    box-shadow: 0 8px 18px rgba(118, 75, 162, 0.08);
}

.figure-card.literature {
    border-left-color: #667eea;
    background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.figure-name {
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.figure-role {
    font-size: 0.85rem;
    color: #7b8190;
}

.figure-symbol {
    display: inline-block;
    margin-right: 0.45rem;
}

.memory-song {
    white-space: pre-line;
    background: linear-gradient(180deg, #f9f5ff 0%, #f5f8ff 100%);
    padding: 1rem;
    border-radius: 16px;
    border: 1px dashed rgba(118, 75, 162, 0.25);
    line-height: 1.9;
}

.story-card {
    background: linear-gradient(135deg, #eef7ff 0%, #fffaf2 100%);
    border-radius: 18px;
    padding: 1rem;
    line-height: 1.8;
}


/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .logo {
        font-size: 1.8rem;
    }

    .mode-switcher {
        gap: 0.3rem;
    }

    .mode-btn {
        padding: 0.5rem 0.9rem;
        font-size: 0.8rem;
    }

    .timeline-node {
        flex-direction: column !important;
        gap: 1rem;
    }

    .timeline-node::before,
    .timeline-river::before,
    .timeline-river::after {
        display: none;
    }

    .node-marker {
        width: 78px;
        height: 78px;
        font-size: 2.1rem;
    }

    .train {
        gap: 0.8rem;
        padding-bottom: 5rem;
    }

    .train-car,
    .train-car.engine {
        width: 110px;
        min-width: 110px;
        height: 110px;
    }

    .train-car.engine .train-engine-front,
    .train-car.engine .train-engine-top,
    .train-car .train-link {
        display: none;
    }

    .steps-list {
        gap: 1rem;
    }

    .step-item,
    .step-item:nth-child(odd),
    .step-item:nth-child(even) {
        margin-left: 0;
        margin-right: 0;
        flex-direction: row;
    }

    .step-item::after {
        display: none;
    }

    .step-number {
        width: 64px;
        height: 64px;
        font-size: 1.4rem;
        border-radius: 18px;
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-panel {
        width: 100%;
        max-width: 100%;
        right: -100% !important;
    }

    .detail-panel.active {
        right: 0 !important;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.4rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    .mode-btn {
        padding: 0.4rem 0.7rem;
        font-size: 0.7rem;
    }

    .node-title {
        font-size: 1.15rem;
    }

    .node-summary {
        font-size: 0.82rem;
    }

    .train-car,
    .train-car.engine {
        width: 96px;
        min-width: 96px;
        height: 100px;
        padding-inline: 0.45rem;
    }

    .train-car-icon {
        font-size: 1.7rem;
    }

    .train-car-name {
        font-size: 0.75rem;
    }

    .step-item {
        gap: 0.8rem;
    }

    .step-content {
        padding: 0.9rem;
    }
}
