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

:root {
    --ink: #111111;
    --muted: #686868;
    --paper: #ffffff;
    --soft: #f8f8f8;
    --soft-2: #eeeeee;
    --accent: #7d7d7d;
    --hero-a: #ffffff;
    --hero-b: #ffffff;
    --section-top: #ffffff;
    --section-mid: #ffffff;
    --section-bottom: #ffffff;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', 'Noto Sans SC', sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.55;
    --hero-foreground: #111111;
    --hero-secondary: rgba(17, 17, 17, 0.72);
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    display: block;
    width: 100%;
}

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 1.05rem 3rem;
    background: transparent;
    box-shadow: none;
    transform: translateY(0);
    transition: transform 260ms ease, background 260ms ease, box-shadow 260ms ease;
}

.site-header.is-hidden {
    transform: translateY(-110%);
}

.brand {
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.3em;
    color: var(--hero-foreground);
}

.main-nav {
    display: flex;
    gap: 1.4rem;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
}

.main-nav a {
    position: relative;
    color: var(--hero-foreground);
}

.main-nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -0.25rem;
    width: 100%;
    height: 1px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 220ms ease;
}

.main-nav a:hover::after {
    transform: scaleX(1);
}

.hero-section,
.journal-section,
.about-section,
.site-footer {
    padding: 0 3rem;
}

.hero-section {
    min-height: 100vh;
    background: var(--hero-a);
    position: relative;
    overflow: hidden;
    display: block;
    padding-top: 0;
    padding-bottom: 0;
}

.hero-copy-block {
    position: absolute;
    left: clamp(1.2rem, 3vw, 3rem);
    bottom: clamp(1.4rem, 4vw, 3rem);
    z-index: 4;
    display: grid;
    gap: 1.15rem;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    transition: color 220ms ease, background 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
    color: var(--hero-foreground);
}

.kicker {
    font-size: 0.72rem;
    letter-spacing: 0.32em;
    color: var(--muted);
}

.hero-copy-block .kicker {
    color: var(--hero-secondary);
}

h1,
h2,
.story-title,
.project-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    line-height: 1;
}

h1 {
    font-size: clamp(3rem, 6vw, 6.4rem);
    max-width: 16ch;
}

.hero-copy {
    color: inherit;
    max-width: 32rem;
}

.hero-carousel {
    position: absolute;
    inset: 0;
    min-height: 100vh;
    overflow: hidden;
    border-radius: 0;
    background: var(--hero-b);
    box-shadow: none;
}

.hero-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 900ms ease;
}

.hero-slide.active {
    opacity: 1;
}

.hero-slide .media-frame {
    height: 100%;
    min-height: 100vh;
}

.hero-overlay {
    display: none;
}

.media-caption {
    display: none;
}

.media-frame {
    position: relative;
    overflow: hidden;
    background: transparent;
}

.media-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent;
}

.hero-slide .media-image,
.story-gallery .media-image {
    min-height: 100%;
}

.hero-slide .media-image {
    object-fit: cover;
    background: transparent;
}

.hero-section::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    pointer-events: none;
}

.media-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.media-frame.is-broken {
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #dfdfdf 0%, #f7f7f7 100%);
}

.media-fallback {
    position: absolute;
    inset: auto 1rem 1rem 1rem;
    display: grid;
    gap: 0.35rem;
    color: #5f5f5f;
    background: rgba(247, 247, 247, 0.86);
    backdrop-filter: blur(6px);
    padding: 0.85rem 0.9rem;
    box-shadow: 0 10px 24px rgba(90, 90, 90, 0.08);
}

.media-fallback-title,
.media-fallback-source {
    font-size: 0.72rem;
    letter-spacing: 0.18em;
}

.media-fallback-note {
    font-size: 0.82rem;
    color: #737373;
}

.journal-section {
    background: var(--section-top);
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.section-head {
    margin-bottom: 2rem;
}

h2 {
    margin-top: 0.45rem;
    font-size: clamp(2rem, 5vw, 4.2rem);
}

.story-list {
    display: grid;
    gap: 1.4rem;
}

.story-section {
    display: grid;
    grid-template-columns: minmax(170px, 20vw) minmax(0, 1fr);
    gap: clamp(1rem, 3vw, 3rem);
    align-items: start;
    padding: 2rem 0;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55), inset 0 -1px 0 rgba(120, 120, 120, 0.06);
}

.story-meta {
    position: sticky;
    top: 5.8rem;
    display: grid;
    gap: 0.7rem;
    align-content: start;
    max-width: 16rem;
}

.story-date {
    font-size: 1.25rem;
    letter-spacing: 0.06em;
    color: var(--ink);
}

.story-tag {
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    color: var(--muted);
}

.story-title {
    font-size: clamp(2rem, 4vw, 3.4rem);
}

.story-intro {
    color: var(--muted);
    max-width: 15rem;
}

.story-gallery {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 0.95rem;
    align-items: start;
}

.story-gallery .media-frame {
    grid-column: span 12;
    box-shadow: none;
    background: transparent;
    padding: 0;
    transition: grid-column 0.3s ease;
    position: relative;
}

/* 优先级更高的 Data Attribute 定义 */
.story-gallery .media-frame[data-span="4"] { grid-column: span 4 !important; }
.story-gallery .media-frame[data-span="8"] { grid-column: span 8 !important; }
.story-gallery .media-frame[data-span="12"] { grid-column: span 12 !important; }

.story-gallery .media-image {
    height: auto;
    object-fit: initial;
    background: transparent;
}

.about-section {
    background: var(--section-mid);
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.about-inner {
    max-width: 44rem;
    display: grid;
    gap: 1rem;
}

.about-inner p:last-child {
    color: var(--muted);
}

.site-footer {
    background: var(--section-bottom);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 1.2rem;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.footer-links {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    letter-spacing: 0.16em;
    color: var(--muted);
}

/* 悬浮置顶按钮 */
.back-to-top {
    position: fixed;
    left: 3rem;
    bottom: 2rem;
    z-index: 100; /* 调高 z-index 确保在所有元素之上 */
    font-size: 0.75rem;
    letter-spacing: 0.2rem;
    font-weight: 700;
    color: #ffffff; /* 必须设为白色才能配合 difference 模式生效 */
    mix-blend-mode: difference;
    text-decoration: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
}

.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.back-to-top:hover {
    opacity: 0.7;
}

@media (max-width: 980px) {
    .site-header,
    .hero-section,
    .journal-section,
    .about-section,
    .site-footer {
        padding-left: 1.2rem;
        padding-right: 1.2rem;
    }

    .back-to-top {
        left: 1.2rem;
        bottom: 1.2rem;
    }

    .hero-carousel {
        min-height: 100vh;
    }

    .hero-slide .media-frame {
        min-height: 100vh;
    }

    .hero-copy-block {
        left: 1rem;
        right: 1rem;
        bottom: 1rem;
        max-width: none;
    }

    .story-section {
        grid-template-columns: 1fr;
    }

    .story-meta {
        position: static;
        max-width: none;
    }

    .story-gallery {
        grid-template-columns: 1fr;
    }

    .story-gallery .media-frame,
    .story-gallery .media-frame:first-child,
    .story-gallery .media-frame:nth-child(2),
    .story-gallery .media-frame:nth-child(3),
    .story-gallery .media-frame:nth-child(4) {
        grid-column: span 1;
    }
}

@media (max-width: 680px) {
    .site-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-nav {
        gap: 0.85rem;
        font-size: 0.7rem;
    }

    .story-gallery {
        grid-template-columns: 1fr;
    }

    .story-gallery .media-frame:first-child {
        grid-column: auto;
    }

    .site-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .hero-copy-block {
        padding: 0;
    }
}

