:root { font-family: "Segoe UI", "Microsoft YaHei", sans-serif; color: #21324b; background: #f2f5fa; font-synthesis: none; }
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
[hidden] { display: none !important; }
main { max-width: 1160px; margin: auto; padding: 0 40px; width: 100dvw; height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
.masthead { display: flex; flex: none; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 0; border-bottom: 1px solid #dce3ef; }
.brand { font-size: 25px; letter-spacing: -.6px; font-weight: 800; text-decoration: none; color: #21324b; }
.brand span { font-size: 12px; letter-spacing: 1px; font-weight: 500; margin-left: 16px; color: #526782; }
.guest, .badge { border-radius: 999px; font-size: 12px; padding: 7px 14px; background: #e7edf8; color: #365888; }
.intro { padding: 22px 0 18px; flex: none; }
.eyebrow { color: #436cd0; font-size: 13px; letter-spacing: 2px; }
h1 { font-size: clamp(32px, 5vw, 48px); margin: 15px 0; letter-spacing: -1px; }
.intro > p:last-child, .muted { color: #64748b; }
.workspace { display: grid; flex: 1; min-height: 0; overflow: hidden; grid-template-columns: minmax(250px, 1fr) minmax(280px, 1.25fr); gap: 24px; }
.library { display: flex; flex-direction: column; min-height: 0; overflow: hidden; }
h2 { font-size: 20px; }
.library h2 { margin-top: 0; }
.catalog-list { display: grid; gap: 14px; overflow: auto; min-height: 0; align-content: start; padding: 4px; }
button { font: inherit; color: inherit; cursor: pointer; border: 1px solid #c9d5e8; background: #fff; padding: 10px 18px; border-radius: 10px; }
button:hover { border-color: #426edd; background: #f5f8ff; }
button:focus-visible, a:focus-visible, #game-mount:focus-visible { outline: 3px solid #8ca7ee; outline-offset: 4px; }
button:disabled { cursor: default; opacity: .5; }
.game-card { text-align: left; padding: 22px; min-height: 105px; }
.game-card strong { display: block; margin-bottom: 10px; font-size: 18px; }
.game-card span { color: #64748b; font-size: 13px; line-height: 1.6; }
.game-card[aria-pressed="true"] { border: 2px solid #426edd; padding: 21px; background: #f7f9ff; }
.detail { padding: 24px; border-radius: 18px; background: #fff; border: 1px solid #dce3ef; box-shadow: 0 8px 30px #21324b05; min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.detail-content { min-height: 0; overflow: auto; flex: 1; }
.detail h2 { font-size: 26px; margin-top: 28px; }
.detail p { line-height: 1.8; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.detail .actions { margin-top: 28px; }
.primary { background: #345fd0; border-color: #345fd0; color: #fff; }
.primary:hover { background: #244fbd; color: #fff; }
.status-box { margin: 14px 0; flex: none; padding: 2px 18px; border-left: 3px solid #91a6d6; font-size: 14px; }
.status-box .muted { font-size: 11px; overflow-wrap: anywhere; }
.runtime-panel { border-radius: 18px; flex: 1; min-height: 0; overflow: hidden; background: #fff; border: 1px solid #dce3ef; display: flex; flex-direction: column; }
.runtime-toolbar { padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.runtime-toolbar h2 { margin: 0; }
#game-mount { flex: 1; min-height: 0; width: 100%; overflow: hidden; background: #edf2fb; }
.fixture-game { display: grid; place-items: center; gap: 14px; padding: 22px; background: #fff; border-radius: 12px; }
.fixture-game canvas { width: min(100%, 520px); height: 120px; }
.fixture-target { min-width: 170px; padding: 16px; background: #eaf0ff; }
.fixture-game output { font-weight: 700; font-size: 23px; }
.fixture-game label { color: #64748b; font-size: 13px; }
footer { color: #64748b; flex: none; font-size: 12px; padding: 16px 0; }
dialog { border: 1px solid #dce3ef; border-radius: 18px; padding: 30px; max-width: 420px; color: #21324b; }
dialog::backdrop { background: #21324b70; }
#switch-dialog { width: min(980px, calc(100dvw - 32px)); max-width: none; height: min(680px, calc(100dvh - 32px)); overflow: hidden; }
#switch-dialog[open] { display: flex; flex-direction: column; gap: 12px; }
#switch-dialog > h2, #switch-dialog > p { margin: 0; }
#switch-dialog > button { align-self: flex-end; }
select { font: inherit; width: 100%; padding: 10px; border: 1px solid #c9d5e8; border-radius: 8px; margin-top: 10px; }
@media (max-width: 640px) { main { padding: 0 16px; } .workspace { grid-template-columns: 1fr; grid-template-rows: minmax(120px, 1fr) minmax(170px, 1fr); gap: 12px; } .masthead { padding: 12px 0; } .masthead .actions { justify-content: flex-end; } .masthead button { padding: 8px; font-size: 12px; } .guest { font-size: 11px; padding: 4px 8px; } .intro { padding: 12px 0; } h1 { margin: 10px 0; } .brand span { display: none; } .detail { padding: 16px; } .detail h2 { margin: 14px 0 8px; font-size: 23px; } .detail .actions { margin-top: 12px; } .runtime-toolbar { padding: 12px; flex-wrap: wrap; } .runtime-toolbar .actions { gap: 6px; } .runtime-toolbar button { padding: 8px 10px; } dialog { max-width: calc(100dvw - 32px); padding: 22px; } }
