/* 插图层（2026-10-08，2026-11-18 方案二手账拼贴升级）：
   世界开篇图、地点图、人物出场照、手账墨水刻度、世界主题色、荧光底线起首短语、手机竖版开场、人物卡头像、设置页书页化。
   电脑对开（>=1080px）时画在左页，窄屏时画在页内；逻辑见 src/branch-tree/103b-sceneArt.js。 */

/* ============ 世界主题色：标牌、选项左竖条、章 ============ */
[data-scene] { --scene-accent: #2e4a7d; }
[data-scene='company'] { --scene-accent: #2f5560; }
[data-scene='tower'] { --scene-accent: #5b4a7a; }
[data-scene='oasis'] { --scene-accent: #8a5a12; }
[data-scene='base'],
[data-scene='home'] { --scene-accent: #8a3d17; }
[data-scene='repair'] { --scene-accent: #2e6b52; }
[data-scene='jinshan'] { --scene-accent: #8f1d1d; }
[data-scene='mistPost'] { --scene-accent: #2e4a7d; }

html body [data-scene] #branch-intro .branch-head h1,
html body [data-scene] #branch-settle .branch-head h1 {
    color: var(--scene-accent);
}
html body :is(#branch-app, #branch-tree-content)[data-scene] #b-title {
    color: var(--px-ink, #2b241d);
}

/* 纸面按世界染一层极微底色（<=0.05，保持点阵与正文高对比） */
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='company']) { --scene-tint: rgba(150, 190, 205, 0.05); }
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='tower']) { --scene-tint: rgba(170, 150, 205, 0.05); }
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='oasis']) { --scene-tint: rgba(245, 200, 110, 0.05); }
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='base']),
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='home']) { --scene-tint: rgba(240, 160, 100, 0.05); }
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='repair']) { --scene-tint: rgba(160, 215, 190, 0.05); }
html.book-skin body #app .main:has(#view-adventure.active #branch-tree-container:not(.hidden) [data-scene='jinshan']) { --scene-tint: rgba(225, 170, 90, 0.05); }

/* 起首短语：手账朱红荧光底线高亮（方案二） */
html body #b-narrative .b-para .b-lead {
    font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
    font-size: 1.08em;
    font-weight: 700;
    line-height: inherit;
    color: inherit;
    background: linear-gradient(180deg, transparent 62%, rgba(166, 58, 43, 0.22) 62%);
    padding: 0 2px;
    margin-right: 0.06em;
}

/* ============ 插图：白边相纸标本卡 + 双斜贴和纸胶带 ============ */
.scene-plate {
    position: relative;
    margin: 0;
    padding: 10px 10px 12px;
    background: #fbf8f0;
    border: 1px solid rgba(43, 36, 29, 0.24);
    box-shadow: 2px 4px 12px rgba(43, 36, 29, 0.16);
    transform: rotate(-0.6deg);
}
.scene-plate::before,
.scene-plate::after {
    content: '';
    position: absolute;
    top: -8px;
    width: 66px;
    height: 18px;
    background: var(--s2-tape, rgba(214, 188, 134, 0.78));
    border-left: 1px dashed rgba(130, 108, 60, 0.45);
    border-right: 1px dashed rgba(130, 108, 60, 0.45);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
    pointer-events: none;
    z-index: 3;
}
.scene-plate::before {
    left: 16px;
    transform: rotate(-11deg);
}
.scene-plate::after {
    right: 16px;
    transform: rotate(9deg);
}
.scene-person {
    position: relative;
    margin: 0;
    padding: 0;
    background: none;
}
.scene-plate img,
.scene-person img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    border: 1px solid rgba(43, 36, 29, 0.35);
    background: #1f1b18;
    image-rendering: pixelated;
}
.scene-plate figcaption,
.scene-person figcaption {
    margin-top: 7px;
    text-align: left;
    font: 11.5px/1.4 'Fusion Pixel', 'NA Pixel', monospace;
    color: var(--px-ink-soft, #6c5d49);
}
/* 结算：褪色 + 结束方式章 */
.scene-plate.is-settled img { filter: grayscale(0.4) sepia(0.25); }
.scene-stamp {
    position: absolute;
    z-index: 4;
    right: 18px;
    bottom: 38px;
    padding: 4px 10px;
    border: 3px solid #a63a2b;
    color: #a63a2b;
    background: rgba(251, 248, 240, 0.94);
    font: 700 16px/1.2 'Fusion Pixel', 'NA Pixel', monospace;
    letter-spacing: 4px;
    text-indent: 4px;
    transform: rotate(-8deg);
}

/* ============ 页内（窄屏、独立页） ============ */
.scene-plate-inline {
    margin: 14px 4px 20px;
}
.scene-plate-inline img {
    aspect-ratio: 4 / 3;
    object-position: center 55%;
}
.scene-person-inline {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 16px;
    padding: 6px 10px 6px 6px;
    background: #fbf8f0;
    border: 1px solid rgba(43, 36, 29, 0.24);
    box-shadow: 2px 3px 8px rgba(43, 36, 29, 0.14);
}
.scene-person-inline img { width: 72px; height: 72px; flex: none; }
.scene-person-inline figcaption { margin: 0; font-size: 13.5px; font-weight: 700; color: var(--px-ink, #2b241d); }
.scene-person-inline figcaption[data-caption]::after { content: attr(data-caption); }
@media (max-width: 1079px) {
    html body #branch-intro.has-plate #intro-stats { display: none; }
    .scene-plate-inline {
        transform: none;
        margin: 14px 0 20px;
    }
    .scene-plate-inline::before,
    .scene-plate-inline::after {
        width: 52px;
        height: 15px;
    }
    .scene-plate-inline::before { left: 10px; }
    .scene-plate-inline::after { right: 10px; }
}

/* ============ 电脑对开：左页标本拼贴 + 拍立得 + 墨水刻度 ============ */
.scene-art-left { display: none; }
@media (min-width: 1080px) {
    html.book-skin body #app .scene-plate-inline,
    html.book-skin body #app .scene-person-inline { display: none; }
    html.book-skin body #app:has(#view-adventure.active #branch-tree-container:not(.hidden)) .scene-art-left:not(:empty) {
        display: flex;
        flex-direction: column;
        gap: 12px;
        order: 1;
        margin: 2px 0 10px;
    }
    html.book-skin body #app .scene-art-left .scene-plate {
        width: 100%;
        box-sizing: border-box;
    }
    html.book-skin body #app .scene-art-left .scene-plate img {
        width: 100%;
        height: 214px;
        max-height: 240px;
        aspect-ratio: auto;
        object-fit: cover;
        object-position: center 50%;
    }
    html.book-skin body #app .scene-art-left .s2-polaroid-row {
        display: flex;
        gap: 12px;
        align-items: flex-start;
        width: 100%;
    }
    html.book-skin body #app .scene-art-left .scene-person {
        position: relative;
        width: 112px;
        flex: none;
        padding: 6px 6px 10px;
        background: #fbf8f0;
        border: 1px solid rgba(43, 36, 29, 0.25);
        box-shadow: 2px 4px 10px rgba(43, 36, 29, 0.18);
        transform: rotate(-1.5deg);
    }
    html.book-skin body #app .scene-art-left .s2-polaroid-pair .scene-person:nth-child(2) {
        transform: rotate(1.2deg);
    }
    html.book-skin body #app .scene-art-left .scene-person::before {
        content: '';
        position: absolute;
        top: -6px;
        left: 50%;
        transform: translateX(-50%);
        width: 12px;
        height: 12px;
        border-radius: 50%;
        background: radial-gradient(circle at 35% 35%, #f5d27b, #b68029 70%, #5c3d0e);
        box-shadow: 0 2px 3px rgba(0, 0, 0, 0.4);
        z-index: 2;
        pointer-events: none;
    }
    html.book-skin body #app .scene-art-left .scene-person img {
        width: 100%;
        height: 94px;
        aspect-ratio: 1;
        object-fit: cover;
        border: 1px solid rgba(43, 36, 29, 0.2);
    }
    html.book-skin body #app .scene-art-left .scene-person figcaption {
        margin-top: 5px;
        text-align: center;
        font: 700 11.5px/1.3 'Fusion Pixel', 'NA Pixel', monospace;
        color: var(--px-ink, #2b241d);
    }
    html.book-skin body #app .scene-art-left .s2-margin-note {
        flex: 1;
        min-width: 0;
        padding: 9px 11px;
        background: #faf6ea;
        border: 1px dashed rgba(46, 74, 125, 0.35);
        font: 12.5px/1.55 var(--reading-font, 'Noto Serif SC', serif);
        color: #3d3328;
    }
    html.book-skin body #app .scene-art-left .s2-margin-note b {
        display: block;
        font: 700 10.5px/1.4 'Fusion Pixel', 'NA Pixel', monospace;
        color: var(--s2-blue, #2e4a7d);
        letter-spacing: 0.06em;
        margin-bottom: 3px;
    }
    html.book-skin body #app .scene-art-left .s2-ink-gauges {
        width: 100%;
        box-sizing: border-box;
        background: #faf6ea;
        border: 1px solid rgba(43, 36, 29, 0.22);
        padding: 10px 12px;
        border-radius: 3px;
        color: var(--px-ink, #2b241d);
    }
    html.book-skin body #app .scene-art-left .s2-gauge-head {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font: 11.5px/1.4 'Fusion Pixel', 'NA Pixel', monospace;
        color: var(--px-ink-soft, #6c5d49);
        margin-bottom: 7px;
    }
    html.book-skin body #app .scene-art-left .s2-gauge-head strong {
        color: var(--s2-sage, #3f6a4e);
        font-weight: 700;
    }
    html.book-skin body #app .scene-art-left .s2-ink-bar-wrap {
        height: 8px;
        background: #ded2b3;
        border: 1px solid rgba(43, 36, 29, 0.3);
        margin-bottom: 9px;
        overflow: hidden;
    }
    html.book-skin body #app .scene-art-left .s2-ink-bar-fill {
        height: 100%;
        background: repeating-linear-gradient(90deg, var(--s2-sage, #3f6a4e) 0 12px, #2b4c3d 12px 14px);
    }
    html.book-skin body #app .scene-art-left .s2-stat-scales {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px 12px;
        font: 12px/1.4 'Fusion Pixel', 'NA Pixel', monospace;
    }
    html.book-skin body #app .scene-art-left .s2-scale-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 4px;
    }
    html.book-skin body #app .scene-art-left .s2-pips {
        display: inline-flex;
        gap: 2px;
        flex: none;
    }
    html.book-skin body #app .scene-art-left .s2-pip {
        width: 7px;
        height: 7px;
        border: 1px solid var(--px-ink-soft, #6c5d49);
        background: transparent;
    }
    html.book-skin body #app .scene-art-left .s2-pip.on {
        background: var(--s2-blue, #2e4a7d);
        border-color: var(--s2-blue, #2e4a7d);
    }
    /* 有画时左页收紧：隐私小字设置页里也有，这里先藏 */
    html.book-skin body #app:has(#view-adventure.active #branch-tree-container:not(.hidden)) .book-front .privacy-banner { display: none; }
}

/* ============ 人物卡头像：地图上的旅人 ============ */
html body #app .player-avatar.has-sprite {
    width: 64px;
    height: 80px;
    padding: 0;
    overflow: hidden;
    align-items: flex-end;
    background: #24321f;
    border: 0;
    box-shadow: 0 0 0 4px #fbf6ea, 0 0 0 6px #2a1f16, 4px 4px 0 6px rgba(42, 31, 22, 0.25);
}
html body #app .player-avatar.has-sprite img {
    display: block;
    height: 108%;
    margin-bottom: -6px;
    image-rendering: pixelated;
}

/* ============ 手机竖屏开场：竖版书桌，书在灯下 ============ */
.room-img-portrait { display: none; }
@media (max-aspect-ratio: 3/4) {
    #intro-stage {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        aspect-ratio: auto;
    }
    #intro-stage .room-img-portrait:not(.hidden) {
        display: block;
        object-fit: cover;
        object-position: 30% 50%;
    }
    #intro-stage .room-img-portrait:not(.hidden) ~ .room-img-landscape,
    #intro-stage .room-img-portrait:not(.hidden) ~ .intro-desk-video { display: none; }
    .intro-prop-lamp { left: 4%; top: 39%; width: 36%; height: 28%; }
    .intro-prop-coffee { left: 10%; top: 68%; width: 18%; height: 10%; }
    .intro-prop-pen { left: 25%; top: 75%; width: 15%; height: 9.5%; }
    .intro-prop-notes { left: 1%; top: 75%; width: 20%; height: 13%; }
    .intro-prop-window { left: 58%; top: 10%; width: 25%; height: 40%; }
    #intro-scene[data-lamp='off'] .intro-lamp-veil {
        background: radial-gradient(
            ellipse 24% 26% at 74% 18%,
            rgba(92, 122, 184, 0.08) 0%,
            rgba(6, 8, 22, 0.66) 54%,
            rgba(4, 5, 14, 0.78) 100%
        );
    }
    .intro-prop-toast {
        bottom: 11.5%;
        width: max-content;
        max-width: 88vw;
    }
    .intro-sticky-card {
        left: 50%;
        bottom: 22%;
        width: min(290px, 84vw);
        transform: translateX(-50%) rotate(-0.8deg);
    }
    html.art-book-pixel #intro-book,
    #intro-book {
        left: 32%;
        top: 61%;
        width: 50%;
        height: auto;
        aspect-ratio: 3 / 2;
    }
    .intro-heading { top: 13%; }
    .intro-hint { bottom: 7%; }
}

/* ============ 设置页：书页样式 ============ */
html.book-skin #intro-settings .menu-window {
    background: var(--na-grain, none), #f3e8cf;
    color: #2a2019;
    border: 0;
    box-shadow: 0 0 0 6px #5a3a22, 0 0 0 8px #2b150a, 8px 8px 0 8px rgba(0, 0, 0, 0.45);
}
html.book-skin #intro-settings .menu-title { color: #3a1d10; }
html.book-skin #intro-settings .menu-note { color: #5e4c3b; }
html.book-skin #intro-settings .reading-settings {
    background: rgba(255, 252, 240, 0.55);
    border: 1px solid rgba(90, 58, 34, 0.35);
}
html.book-skin #intro-settings .reading-settings legend {
    color: #fbf6ea;
    background: #5a3a22;
    border: 0;
}
html.book-skin #intro-settings .menu-item {
    color: #3a1d10;
    background: #e9d9b4;
    border: 1px solid rgba(90, 58, 34, 0.45);
    box-shadow: 0 2px 0 rgba(90, 58, 34, 0.35);
}
html.book-skin #intro-settings .menu-item:hover,
html.book-skin #intro-settings .menu-item:focus-visible {
    background: #f3e8cf;
}

/* ============ 人物册图鉴（日志页「人物」标签） ============ */
.codex-scene-heading {
    margin: 14px 0 6px;
    padding: 3px 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--ink, #2a2019);
    border-left: 3px solid var(--accent, #8b3a2b);
    background: rgba(90, 58, 34, 0.08);
}
.codex-person-card { display: flex; gap: 12px; align-items: flex-start; }
.codex-avatar {
    width: 56px;
    height: 70px;
    flex: none;
    object-fit: cover;
    image-rendering: pixelated;
    border: 1px solid rgba(90, 58, 34, 0.45);
    background: #ece0c4;
}
.codex-avatar-locked {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #7c6b58;
}
.codex-body { flex: 1; min-width: 0; }
.codex-meta { font-size: 12px; color: #6c5d49; margin: 2px 0 6px; }
.codex-familiar { margin-top: 6px; padding-top: 6px; border-top: 1px dashed rgba(90, 58, 34, 0.25); }
.codex-settle-face { max-width: 96px; margin-bottom: 8px; }

