/* Approved C / 青铜军略. Shared component tokens and adapters for existing pages. */
:root{--sg-bg:#08191e;--sg-panel:#10262ceF;--sg-raised:#19383d;--sg-edge:#9a815044;--sg-gold:#dec492;--sg-text:#e0dfce;--sg-muted:#99aea8;--sg-jade:#8ed2b5;--sg-action:#a16d2b;--sg-art:url('assets/ui/reforged/strategy-scenery.png');--paper:var(--sg-text);--quiet:var(--sg-muted);--accent:var(--sg-gold);--edge:var(--sg-edge);--text:var(--sg-text);--muted:var(--sg-muted);--gold:var(--sg-gold);--line:var(--sg-edge)}
/* Component: one quiet surface, fine dividers, no nested ornamental borders. */
body{background:var(--sg-bg);color:var(--sg-text)}
.app{background:linear-gradient(#08191e55,#08191ebb),var(--sg-art) center/cover fixed}
:is(dialog,.new-game,.classic-management,.classic-general-dialog,.manual-battle-dialog){color:var(--sg-text);border:1px solid #a58b58!important;border-image:none!important;border-radius:2px!important;background:linear-gradient(#0b222bea,#0b222bf5),var(--sg-art) center/cover!important;box-shadow:0 24px 100px #000a;padding:24px;max-width:calc(100vw - 24px);max-height:calc(100dvh - 24px)}
dialog::backdrop{background:#020c12b8;backdrop-filter:blur(5px)}
:is(.sg-panel,.original-frame,.policy-heading,.policy-task-choice,.policy-cities,.policy-roster,.policy-city-info,.policy-commands,.policy-delegation,.policy-person-info,.policy-ending,.cm-top,.cm-header,.cm-strip,.cm-main,.cm-footer,.cg-toolbar,.cg-panel,.battle-commands,.battle-skills){border-image:none!important;border-radius:0!important;box-shadow:none!important;border:0;background:transparent;color:var(--sg-text)}
:is(h1,h2,h3,.brand strong,.sg-panel-heading){color:var(--sg-gold);font-family:KaiTi,STKaiti,serif}
/* Component: action / secondary / selected / disabled / keyboard focus. */
button,.classic-management button,.policy-commands button,.cg-toolbar button{border:1px solid #a18a5555;border-image:none;background:linear-gradient(#1d3941c9,#0e252dc9);border-radius:2px;box-shadow:none;color:var(--sg-text);min-height:40px;padding:9px 16px;font:14px/1.5 "Microsoft YaHei",sans-serif;transition:background .15s,border-color .15s}
button:hover:not(:disabled){background:#28504e;border-color:var(--sg-jade);color:#fff4d9}
button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--sg-jade);outline-offset:3px}
button:disabled{opacity:.4;cursor:not-allowed}
:is(.sg-primary,#world-play,#manual-battle,.original-end-button,.policy-commands .policy-order,.action-grid .primary,.battle-command-primary,.battle-body>button){background:linear-gradient(115deg,#a27435,#755021)!important;color:#fff0ce!important;border:1px solid #d6ac69!important;border-image:none!important;box-shadow:inset 0 0 0 3px #50391f66!important;font-weight:600;min-height:44px}
:is(button[aria-pressed=true],button[aria-selected=true],.tabs button.active,.list-button.selected,.cm-selected){background:linear-gradient(100deg,#27574eaa,#183d3a77)!important;border-color:#8ed2b5!important;color:#cbf0dd!important;box-shadow:inset 3px 0 #8ed2b5!important}
input,select,.classic-management select,.classic-management input[type=number]{background:#091d25;color:var(--sg-text);border:1px solid #839c8b66;min-width:0;max-width:100%}
:is(.phase-guide,.notice,.action-result,.cm-status,.battle-notice){background:#112c32b8;border:0;border-left:2px solid #78a894;box-shadow:none;color:#c7d5c7}
.phase-guide li[aria-current]{color:var(--sg-jade);border-color:var(--sg-jade)}
:is(.topbar,.campaign-controls,.inspector,.system-menu>div,.system-menu>summary){background:#0d242ceF!important;border:1px solid var(--sg-edge);border-image:none!important;box-shadow:0 6px 24px #0003;border-radius:2px}
.topbar{padding:12px 18px}.brand-seal{background:#183a3c;border-color:#a58b58;box-shadow:none}.brand strong{font-size:26px}
.stat-grid{background:transparent;border:0;gap:1px}.stat{background:#19353c88;border-bottom:1px solid var(--sg-edge)}.stat strong{color:var(--sg-jade)}
:is(.section-heading,.cg-section-title){border-color:var(--sg-edge);color:var(--sg-gold)}
.inspector-top,.inspector-foot,.detail,.cm-detail,.cm-roster th{background:transparent;color:var(--sg-text)}
.list-button{background:#142f36;border-color:#647f6e44}.map-options,.map-toolbar button,.campaign-journal{background:#102930ed!important;border-color:var(--sg-edge)}
/* Component: roster rows, shared portraits and headings. */
.sg-panel-heading{display:flex;align-items:baseline;gap:12px;justify-content:space-between;padding:0 0 16px;border-bottom:1px solid var(--sg-edge);margin-bottom:8px}
.sg-panel-heading h3{margin:0!important;padding:0!important;border:0!important;text-align:left;font-size:23px;color:var(--sg-gold)}
.sg-panel-heading small{font:12px/1.5 "Microsoft YaHei",sans-serif;color:var(--sg-muted)}
.sg-roster-row,.policy-scroll .sg-roster-row{display:flex;align-items:center;gap:16px;padding:14px 12px;min-height:76px;border:1px solid transparent;border-bottom-color:#8ca18c22;text-align:left;box-shadow:none;width:100%;background:transparent}
.sg-roster-art{width:58px;height:72px;flex:0 0 58px;overflow:hidden;border:1px solid #bda67566;background:#0a1b20}.sg-roster-art .portrait{width:100%;height:100%;object-fit:contain}
.sg-roster-copy{min-width:0}.sg-roster-copy strong{font:24px KaiTi,serif!important;color:var(--sg-text)!important}.sg-roster-copy small{display:block;color:var(--sg-muted)!important;font:12px/1.7 "Microsoft YaHei",sans-serif!important;margin-top:5px}
:is(.cm-face,.cg-face,.native-hud-portrait .portrait){border:1px solid #ae996355!important;border-image:none!important;background:#0b2229;box-sizing:border-box}
/* Domestic workbench: city | officers | portrait, task, result. */
body[data-phase=domestic]:not([data-domestic-map=true]) .app{padding:12px 22px;gap:0}
body[data-phase=domestic]:not([data-domestic-map=true]) .campaign-controls{display:none}
.domestic-view{margin:8px 0 0;border:1px solid var(--sg-edge);border-radius:2px;background:linear-gradient(110deg,#0d252df5,#0d252ddd);min-height:0}
.policy-heading{padding:24px 28px 12px;gap:18px}.policy-heading h2{font-size:34px;letter-spacing:3px}.policy-heading>span{font-size:12px;color:var(--sg-muted)}
.policy-task-choice{padding:8px 28px 16px;gap:10px;border-bottom:1px solid var(--sg-edge)}.policy-task-choice p{flex:0 0 auto;margin-right:10px;font-size:13px;color:var(--sg-muted)}.policy-task-choice button{min-width:140px;min-height:42px}
.policy-hall{background:none;display:grid;grid-template-columns:minmax(150px,.7fr) minmax(240px,1.15fr) minmax(300px,1fr);grid-template-rows:auto minmax(0,1fr);padding:16px 28px;gap:18px 26px;min-height:0;align-items:stretch}
.policy-task-guide{background:none;border:0;padding:0 0 6px;font-size:12px;color:var(--sg-muted);line-height:1.6}
.policy-cities,.policy-roster{padding:0;min-height:0;height:auto;border:0;border-right:1px solid var(--sg-edge);padding-right:22px;visibility:visible!important}
.policy-scroll{padding:0 3px;scrollbar-color:#527b70 #10252d}.policy-scroll button:hover{outline:0}.policy-scroll button[aria-pressed=true]{outline:0}
.policy-office{display:flex;align-items:stretch;justify-content:flex-start;gap:18px;overflow:auto;min-height:0;padding-right:6px}
.policy-office>div,.policy-office>section,.policy-office>details{width:100%;padding:0;background:none}
.policy-office .policy-person-info{display:grid;grid-template-columns:110px minmax(0,1fr);gap:18px;min-height:150px;padding:0 0 16px;border-bottom:1px solid var(--sg-edge)}
.policy-portrait{min-height:138px}.policy-portrait .portrait{object-fit:contain;object-position:center top;image-rendering:auto;border:1px solid #9a815044;background:linear-gradient(#23515377,#0c202755)}
.policy-person-summary{padding:0;align-self:start}.policy-person-summary h3{font-size:24px;line-height:1.6;margin:0 0 8px;color:var(--sg-gold)}.policy-person-summary small{font-size:12px;color:var(--sg-muted)}.policy-feedback{font-size:13px;color:var(--sg-jade);line-height:1.7}
.policy-office .policy-city-info{padding:0 0 14px;border-bottom:1px solid var(--sg-edge)}.policy-city-info h3{font-size:18px}.policy-city-info p{font-size:12px;color:var(--sg-muted)}
.policy-commands{gap:10px}.policy-office h3{letter-spacing:1px}.policy-commands h3{font-size:24px;margin-bottom:2px}.policy-commands .policy-order{grid-row:auto;min-height:50px;font-size:20px;font-family:KaiTi,serif}.policy-caption{font-size:12px;color:#a5bab2;line-height:1.8}
.policy-delegation{border-top:1px solid var(--sg-edge);padding-top:12px!important}.policy-delegation summary{font-size:13px;color:var(--sg-muted)}
.policy-ending{padding:14px 28px;border-top:1px solid var(--sg-edge);gap:12px;background:#0c222bdd;position:static}.policy-ending p{font-size:12px;color:var(--sg-muted)}
/* Shared dialog sections: management, recruitment, expedition, general sheet. */
.classic-management{padding:0!important}.classic-management .cm-top,.cg-toolbar{padding:20px 24px;border-bottom:1px solid var(--sg-edge);background:#102a32a8}
.cm-header,.cm-management .cm-header,.cm-recruitment .cm-header{background:linear-gradient(90deg,#12323cf5,#12323c80),var(--sg-art) center 35%/cover;padding:22px 26px}
.cm-strip,.cm-management .cm-strip,.cm-armies .cm-strip,.cm-recruitment .cm-strip{background:#102a32aa;border-bottom:1px solid var(--sg-edge);padding:12px 24px}
.cm-main,.cm-recruitment .cm-main{background:none;padding:20px 24px;gap:24px}.cm-roster{border-color:var(--sg-edge)}.cm-roster th{background:#102a32;color:var(--sg-gold)}.cm-roster td{border-color:#80988022}.cm-help{color:var(--sg-muted)}
.classic-management .cm-footer{padding:16px 24px;background:#0c232b;border-top:1px solid var(--sg-edge)}
.cg-board{background:none;gap:20px}.cg-panel{border-bottom:1px solid var(--sg-edge);padding:16px;background:#102b3266}.cg-toolbar button{background:#18343b}
/* Battle deck and conversations use the same surfaces. */
.native-selection-matchup,.native-combatant,.native-combatant.enemy,.classic-dialogue-panel,.prisoner-card{border:1px solid var(--sg-edge);border-image:none;background:#153139cc;border-radius:2px;box-shadow:none}
.native-combatant.enemy{background:#2d3031cc}.battle-commands,.battle-skills{background:#102a32aa;padding:12px;border-top:1px solid var(--sg-edge);border-bottom:1px solid var(--sg-edge)}
.battle-scene{border-color:var(--sg-edge)}.battle-toolbar{border-color:var(--sg-edge)}.battle-body>label,.battle-body>details{background:#132f37aa;border-color:var(--sg-edge)}
/* Start, scenario, ruler, saves, audio, outcome dialogs. */
#new-game[data-step]{background:linear-gradient(90deg,#081c29dd,#081c2955),var(--sg-art) center/cover!important;padding:40px;min-height:520px;width:min(1100px,96vw)}
#new-game[data-step] h1{font-size:42px;letter-spacing:5px}#new-game[data-step="0"] #new-game-content>button:nth-child(n),#new-game[data-step="1"] #new-game-content>button:nth-child(n){border:1px solid #9a815066;background:#102d37dd;color:var(--sg-gold);box-shadow:none;font:22px KaiTi,serif;min-height:54px}
#new-game .king-grid button{background:#15323cdd;border-color:var(--sg-edge)}
body[data-map-stage=true] .topbar{background:#0b242deb!important;padding:10px 16px}body[data-map-stage=true] .inspector{background:#0e2831f5!important}body[data-map-stage=true] #play-guide{bottom:104px}
@media(min-width:761px) and (min-height:650px){.policy-hall{flex:1;overflow:hidden}.policy-ending{flex-shrink:0}.domestic-view{overflow:hidden}}
@media(max-width:1050px){.policy-hall{grid-template-columns:minmax(125px,.65fr) minmax(180px,1fr) minmax(240px,1fr);gap:16px;padding:14px 18px}.policy-cities,.policy-roster{padding-right:12px}.policy-office .policy-person-info{grid-template-columns:72px minmax(0,1fr);gap:12px}.policy-portrait{min-height:96px}.policy-person-summary h3{font-size:20px}.sg-roster-art{width:44px;height:56px;flex-basis:44px}.policy-scroll .sg-roster-row{gap:10px;padding:10px 7px}.sg-roster-copy strong{font-size:21px!important}}
@media(max-width:760px){
 body[data-phase=domestic]:not([data-domestic-map=true]) .app{padding:6px 8px;height:auto;overflow:visible}
 .domestic-view{overflow:visible}.policy-heading{padding:18px 14px 8px;gap:8px}.policy-heading h2{font-size:26px}.policy-heading>span{font-size:11px}.policy-heading button{font-size:12px}
 .policy-task-choice{padding:8px 14px 12px}.policy-task-choice p{display:none}.policy-task-choice button{min-width:0;flex:1;font-size:13px}
 .policy-hall{grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);grid-template-rows:auto 300px auto;gap:16px 12px;padding:14px;overflow:visible;flex:none}
 .policy-cities,.policy-roster{height:300px;padding-right:4px}.policy-roster{border-right:0}.sg-panel-heading{display:block;padding-bottom:10px}.sg-panel-heading h3{font-size:19px}.sg-panel-heading small{font-size:10px}.policy-scroll .sg-roster-row{gap:7px;padding:8px 4px;min-height:70px}.sg-roster-art{width:32px;height:42px;flex-basis:32px}.sg-roster-copy strong{font-size:19px!important}.sg-roster-copy small{font-size:10px!important}
 .policy-office{grid-column:1/-1;overflow:visible;border-top:1px solid var(--sg-edge);padding-top:18px}.policy-office .policy-person-info{grid-template-columns:90px minmax(0,1fr)}.policy-portrait{min-height:115px}.policy-ending{padding:14px;flex-wrap:wrap}.policy-ending p{flex-basis:100%}.policy-ending button{font-size:13px;flex:1}
 dialog,.manual-battle-dialog{padding:12px;max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px)}
 .cm-main,.cm-recruitment .cm-main{padding:12px;gap:12px}.classic-management .cm-top,.cg-toolbar{padding:14px}.cm-header,.cm-management .cm-header,.cm-recruitment .cm-header{padding:14px}.cm-strip,.cm-management .cm-strip,.cm-armies .cm-strip,.cm-recruitment .cm-strip{padding:10px 14px}
 .classic-management .cm-footer{padding:12px}.cg-board{gap:8px}.cg-panel{padding:10px}.battle-commands,.battle-skills{padding:8px}.battle-commands button{font-size:12px}
 #new-game[data-step]{padding:22px;min-height:460px}#new-game[data-step] h1{font-size:28px}
 body[data-map-stage=true] .topbar{padding:8px}body[data-map-stage=true] #play-guide{bottom:116px}
}

.policy-cities .policy-city-info{flex-shrink:0;border-top:1px solid var(--sg-edge);padding:12px 4px 0;margin-top:8px;width:100%}.policy-cities .policy-city-info h3{display:none}.policy-cities .policy-city-info p{font-size:11px;line-height:1.7}.policy-office .policy-person-info{min-height:138px}.policy-task-guide{white-space:normal}

/* Shared speech overlays cover opening dialogue, victory and prisoner conversations. */
.battle-dialogue,.classic-speech{background:#102b34f5;border:1px solid #a58b58;border-image:none;border-radius:2px;color:var(--sg-text);box-shadow:0 12px 35px #0006}.battle-dialogue button{margin-top:12px}.prisoner-portrait{border:1px solid var(--sg-edge)}
