/* Original Onyu design: ink-blue lacquer, warm hanji, brass, readable clinical panels. */
:root{--ink:#312b27;--muted:#786d5c;--paper:#f6ecd5;--line:#c9b589;--green:#345c59;--light:#e5e4c9;--gold:#a67d3d;--red:#a1443e;background:#192d30}
.topbar,html[data-input=touch] .topbar{background:linear-gradient(#263f44,#1b2e34);border-bottom:2px solid #927545;color:#f5e5bf;box-shadow:0 2px 8px #101c2460;z-index:3}.brand,.brand b{color:#f4e5bf}.seal{background:#8d4540;border-color:#d0ac6c}.level-pill{background:#344d50;color:#f4dfb6;border-color:#a38856}.topbar .icon-button{background:#294148;color:#f1dfba;border-color:#6f715a}.topbar .xp-track{background:#16282e}.topbar .xp-track i{background:#c99f55}.topbar .stat-count{color:#d8c69d}.tabs,html[data-input=touch] .tabs{background:#253b3d;border-bottom:1px solid #84724f;gap:2px;padding:2px 8px}.tabs button,html[data-input=touch] .tabs button{color:#d4c5a5;border:0;border-radius:3px;font-size:12px}.tabs button.selected{background:#d7bd83;color:#283b39;box-shadow:inset 0 -2px #9e7b49}.tabs button:hover:not(:disabled){background:#47605b;color:#fff0d3}.world-top,html[data-input=touch] .world-top{background:#293e3c;color:#ecdec0;border:0;height:36px;min-height:36px}.world-top .muted{color:#b3b79b}.world-top button{border-color:#757758;background:#3a5147;color:#f4e9c9;padding:5px 10px}.world-card{background:#273f39}.map-note{display:none}.controls{background:#233936;color:#ddd1ad}.controls kbd{background:#425249;border-color:#77765c;color:#f9edcb}.controls .text-button{color:#cfbd8f}.interaction{background:#1c3436ed;border:1px solid #d0ac64;color:#f8ebc9;box-shadow:0 3px 0 #192c28}.interaction kbd{background:#c4a063;color:#23312f}.sidebar,.journal-card{background:#f0e4c6;border-color:#9b7a49}.sidebar{box-shadow:-4px 0 16px #152b3155}.quest-item{border-color:#c3b084}.quest-item:hover{background:#e7d8b2}.quest-item canvas{border:1px solid #bca778;border-radius:50%}.mentor-card{background:#e5d7b5}.live-dot{background:#d3b96e}
.modal-layer{background:#11262b9c;backdrop-filter:blur(2px)}#modal,html[data-input=touch] #modal{border:2px solid #ac8a51;border-radius:10px;box-shadow:0 0 0 3px #263c40,0 18px 70px #081b2399;background:#f6ecd5}.modal-header{background:linear-gradient(110deg,#253c43,#3b514b);border-bottom:2px solid #b59358;color:#f8e8c5;padding:12px 20px}.modal-header .eyebrow{color:#bcbd9a}.modal-header .icon-button{background:#1e3338;color:#ebd7b2;border-color:#818166}.modal-header h2{font-family:serif;font-size:22px;letter-spacing:.3px}#modal-body{background-color:#f6ecd5;background-image:repeating-linear-gradient(0deg,transparent,transparent 3px,#b5a27a07 4px);padding:18px 22px}button.primary,a.primary{background:#345957;color:#fff1cd;border-color:#2c484a;border-bottom:3px solid #203c40;border-radius:5px}button.primary:hover:not(:disabled){background:#416b62}.fact-box,.chart{border:1px solid #cbb68a;background:#fff6e2;border-radius:6px;box-shadow:inset 0 1px #fffaf0}.chart{padding:14px}.patient-badge canvas{width:78px;height:78px;border:3px double #ad8e55;border-radius:8px;background:#e6d2a8}.patient-badge b{font-family:serif;font-size:22px}.clinic-layout,html[data-input=touch] .clinic-layout{display:grid;grid-template-columns:280px minmax(0,1fr);gap:22px}.patient-badge{align-items:center}.question-area{padding:18px;border:1px solid #b99b66;border-radius:7px;background:linear-gradient(#fff7e9e8,#f4e5cce8),url('../assets/scenes/clinic.png') center/cover}.question-area>.speech{background:#fff9eb;border:1px solid #cbb180;border-radius:7px;box-shadow:0 3px 0 #a28c5e20;font-family:serif;font-size:20px;line-height:1.7;min-height:100px}.question-button{background:#fff9ea;border-color:#bfa77d;min-height:52px;box-shadow:0 2px 0 #b4a37c30;font-size:16px;text-align:left}.question-button>span:first-child,.choice>span:first-child{background:#42594f;color:#ffefc7;border-radius:4px}.questions{gap:9px}.key-clue{background:#e7e8ca;border-left:3px solid #929250;animation:clue-in .2s ease-out}.clue-star{color:#a17b35}.general-evidence .evidence-list{max-height:150px;overflow:auto}.chart .key-evidence{max-height:270px;overflow:auto}.patient-intro{background:linear-gradient(100deg,#f6e8cbe8,#fff8e9e8),url('../assets/scenes/clinic.png') center/cover;border:1px solid #bca06a;border-radius:7px;padding:20px}.patient-intro canvas{width:120px;height:120px;border:3px double #a78b58;border-radius:8px}.patient-intro .speech{background:#fff7e6;border:1px solid #d2bc8f;border-radius:6px;padding:16px}.choices{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.choice{display:flex;align-items:center;gap:10px;text-align:left;min-height:76px;background:#f9efd5;border:2px solid #c4aa7b;border-bottom:4px solid #a68b5c;font-size:18px;line-height:1.5}.choice:hover:not(:disabled){background:#e5ebd2;border-color:#55725d}.choice:before{content:'方';display:grid;place-items:center;width:26px;height:34px;background:#a78852;color:#f9efd4;font:18px serif;flex-shrink:0}.result-banner{background:linear-gradient(110deg,#e0e6c9,#f6ebcd);border:1px solid #a7aa77;border-radius:6px}.result-banner.wrong{background:#f1e0ce;border-color:#bf9780}.result-badge{background:#375650;color:#f9e8b9}.focus-review>.comparison{margin-top:14px}.focus-review h3{font:700 18px serif}.focus-reason{background:#e6e5cc}.three-metrics{margin:12px 0}.metric{border-color:#c6b287;background:#fff6e3}.full-lecture-review summary{background:#e5d6b5;color:#554a38}.modal-actions{gap:10px}.wooden-shelf,html[data-input=touch] .wooden-shelf{grid-template-columns:repeat(3,minmax(0,1fr));padding:12px;background:repeating-linear-gradient(0deg,#76563d,#76563d 4px,#856349 5px,#8f6c49 80px);border-color:#4f3b30;border-radius:6px}.herb-drawer{position:relative;background:#f2e4c7;border:2px solid #b59a6b;border-bottom:4px solid #ad8d59;border-radius:6px;padding:9px;min-width:0}.herb-drawer>span{display:block;font-size:14px;line-height:1.7}.herb-drawer:hover:not(:disabled){background:#fff0cf}.decoction-desk{background:linear-gradient(#ebdcc0,#dac59b);border:2px solid #ac8c58;box-shadow:inset 0 1px #fff6db}.herb-drawer.selected{background:#e4e4c6}.herb-drawer.correct,.craft-chip.correct{border-color:#32724b;box-shadow:inset 0 0 0 1px #32724b;background:#e3ebd1}.herb-drawer.incorrect,.craft-chip.incorrect{border-color:#aa433f;box-shadow:inset 0 0 0 1px #aa433f;background:#f3ded0}.ingredient-verdict{position:absolute;right:5px;top:5px;display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:#32724b;color:#fff;font-size:19px;font-weight:bold}.incorrect .ingredient-verdict{background:#aa433f}.craft-counts{display:flex;justify-content:center;gap:15px;font-size:14px;padding:10px;border:1px solid #b5a176;border-radius:4px;background:#fff4da}.craft-counts b:first-child{color:#25633b}.craft-counts b:last-child{color:#a13d37}.craft-chip{line-height:1.5;min-height:44px}.room-vignette{height:70px;object-fit:cover;object-position:center 55%;border-radius:5px;border:1px solid #ae8d58}.herb-visual,.dex-card{border:1px solid #baa273;background:#fff3d9;box-shadow:0 2px 0 #b69b6e38}.herb-visual:hover,.dex-card:hover{background:#e8e8cf}.toolbar input,.toolbar select,input,select{background:#fff8e6;border:1px solid #b8a27b;border-radius:5px;color:#312b27}.patient-switcher{display:flex;align-items:center;gap:7px;overflow:auto;max-width:100%;margin:0 0 16px;padding:7px;background:#e6d6b5;border:1px solid #c5ad7d;border-radius:5px;scrollbar-width:thin}.patient-switcher>span{font-size:12px;white-space:nowrap;color:#6c6046;padding:0 5px}.patient-switcher button{min-height:40px;padding:6px 11px;white-space:nowrap;font-size:13px;border-color:#bda679;background:#fff2d6}.patient-switcher button[aria-current=true]{background:#345957;color:#fff0cc;border-color:#284c49}.patient-switcher small{font-size:10px;display:block;margin-top:2px}.brew-scene{background:radial-gradient(ellipse at center,#faf1d9,#c6ad7c70);border:1px solid #b9a171;border-radius:6px}.selected-ingredients{max-height:200px;overflow:auto}.skip-notice,.note{color:#72654c}.focus-review ul{line-height:1.8}#touch-action,#touch-pause{background:#263f3fe8;color:#f6e3b9;border-color:#aa8c58}.joystick-ring{border-color:#d2b46e80}#joystick{background:#1e3b3a80;border-color:#a99a6b90;backdrop-filter:blur(1px)}.joystick-knob{background:#526c5bd9;border-color:#d2bf8c}.joystick-label{color:#e2d7ad}
@keyframes clue-in{from{transform:translateX(-4px);opacity:.6}to{transform:translateX(0);opacity:1}}
@media(min-width:1000px) and (max-height:800px){.modal-layer{padding:10px}#modal-body{padding:14px 18px}.clinic-layout{gap:15px;grid-template-columns:255px minmax(0,1fr)}.question-area{padding:14px}.question-area>.speech{font-size:18px;min-height:80px}.question-button{min-height:46px;padding:10px}.patient-badge canvas{width:64px;height:64px}.patient-switcher{margin-bottom:12px}.room-vignette{height:48px}}
@media(max-width:900px){.clinic-layout,html[data-input=touch] .clinic-layout{grid-template-columns:230px minmax(0,1fr);gap:14px}.patient-badge canvas{width:64px;height:64px}.question-area{padding:12px}.question-area>.speech{font-size:18px}.wooden-shelf,html[data-input=touch] .wooden-shelf{grid-template-columns:repeat(2,minmax(0,1fr))}.choice{font-size:15px}.tabs button{font-size:11px}}
@media(orientation:portrait) and (max-width:900px){.clinic-layout,html[data-input=touch] .clinic-layout{grid-template-columns:1fr}.chart{max-height:230px;overflow:auto}.patient-badge canvas{width:52px;height:52px}.patient-switcher{gap:5px}.question-area>.speech{font-size:17px}.choices{grid-template-columns:1fr}}
@media(max-width:540px){.patient-intro canvas{width:76px;height:76px}.patient-intro{padding:12px;gap:12px}.world-top #world-progress{display:none}.world-top{gap:5px}.choices{grid-template-columns:1fr}.question-area{padding:10px}.dispensing-layout,html[data-input=touch] .dispensing-layout{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.key-clue{animation:none}}
/* Card surface scrolls natively; deliberate touch dragging uses its own grip. */
.herb-drawer,html[data-input=touch] .herb-drawer{touch-action:pan-y;user-select:none;-webkit-user-select:none;position:relative}
.herb-drawer:active{transform:none}.ingredient-grip{display:block;min-height:36px;padding:6px;margin-top:4px;border-top:1px dashed #aa9876;color:#675940;touch-action:none;cursor:grab;font-size:12px}
.ingredient-grip:active{cursor:grabbing}.herb-photo{object-fit:contain;max-width:100%}.art-pending.image-error{height:auto;min-height:80px;padding:8px}
