/* 书本外壳层 v2026.10.06.1：打开的就是封面那本棕皮烫金书。最后加载，只换外壳和标签类组件，
   页内票根、印章、属性格不动。整层由 <html class="book-skin"> 开关，去掉该类即回到「夜班档案」档案夹样式。
   电脑（≥1080px）左右两页对开：左页 aside.book-front（书名、目录、合上书、隐私小字），右页 .main；
   窄屏单页：左侧书脊，章节入口为书页顶上的索引标签。
   本文件按评审轮次叠加，后面的段落覆盖前面的同名规则。 */
:root {
    --bk-leather: #4e2817;
    --bk-leather-2: #3a1d10;
    --bk-leather-hi: #6e3a20;
    --bk-gold: #d3a24c;
    --bk-gold-dark: #8a5f22;
    --bk-page: #f2e5c6;
    --bk-edge-a: #e7d6af;
    --bk-edge-b: #c4a874;
    --bk-ribbon: #9e2a20;
    --bk-ribbon-dark: #6b1a13;
    --bk-leather-tex:
        var(--na-grain),
        radial-gradient(ellipse 60% 50% at 30% 20%, rgba(255, 190, 120, 0.10), transparent 70%),
        radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.35)),
        var(--bk-leather);
    --bk-corner: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'><g fill='%23c99a45'><rect x='1' y='1' width='14' height='2'/><rect x='1' y='1' width='2' height='14'/><rect x='5' y='5' width='6' height='1'/><rect x='5' y='5' width='1' height='6'/><rect x='17' y='1' width='2' height='2'/><rect x='21' y='1' width='2' height='2'/><rect x='1' y='17' width='2' height='2'/><rect x='1' y='21' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/></g><g fill='%238a5f22'><rect x='3' y='3' width='12' height='1'/><rect x='3' y='3' width='1' height='12'/></g></svg>");
    --bk-corner-r: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'><g transform='matrix(-1 0 0 1 24 0)'><g fill='%23c99a45'><rect x='1' y='1' width='14' height='2'/><rect x='1' y='1' width='2' height='14'/><rect x='5' y='5' width='6' height='1'/><rect x='5' y='5' width='1' height='6'/><rect x='17' y='1' width='2' height='2'/><rect x='21' y='1' width='2' height='2'/><rect x='1' y='17' width='2' height='2'/><rect x='1' y='21' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/></g><g fill='%238a5f22'><rect x='3' y='3' width='12' height='1'/><rect x='3' y='3' width='1' height='12'/></g></g></svg>");
    --bk-divider: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='9' shape-rendering='crispEdges'><g fill='%23b0812f'><rect x='0' y='4' width='62' height='1'/><rect x='98' y='4' width='62' height='1'/><rect x='64' y='3' width='3' height='3'/><rect x='93' y='3' width='3' height='3'/><rect x='79' y='0' width='2' height='1'/><rect x='78' y='1' width='4' height='1'/><rect x='77' y='2' width='6' height='1'/><rect x='76' y='3' width='8' height='1'/><rect x='75' y='4' width='10' height='1'/><rect x='76' y='5' width='8' height='1'/><rect x='77' y='6' width='6' height='1'/><rect x='78' y='7' width='4' height='1'/><rect x='79' y='8' width='2' height='1'/></g></svg>");
    /* 书页边：一层浅一层深，右下方向错开 */
    --bk-edges-r: 2px 2px 0 var(--bk-edge-b), 4px 3px 0 var(--bk-edge-a), 6px 4px 0 var(--bk-edge-b),
        8px 5px 0 var(--bk-edge-a), 10px 6px 0 var(--bk-edge-b), 12px 7px 0 #2a150b;
    --bk-edges-l: -2px 2px 0 var(--bk-edge-b), -4px 3px 0 var(--bk-edge-a), -6px 4px 0 var(--bk-edge-b),
        -8px 5px 0 var(--bk-edge-a), -10px 6px 0 var(--bk-edge-b), -12px 7px 0 #2a150b;
    /* 书脊处阴影：阶梯式，像素感 */
    --bk-gutter-l: linear-gradient(90deg, rgba(70, 40, 18, 0.42) 0 3px, rgba(70, 40, 18, 0.28) 3px 8px,
        rgba(70, 40, 18, 0.17) 8px 16px, rgba(70, 40, 18, 0.08) 16px 28px, transparent 28px);
    --bk-gutter-r: linear-gradient(270deg, rgba(70, 40, 18, 0.42) 0 3px, rgba(70, 40, 18, 0.28) 3px 8px,
        rgba(70, 40, 18, 0.17) 8px 16px, rgba(70, 40, 18, 0.08) 16px 28px, transparent 28px);
}

/* ================= 书桌：台灯光落在书上 ================= */
html.book-skin body:has(#app:not(.hidden)) {
    background:
        radial-gradient(ellipse 55% 45% at 50% 18%, rgba(242, 194, 122, 0.16), transparent 70%),
        radial-gradient(ellipse 120% 90% at 50% 40%, transparent 50%, rgba(0, 0, 0, 0.55)),
        repeating-linear-gradient(92deg, #1d140e 0 38px, #261a12 38px 41px, #1d140e 41px 90px),
        #1d140e !important;
}

/* ================= 书壳：皮面 + 烫金线 ================= */
html.book-skin body #app {
    max-width: 760px;
    margin: 26px auto 40px;
    padding: 18px 22px 26px 30px;
    background: var(--bk-leather-tex);
    border: 3px solid #1e0f07;
    box-shadow:
        inset 0 0 0 5px transparent,
        inset 0 0 0 7px rgba(211, 162, 76, 0.55),
        inset 0 0 0 8px rgba(0, 0, 0, 0.35),
        0 4px 0 #1e0f07, 0 24px 50px rgba(0, 0, 0, 0.6);
    position: relative;
}
/* 手机/窄屏：左侧书脊 */
html.book-skin body #app::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 18px;
    background:
        repeating-linear-gradient(180deg, transparent 0 86px, rgba(211, 162, 76, 0.5) 86px 88px, #1e0f07 88px 90px, transparent 90px 96px),
        linear-gradient(90deg, #2b150a 0 3px, var(--bk-leather-hi) 3px 7px, var(--bk-leather) 7px 14px, #2b150a 14px);
    display: block;
    opacity: 1;
    z-index: 0;
    pointer-events: none;
}
/* 红丝带书签 */
html.book-skin body #app::after {
    content: '';
    position: absolute;
    top: -8px;
    right: 64px;
    width: 20px;
    height: 118px;
    z-index: 30;
    pointer-events: none;
    background:
        linear-gradient(90deg, var(--bk-ribbon-dark) 0 3px, var(--bk-ribbon) 3px 14px, #c0463a 14px 16px, var(--bk-ribbon) 16px 17px, var(--bk-ribbon-dark) 17px);
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
    filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, 0.35));
}

/* 顶栏在皮面上：烫金书名 */
html.book-skin body #app .privacy-banner {
    color: rgba(243, 220, 170, 0.6);
    position: relative;
    z-index: 1;
}
html.book-skin body #app .app-bar { position: relative; z-index: 1; margin-bottom: 14px; }
html.book-skin body #app .wordmark {
    color: var(--bk-gold);
    text-shadow: 0 2px 0 #1e0f07, 0 -1px 0 rgba(255, 220, 150, 0.25);
}
html.book-skin body #app .wordmark-en { color: rgba(211, 162, 76, 0.7); text-shadow: none; }

/* ================= 书页 ================= */
html.book-skin body #app .main,
html.book-skin body #app .main:has(#view-adventure.active) {
    position: relative;
    z-index: 2;
    border: 0;
    background:
        var(--bk-corner) left 16px top 14px / 36px 36px no-repeat,
        var(--bk-corner-r) right 16px top 14px / 36px 36px no-repeat,
        var(--bk-gutter-l),
        var(--na-grain),
        radial-gradient(ellipse 90% 70% at 60% 40%, rgba(255, 250, 235, 0.5), transparent 75%),
        var(--bk-page);
    box-shadow: var(--bk-edges-r);
    padding-top: 30px;
    min-height: 70vh;
}
/* 书眉 */
html.book-skin body #app .main::before {
    content: '平行坐标　·　人物卡';
    display: block;
    margin: 0 64px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(138, 95, 34, 0.45);
    color: var(--bk-gold-dark);
    font: 12px/1.5 var(--na-px);
    letter-spacing: 4px;
    text-align: center;
}
html.book-skin body #app:has(#nav-adventure.active) .main::before { content: '平行坐标　·　第一章　今日冒险'; }
html.book-skin body #app:has(#nav-logs.active) .main::before { content: '平行坐标　·　后记　冒险日志'; }
html.book-skin body #app:has(#nav-notes.active) .main::before { content: '平行坐标　·　引子　记一笔'; }
/* 页脚花饰 */
html.book-skin body #app .main::after {
    content: '';
    display: block;
    height: 9px;
    margin: 6px auto 22px;
    border: 0;
    width: 160px;
    background: var(--bk-divider) center / 160px 9px no-repeat;
}
/* 稿纸红边线、档案角标都去掉：书页不需要 */
html.book-skin body #app .panel-ornament { display: none !important; }
html.book-skin body #app .panel { background: transparent !important; }

/* ================= 章节入口：书签带（窄屏） ================= */
html.book-skin body #app .tabs {
    position: relative;
    z-index: 3;
    gap: 10px;
    padding: 0 10px;
    margin-bottom: -6px;
    justify-content: flex-start;
}
html.book-skin body #app .tabs .tab {
    flex: 0 1 auto;
    min-height: 0;
    padding: 9px 14px 14px;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.18) 0 2px, transparent 2px calc(100% - 2px), rgba(0, 0, 0, 0.22) calc(100% - 2px)), #3d4a3a;
    color: #f0dfb4;
    clip-path: polygon(0 0, 100% 0, 100% 100%, 50% calc(100% - 7px), 0 100%);
    letter-spacing: 1px;
    transform: none;
    box-shadow: none;
}
html.book-skin body #app .tabs #nav-character { background-color: #6b4a2a; }
html.book-skin body #app .tabs #nav-adventure { background-color: #2f4466; }
html.book-skin body #app .tabs #nav-notes { background-color: #6e3a34; }
html.book-skin body #app .tabs #nav-logs { background-color: #4c5a3a; }
html.book-skin body #app .tabs .tab.active,
html.book-skin body #app .tabs #nav-adventure.active {
    background: linear-gradient(90deg, var(--bk-ribbon-dark) 0 2px, var(--bk-ribbon) 2px calc(100% - 2px), var(--bk-ribbon-dark) calc(100% - 2px));
    color: #fbecc8;
    padding-bottom: 22px;
    min-height: 0;
}
html.book-skin body #app .tabs .nav-chapter,
html.book-skin body #app .tabs .tab.active .nav-chapter { color: rgba(240, 223, 180, 0.75); }
html.book-skin body #app .tabs .tab::before { filter: drop-shadow(0 0 0 #f0dfb4); }
html.book-skin body #app #close-book-button { position: relative; }

/* ================= 开始菜单：书的首页（电脑上是一本摊开的书） ================= */
html.book-skin #intro-scene:has(#intro-menu:not(.hidden)) #intro-book,
html.book-skin #intro-scene:has(#intro-menu:not(.hidden)) .intro-hint { visibility: hidden; }
html.book-skin #intro-menu { background: radial-gradient(ellipse 60% 60% at 50% 55%, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.55)); }
html.book-skin #intro-menu .menu-window {
    display: grid;
    grid-template-columns: 230px 230px;
    grid-template-rows: repeat(4, auto);
    align-items: center;
    padding: 14px 18px 22px;
    min-width: 0;
    outline: 0;
    border: 3px solid #1e0f07;
    background: var(--bk-leather-tex);
    box-shadow: inset 0 0 0 5px transparent, inset 0 0 0 6px rgba(211, 162, 76, 0.5), 0 4px 0 #1e0f07, 0 26px 50px rgba(0, 0, 0, 0.7);
    position: relative;
}
html.book-skin #intro-menu .menu-window::before,
html.book-skin #intro-menu .menu-window::after {
    content: '';
    grid-row: 1 / 5;
    align-self: stretch;
    margin: 0;
    z-index: 0;
}
html.book-skin #intro-menu .menu-window::before {
    grid-column: 1;
    background:
        var(--bk-corner) left 10px top 10px / 30px 30px no-repeat,
        var(--bk-gutter-r), var(--na-grain), var(--bk-page);
    box-shadow: var(--bk-edges-l);
}
html.book-skin #intro-menu .menu-window::after {
    grid-column: 2;
    background:
        var(--bk-corner-r) right 10px top 10px / 30px 30px no-repeat,
        var(--bk-gutter-l), var(--na-grain), var(--bk-page);
    box-shadow: var(--bk-edges-r);
}
html.book-skin #intro-menu .menu-title,
html.book-skin #intro-menu .menu-sub { grid-column: 1; position: relative; z-index: 1; }
html.book-skin #intro-menu .menu-title {
    grid-row: 1 / 3;
    align-self: end;
    color: #3a1d10;
    text-shadow: none;
    font-size: 30px;
    padding-top: 70px;
}
html.book-skin #intro-menu .menu-sub {
    grid-row: 3 / 5;
    align-self: start;
    color: var(--bk-gold-dark);
    margin: 10px 0 0;
    padding-bottom: 70px;
    background: var(--bk-divider) center bottom 40px / 140px 8px no-repeat;
}
html.book-skin #intro-menu .menu-item {
    grid-column: 2;
    position: relative;
    z-index: 1;
    width: auto;
    margin: 0 26px 0 30px;
    color: #3a1d10;
    border-bottom: 1px dashed rgba(138, 95, 34, 0.45);
}
html.book-skin #intro-menu #menu-start { margin-top: 40px; }
html.book-skin #intro-menu #menu-exit { margin-bottom: 40px; border-bottom: 0; }
html.book-skin #intro-menu .menu-item::before { color: var(--bk-ribbon); }
html.book-skin #intro-menu .menu-item:hover,
html.book-skin #intro-menu .menu-item.cursor-on { background: rgba(158, 42, 32, 0.08); color: var(--bk-ribbon-dark); }
html.book-skin #intro-menu .menu-item-danger { color: #8a3324; }

@media (max-width: 600px) {
    html.book-skin body #app { margin: 10px 6px 24px; padding: 14px 12px 22px 24px; }
    html.book-skin body #app::after { right: 30px; height: 96px; }
    html.book-skin body #app .main::before { margin: 0 44px; font-size: 11px; letter-spacing: 2px; }
    html.book-skin body #app .tabs { gap: 6px; padding: 0 4px; }
    html.book-skin body #app .tabs .tab { padding: 8px 10px 13px; font-size: 14px; }
    html.book-skin body #app .tabs .tab.active { padding-bottom: 19px; }
    html.book-skin body #app .main { box-shadow: 2px 2px 0 var(--bk-edge-b), 3px 3px 0 var(--bk-edge-a), 5px 4px 0 var(--bk-edge-b), 6px 5px 0 var(--bk-edge-a), 8px 6px 0 #2a150b; }
    html.book-skin #intro-menu .menu-window { grid-template-columns: 1fr; width: min(300px, 86vw); }
    html.book-skin #intro-menu .menu-window::before { display: none; }
    html.book-skin #intro-menu .menu-window::after { grid-column: 1; grid-row: 1 / 7; background: var(--bk-corner) left 10px top 10px / 26px 26px no-repeat, var(--bk-corner-r) right 10px top 10px / 26px 26px no-repeat, var(--bk-gutter-l), var(--na-grain), var(--bk-page); }
    html.book-skin #intro-menu .menu-window { grid-template-rows: auto auto auto auto auto auto; }
    html.book-skin #intro-menu .menu-title { grid-row: 1; padding-top: 40px; align-self: auto; text-align: center; }
    html.book-skin #intro-menu .menu-sub { grid-row: 2; padding-bottom: 34px; background-position: center bottom 12px; text-align: center; }
    html.book-skin #intro-menu .menu-item { grid-column: 1; }
    html.book-skin #intro-menu #menu-start { margin-top: 0; }
    html.book-skin #intro-menu #menu-exit { margin-bottom: 26px; }
}

/* ================= 电脑：左右两页对开 ================= */
@media (min-width: 1080px) {
    html.book-skin body #app {
        display: grid;
        grid-template-columns: 300px minmax(0, 1fr);
        max-width: 1180px;
        padding: 20px 26px 30px;
        column-gap: 0;
    }
    /* 对开时书脊在中间：用左页右缘和右页左缘的阴影表现，皮面书脊条隐藏 */
    html.book-skin body #app::before {
        left: calc(26px + 300px - 5px);
        width: 10px;
        top: 12px;
        bottom: 18px;
        background: linear-gradient(90deg, #2b150a 0 2px, var(--bk-leather-hi) 2px 4px, #2b150a 4px 6px, var(--bk-leather) 6px 8px, #2b150a 8px);
        z-index: 4;
    }
    html.book-skin body #app::after { right: 120px; height: 140px; }
    html.book-skin body #app > .book-front {
        grid-column: 1;
        grid-row: 1;
        position: relative;
        z-index: 2;
        background:
            var(--bk-corner) left 14px top 14px / 36px 36px no-repeat,
            var(--bk-gutter-r),
            var(--na-grain),
            radial-gradient(ellipse 90% 70% at 40% 40%, rgba(255, 250, 235, 0.5), transparent 75%),
            var(--bk-page);
        box-shadow: var(--bk-edges-l);
    }
    html.book-skin body #app > .main { grid-column: 2; grid-row: 1; }
    html.book-skin body #app .book-front-inner {
        position: sticky;
        top: 20px;
        display: flex;
        flex-direction: column;
        padding: 64px 34px 30px 30px;
    }
    html.book-skin body #app .book-front .app-bar { display: contents; }
    html.book-skin body #app .book-front .wordmark {
        order: 1;
        text-align: center;
        color: #3a1d10;
        font-size: 30px;
        letter-spacing: 10px;
        text-indent: 10px;
        text-shadow: none;
    }
    html.book-skin body #app .book-front .wordmark-en { color: var(--bk-gold-dark); margin-top: 12px; text-align: center; text-indent: 3px; }
    html.book-skin body #app .book-front .wordmark::after {
        content: '';
        display: block;
        height: 9px;
        margin: 22px auto 0;
        background: var(--bk-divider) center / 160px 9px no-repeat;
    }
    html.book-skin body #app .book-front .tabs {
        order: 2;
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 44px 0 0;
    }
    html.book-skin body #app .book-front .tabs::before {
        content: '目　录';
        display: block;
        margin-bottom: 10px;
        color: var(--bk-gold-dark);
        font: 13px/1.5 var(--na-px);
        letter-spacing: 6px;
        text-align: center;
    }
    html.book-skin body #app .book-front .tabs .tab,
    html.book-skin body #app .book-front .tabs .tab.active,
    html.book-skin body #app .book-front .tabs #nav-adventure.active {
        display: flex;
        align-items: center;
        min-height: 46px;
        padding: 10px 6px 10px 14px;
        background: transparent;
        clip-path: none;
        color: #3a1d10;
        font-size: 15px;
        text-align: left;
        border-bottom: 1px dashed rgba(138, 95, 34, 0.45);
        position: relative;
    }
    html.book-skin body #app .book-front .tabs .tab::after {
        content: '';
        flex: 1;
        align-self: flex-end;
        margin: 0 0 6px 10px;
        border-bottom: 2px dotted rgba(94, 76, 59, 0.45);
    }
    html.book-skin body #app .book-front .tabs .tab .nav-chapter { color: var(--bk-gold-dark); margin-right: 4px; }
    html.book-skin body #app .book-front .tabs .tab.active {
        background: linear-gradient(90deg, rgba(158, 42, 32, 0.1), transparent 80%);
        font-weight: 700;
    }
    html.book-skin body #app .book-front .tabs .tab.active::before {
        box-shadow: -14px 0 0 -0px var(--bk-ribbon);
    }
    html.book-skin body #app .book-front .tabs .tab.active .nav-chapter { color: var(--bk-ribbon); }
    html.book-skin body #app .book-front #close-book-button { order: 3; align-self: center; margin: 40px 0 0; }
    html.book-skin body #app .book-front .privacy-banner {
        order: 4;
        margin: 60px 0 0;
        padding: 12px 0 0;
        border: 0;
        border-top: 1px solid rgba(138, 95, 34, 0.35);
        background: transparent;
        color: var(--na-ink-soft);
        font-size: 11px;
        opacity: 0.8;
        text-align: center;
    }
    html.book-skin body #app .book-front .privacy-dot { display: none; }
    html.book-skin body #app .main,
    html.book-skin body #app .main:has(#view-adventure.active) {
        background:
            var(--bk-corner-r) right 16px top 14px / 36px 36px no-repeat,
            var(--bk-gutter-l),
            var(--na-grain),
            radial-gradient(ellipse 90% 70% at 60% 40%, rgba(255, 250, 235, 0.5), transparent 75%),
            var(--bk-page);
    }
}

/* ---- 修正：菜单分栏、窄屏顶栏、电脑目录 ---- */
html.book-skin #intro-menu .menu-window { grid-template-columns: 250px 250px; }
html.book-skin #intro-menu .menu-item { margin: 0 20px 0 24px; white-space: nowrap; }
html.book-skin #intro-menu #menu-start { grid-row: 1; }
html.book-skin #intro-menu #menu-load { grid-row: 2; }
html.book-skin #intro-menu #menu-settings { grid-row: 3; }
html.book-skin #intro-menu #menu-exit { grid-row: 4; }
@media (max-width: 600px) {
    html.book-skin #intro-menu #menu-start { grid-row: 3; }
    html.book-skin #intro-menu #menu-load { grid-row: 4; }
    html.book-skin #intro-menu #menu-settings { grid-row: 5; }
    html.book-skin #intro-menu #menu-exit { grid-row: 6; }
}
@media (max-width: 1079px) {
    html.book-skin body #app > .book-front,
    html.book-skin body #app .book-front-inner { display: contents; }
    html.book-skin body #app .app-bar { order: 1; }
    html.book-skin body #app .tabs { order: 2; }
    html.book-skin body #app .main { order: 3; }
    html.book-skin body #app .privacy-banner { order: 99; }
}
@media (max-width: 600px) {
    html.book-skin body #app::after { display: none; }
}
@media (min-width: 1080px) {
    html.book-skin body #app .book-front .tabs { align-items: stretch; }
    html.book-skin body #app .book-front .tabs .tab,
    html.book-skin body #app .book-front .tabs #nav-character,
    html.book-skin body #app .book-front .tabs #nav-adventure,
    html.book-skin body #app .book-front .tabs #nav-notes,
    html.book-skin body #app .book-front .tabs #nav-logs {
        background: transparent;
        justify-content: flex-start;
        width: 100%;
        letter-spacing: 1px;
    }
    html.book-skin body #app .book-front .tabs .tab.active,
    html.book-skin body #app .book-front .tabs #nav-adventure.active,
    html.book-skin body #app .book-front .tabs #nav-character.active,
    html.book-skin body #app .book-front .tabs #nav-notes.active,
    html.book-skin body #app .book-front .tabs #nav-logs.active {
        background: linear-gradient(90deg, var(--bk-ribbon) 0 4px, rgba(158, 42, 32, 0.1) 4px, transparent 85%);
    }
}

/* ---- 标签类组件换成书本语言（不再用牛皮纸箭头标签） ---- */
/* 1. 小按钮：米色压印签条，棕边 + 烫金细线，方角无箭头 */
html.book-skin body #app .button-group button:not(.primary),
html.book-skin body #app .actions button,
html.book-skin body #app .actions .import-label,
html.book-skin body #app .event-actions button,
html.book-skin body :is(#branch-app, #branch-tree-content) .btn-sub,
html.book-skin body :is(#branch-app, #branch-tree-content) .journal-tab,
html.book-skin body .log-pagination button {
    clip-path: none;
    padding: 8px 16px;
    border: 2px solid #5a3a22;
    background: var(--na-grain), #ecdcb4;
    box-shadow: inset 0 0 0 2px #f4e8cb, inset 0 0 0 3px rgba(176, 129, 47, 0.75), 2px 2px 0 rgba(58, 29, 16, 0.45);
    color: #3a1d10;
}
html.book-skin body #app .button-group button:not(.primary):not(:disabled):hover,
html.book-skin body #app .actions button:not(:disabled):hover,
html.book-skin body #app .event-actions button:not(:disabled):hover,
html.book-skin body :is(#branch-app, #branch-tree-content) .btn-sub:not(:disabled):hover,
html.book-skin body :is(#branch-app, #branch-tree-content) .journal-tab:not(:disabled):hover {
    background: var(--na-grain), #f5e8c8;
}
html.book-skin body #app .button-group button:not(.primary):not(:disabled):active,
html.book-skin body #app .actions button:not(:disabled):active,
html.book-skin body :is(#branch-app, #branch-tree-content) .btn-sub:not(:disabled):active {
    transform: translate(2px, 2px);
    box-shadow: inset 0 0 0 2px #f4e8cb, inset 0 0 0 3px rgba(176, 129, 47, 0.75);
}
html.book-skin body #app .button-group button:not(.primary) { padding: 8px 16px; }
html.book-skin body #app .button-group button:not(.primary).active,
html.book-skin body #app .button-group button:not(.primary).active:not(:disabled):hover,
html.book-skin body :is(#branch-app, #branch-tree-content) .journal-tab.active,
html.book-skin body :is(#branch-app, #branch-tree-content) .journal-tab.active:not(:disabled):hover {
    background: var(--na-grain), var(--bk-ribbon);
    border-color: var(--bk-ribbon-dark);
    color: #fbecc8;
    box-shadow: inset 0 0 0 2px var(--bk-ribbon), inset 0 0 0 3px rgba(240, 200, 120, 0.6), 2px 2px 0 rgba(58, 29, 16, 0.45);
}

/* 2. 合上书：小块皮面，烫金字 */
html.book-skin body #app #close-book-button {
    clip-path: none;
    padding: 8px 16px;
    border: 2px solid #1e0f07;
    background: var(--na-grain), linear-gradient(180deg, var(--bk-leather-hi), var(--bk-leather) 60%, var(--bk-leather-2));
    box-shadow: inset 0 0 0 2px var(--bk-leather), inset 0 0 0 3px rgba(211, 162, 76, 0.7), 2px 2px 0 rgba(0, 0, 0, 0.4);
    color: var(--bk-gold);
}
html.book-skin body #app #close-book-button:not(:disabled):hover {
    background: var(--na-grain), linear-gradient(180deg, #82482a, var(--bk-leather-hi) 60%, var(--bk-leather));
}

/* 3. 页眉小标记（映界 / 今日坐标 / 人物卡）：不要标签，改成红字 + 烫金短线 */
html.book-skin body #app .page-mark,
html.book-skin body #app #view-adventure .page-mark {
    display: flex;
    align-items: center;
    gap: 10px;
    width: auto;
    padding: 0;
    background: none;
    box-shadow: none;
    clip-path: none;
    color: var(--bk-ribbon-dark);
    letter-spacing: 4px;
}
html.book-skin body #app .page-mark::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--bk-gold);
    transform: rotate(45deg);
    flex: none;
}
html.book-skin body #app .page-mark::after {
    content: '';
    width: 48px;
    height: 0;
    border-top: 1px solid var(--bk-gold);
    flex: none;
}

/* 4. 窄屏章节入口：书页上的索引标签 */
@media (max-width: 1079px) {
    html.book-skin body #app .tabs { gap: 4px; padding: 0 8px; margin-bottom: -2px; align-items: flex-end; }
    html.book-skin body #app .tabs .tab,
    html.book-skin body #app .tabs #nav-character,
    html.book-skin body #app .tabs #nav-adventure,
    html.book-skin body #app .tabs #nav-notes,
    html.book-skin body #app .tabs #nav-logs {
        flex: 1 1 0;
        padding: 10px 6px 8px;
        border: 2px solid #2a150b;
        border-bottom: 0;
        background: var(--na-grain), #d6be8c;
        color: #5e4c3b;
        clip-path: polygon(0 4px, 4px 4px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 4px, 100% 4px, 100% 100%, 0 100%);
        box-shadow: inset 0 -3px 0 rgba(58, 29, 16, 0.18);
    }
    html.book-skin body #app .tabs .tab.active,
    html.book-skin body #app .tabs #nav-character.active,
    html.book-skin body #app .tabs #nav-adventure.active,
    html.book-skin body #app .tabs #nav-notes.active,
    html.book-skin body #app .tabs #nav-logs.active {
        padding: 13px 6px 10px;
        background: var(--na-grain), var(--bk-page);
        color: #3a1d10;
        font-weight: 700;
        box-shadow: inset 0 3px 0 var(--bk-ribbon);
    }
    html.book-skin body #app .tabs .nav-chapter,
    html.book-skin body #app .tabs .tab.active .nav-chapter { color: var(--bk-gold-dark); }
}

/* ---- 细节与厚度：像素式高光/暗边、皮纹、三色烫金、纸面老化 ---- */
:root {
    /* 三色烫金角花：高光 / 金 / 暗金 */
    --bk-corner: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'><g fill='%237a4f18'><rect x='2' y='3' width='14' height='1'/><rect x='3' y='2' width='1' height='14'/><rect x='6' y='7' width='6' height='1'/><rect x='7' y='6' width='1' height='6'/><rect x='18' y='3' width='2' height='1'/><rect x='22' y='3' width='1' height='1'/><rect x='3' y='18' width='1' height='2'/><rect x='3' y='22' width='1' height='1'/><rect x='9' y='10' width='2' height='1'/></g><g fill='%23c99a45'><rect x='1' y='1' width='14' height='2'/><rect x='1' y='1' width='2' height='14'/><rect x='5' y='5' width='6' height='2'/><rect x='5' y='5' width='2' height='6'/><rect x='17' y='1' width='2' height='2'/><rect x='21' y='1' width='2' height='2'/><rect x='1' y='17' width='2' height='2'/><rect x='1' y='21' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/></g><g fill='%23f3d68e'><rect x='1' y='1' width='13' height='1'/><rect x='1' y='1' width='1' height='13'/><rect x='5' y='5' width='5' height='1'/><rect x='5' y='5' width='1' height='5'/><rect x='17' y='1' width='1' height='1'/><rect x='21' y='1' width='1' height='1'/><rect x='8' y='8' width='1' height='1'/></g></svg>");
    --bk-corner-r: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' shape-rendering='crispEdges'><g transform='matrix(-1 0 0 1 24 0)'><g fill='%237a4f18'><rect x='2' y='3' width='14' height='1'/><rect x='3' y='2' width='1' height='14'/><rect x='6' y='7' width='6' height='1'/><rect x='7' y='6' width='1' height='6'/><rect x='18' y='3' width='2' height='1'/><rect x='22' y='3' width='1' height='1'/><rect x='3' y='18' width='1' height='2'/><rect x='3' y='22' width='1' height='1'/><rect x='9' y='10' width='2' height='1'/></g><g fill='%23c99a45'><rect x='1' y='1' width='14' height='2'/><rect x='1' y='1' width='2' height='14'/><rect x='5' y='5' width='6' height='2'/><rect x='5' y='5' width='2' height='6'/><rect x='17' y='1' width='2' height='2'/><rect x='21' y='1' width='2' height='2'/><rect x='1' y='17' width='2' height='2'/><rect x='1' y='21' width='2' height='2'/><rect x='8' y='8' width='2' height='2'/></g><g fill='%23f3d68e'><rect x='1' y='1' width='13' height='1'/><rect x='1' y='1' width='1' height='13'/><rect x='5' y='5' width='5' height='1'/><rect x='5' y='5' width='1' height='5'/><rect x='17' y='1' width='1' height='1'/><rect x='21' y='1' width='1' height='1'/><rect x='8' y='8' width='1' height='1'/></g></g></svg>");
    /* 皮面：大块斑驳 + 细毛孔 */
    --bk-mottle: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='l'><feTurbulence type='fractalNoise' baseFrequency='.035' numOctaves='3' seed='5' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .08  0 0 0 0 .03  0 0 0 0 .01  0 0 0 1.4 -.45'/></filter><rect width='100%25' height='100%25' filter='url(%23l)'/></svg>");
    --bk-pores: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='90' height='90'><filter id='p'><feTurbulence type='fractalNoise' baseFrequency='1.6' numOctaves='1' seed='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .95  0 0 0 0 .7  0 0 0 0 .45  0 0 0 6 -4.9'/></filter><rect width='100%25' height='100%25' filter='url(%23p)'/></svg>");
    /* 纸面：淡淡的黄斑 */
    --bk-foxing: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.018' numOctaves='3' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .38  0 0 0 0 .16  0 0 0 2.2 -1.25'/></filter><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>");
    --bk-leather-tex:
        var(--bk-pores),
        var(--bk-mottle),
        var(--na-grain),
        radial-gradient(ellipse 60% 50% at 30% 20%, rgba(255, 190, 120, 0.12), transparent 70%),
        radial-gradient(ellipse 120% 100% at 50% 50%, transparent 55%, rgba(0, 0, 0, 0.4)),
        var(--bk-leather);
    --bk-stitch-h: repeating-linear-gradient(90deg, rgba(222, 176, 92, 0.75) 0 6px, transparent 6px 10px);
    --bk-stitch-v: repeating-linear-gradient(180deg, rgba(222, 176, 92, 0.75) 0 6px, transparent 6px 10px);
    --bk-page-tex:
        var(--bk-foxing),
        var(--na-fiber),
        var(--na-grain),
        radial-gradient(ellipse 90% 70% at 55% 40%, rgba(255, 250, 235, 0.55), transparent 75%),
        radial-gradient(ellipse 110% 100% at 50% 45%, transparent 60%, rgba(150, 105, 50, 0.22)),
        var(--bk-page);
}
/* 皮面书壳：四角烫金 + 一圈金色缝线 + 立体边 */
html.book-skin body #app {
    background:
        var(--bk-corner) left 12px top 12px / 40px 40px no-repeat,
        var(--bk-corner-r) right 12px top 12px / 40px 40px no-repeat,
        var(--bk-stitch-h) left 14px top 8px / calc(100% - 28px) 1px no-repeat,
        var(--bk-stitch-h) left 14px bottom 8px / calc(100% - 28px) 1px no-repeat,
        var(--bk-stitch-v) right 8px top 14px / 1px calc(100% - 28px) no-repeat,
        var(--bk-leather-tex);
    box-shadow:
        inset 2px 2px 0 rgba(255, 196, 140, 0.18),
        inset -2px -2px 0 rgba(0, 0, 0, 0.45),
        0 4px 0 #1e0f07, 0 7px 0 #120802, 0 26px 50px rgba(0, 0, 0, 0.6);
}
/* 书页：纸面老化 + 外缘压暗 */
html.book-skin body #app .main,
html.book-skin body #app .main:has(#view-adventure.active) {
    background:
        var(--bk-corner) left 16px top 14px / 40px 40px no-repeat,
        var(--bk-corner-r) right 16px top 14px / 40px 40px no-repeat,
        var(--bk-gutter-l),
        var(--bk-page-tex);
    box-shadow:
        inset -2px 0 0 rgba(140, 95, 45, 0.25), inset 0 -2px 0 rgba(140, 95, 45, 0.25), inset 0 2px 0 rgba(255, 252, 240, 0.7),
        var(--bk-edges-r);
}
/* 红丝带：织纹 + 折光 */
html.book-skin body #app::after {
    background:
        repeating-linear-gradient(0deg, rgba(0, 0, 0, 0.12) 0 1px, transparent 1px 3px),
        linear-gradient(90deg, var(--bk-ribbon-dark) 0 3px, var(--bk-ribbon) 3px 8px, #d0574a 8px 10px, var(--bk-ribbon) 10px 16px, var(--bk-ribbon-dark) 16px);
}
/* 小按钮：像素式立体（左上亮、右下暗、底下有厚度） */
html.book-skin body #app .button-group button:not(.primary),
html.book-skin body #app .actions button,
html.book-skin body #app .actions .import-label,
html.book-skin body #app .event-actions button,
html.book-skin body :is(#branch-app, #branch-tree-content) .btn-sub,
html.book-skin body :is(#branch-app, #branch-tree-content) .journal-tab,
html.book-skin body .log-pagination button {
    background: var(--na-fiber), var(--na-grain), linear-gradient(180deg, #f3e6c2, #e3cf9f);
    box-shadow:
        inset 2px 2px 0 #fff6dc, inset -2px -2px 0 #c2a46c,
        inset 0 0 0 4px #ead8ad, inset 0 0 0 5px rgba(176, 129, 47, 0.85),
        0 3px 0 #5a3a22, 2px 5px 0 rgba(30, 15, 7, 0.3);
    margin-bottom: 3px;
}
html.book-skin body #app .button-group button:not(.primary):not(:disabled):active,
html.book-skin body #app .actions button:not(:disabled):active,
html.book-skin body :is(#branch-app, #branch-tree-content) .btn-sub:not(:disabled):active {
    transform: translateY(3px);
    box-shadow: inset 2px 2px 0 #c2a46c, inset 0 0 0 4px #ead8ad, inset 0 0 0 5px rgba(176, 129, 47, 0.85);
}
html.book-skin body #app .button-group button:not(.primary).active,
html.book-skin body #app .button-group button:not(.primary).active:not(:disabled):hover,
html.book-skin body :is(#branch-app, #branch-tree-content) .journal-tab.active {
    background: var(--na-grain), linear-gradient(180deg, #b8402f, var(--bk-ribbon));
    box-shadow:
        inset 2px 2px 0 rgba(255, 200, 170, 0.45), inset -2px -2px 0 var(--bk-ribbon-dark),
        inset 0 0 0 4px var(--bk-ribbon), inset 0 0 0 5px rgba(240, 200, 120, 0.7),
        0 3px 0 #4a120c, 2px 5px 0 rgba(30, 15, 7, 0.3);
}
/* 合上书：皮面 + 烫金 + 厚度 */
html.book-skin body #app #close-book-button {
    background: var(--bk-pores), var(--na-grain), linear-gradient(180deg, #7e4626, var(--bk-leather) 55%, var(--bk-leather-2));
    box-shadow:
        inset 2px 2px 0 rgba(255, 196, 140, 0.3), inset -2px -2px 0 rgba(0, 0, 0, 0.4),
        inset 0 0 0 4px var(--bk-leather), inset 0 0 0 5px rgba(222, 176, 92, 0.85),
        0 3px 0 #120802, 2px 5px 0 rgba(0, 0, 0, 0.3);
    text-shadow: 0 1px 0 #1e0f07;
    margin-bottom: 3px;
}
/* 页眉小标记：小方块也做成三色烫金 */
html.book-skin body #app .page-mark::before {
    width: 7px;
    height: 7px;
    background: linear-gradient(135deg, #f3d68e 0 35%, #c99a45 35% 70%, #7a4f18 70%);
}
html.book-skin body #app .page-mark::after {
    height: 1px;
    border-top: 1px solid #c99a45;
    box-shadow: 0 1px 0 rgba(255, 246, 220, 0.8);
}

@media (min-width: 1080px) {
    /* 目录：四列对齐（图标 / 章 / 篇名 / 引线） */
    html.book-skin body #app .book-front .tabs .tab,
    html.book-skin body #app .book-front .tabs #nav-character,
    html.book-skin body #app .book-front .tabs #nav-adventure,
    html.book-skin body #app .book-front .tabs #nav-notes,
    html.book-skin body #app .book-front .tabs #nav-logs {
        display: grid;
        grid-template-columns: 16px 5.2em auto 1fr;
        column-gap: 8px;
        align-items: center;
        justify-items: start;
    }
    html.book-skin body #app .book-front .tabs .tab::before { margin: 0; }
    html.book-skin body #app .book-front .tabs .tab .nav-chapter { margin: 0; white-space: nowrap; }
    html.book-skin body #app .book-front .tabs .tab::after { width: 100%; margin: 0 0 4px; align-self: end; }
    /* 两页同样老化 */
    html.book-skin body #app > .book-front {
        background:
            var(--bk-corner) left 14px top 14px / 40px 40px no-repeat,
            var(--bk-gutter-r),
            var(--bk-page-tex);
        box-shadow:
            inset 2px 0 0 rgba(140, 95, 45, 0.25), inset 0 -2px 0 rgba(140, 95, 45, 0.25), inset 0 2px 0 rgba(255, 252, 240, 0.7),
            var(--bk-edges-l);
    }
    html.book-skin body #app .main,
    html.book-skin body #app .main:has(#view-adventure.active) {
        background:
            var(--bk-corner-r) right 16px top 14px / 40px 40px no-repeat,
            var(--bk-gutter-l),
            var(--bk-page-tex);
    }
    /* 书脊：中间一道金线 */
    html.book-skin body #app::before {
        background: linear-gradient(90deg, #1e0f07 0 1px, #2b150a 1px 2px, var(--bk-leather-hi) 2px 4px, #c99a45 4px 5px, var(--bk-leather) 5px 7px, #2b150a 7px 9px, #1e0f07 9px);
    }
}

@media (max-width: 1079px) {
    /* 窄屏索引标签：立体 */
    html.book-skin body #app .tabs .tab,
    html.book-skin body #app .tabs #nav-character,
    html.book-skin body #app .tabs #nav-adventure,
    html.book-skin body #app .tabs #nav-notes,
    html.book-skin body #app .tabs #nav-logs {
        background: var(--na-fiber), var(--na-grain), linear-gradient(180deg, #e2cc98, #cdb27a);
        box-shadow: inset 2px 2px 0 rgba(255, 246, 220, 0.75), inset -2px 0 0 rgba(120, 80, 40, 0.35), inset 0 -4px 0 rgba(58, 29, 16, 0.22);
    }
    html.book-skin body #app .tabs .tab.active,
    html.book-skin body #app .tabs #nav-character.active,
    html.book-skin body #app .tabs #nav-adventure.active,
    html.book-skin body #app .tabs #nav-notes.active,
    html.book-skin body #app .tabs #nav-logs.active {
        background: var(--na-fiber), var(--na-grain), var(--bk-page);
        box-shadow: inset 0 3px 0 var(--bk-ribbon), inset 0 5px 0 rgba(255, 200, 170, 0.5), inset 2px 0 0 rgba(255, 252, 240, 0.8), inset -2px 0 0 rgba(140, 95, 45, 0.3);
    }
    /* 书脊：竹节金箍 */
    html.book-skin body #app::before {
        background:
            repeating-linear-gradient(180deg, transparent 0 86px, #f3d68e 86px 87px, #c99a45 87px 88px, #1e0f07 88px 90px, transparent 90px 96px),
            var(--bk-pores),
            linear-gradient(90deg, #1e0f07 0 2px, #2b150a 2px 3px, #8a4e2c 3px 5px, var(--bk-leather-hi) 5px 8px, var(--bk-leather) 8px 13px, #2b150a 13px 16px, #1e0f07 16px);
    }
}

/* ---- 纸面黄斑减淡；窄屏书壳不放角花 ---- */
:root {
    --bk-foxing: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.018' numOctaves='3' seed='9' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .55  0 0 0 0 .38  0 0 0 0 .16  0 0 0 1.2 -.76'/></filter><rect width='100%25' height='100%25' filter='url(%23f)'/></svg>");
    --bk-page-tex:
        var(--bk-foxing),
        var(--na-grain),
        radial-gradient(ellipse 90% 70% at 55% 40%, rgba(255, 250, 235, 0.55), transparent 75%),
        radial-gradient(ellipse 110% 100% at 50% 45%, transparent 60%, rgba(150, 105, 50, 0.2)),
        var(--bk-page);
}
@media (min-width: 1080px) {
    html.book-skin body #app .book-front .tabs .tab .nav-chapter { justify-self: end; }
}
@media (max-width: 1079px) {
    html.book-skin body #app {
        background:
            var(--bk-stitch-h) left 22px top 8px / calc(100% - 30px) 1px no-repeat,
            var(--bk-stitch-h) left 22px bottom 8px / calc(100% - 30px) 1px no-repeat,
            var(--bk-stitch-v) right 8px top 14px / 1px calc(100% - 28px) no-repeat,
            var(--bk-leather-tex);
    }
}

/* ---- 目录对齐：图标 / 章（定宽左齐）/ 篇名 / 引线（章名后不带「·」，见 index.html） ---- */
@media (min-width: 1080px) {
    html.book-skin body #app .book-front .tabs .tab,
    html.book-skin body #app .book-front .tabs #nav-character,
    html.book-skin body #app .book-front .tabs #nav-adventure,
    html.book-skin body #app .book-front .tabs #nav-notes,
    html.book-skin body #app .book-front .tabs #nav-logs { grid-template-columns: 16px 3.4em auto 1fr; column-gap: 12px; }
    html.book-skin body #app .book-front .tabs .tab .nav-chapter { justify-self: start; }
}
@media (min-width: 1080px) {
    html.book-skin body #app .book-front .tabs #nav-character.active,
    html.book-skin body #app .book-front .tabs #nav-adventure.active,
    html.book-skin body #app .book-front .tabs #nav-notes.active,
    html.book-skin body #app .book-front .tabs #nav-logs.active {
        display: grid;
        grid-template-columns: 16px 3.4em auto 1fr;
        column-gap: 12px;
        align-items: center;
        justify-items: start;
    }
}

/* 准备页：「去公司上工」独占一行，不被挤成竖排 */
html.book-skin body #app #behavior-options > #company-chain-entry { flex: 1 0 100%; width: 100%; grid-column: 1 / -1; }

/* 准备页：状态作用说明 */
html.book-skin body #app #status-effects {
    margin: 10px 0 0;
    color: var(--na-ink-soft);
    font-size: 14px;
    line-height: 1.6;
}

/* 窄屏（600–1079px）章节名仍显示时补回分隔点；手机上章节名本就隐藏 */
@media (max-width: 1079px) {
    html.book-skin body #app .tabs .nav-chapter::after { content: ' · '; }
}
