/* =========================================================
   《出师表》沉浸式电影导读
   主题：夜烛青墨 · 竹简土黄 · 忠诚悲壮
   前景：烛火余烬（上升光点）· 氛围：夜风（Web Audio 合成）
   ========================================================= */

@import"https://fonts.googleapis.com/css2?family=Ma+Shan+Zheng&family=Noto+Serif+SC:wght@400;500;600;700;900&family=ZCOOL+XiaoWei&display=swap";

:root {
    font-family: "Noto Serif SC", Songti SC, SimSun, serif;
    color: #efe6d6;
    background: #241f1a;
    font-synthesis: none;
    --paper: #e6dcc6;
    --ink: #1d1913;
    --cinnabar: #b5503a;
    --gold: #d9a55e
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth;
    background: #241f1a
}

body {
    margin: 0;
    min-width: 320px;
    overflow-x: hidden
}

button,
a {
    font: inherit
}

button {
    color: inherit
}

.experience {
    position: relative;
    min-height: 100%;
    background: #2f2820
}

.scene-wrap {
    position: fixed;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    background: #2f2820
}

.scene-wrap:before {
    content: "";
    position: absolute;
    inset: -40px;
    background-image: linear-gradient(#1915103d, #19151061), var(--scene-image, url(../generated/chushibiao/hero.avif));
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    filter: blur(24px) saturate(.82) brightness(.88);
    transform: scale(1.08)
}

.scene-wrap:after {
    content: "";
    position: absolute;
    z-index: 2;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg, rgba(14, 11, 8, .6), transparent 26%, transparent 74%, rgba(14, 11, 8, .6)), linear-gradient(0deg, rgba(14, 11, 8, .58), transparent 40%, rgba(18, 14, 10, .12))
}

.scene-wrap canvas {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: 100%
}

.grain {
    position: fixed;
    z-index: 1;
    inset: 0;
    opacity: .12;
    pointer-events: none;
    mix-blend-mode: soft-light;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.72' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.8'/%3E%3C/svg%3E")
}

/* 前景烛火余烬层 */
.ember-layer {
    position: fixed;
    z-index: 5;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none
}

.site-header {
    position: fixed;
    z-index: 9;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 26px;
    pointer-events: none
}

.seal {
    display: grid;
    width: 49px;
    height: 49px;
    place-items: center;
    border: 1px solid rgba(230, 220, 198, .5);
    color: #efe6d6;
    background: #4a3527c4;
    box-shadow: inset 0 0 0 3px #efe6d614, 0 8px 30px #0b08061f;
    text-decoration: none;
    font-family: Ma Shan Zheng, cursive;
    font-size: 15px;
    line-height: 1.25;
    letter-spacing: .08em;
    pointer-events: auto
}

.header-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #e6d9c0b8;
    font-size: 10px;
    letter-spacing: .16em
}

.header-meta span:first-child {
    color: #efe6d6;
    font-size: 12px
}

.poem-switch {
    display: flex;
    gap: 4px;
    margin-left: auto;
    padding: 4px;
    border: 1px solid rgba(230, 220, 198, .24);
    border-radius: 99px;
    background: #1d171040;
    pointer-events: auto;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px)
}

.poem-switch a {
    border-radius: 99px;
    padding: 7px 10px;
    color: #e6d9c0b8;
    text-decoration: none;
    font-size: 9px;
    letter-spacing: .08em;
    white-space: nowrap
}

.poem-switch a:hover,
.poem-switch a:focus-visible {
    color: #f2d8ae;
    background: #ffffff12
}

.poem-switch a[aria-current="page"] {
    color: #1d1710;
    background: #e6d9c0d9
}

.soundless-control {
    border: 1px solid rgba(230, 220, 198, .32);
    border-radius: 99px;
    padding: 9px 14px;
    background: #1d171047;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: pointer;
    pointer-events: auto;
    font-size: 11px;
    letter-spacing: .12em;
    transition: .2s ease
}

.soundless-control:hover,
.soundless-control.active {
    color: #1d1913;
    background: #e6dcc6
}

/* 朗读按钮（AUDIO_SRC 填了路径后才会出现） */
.csb-audio {
    --audio-border: rgba(230, 220, 198, .32);
    --audio-color: rgba(230, 220, 198, .82);
    --audio-bg: rgba(29, 23, 16, .28);
    --audio-active-color: #1d1913;
    --audio-active-bg: #e6dcc6;
    --audio-focus: #e6dcc6;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px)
}

.chapter-nav {
    position: fixed;
    z-index: 8;
    top: 50%;
    right: 22px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    transform: translateY(-50%)
}

.chapter-nav a {
    display: grid;
    width: 28px;
    height: 28px;
    place-items: center;
    border: 1px solid rgba(230, 220, 198, .22);
    border-radius: 50%;
    color: #e6d9c08c;
    background: #14100c2e;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    text-decoration: none;
    font-size: 10px;
    transition: .25s ease
}

.chapter-nav a.two-chars {
    font-size: 8.5px;
    letter-spacing: -.02em
}

.chapter-nav a:hover,
.chapter-nav a.active {
    color: #1d1913;
    background: #e6dcc6;
    transform: scale(1.12)
}

.scene-note {
    position: fixed;
    z-index: 8;
    right: 70px;
    bottom: 26px;
    width: min(340px, calc(100vw - 40px));
    padding: 17px 19px;
    border: 1px solid rgba(230, 220, 198, .22);
    border-radius: 3px;
    color: #efe6d6;
    background: #1e1911c7;
    box-shadow: 0 18px 60px #0805034d;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity .25s ease, transform .25s ease;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px)
}

.scene-note.open {
    opacity: 1;
    transform: none
}

.scene-note-kicker {
    display: block;
    margin-bottom: 4px;
    color: #d9a55e;
    font-size: 10px;
    letter-spacing: .15em
}

.scene-note strong {
    font-size: 20px;
    font-weight: 600
}

.scene-note p {
    margin: 7px 0 0;
    color: #e6d9c0b8;
    font-size: 12px;
    line-height: 1.75
}

.story {
    position: relative;
    z-index: 3
}

.chapter {
    position: relative;
    display: flex;
    min-height: 110vh;
    align-items: center;
    padding: 12vh clamp(24px, 7vw, 110px);
    pointer-events: none
}

.chapter:before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0;
    background: radial-gradient(circle at 20% 50%, rgba(12, 9, 6, .48), transparent 50%);
    transition: opacity .8s ease;
    pointer-events: none
}

.chapter.active:before {
    opacity: 1
}

.chapter.align-right {
    justify-content: flex-end
}

.chapter.align-right:before {
    background: radial-gradient(circle at 80% 50%, rgba(12, 9, 6, .52), transparent 50%)
}

.copy {
    position: relative;
    z-index: 1;
    width: min(535px, 48vw);
    pointer-events: auto
}

.hero {
    min-height: 120vh;
    align-items: flex-start;
    padding-top: 19vh
}

.hero-copy {
    width: min(620px, 58vw);
    text-shadow: 0 3px 24px rgba(10, 8, 5, .6);
    opacity: 0;
    transition: opacity 1s ease
}

.chapter.hero.active .hero-copy {
    opacity: 1
}

.kicker,
.chapter-number {
    margin: 0 0 16px;
    color: #d9a55e;
    font-size: 11px;
    letter-spacing: .28em;
    text-transform: uppercase
}

h1,
h2,
p {
    margin-top: 0
}

h1 {
    margin-bottom: 7px;
    font-family: ZCOOL XiaoWei, "Noto Serif SC", serif;
    font-size: clamp(58px, 8.5vw, 128px);
    font-weight: 400;
    letter-spacing: -.05em;
    line-height: .88
}

h1 em {
    color: #c9713f;
    font-style: normal
}

.author {
    margin: 18px 0 36px;
    color: #e6d9c0b3;
    font-size: 13px;
    letter-spacing: .28em
}

blockquote {
    margin: 0 0 34px;
    padding: 0;
    font-family: Ma Shan Zheng, cursive;
    font-size: clamp(24px, 3vw, 40px);
    line-height: 1.75
}

blockquote span {
    display: block;
    opacity: 0;
    transform: translateY(10px);
    animation: line-in 1.1s ease forwards
}

blockquote span:nth-child(1) { animation-delay: .5s }
blockquote span:nth-child(2) { animation-delay: .85s }
blockquote span:nth-child(3) { animation-delay: 1.2s }
blockquote span:nth-child(4) { animation-delay: 1.55s }
blockquote span:nth-child(5) { animation-delay: 1.9s }
blockquote span:nth-child(6) { animation-delay: 2.25s }
blockquote span:nth-child(7) { animation-delay: 2.6s }
blockquote span:nth-child(8) { animation-delay: 2.95s }
blockquote span:nth-child(9) { animation-delay: 3.3s }
blockquote span:nth-child(10) { animation-delay: 3.65s }

.enter {
    border: 0;
    border-bottom: 1px solid rgba(230, 220, 198, .45);
    padding: 10px 0;
    color: #efe6d6;
    background: none;
    cursor: pointer;
    letter-spacing: .08em
}

.enter i {
    display: inline-block;
    margin-left: 12px;
    font-style: normal;
    animation: bob 1.8s ease-in-out infinite
}

.scroll-mark {
    position: absolute;
    bottom: 10vh;
    left: clamp(24px, 7vw, 110px);
    display: flex;
    align-items: center;
    gap: 12px;
    color: #e6d9c08c;
    font-size: 10px;
    letter-spacing: .14em;
    opacity: 0;
    transition: opacity 1s ease
}

.chapter.hero.active .scroll-mark {
    opacity: 1
}

.scroll-mark span {
    display: block;
    width: 42px;
    height: 1px;
    background: #e6d9c080
}

/* 引文句：每章只放一两句，字号大而留白多 */
.quote-line {
    margin: 0 0 22px;
    padding-left: 18px;
    border-left: 2px solid #b5503a;
    color: #f2e9d9;
    font-family: ZCOOL XiaoWei, "Noto Serif SC", serif;
    font-size: clamp(20px, 2.2vw, 28px);
    line-height: 1.75
}

.card {
    padding: clamp(26px, 4vw, 54px);
    border: 1px solid rgba(230, 220, 198, .17);
    color: #f5ecdd;
    background: linear-gradient(145deg, #1b1610e6, #352c20ba);
    box-shadow: 0 28px 90px #0705033b;
    opacity: .42;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
    -webkit-backdrop-filter: blur(8px) saturate(.82);
    backdrop-filter: blur(8px) saturate(.82)
}

.chapter.active .card {
    opacity: 1;
    transform: none
}

.card h2,
.reading h2 {
    margin-bottom: 5px;
    font-family: ZCOOL XiaoWei, "Noto Serif SC", serif;
    font-size: clamp(30px, 3.6vw, 46px);
    font-weight: 500;
    letter-spacing: -.04em;
    line-height: 1.3
}

.pinyin {
    margin-bottom: 24px;
    color: #c2a878;
    font-size: 10px;
    letter-spacing: .19em;
    text-transform: uppercase
}

.translation {
    margin-bottom: 21px;
    color: #efe6d6;
    font-size: 17px;
    line-height: 1.75
}

.commentary {
    margin-bottom: 0;
    color: #e6d9c0b8;
    font-size: 14px;
    line-height: 2
}

/* 对照条 */
.contrast {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid rgba(230, 220, 198, .18);
    color: #d9a55e;
    font-size: 12px
}

.contrast i {
    color: #e6d9c059;
    font-style: normal
}

.contrast b {
    color: #efe6d6;
    font-weight: 600
}

/* 节奏条 */
.rhythm {
    display: flex;
    gap: 9px;
    margin-top: 28px
}

.rhythm span {
    flex: 1;
    padding: 12px 8px;
    border: 1px solid rgba(230, 220, 198, .2);
    text-align: center;
    font-family: Ma Shan Zheng, cursive;
    font-size: 20px
}

.rhythm span.wide {
    flex: 1.6
}

/* 三列意象 */
.triple {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    margin: 26px 0;
    background: #e6dcc62e
}

.triple div {
    padding: 15px 10px;
    background: #171310e0;
    text-align: center
}

.triple b {
    display: block;
    margin-bottom: 3px;
    color: #e0cba4;
    font-family: Ma Shan Zheng, cursive;
    font-size: 23px;
    font-weight: 400
}

.triple span {
    color: #e6d9c08c;
    font-size: 10px;
    letter-spacing: .1em
}

/* 时间轴：二十有一年 */
.timeline {
    position: relative;
    margin-top: 30px;
    padding-left: 22px;
    border-left: 1px solid rgba(230, 220, 198, .28)
}

.timeline div {
    position: relative;
    margin-bottom: 16px
}

.timeline div:last-child {
    margin-bottom: 0
}

.timeline div:before {
    content: "";
    position: absolute;
    top: 6px;
    left: -26px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #b5503a
}

.timeline b {
    display: block;
    color: #e0cba4;
    font-size: 13px;
    font-weight: 600
}

.timeline span {
    color: #e6d9c08c;
    font-size: 11px;
    letter-spacing: .12em
}

/* 二格：宜 / 不宜 */
.pair-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 26px
}

.pair-grid div {
    padding: 13px 12px;
    border: 1px solid rgba(230, 220, 198, .18);
    background: #171310e0
}

.pair-grid b {
    display: block;
    margin-bottom: 3px;
    color: #e0cba4;
    font-family: Ma Shan Zheng, cursive;
    font-size: 21px;
    font-weight: 400
}

.pair-grid span {
    color: #e6d9c08c;
    font-size: 10px;
    letter-spacing: .1em
}

.final-line-card-q {
    display: block;
    margin-top: 30px;
    padding-left: 21px;
    border-left: 2px solid #b5503a;
    color: #d9a55e;
    font-family: ZCOOL XiaoWei, serif;
    font-size: 20px;
    line-height: 1.8
}

.reading {
    min-height: 120vh;
    align-items: flex-end;
    padding-bottom: 9vh;
    background: linear-gradient(0deg, rgba(18, 14, 9, .94) 0, rgba(18, 14, 9, .72) 50%, transparent 100%)
}

.reading-panel {
    width: 100%;
    padding: clamp(28px, 5vw, 66px);
    border-top: 1px solid rgba(230, 220, 198, .2);
    background: #1b1610b8;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    pointer-events: auto
}

.reading-heading {
    display: grid;
    grid-template-columns: 1fr 2fr;
    align-items: end;
    gap: 50px
}

.reading-heading h2 {
    margin: 0;
    font-size: clamp(39px, 6vw, 82px)
}

.reading-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    margin-top: 44px;
    background: #e6dcc626
}

.fact {
    min-height: 185px;
    padding: 23px;
    background: #171310e6
}

.fact span {
    display: block;
    margin-bottom: 20px;
    color: #c2a878;
    font-size: 10px;
    letter-spacing: .24em
}

.fact p {
    margin: 0;
    color: #e6d9c0ad;
    font-size: 13px;
    line-height: 1.85
}

.fact b {
    color: #e0cba4;
    font-weight: 600
}

.emotion-arc {
    display: flex;
    height: 41px;
    margin-top: 28px;
    overflow: hidden;
    border: 1px solid rgba(230, 220, 198, .15)
}

.emotion-arc span {
    display: grid;
    width: var(--w);
    place-items: center;
    color: #f5ecddc7;
    background: color-mix(in srgb, #b5503a calc(var(--w) * 2.6), #3d332a);
    font-size: 10px;
    letter-spacing: .06em
}

.reading footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-top: 28px;
    color: #e6d9c07a;
    font-size: 11px;
    letter-spacing: .1em
}

.reading footer p {
    margin: 0
}

.reading footer button {
    border: 1px solid rgba(230, 220, 198, .25);
    border-radius: 99px;
    padding: 10px 16px;
    background: transparent;
    cursor: pointer
}

.reading footer button:hover {
    color: #1d1913;
    background: #e6dcc6
}

.focus-scene .story,
.focus-scene .chapter-nav,
.focus-scene .scene-note {
    opacity: .08;
    transition: opacity .3s ease
}

.focus-scene .site-header {
    opacity: .85
}

.loading {
    position: fixed;
    z-index: 20;
    inset: 0;
    display: grid;
    place-items: center;
    color: #e0cba4;
    background: #241f1a;
    letter-spacing: .22em;
    font-size: 11px;
    transition: opacity .6s ease
}

.loading:before {
    content: "";
    position: absolute;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(217, 165, 94, .3);
    border-top-color: #d9a55e;
    border-radius: 50%;
    animation: spin 1.4s linear infinite
}

.loading span {
    margin-top: 95px
}

.loading.done {
    visibility: hidden;
    opacity: 0;
    pointer-events: none
}

.review-mode .site-header,
.review-mode .chapter-nav,
.review-mode .scene-note,
.review-mode .story,
.review-mode .grain,
.review-mode .ember-layer {
    display: none
}

@keyframes bob {
    50% {
        transform: translateY(5px)
    }
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

@keyframes line-in {
    to {
        opacity: 1;
        transform: none
    }
}

@media(max-width:860px) {
    .site-header {
        padding: 14px
    }

    .seal {
        width: 43px;
        height: 43px;
        font-size: 14px
    }

    .header-meta span:last-child {
        display: none
    }

    .soundless-control {
        padding: 8px 11px
    }

    .poem-switch a {
        padding: 6px 8px
    }

    .chapter-nav {
        right: 8px;
        gap: 5px
    }

    .chapter-nav a {
        width: 24px;
        height: 24px;
        font-size: 9px
    }

    .chapter-nav a.two-chars {
        font-size: 7.5px
    }

    .chapter {
        min-height: 118vh;
        padding: 16vh 24px 12vh;
        align-items: flex-end
    }

    .hero {
        min-height: 125vh;
        align-items: flex-start;
        padding-top: 18vh
    }

    .copy,
    .hero-copy {
        width: calc(100% - 34px);
        max-width: 560px
    }

    h1 {
        font-size: clamp(52px, 16vw, 82px)
    }

    blockquote {
        font-size: clamp(21px, 6vw, 30px)
    }

    .card {
        padding: 25px;
        background: linear-gradient(145deg, #211a12e0, #33291dbf)
    }

    .card h2 {
        font-size: clamp(28px, 8vw, 42px)
    }

    .quote-line {
        font-size: clamp(18px, 5.5vw, 24px)
    }

    .scene-note {
        right: 14px;
        bottom: 14px
    }

    .triple {
        grid-template-columns: 1fr
    }

    .reading {
        padding: 10vh 14px 3vh
    }

    .reading-panel {
        padding: 26px 20px
    }

    .reading-heading {
        grid-template-columns: 1fr;
        gap: 10px
    }

    .reading-content {
        grid-template-columns: 1fr 1fr
    }

    .emotion-arc {
        height: auto;
        flex-wrap: wrap
    }

    .emotion-arc span {
        min-width: 33%;
        min-height: 36px;
        flex-grow: 1
    }
}

@media(max-width:540px) {

    .header-meta,
    #focus-scene {
        display: none
    }



    .hero-copy {
        width: calc(100% - 15px)
    }

    .author {
        margin-bottom: 25px
    }

    .scroll-mark {
        display: none
    }

    .translation {
        font-size: 15px
    }

    .commentary {
        font-size: 13px;
        line-height: 1.9
    }

    .pair-grid {
        grid-template-columns: 1fr
    }

    .reading-content {
        grid-template-columns: 1fr
    }

    .fact {
        min-height: auto
    }

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

@media(prefers-reduced-motion:reduce) {
    html {
        scroll-behavior: auto
    }

    *,
    *:before,
    *:after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important
    }
}
