* { box-sizing: border-box }
:root { --paper:#f1f0e9; --ink:#26382f; --muted:#56645c; --line:#cbd0c5; --glass:#203334a6; --space:clamp(16px,3vw,48px); font-family:"DM Sans","Segoe UI","Microsoft YaHei UI",sans-serif; color:var(--ink) }
body { margin:0; background:#263e46 }
button,input { font:inherit } button { color:inherit; cursor:pointer; border:0; background:none }
[hidden] { display:none!important }
a:focus-visible,button:focus-visible,input:focus-visible,canvas:focus-visible { outline:2px solid #cfad74; outline-offset:3px }
svg:not(.symbols) { width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.55;stroke-linecap:round;stroke-linejoin:round;pointer-events:none }
.symbols { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%) }
.stage { position:relative; isolation:isolate; overflow:hidden; width:100%; height:100vh; height:100dvh; color:#f4f2e8; background:radial-gradient(ellipse at 38% 74%,#789198 0%,#536f78 32%,#344d58 62%,#1d303a 100%) }
.stage::before { content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(180deg,#0c1b201b,transparent 20%,transparent 81%,#0e22282e) }
.stage.expand-fallback,.stage:fullscreen { position:fixed;inset:0;z-index:4 }
#scene { width:100%;height:100%;display:block;touch-action:none;cursor:grab;outline-offset:-4px }
#scene.pointer-focus {outline:0}
.topbar,.dock { position:absolute;left:max(var(--space),env(safe-area-inset-left));right:max(var(--space),env(safe-area-inset-right));display:flex;align-items:center;justify-content:space-between;gap:10px;pointer-events:none }
.topbar { top:max(20px,env(safe-area-inset-top)) }
.brand {display:flex;align-items:center;gap:10px;text-shadow:0 1px 9px #1b303666}
.brand svg {stroke:none;width:31px;height:31px;color:#e1e6d8}
.brand span,.english {font:italic 34px/1 Baskerville,"Times New Roman",serif;letter-spacing:-1.8px}
.brand small {margin-left:6px;padding-left:14px;border-left:1px solid #d3dfce66;font-size:11px;letter-spacing:.16em}
nav,.tools {display:flex;align-items:center;gap:7px} nav,.tools>*,.dock>button {pointer-events:auto}
#exploreNav,#exploreActions {flex-direction:row-reverse}
#exploreActions {display:flex;align-items:center;gap:inherit}
#exploreToggle .close-mark,#exploreToggle[aria-expanded=true] .more-mark {display:none}
#exploreToggle[aria-expanded=true] .close-mark {display:inline}
#exploreToggle[aria-expanded=true] {color:#304039;background:#eff0e5}
@media(prefers-reduced-motion:no-preference){
 #exploreToggle[aria-expanded=true]+#exploreActions {animation:reveal-tools .24s ease-out both}
 @keyframes reveal-tools {from{opacity:0;transform:translateX(10px);clip-path:inset(-6px -6px -6px 100%)}to{opacity:1;transform:none;clip-path:inset(-6px)}}
}
@media(max-width:390px){.topbar:has(#exploreToggle[aria-expanded=true]) .brand span {display:none}}
.round,.action,#materials { display:inline-flex;align-items:center;justify-content:center;gap:8px;background:var(--glass);border:1px solid #d1e1db4a;backdrop-filter:blur(12px);color:#f2f3e9;transition:background .18s,transform .18s }
.round {width:42px;height:42px;border-radius:50%}.round:hover,.action:hover,#materials:hover {background:#293e40ed}
button:active {transform:translateY(1px)}
.dock { bottom:max(24px,env(safe-area-inset-bottom));align-items:flex-end }
#materials {padding:10px 13px 10px 10px;border-radius:12px;gap:12px;text-align:left}
#materials small,#materials b {display:block}
#materials small {font-size:10px;line-height:1.3;color:#d2ddd6;letter-spacing:.14em}
#materials b {font-size:13px;font-weight:540;line-height:1.6;font-variant-numeric:tabular-nums}
#materials svg {width:16px}
.chip {width:32px;height:34px;display:block;border-radius:6px;border:1px solid #c6cabe55;background:repeating-linear-gradient(118deg,transparent 0 1px,#ffffff0a 1px 2px),linear-gradient(135deg,#17191e,#515258 45%,#23252b 70%,#3a3d40)}

.action {min-height:42px;padding:0 14px;border-radius:24px;font-size:13px}#repair {color:#2c4039;background:#edefdf;border-color:#f7f8e8}
.grab-hint {position:absolute;display:flex;align-items:center;pointer-events:none;transform:translate(-9px,-50%);transition:opacity .35s}.grab-hint.gone {opacity:0}
.grab-hint span {width:18px;height:18px;border:1px solid #ffffffe0;border-radius:50%;box-shadow:inset 0 0 0 5px #28363c52;background:#f8f5e6}
.grab-hint i {width:22px;border-top:1px solid #eef3dfaa}.grab-hint b {font-size:12px;white-space:nowrap;font-weight:500;border-radius:16px;padding:6px 10px;background:#253736c9;color:white}
.stage-toast,#error {position:absolute;left:50%;bottom:96px;transform:translateX(-50%);background:#253936e6;color:white;padding:8px 14px;border-radius:8px;font-size:13px}.stage-toast{pointer-events:none;opacity:0;transition:opacity .15s}.stage-toast.show{opacity:1}
dialog {color:var(--ink);background:var(--paper);border:1px solid #ffffff88;border-radius:15px;padding:26px;width:min(380px,calc(100% - 28px));max-height:85dvh;overflow:auto;box-shadow:0 12px 50px #17292130}
dialog::backdrop {background:#152c3240}#materialPanel::backdrop {background:#14283116}
#materialPanel {position:fixed;inset:auto auto max(96px,env(safe-area-inset-bottom)) var(--space);margin:0;width:min(330px,calc(100% - 32px));max-height:calc(100dvh - 125px)}
.x {position:absolute;right:12px;top:12px;width:34px;height:34px;display:grid;place-items:center;border-radius:50%}.x:hover{background:#dde2d6}
.panel-title h1 {font-size:20px;margin:0 0 17px}.english{font-size:33px;color:#425b4d}
.group {border-top:1px solid var(--line);padding:15px 0 3px}.group h2{font-size:13px;margin:0 0 10px;font-weight:600}
.garments{display:flex;gap:3px;background:#e1e4da;border-radius:9px;padding:3px;margin:0 0 16px}.garments button{flex:1;min-height:32px;border-radius:6px;color:var(--muted);font-size:13px}.garments [aria-selected=true]{color:var(--ink);background:#fafaf4;box-shadow:0 1px 3px #26382f20;font-weight:600}
.swatches{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-bottom:10px}.swatch{position:relative;padding:0;text-align:left}.swatch canvas{object-fit:cover;width:100%;height:43px;display:block;border-radius:5px}
.swatch span{display:block;margin-top:5px;font-size:12px}.swatch i{display:none}.swatch[aria-pressed=true] canvas{outline:1px solid #496953;outline-offset:2px}.swatch[aria-pressed=true] i{display:grid;place-items:center;position:absolute;right:5px;top:21px;background:var(--paper);border-radius:50%;width:17px;height:17px}.swatch i svg{width:13px}
.settings label,.tension-title{display:flex;justify-content:space-between;align-items:center;font-size:12px}.settings input{width:100%;accent-color:#476552;margin:6px 0 13px;cursor:pointer}
output{font-variant-numeric:tabular-nums}.tension-title h2{margin:0}.meter{display:flex;gap:3px;margin:10px 0}.meter i{flex:1;height:5px;background:#d5d9ce}.meter .on{background:#5e7d62}.meter .hot{background:#af694c}
#condition{font-size:12px;color:var(--muted);margin:0}dialog dt{font-weight:600;font-size:14px;margin-top:13px}dialog dd{margin:4px 0;font-size:13px;line-height:1.65}dialog h2{font-size:19px}.credits{margin:14px 0 4px;font-size:12px;line-height:1.7;color:var(--muted)}.guide-views{display:flex;gap:8px;margin-top:8px}.guide-views button{border:1px solid var(--line);border-radius:5px;padding:4px 8px}.repair{width:100%;padding:11px;border-radius:6px;background:#344d40;color:white}
@media(max-width:640px){.topbar{top:max(13px,env(safe-area-inset-top))}.brand{gap:6px}.brand span{font-size:28px}.brand svg{width:23px}.brand small{display:none}.dock{bottom:max(16px,env(safe-area-inset-bottom))}.round{width:40px;height:40px}.tools{gap:5px}#materials{gap:7px;padding:6px 8px}.chip{width:24px;height:30px}.action{font-size:12px;padding:0 9px}.action svg{width:16px}#materialPanel{inset:auto 0 0;width:100%;max-width:none;border-radius:20px 20px 0 0;padding:23px 24px max(22px,env(safe-area-inset-bottom));max-height:min(74dvh,520px)}.grab-hint{transform:translate(calc(-100% + 9px),-50%);flex-direction:row-reverse}}
@media(max-width:420px){#unpin{position:absolute;right:0;bottom:52px}}
@media(max-height:480px){.topbar{top:8px}.dock{bottom:8px}#materialPanel{inset:auto 12px 12px auto;max-height:calc(100dvh - 24px)}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

#zoomPanel {position:absolute;right:max(var(--space),env(safe-area-inset-right));bottom:calc(max(24px,env(safe-area-inset-bottom)) + 58px);width:min(220px,calc(100% - 32px));padding:15px 17px 11px;border-radius:12px;background:var(--paper);color:var(--ink);box-shadow:0 7px 28px #17292138}
#zoomPanel div {display:flex;justify-content:space-between;align-items:center;font-size:13px}
#zoomValue {font-variant-numeric:tabular-nums;color:var(--muted)}
#magnification {width:100%;height:24px;accent-color:#476552;cursor:pointer;margin:4px 0}
#resetZoom {display:block;margin-left:auto;font-size:12px;padding:4px 0 4px 9px;color:#405e4b}
#zoom[aria-expanded=true] {background:#eff0e5;color:#304039}
@media(max-width:420px){.stage:has(#unpin:not([hidden])) #zoomPanel{bottom:118px}}

.immersive-face {display:inline-flex;align-items:center;justify-content:center}
.immersive-face span {display:none}
.immersive .brand,.immersive #exploreToggle,.immersive #exploreActions > :not(#immersiveToggle),.immersive .dock,.immersive .grab-hint,.immersive .stage-toast {display:none}
.immersive .topbar,.immersive .topbar nav,.immersive #exploreActions {display:contents}
.immersive #immersiveToggle {
 position:absolute;top:50%;right:env(safe-area-inset-right,0px);transform:translateY(-50%);
 --edge-hit:32px;width:var(--edge-hit);height:48px;overflow:hidden;pointer-events:auto;padding:0;border:0;border-radius:0;
 background:transparent;backdrop-filter:none;transition:width .18s ease;z-index:1
}
.immersive .immersive-face {
 position:absolute;left:calc(var(--edge-hit) - 16px);top:3px;bottom:3px;width:116px;justify-content:flex-start;gap:9px;
 background:#253c40e8;border:1px solid #d1e1db55;border-radius:18px 0 0 18px;color:var(--paper)
}
.immersive .immersive-face::before {content:"";width:3px;height:17px;margin-left:6px;background:#cad9d2;border-radius:3px}
.immersive .immersive-face span {display:inline;font-size:13px;white-space:nowrap}
.immersive #immersiveToggle:focus-visible {width:calc(var(--edge-hit) + 100px);outline-offset:-2px}
@media(hover:hover){.immersive #immersiveToggle:hover {width:calc(var(--edge-hit) + 100px)}}
@media(pointer:coarse){.immersive #immersiveToggle {--edge-hit:44px}}
@media(max-width:360px){.topbar nav {gap:3px}.brand span {font-size:25px}}
@media(prefers-reduced-motion:reduce){.immersive #immersiveToggle {transition:none}}

.inspect-options {border:0;border-top:1px solid var(--line);padding:8px 0 0;margin:10px 0 0;display:grid;grid-template-columns:1fr 1fr;gap:3px}
.inspect-options legend {font-size:12px;padding-right:8px}
.inspect-options label {display:flex;gap:4px;align-items:center;min-height:32px;font-size:12px}
.inspect-options input {accent-color:#476552}
#zoomPanel {max-height:calc(100dvh - 125px);overflow-y:auto}
@media(max-width:420px){#undoTear{position:absolute;right:0;bottom:52px}#unpin:not([hidden])~#undoTear{right:92px}}

#musicToggle[aria-pressed=true] {background:var(--paper);color:var(--ink)}

.stage:not(.immersive) > #immersiveToggle {display:none}
#zoomPanel .preferences {border-top:1px solid var(--line);margin-top:8px;padding-top:6px;display:grid;gap:3px}
.preferences button,.preferences #musicToggle {width:100%;height:36px;border:0;border-radius:6px;padding:0 6px;display:flex;align-items:center;justify-content:flex-start;gap:9px;background:transparent;color:var(--ink);font-size:13px}
.preferences #musicToggle::after {content:'关';margin-left:auto}.preferences #musicToggle[aria-pressed=true]::after {content:'开'}

.contact-tools{position:absolute;top:calc(max(var(--space),env(safe-area-inset-top)) + 58px);left:max(var(--space),env(safe-area-inset-left));display:flex;align-items:center;gap:6px;z-index:1}
.contact-modes,.sole-toggle{border:1px solid #d1e1db45;border-radius:12px;background:#21383eeb;color:#f1f3e9;box-shadow:0 3px 15px #152a301a;backdrop-filter:blur(8px)}
.contact-modes{display:flex;gap:2px;padding:3px}.contact-modes button,.sole-toggle{font:inherit;font-size:12px;font-weight:570;line-height:1;display:inline-flex;align-items:center;justify-content:center;gap:5px;cursor:pointer;white-space:nowrap}.contact-modes button{color:#e0e6df;padding:9px 10px;border:0;border-radius:8px;background:transparent}.contact-modes button[aria-pressed=true]{color:#253b3c;background:#e5e9dc}.contact-tools svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.65;stroke-linecap:round;stroke-linejoin:round}.sole-toggle{padding:12px 11px}.sole-toggle[aria-pressed=true]{background:#d4dfce;color:#243737}.contact-tools button:focus-visible{outline:2px solid #e7d39e;outline-offset:3px}.contact-tools button:hover{filter:brightness(1.10)}
.immersive .contact-tools{display:none}#scene[data-mode=press]{cursor:crosshair}#scene[data-mode=orbit],#scene[data-mode=pull]{cursor:grab}.material-behavior{font-size:12px;line-height:1.6;color:#51645a;margin:11px 0 8px}.show-skin{display:flex;gap:6px;align-items:center;font-size:12px;color:var(--ink);margin:10px 0 12px}.show-skin input{accent-color:#4b6b56}
.face-cover-hint{margin:0 0 10px;font-size:12px;line-height:1.55;color:#51645a}
.face-cover-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin-bottom:10px}
.face-upload,.face-clear{display:inline-flex;align-items:center;justify-content:center;min-height:34px;padding:0 12px;border-radius:7px;font:inherit;font-size:13px;cursor:pointer}
.face-upload{background:#365149;color:#fff}.face-upload:hover{background:#2c433b}
.face-clear{background:#e7e8de;border:1px solid #69796b44;color:var(--ink)}.face-clear:hover{background:#dde2d6}
.face-cover-preview{border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#e9ebe2;aspect-ratio:1;max-width:160px}
.face-cover-preview img{display:block;width:100%;height:100%;object-fit:cover}.preset-row{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 12px;border:0;border-top:1px solid var(--line);padding:8px 0 0}.preset-row legend{padding:0 5px 0 0;font-size:12px;color:#495951}.preset-row button{background:#e7e8de;border:1px solid #69796b44;color:var(--ink);font:inherit;font-size:12px;padding:6px 8px;border-radius:6px;cursor:pointer}.preset-row button[aria-pressed=true]{background:#365149;color:white}.guide-views{flex-wrap:wrap}.contact-tools[hidden]{display:none}
@media(max-width:650px){.contact-tools{top:max(65px,calc(env(safe-area-inset-top) + 48px));left:max(12px,env(safe-area-inset-left));gap:4px}.contact-modes{padding:2px;border-radius:10px}.contact-modes button{padding:9px 8px}.sole-toggle{padding:11px 9px;border-radius:10px}.stage:has(#materialPanel[open]) .contact-tools{visibility:hidden}}
@media(max-height:460px){.contact-tools{top:53px}.contact-modes button{padding:7px}.sole-toggle{padding:10px 8px}}
#materialPanel[open],#zoomPanel:not([hidden]){z-index:3}.stage:has(#materialPanel[open]) .contact-tools{visibility:hidden}

