/* ===== Reset & Base ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-bg: #1a1611;
    --color-bg-light: #2a2319;
    --color-paper: #f5efe0;
    --color-paper-dark: #e8dcc8;
    --color-ink: #3d3427;
    --color-ink-light: #6b5d4d;
    --color-accent: #c4956a;
    --color-accent-dark: #a07548;
    --color-gold: #d4a853;
    --color-gold-dim: #b8923e;
    --color-red: #a0522d;
    --color-line: rgba(196, 149, 106, 0.3);
    --font-display: 'Ma Shan Zheng', cursive;
    --font-body: 'Noto Serif SC', 'SimSun', serif;
    --font-accent: 'ZCOOL XiaoWei', serif;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-ink);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ===== Hero Section ===== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(ellipse at 30% 20%, rgba(212, 168, 83, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 70% 80%, rgba(160, 82, 45, 0.06) 0%, transparent 60%),
        linear-gradient(180deg, #1a1611 0%, #231e16 50%, #1a1611 100%);
    overflow: hidden;
}

.film-grain {
    position: absolute;
    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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    background-size: 256px;
    pointer-events: none;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 40px;
}

.hero-subtitle {
    font-family: var(--font-accent);
    font-size: 1.1rem;
    color: var(--color-accent);
    letter-spacing: 8px;
    margin-bottom: 20px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.3s forwards;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(4rem, 12vw, 8rem);
    color: var(--color-paper);
    text-shadow:
        0 0 40px rgba(212, 168, 83, 0.3),
        0 0 80px rgba(212, 168, 83, 0.1);
    letter-spacing: 12px;
    margin-bottom: 30px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.6s forwards;
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--color-ink-light);
    line-height: 2;
    letter-spacing: 2px;
    opacity: 0;
    animation: fadeInUp 1s ease 0.9s forwards;
}

.scroll-hint {
    position: absolute;
    bottom: -120px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    opacity: 0;
    animation: fadeInUp 1s ease 1.4s forwards;
}

.scroll-hint span {
    font-size: 0.8rem;
    color: var(--color-accent);
    letter-spacing: 4px;
}

.scroll-arrow {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--color-accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

.hero-decoration .circle {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(212, 168, 83, 0.06);
}

.hero-decoration .c1 {
    width: 500px;
    height: 500px;
    top: -100px;
    right: -150px;
    animation: floatSlow 20s ease-in-out infinite;
}

.hero-decoration .c2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -100px;
    animation: floatSlow 15s ease-in-out infinite reverse;
}

.hero-decoration .c3 {
    width: 200px;
    height: 200px;
    top: 50%;
    left: 60%;
    animation: floatSlow 18s ease-in-out infinite 3s;
}

/* ===== Intro Section ===== */
.intro {
    padding: 100px 0;
    background: linear-gradient(180deg, var(--color-bg) 0%, var(--color-bg-light) 100%);
}

.intro-text {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
    position: relative;
}

.quote-mark {
    font-family: var(--font-display);
    font-size: 6rem;
    color: var(--color-gold);
    opacity: 0.2;
    line-height: 1;
    margin-bottom: -30px;
}

.intro-text p {
    font-size: 1.1rem;
    color: var(--color-paper-dark);
    line-height: 2.2;
    letter-spacing: 1px;
}

.quote-author {
    margin-top: 24px;
    font-size: 0.95rem !important;
    color: var(--color-accent) !important;
    font-style: italic;
}

/* ===== Timeline Section ===== */
.timeline-section {
    padding: 80px 0 100px;
    background: var(--color-bg-light);
}

.section-title {
    font-family: var(--font-display);
    font-size: 2.8rem;
    color: var(--color-paper);
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: 6px;
}

.section-title.light {
    color: var(--color-paper);
}

.section-subtitle {
    text-align: center;
    color: var(--color-ink-light);
    font-size: 0.95rem;
    letter-spacing: 3px;
    margin-bottom: 60px;
}

/* Timeline layout */
.timeline {
    position: relative;
    padding: 20px 0;
}

.timeline-line {
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        var(--color-line) 5%,
        var(--color-line) 95%,
        transparent 100%
    );
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    display: flex;
    margin-bottom: 60px;
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.timeline-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.timeline-item:nth-child(odd) {
    justify-content: flex-start;
    padding-right: calc(50% + 40px);
}

.timeline-item:nth-child(even) {
    justify-content: flex-end;
    padding-left: calc(50% + 40px);
}

.timeline-dot {
    position: absolute;
    left: 50%;
    top: 30px;
    width: 14px;
    height: 14px;
    background: var(--color-bg-light);
    border: 2px solid var(--color-gold-dim);
    border-radius: 50%;
    transform: translateX(-50%);
    z-index: 2;
    transition: all 0.4s ease;
}

.timeline-item.visible .timeline-dot {
    background: var(--color-gold);
    border-color: var(--color-gold);
    box-shadow: 0 0 12px rgba(212, 168, 83, 0.4);
}

/* Timeline card */
.timeline-card {
    background:
        linear-gradient(135deg, rgba(245, 239, 224, 0.03) 0%, rgba(245, 239, 224, 0.01) 100%);
    border: 1px solid rgba(196, 149, 106, 0.12);
    border-radius: 8px;
    padding: 28px;
    width: 100%;
    backdrop-filter: blur(4px);
    transition: all 0.4s ease;
}

.timeline-card:hover {
    border-color: rgba(212, 168, 83, 0.25);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transform: translateY(-2px);
}

.card-year {
    font-family: var(--font-accent);
    font-size: 0.85rem;
    color: var(--color-gold-dim);
    letter-spacing: 4px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(196, 149, 106, 0.1);
}

.timeline-card h3 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--color-paper);
    margin-bottom: 12px;
    letter-spacing: 2px;
}

.card-desc {
    font-size: 0.92rem;
    color: var(--color-ink-light);
    line-height: 1.9;
    margin-bottom: 20px;
}

/* Image placeholder */
.card-image.placeholder {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    overflow: hidden;
    background:
        repeating-linear-gradient(
            45deg,
            rgba(196, 149, 106, 0.03),
            rgba(196, 149, 106, 0.03) 10px,
            transparent 10px,
            transparent 20px
        ),
        linear-gradient(135deg, rgba(26, 22, 17, 0.8), rgba(42, 35, 25, 0.8));
    border: 1px dashed rgba(196, 149, 106, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.card-image.placeholder:hover {
    border-color: rgba(212, 168, 83, 0.4);
    background-color: rgba(42, 35, 25, 0.6);
}

.placeholder-inner {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.placeholder-icon {
    width: 40px;
    height: 40px;
    color: var(--color-accent);
    opacity: 0.4;
}

.placeholder-icon svg {
    width: 100%;
    height: 100%;
}

.placeholder-inner span {
    font-size: 0.85rem;
    color: var(--color-accent);
    opacity: 0.5;
    letter-spacing: 2px;
}

.placeholder-inner small {
    font-size: 0.75rem;
    color: var(--color-ink-light);
    opacity: 0.4;
}

/* ===== Stats Section ===== */
.stats-section {
    padding: 80px 0;
    background:
        radial-gradient(ellipse at 50% 50%, rgba(212, 168, 83, 0.05) 0%, transparent 70%),
        var(--color-bg);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-top: 50px;
}

.stat-item {
    text-align: center;
    padding: 30px 16px;
    border: 1px solid rgba(196, 149, 106, 0.08);
    border-radius: 8px;
    background: rgba(245, 239, 224, 0.02);
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    color: var(--color-gold);
    line-height: 1.2;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--color-ink-light);
    letter-spacing: 2px;
}

/* ===== Footer ===== */
.footer {
    padding: 60px 0 40px;
    background: var(--color-bg);
    border-top: 1px solid rgba(196, 149, 106, 0.08);
}

.footer-content {
    text-align: center;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    color: var(--color-paper);
    letter-spacing: 6px;
    margin-bottom: 16px;
}

.footer-text {
    font-size: 0.95rem;
    color: var(--color-ink-light);
    letter-spacing: 2px;
    margin-bottom: 24px;
}

.footer-sites {
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: var(--color-ink-light);
    letter-spacing: 1px;
}

.footer-sites-label {
    color: rgba(107, 93, 77, 0.8);
}

.footer-sites-list {
    display: inline-flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-site-link {
    color: var(--color-ink-light);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-site-link:hover {
    color: var(--color-accent);
}

.footer-copy {
    font-size: 0.8rem;
    color: rgba(107, 93, 77, 0.6);
    letter-spacing: 1px;
}

/* ===== Screenshot Thumbnail ===== */
.card-image.screenshot {
    width: 100%;
    aspect-ratio: 16 / 10;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
    background: rgba(26, 22, 17, 0.8);
    border: 1px solid rgba(196, 149, 106, 0.12);
}

.card-image.screenshot .lightbox-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: relative;
    cursor: zoom-in;
}

.card-image.screenshot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease, filter 0.3s ease;
}

.card-image.screenshot .lightbox-trigger:hover img {
    transform: scale(1.02);
    filter: brightness(1.1);
}

.zoom-hint {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 8px 12px;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: var(--color-paper);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-image.screenshot .lightbox-trigger:hover .zoom-hint {
    opacity: 1;
}

/* ===== Lightbox ===== */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(8px);
}

.lightbox-content {
    position: relative;
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 1;
}

.lightbox-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    z-index: 2;
}

.lightbox-zoom-btn {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(196, 149, 106, 0.3);
    border-radius: 6px;
    background: rgba(42, 35, 25, 0.8);
    color: var(--color-paper);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.lightbox-zoom-btn:hover {
    background: rgba(196, 149, 106, 0.2);
    border-color: var(--color-gold);
}

.lightbox-img-wrap {
    flex: 1;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    cursor: grab;
}

.lightbox-img-wrap:active {
    cursor: grabbing;
}

.lightbox-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.6);
    transition: transform 0.2s ease;
    transform-origin: center center;
    user-select: none;
    -webkit-user-drag: none;
}

.lightbox-caption {
    text-align: center;
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--color-paper-dark);
    letter-spacing: 2px;
    flex-shrink: 0;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: var(--color-paper);
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.2s;
    line-height: 1;
    z-index: 3;
}

.lightbox-close:hover {
    opacity: 1;
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes floatSlow {
    0%, 100% { transform: translate(0, 0); }
    33% { transform: translate(10px, -15px); }
    66% { transform: translate(-8px, 10px); }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .timeline-line {
        left: 20px;
    }

    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 52px;
        padding-right: 0;
        justify-content: flex-start;
    }

    .timeline-dot {
        left: 20px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hero-title {
        letter-spacing: 6px;
    }

    .section-title {
        font-size: 2.2rem;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-number {
        font-size: 2.2rem;
    }

    .timeline-card {
        padding: 20px;
    }

    .timeline-card h3 {
        font-size: 1.3rem;
    }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--color-accent-dark);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-accent);
}

/* ===== Selection ===== */
::selection {
    background: rgba(212, 168, 83, 0.3);
    color: var(--color-paper);
}
