/* v2026.09.09.4 / 映界：深墨、亮纸与皮革明度层次。 */
:root {
    --ad-night: #17130f;
    --ad-leather: #302219;
    --ad-action: #82521e;
    --ad-mint: #e8d5a7;
    --ad-paper: #fff9eb;
    --ad-gold: #d8a84e;
    --ad-ink: #191610;
}
html:has(#app:not(.hidden)), html:has(#branch-app) { background: #17130f; }
body:has(#app:not(.hidden)), body:has(> #branch-app) {
    height: auto;
    min-height: 100vh;
    background: radial-gradient(ellipse at 50% 0, #463628 0, #17130f 65%, #110e0a 100%);
    background-attachment: scroll;
}
#app .main:has(#view-adventure.active), #branch-app {
    background-color: var(--ad-paper);
    border-color: #5c412a;
    border-top-color: #e4c58d;
    box-shadow: inset 0 3px #fffaf0, inset 0 -4px #d4c9af, 0 4px #aeaa96, 4px 8px #4a321f, 8px 12px #100c08;
}
html #app .tabs #nav-adventure.active {
    background: var(--ad-action);
    color: #fff5de;
    border-color: #b68741;
    box-shadow: inset 0 4px var(--ad-gold), inset 3px 0 #ba8d47, inset -3px 0 #583712;
}
#app #view-adventure .page-mark {
    background: #ead9b5;
    color: #50391f;
    box-shadow: inset 3px 0 #a97a32, inset 0 2px #fff4d4, 0 2px #bca373;
}
#app #view-adventure .panel-ornament { border-color: #b8873d; }
#app #view-adventure .prep-panel > h2 {
    color: var(--ad-leather);
    border-bottom: 3px solid #c8ad79;
    padding-bottom: 18px;
}
#app #view-adventure .scene-map {
    border: 4px solid var(--ad-leather);
    box-shadow: 0 3px #b99657, 3px 6px #d4bb8a;
}
#app #view-adventure .field-label, #app #view-adventure label { color: #3d2d1c; }
#app #view-adventure .field-hint { color: #66523b; }
#app #status-options button, #app #behavior-options button {
    border-color: #9a7b49;
    background: #f4e5c5;
    color: #312318;
    box-shadow: inset 2px 2px #fffbea, inset -2px -2px #c9ad79, 0 3px #6b4d2c;
}
#app #status-options button.active, #app #behavior-options button.active {
    background: var(--ad-action);
    border-color: #553817;
    color: #fff9e8;
    box-shadow: inset 2px 2px #d4ab65, inset -2px -2px #583717, 0 3px #38220e;
}
#app #generate-event-button {
    background: var(--ad-action);
    color: #fff9e8;
    border: 3px solid #543510;
    box-shadow: inset 3px 3px #d4a55b, inset -3px -3px #553714, 0 4px #39240e;
    min-height: 54px;
    letter-spacing: 3px;
}
#app #generate-event-button::after { content: ' →'; color: var(--ad-gold); }
:is(#branch-app, #branch-tree-content) { --ink-faint: #65513c; }
:is(#branch-app, #branch-tree-content) .game-meta {
    background: var(--ad-leather);
    color: #e4d1a8;
    border: 3px solid #1e150e;
    border-bottom: 0;
    box-shadow: inset 3px 3px #705032;
    padding: 16px 22px 0;
    margin: 0;
}
:is(#branch-app, #branch-tree-content) #b-nodetype {
    color: #f1d496;
    border-left: 2px solid #a88142;
    padding-left: 12px;
}
:is(#branch-app, #branch-tree-content) #b-title {
    position: relative;
    background: var(--ad-leather);
    color: #fff2d2;
    border: 3px solid #1e150e;
    border-top: 0;
    border-bottom: 4px solid var(--ad-gold);
    padding: 8px 22px 20px;
    margin: 0 0 30px;
    box-shadow: inset 3px 0 #705032, 3px 3px #baa374;
    text-shadow: 2px 2px #150d06;
}
:is(#branch-app, #branch-tree-content) #b-title::after {
    content: '';
    position: absolute;
    width: 8px;
    height: 8px;
    right: 20px;
    bottom: -6px;
    background: #f3d997;
    border: 2px solid #997c42;
}
:is(#branch-app, #branch-tree-content) #b-narrative { color: var(--ad-ink); }
:is(#branch-app, #branch-tree-content) #b-stats {
    background: #e8d8b7;
    border: 2px solid #ae905a;
    border-left: 5px solid #99733c;
    padding: 14px 16px;
    margin: 26px 0;
    color: #352619;
    box-shadow: inset 0 2px #fff5d7;
}
:is(#branch-app, #branch-tree-content) .energy-track-mini { background: #c2a675; border-color: #93713c; }
:is(#branch-app, #branch-tree-content) .energy-track-mini .energy-fill { background: #bc8530; }
:is(#branch-app, #branch-tree-content) #b-choices {
    border-top: 3px solid #b99453;
    padding-top: 20px;
}
:is(#branch-app, #branch-tree-content) .branch-choice {
    border: 2px solid #9d7d45;
    border-left: 5px solid #805021;
    background: #fff8e5;
    color: var(--ad-ink);
    box-shadow: inset 0 2px #fffdf5, 0 3px #b19a70;
}
:is(#branch-app, #branch-tree-content) .choice-key {
    background: #57381b;
    color: #fff5d9;
    border: 2px solid #31200f;
    box-shadow: inset 1px 1px #b99453, 2px 2px #cbb585;
    min-width: 26px;
    text-align: center;
}
:is(#branch-app, #branch-tree-content) .branch-choice:not(:disabled):hover {
    border-color: #87551d;
    background: #f5e1ae;
    box-shadow: inset 0 2px #fffce8, 0 3px #a28148;
}
:is(#branch-app, #branch-tree-content) .branch-choice:disabled {
    background: #ddd4c1;
    border-color: #b1a48b;
    border-left-color: #918067;
    box-shadow: none;
}
:is(#branch-app, #branch-tree-content) .branch-choice:disabled .choice-key { background: #b9aa8e; color: #4b3d2b; }
:is(#branch-app, #branch-tree-content) .branch-head {
    background: var(--ad-leather);
    border: 3px solid #1e150e;
    border-bottom: 4px solid var(--ad-gold);
    padding: 24px;
    box-shadow: inset 3px 3px #705032, 3px 3px #baa374;
}
:is(#branch-app, #branch-tree-content) .branch-head h1 { color: #fff2d2; text-shadow: 2px 2px #150d06; }
:is(#branch-app, #branch-tree-content) .branch-head .sub { color: #e4d1a8; }
:is(#branch-app, #branch-tree-content) .btn-main {
    background: var(--ad-action);
    color: #fff9e8;
    border-color: #573814;
    box-shadow: inset 2px 2px #d4a55b, inset -2px -2px #553714, 0 3px #39240e;
}
#app #event-coordinate-map { background: #e8d8b7; border-color: #ae905a; }
#app #event-title { color: var(--ad-action); }
#app #event-choices .choice-btn { background: #fff8e5; border-color: #9d7d45; border-left-color: #805021; }
@media (min-width: 800px) {
    #app .prep-panel { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
    #app .prep-panel > .page-mark, #app .prep-panel > h2,
    #app .prep-panel > .field:has(#scene-map), #app #generate-event-button { grid-column: 1 / -1; }
    #app .prep-panel.hidden { display: none; }
}
@media (max-width: 600px) {
    :is(#branch-app, #branch-tree-content) .game-meta { padding: 12px 14px 0; }
    :is(#branch-app, #branch-tree-content) #b-title { padding: 8px 14px 16px; font-size: 23px; }
    :is(#branch-app, #branch-tree-content) #b-stats { padding: 12px 10px; }
    :is(#branch-app, #branch-tree-content) .branch-head { padding: 18px 14px; }
}

/* 深色皮革仅放在书脊和页眉，亮纸面保留给长文阅读。 */
#app .main:has(#view-adventure.active), #branch-app {
 background-image: linear-gradient(90deg, #6a4628 0 5px, #b99258 5px 8px, #e6d4ac 8px 12px, transparent 20px calc(100% - 10px), #d7c096 calc(100% - 5px));
 box-shadow: inset 0 3px #fffdf1, inset 0 -4px #cdb58a, 0 4px #f1e0b9, 0 7px #bca075, 4px 11px #51351f, 8px 15px #140e09;
}
#app .panel:has(#branch-tree-content) { padding-top: 30px; }
#app #branch-tree-content .b-para, :is(#branch-app, #branch-tree-content) .b-para,
#app .panel #event-narrative, :is(#branch-app, #branch-tree-content) .journal-card.story .journal-card-desc {
 color: #191610;
 font-family: 'Microsoft YaHei', 'PingFang SC', 'Noto Sans SC', sans-serif;
 font-size: 20px;
 font-weight: 500;
 line-height: 1.9;
 letter-spacing: 0;
 text-shadow: none;
 -webkit-font-smoothing: auto;
}
:is(#branch-app, #branch-tree-content) .b-para strong { color: #58340e; font-weight: 700; }
:is(#branch-app, #branch-tree-content) .game-meta,
:is(#branch-app, #branch-tree-content) .branch-head {
 background-image: repeating-linear-gradient(0deg, #ffffff04 0 2px, transparent 2px 5px);
}
:is(#branch-app, #branch-tree-content) #b-title { font-size: 29px; font-weight: 700; }
:is(#branch-app, #branch-tree-content) #b-stats {
 background: #3d2e20;
 border: 3px solid #6d5130;
 color: #fff1cf;
 box-shadow: inset 0 2px #a48049, 0 3px #c2aa7a;
}
:is(#branch-app, #branch-tree-content) #b-stats span { color: #efddba; }
:is(#branch-app, #branch-tree-content) #b-stats strong { color: #fff9eb; font-size: 19px; }
:is(#branch-app, #branch-tree-content) .branch-choice {
 border-width: 2px 2px 3px 5px;
 box-shadow: inset 0 3px #ffffff, inset 0 -3px #e7cf9d, 0 4px #81643b;
 margin-bottom: 16px;
 color: #23190e;
 font-size: 18px;
}
:is(#branch-app, #branch-tree-content) .choice-meta { color: #675037; }
:is(#branch-app, #branch-tree-content) .choice-meta .cost { color: #883b25; }
:is(#branch-app, #branch-tree-content) .choice-meta .restore { color: #355a32; }
:is(#branch-app, #branch-tree-content) .branch-choice:not(:disabled):active {
 box-shadow: inset 0 2px #d3b47d, 0 1px #81643b;
}
#app #status-options button.active, #app #behavior-options button.active { opacity: 1; }
@media(max-width:600px) {
 :is(#branch-app, #branch-tree-content) #b-title { font-size: 25px; }
}
