/* ═══════════════════════════════════════
   发展历程 · 滚动驱动时间线
   ═══════════════════════════════════════ */

.page-history {
    --history-accent: var(--primary-color);
    --history-nav-h: 4.25rem;
    --history-text: var(--text-color);
    --history-muted: var(--text-light);
    --history-bg: #fff;
    --history-surface: #f7fbfb;
    overflow-x: hidden;
}

.page-history::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 9999;
    opacity: 0.25;
}

/* ── Hero ── */
.history-hero {
    min-height: calc(100vh - var(--header-height));
    min-height: calc(100svh - var(--header-height));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: calc(var(--header-height) + 3rem) 2rem 4rem;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #f7fbfb 0%, #fff 55%);
}

.history-hero__glow {
    position: absolute;
    width: min(60vw, 700px);
    height: min(60vw, 700px);
    border-radius: 50%;
    background: radial-gradient(circle, var(--history-accent) 0%, transparent 70%);
    opacity: 0.1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(60px);
    pointer-events: none;
}

.history-hero__label {
    font-size: 0.75rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: var(--history-accent);
    margin-bottom: 1.5rem;
    opacity: 0;
}

.history-hero__title {
    font-size: clamp(2.5rem, 9vw, 5.5rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem;
    color: var(--history-text);
    opacity: 0;
}

.history-hero__title em {
    font-style: normal;
    color: var(--history-accent);
}

.history-hero__desc {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--history-muted);
    max-width: 36rem;
    line-height: 1.75;
    margin: 0 0 3rem;
    opacity: 0;
}

.history-hero__scroll {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    color: var(--history-muted);
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0;
}

.history-hero__scroll-line {
    width: 1px;
    height: 4rem;
    background: linear-gradient(to bottom, var(--history-accent), transparent);
    animation: historyScrollPulse 2s ease-in-out infinite;
}

@keyframes historyScrollPulse {
    0%, 100% { transform: scaleY(1); opacity: 1; }
    50% { transform: scaleY(0.6); opacity: 0.4; }
}

/* ── Fixed timeline nav (below site header) ── */
.history-timeline-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: var(--history-nav-h);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    z-index: 900;
    overflow: hidden;
    transition: top 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}

body.header-is-hidden .history-timeline-nav {
    top: 0;
}

.history-nav__fade {
    position: absolute;
    top: 0;
    bottom: 0;
    width: clamp(2rem, 6vw, 4rem);
    z-index: 15;
    pointer-events: none;
}

.history-nav__fade--left {
    left: 0;
    background: linear-gradient(to right, var(--history-bg) 30%, transparent);
}

.history-nav__fade--right {
    right: 0;
    background: linear-gradient(to left, var(--history-bg) 30%, transparent);
}

.history-timeline-nav::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    width: var(--history-nav-progress, 0%);
    background: linear-gradient(90deg, var(--history-accent), color-mix(in srgb, var(--history-accent) 60%, white));
    transition: background 0.6s ease;
    z-index: 2;
    pointer-events: none;
}

.history-nav__track {
    position: relative;
    min-width: max(200rem, 200%);
    padding: 0 max(100rem, 100%) 0 0;
    height: var(--history-nav-h);
    z-index: 5;
}

.history-nav__list {
    list-style: none;
    display: flex;
    justify-content: space-between;
    margin: 0;
    padding: 0 2rem;
    height: 100%;
    align-items: center;
}

.history-nav__link {
    position: relative;
    display: block;
    min-width: 4.5rem;
    padding: 0 0.65rem;
    text-align: center;
    color: var(--history-muted);
    text-decoration: none;
    z-index: 10;
    cursor: pointer;
}

.history-nav__link:hover {
    color: var(--history-text);
}

.history-nav__link span {
    display: block;
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s;
    white-space: nowrap;
}

.history-nav__link.is-active {
    color: var(--history-accent);
}

.history-nav__link.is-active span {
    transform: scale(1.15);
    color: var(--history-accent);
    font-weight: 700;
    font-size: 0.88rem;
}

/* ── Left progress rail ── */
.history-progress-rail {
    position: fixed;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
}

.history-progress-rail__line {
    width: 1px;
    height: 12rem;
    background: rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
}

.history-progress-rail__fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: linear-gradient(to bottom, var(--history-accent), transparent);
    transition: background 0.6s;
}

.history-progress-rail__count {
    font-size: 0.65rem;
    letter-spacing: 0.15em;
    color: var(--history-muted);
    margin-top: 0.75rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
}

.history-progress-rail__count strong {
    color: var(--history-accent);
    font-size: 1.1rem;
    letter-spacing: 0;
    transition: color 0.6s;
}

/* ── Timeline sections ── */
.history-timeline-main section {
    min-height: 100vh;
    padding: calc(var(--header-height) + var(--history-nav-h) + 4rem) 0 5rem;
    display: flex;
    align-items: center;
    position: relative;
}

.history-timeline-main section.has-gallery-pin {
    align-items: flex-start;
    padding-top: calc(var(--header-height) + var(--history-nav-h) + 2rem);
}

.history-timeline-main section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 80% 60% at 20% 50%, color-mix(in srgb, var(--accent, var(--history-accent)) 6%, transparent), transparent);
    pointer-events: none;
}

.history-section__grid {
    width: 100%;
    max-width: 76rem;
    margin: 0 auto;
    padding: 0 clamp(1.5rem, 5vw, 4rem);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
    position: relative;
}

.history-timeline-main .section__content {
    position: relative;
    z-index: 1;
}

.history-timeline-main .section__index {
    font-size: 0.7rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent, var(--history-accent));
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.history-timeline-main .section__index::after {
    content: '';
    flex: 1;
    max-width: 3rem;
    height: 1px;
    background: var(--accent, var(--history-accent));
    opacity: 0.4;
}

.history-timeline-main .section__year {
    font-size: clamp(3.5rem, 10vw, 6.5rem);
    font-weight: 800;
    line-height: 0.85;
    letter-spacing: -0.04em;
    color: transparent;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 0.1);
    margin: 0 0 0.5rem;
    overflow: hidden;
}

.history-timeline-main .section__year-fill {
    display: block;
    color: var(--accent, var(--history-accent));
    -webkit-text-stroke: 0;
}

.history-timeline-main .section__heading {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem;
    color: var(--history-text);
}

.history-timeline-main .section__heading .line {
    display: block;
    overflow: hidden;
}

.history-timeline-main .section__heading .line-inner {
    display: block;
    transform: translateY(110%);
}

.history-timeline-main .section__desc {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--history-muted);
    max-width: 32rem;
    margin: 0 0 1.75rem;
}

.history-timeline-main .section__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.history-timeline-main .section__tag {
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 0.4rem 0.85rem;
    border: 1px solid rgba(17, 214, 187, 0.2);
    border-radius: 100px;
    color: var(--history-muted);
    background: rgba(17, 214, 187, 0.06);
}

.history-timeline-main .section__image {
    position: relative;
    aspect-ratio: 1;
    border-radius: 1.25rem;
    overflow: hidden;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.08);
}

.history-timeline-main .section__image-frame {
    position: absolute;
    inset: -1px;
    border-radius: 1.25rem;
    border: 1px solid rgba(17, 214, 187, 0.12);
    pointer-events: none;
    z-index: 2;
}

.history-timeline-main .section__image-glow {
    position: absolute;
    inset: 10%;
    border-radius: 50%;
    background: var(--accent, var(--history-accent));
    filter: blur(60px);
    opacity: 0.15;
    z-index: 0;
    transition: background 0.6s;
}

.history-timeline-main .section__slides {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 1.25rem;
    z-index: 1;
}

.history-timeline-main .section__slide {
    position: absolute;
    inset: 0;
    overflow: hidden;
    border-radius: 1.25rem;
}

.history-timeline-main .section__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.history-timeline-main .section__image--banner {
    aspect-ratio: 2612 / 1257;
    background: linear-gradient(180deg, #f7fbfb 0%, #eef8f6 100%);
}

.history-timeline-main .section__image--banner .section__image-glow {
    display: none;
}

.history-timeline-main .section__slide--banner img {
    object-fit: contain;
    object-position: center center;
}

/* ── CTA ── */
.history-cta {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--primary-color) 0%, #0d9a85 100%);
    color: white;
    text-align: center;
}

.history-cta .cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.history-cta .cta-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.history-cta .cta-desc {
    font-size: 1.125rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.history-cta .btn-primary {
    background: white;
    color: var(--primary-color);
}

.history-cta .btn-primary:hover {
    background: var(--bg-gray);
}

@media (max-width: 900px) {
    .history-section__grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .history-timeline-main .section__content {
        order: 1;
    }

    .history-timeline-main .section__image {
        order: 2;
    }
}

@media (max-width: 768px) {
    .page-history {
        --history-nav-h: 3.75rem;
    }

    .history-hero {
        min-height: calc(100svh - var(--header-height));
        padding: calc(var(--header-height) + 2rem) 1.25rem 3rem;
    }

    .history-nav__list {
        padding: 0 0.75rem;
    }

    .history-nav__link {
        min-width: 3.5rem;
        padding: 0 0.35rem;
    }

    .history-nav__link span {
        font-size: 0.68rem;
    }

    .history-nav__link.is-active span {
        font-size: 0.76rem;
    }

    .history-nav__fade {
        width: 1.5rem;
    }

    .history-progress-rail {
        display: none;
    }

    .history-timeline-main section {
        min-height: auto;
        padding: calc(var(--header-height) + var(--history-nav-h) + 1.5rem) 0 3rem;
        align-items: flex-start;
    }

    .history-timeline-main section.has-gallery-pin {
        min-height: 100svh;
        min-height: 100dvh;
        padding-top: calc(var(--header-height) + var(--history-nav-h) + 0.75rem);
        padding-bottom: 1rem;
    }

    .history-section__grid {
        gap: 1.25rem;
        padding: 0 1rem;
    }

    .history-timeline-main section.has-gallery-pin .history-section__grid {
        display: flex;
        flex-direction: column;
        height: calc(100dvh - var(--header-height) - var(--history-nav-h) - 1.5rem);
        min-height: 0;
    }

    .history-timeline-main section.has-gallery-pin .section__content {
        flex-shrink: 0;
    }

    .history-timeline-main section.has-gallery-pin .section__desc {
        margin-bottom: 0.75rem;
        font-size: 0.92rem;
        line-height: 1.65;
    }

    .history-timeline-main section.has-gallery-pin .section__tags {
        display: none;
    }

    .history-timeline-main section.has-gallery-pin .section__image {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        aspect-ratio: auto;
        height: auto;
        max-height: none;
    }

    .history-timeline-main section.has-gallery-pin .section__image--banner,
    .history-timeline-main .section__image--banner {
        aspect-ratio: 2612 / 1257;
        min-height: auto;
    }

    .history-timeline-main .section__year {
        font-size: clamp(2.75rem, 16vw, 4rem);
        margin-bottom: 0.35rem;
    }

    .history-timeline-main .section__heading {
        font-size: clamp(1.5rem, 7vw, 2rem);
        margin-bottom: 0.75rem;
    }

    .history-timeline-main .section__desc {
        font-size: 0.95rem;
        margin-bottom: 1.25rem;
    }

    .history-timeline-main .section__image:not(.section__image--banner) {
        width: 100%;
        aspect-ratio: 4 / 3;
        min-height: clamp(220px, 56vw, 380px);
        border-radius: 1rem;
    }

    .history-timeline-main .section__image--banner {
        width: 100%;
        border-radius: 1rem;
    }

    .history-timeline-main .section__slides,
    .history-timeline-main .section__slide,
    .history-timeline-main .section__image-frame {
        border-radius: 1rem;
    }

    .history-cta {
        padding: 2rem 0;
    }

    .history-cta .cta-title {
        font-size: 1.5rem;
    }

    .history-cta .cta-desc {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .history-section__grid {
        padding: 0 0.85rem;
    }

    .history-timeline-main .section__image:not(.section__image--banner) {
        aspect-ratio: 1 / 1;
        min-height: clamp(200px, 88vw, 320px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .history-hero__scroll-line {
        animation: none;
    }
}
