:root {
  color-scheme: dark;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  --accent: #ff6334;
  --ink: #f7f6fb;
  --muted: #aaa9b5;
  --line: rgba(255, 255, 255, .16);
  --panel: rgba(18, 18, 29, .84);
}

* { box-sizing: border-box; }
html, body { min-width: 980px; min-height: 100%; margin: 0; }
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
[hidden] { display: none !important; }

.player-page { min-height: 100vh; overflow: hidden; color: var(--ink); background: #11111b; }
.player-shell { position: relative; min-height: 100vh; isolation: isolate; overflow: hidden; background: radial-gradient(circle at 76% 30%, #30336d 0, #191a31 38%, #0f101b 78%); }
.scene-background { position: absolute; inset: 0; z-index: -3; background-position: center; background-size: cover; transform: scale(1.01); transition: opacity .28s ease; }
.scene-shade { position: absolute; inset: 0; z-index: -2; background: linear-gradient(180deg, rgba(8, 9, 15, .14) 0%, rgba(8, 9, 15, .04) 38%, rgba(8, 9, 15, .74) 100%), linear-gradient(90deg, rgba(8, 9, 15, .2), transparent 52%, rgba(8, 9, 15, .12)); }
.player-topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 42px; }
.brand-lockup, .studio-entry { color: #fff; text-decoration: none; }
.brand-lockup { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .12em; }
.branch-mark { width: 35px; height: 35px; display: inline-grid; place-items: center; border-radius: 10px; color: #fff; background: var(--accent); box-shadow: 0 9px 24px color-mix(in srgb, var(--accent) 38%, transparent); font: 800 23px/1 Georgia, serif; }
.studio-entry { padding: 9px 14px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 999px; background: rgba(7, 8, 14, .25); backdrop-filter: blur(12px); font-size: 13px; opacity: .78; transition: .16s ease; }
.studio-entry:hover { opacity: 1; border-color: rgba(255, 255, 255, .42); }
.player-stage { min-height: calc(100vh - 82px); display: flex; align-items: flex-end; padding: 26px 42px 34px; }
.dialogue-box { width: min(1180px, calc(100vw - 84px)); min-height: 245px; margin: 0 auto; display: grid; grid-template-columns: minmax(360px, 1.15fr) minmax(400px, .85fr); gap: 38px; align-items: center; padding: 28px 32px; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(128deg, rgba(19, 18, 30, .91), rgba(31, 31, 49, .82)); box-shadow: 0 28px 80px rgba(0, 0, 0, .38); backdrop-filter: blur(18px) saturate(118%); transition: opacity .16s ease, transform .16s ease; }
.dialogue-box.is-moving { opacity: .58; transform: translateY(4px); }
.dialogue-copy { min-width: 0; }
.dialogue-label, .panel-kicker { margin: 0; color: var(--accent); font-size: 12px; font-weight: 900; letter-spacing: .15em; text-transform: uppercase; }
.dialogue-copy h1 { margin: 8px 0 10px; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-size: clamp(28px, 2.5vw, 43px); font-weight: 600; line-height: 1.18; letter-spacing: -.035em; }
.dialogue-copy > p:not(.dialogue-label) { max-width: 650px; margin: 0; color: #c9c8d1; font-size: 16px; line-height: 1.75; }
.story-meta { margin-top: 17px; display: flex; align-items: center; gap: 16px; color: #8f8e9c; font-size: 12px; }
.text-button { padding: 0; border: 0; color: #bdbcc6; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
.dialogue-actions { display: grid; gap: 9px; align-content: center; }
.choice-button, .start-game, .result-button { min-height: 48px; border-radius: 12px; transition: .16s ease; }
.choice-button { display: grid; grid-template-columns: 30px 1fr 20px; gap: 10px; align-items: center; width: 100%; padding: 10px 14px; border: 1px solid rgba(255, 255, 255, .14); color: #f6f5fa; background: rgba(255, 255, 255, .075); text-align: left; }
.choice-button:hover, .choice-button:focus-visible { border-color: color-mix(in srgb, var(--accent) 68%, white); background: color-mix(in srgb, var(--accent) 17%, rgba(255, 255, 255, .08)); transform: translateX(4px); outline: none; }
.choice-letter { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 8px; color: var(--accent); background: rgba(255, 255, 255, .1); font-size: 11px; font-weight: 900; }
.choice-button strong { font-size: 14px; line-height: 1.4; }
.choice-arrow { color: #9694a3; font-size: 18px; text-align: right; }
.start-game, .result-button { display: inline-flex; align-items: center; justify-content: center; gap: 9px; padding: 0 25px; border: 0; color: #fff; background: var(--accent); font-weight: 800; box-shadow: 0 14px 36px color-mix(in srgb, var(--accent) 28%, transparent); }
.start-game:hover, .result-button:hover { filter: brightness(1.08); transform: translateY(-1px); }
.intro-note { color: #9695a1; font-size: 12px; text-align: center; }
.result-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.result-button.secondary { border: 1px solid rgba(255, 255, 255, .2); color: #fff; background: rgba(255, 255, 255, .07); box-shadow: none; }
.toast { position: fixed; z-index: 100; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: 520px; padding: 12px 18px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 11px; color: #fff; background: #252438; box-shadow: 0 15px 50px rgba(0, 0, 0, .3); font-size: 14px; }

.studio-page { min-height: 100vh; color: #292839; background: #eceef3; }
.lock-screen { min-height: 100vh; display: grid; place-items: center; background: radial-gradient(circle at 18% 10%, #554043, transparent 36%), radial-gradient(circle at 88% 85%, #272968, transparent 40%), #141522; }
.lock-card { width: 420px; display: grid; gap: 13px; padding: 38px; border: 1px solid rgba(255, 255, 255, .14); border-radius: 22px; color: #fff; background: rgba(31, 31, 46, .86); box-shadow: 0 35px 100px rgba(0, 0, 0, .42); backdrop-filter: blur(18px); }
.lock-mark { width: 49px; height: 49px; display: grid; place-items: center; border-radius: 15px; color: #fff; background: #ff6334; font-size: 21px; }
.lock-card h1 { margin: 4px 0 0; font-family: Georgia, "Noto Serif SC", serif; font-size: 32px; }
.lock-card > p:not(.panel-kicker):not(.form-error) { margin: 0 0 5px; color: #b9b8c2; line-height: 1.7; }
.lock-card label { margin-top: 4px; color: #c8c7d0; font-size: 13px; font-weight: 700; }
.lock-card input { height: 48px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .18); border-radius: 11px; color: #fff; background: rgba(255, 255, 255, .07); outline: none; }
.lock-card input:focus { border-color: #ff6334; box-shadow: 0 0 0 3px rgba(255, 99, 52, .14); }
.lock-card a { margin-top: 2px; color: #abaab5; font-size: 13px; text-align: center; }
.form-error { margin: 0; color: #ff9b83; font-size: 13px; text-align: center; }

.studio-shell { min-height: 100vh; }
.studio-header { height: 72px; display: grid; grid-template-columns: 240px 1fr auto; align-items: center; gap: 20px; padding: 0 20px; border-bottom: 1px solid #dcdee5; background: rgba(255, 255, 255, .96); }
.studio-brand { display: flex; align-items: center; gap: 10px; color: #292839; text-decoration: none; }
.studio-brand > span:last-child { display: flex; flex-direction: column; gap: 1px; }
.studio-brand strong { letter-spacing: .12em; }
.studio-brand small { color: #9696a3; font-size: 10px; }
.studio-title-block { min-width: 0; display: flex; align-items: baseline; gap: 10px; }
.studio-title-block strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.studio-title-block span { color: #8c8c99; font-size: 12px; }
.header-actions, .map-toolbar > div:last-child, .media-actions { display: flex; gap: 8px; align-items: center; }
button:disabled { cursor: not-allowed; opacity: .55; }
.primary-button, .secondary-button, .icon-button, .danger-button { min-height: 37px; padding: 0 14px; border-radius: 9px; font-size: 13px; font-weight: 800; }
.primary-button { border: 1px solid #ff6334; color: #fff; background: #ff6334; }
.primary-button:hover { background: #eb5529; }
.secondary-button { border: 1px solid #d5d7df; color: #444356; background: #fff; }
.secondary-button:hover { border-color: #aaaeba; background: #fafaff; }
.secondary-button.compact { min-height: 30px; padding: 0 9px; font-size: 12px; }
.icon-button { width: 37px; padding: 0; border: 1px solid #d5d7df; color: #6d6c7b; background: #fff; }
.danger-button { min-height: 31px; border: 1px solid #efc4c4; color: #b64444; background: #fff5f5; }
.danger-text { color: #b94b4b; }

.studio-workspace { height: calc(100vh - 72px); display: grid; grid-template-columns: 260px minmax(520px, 1fr) 350px; overflow: hidden; }
.project-panel, .inspector-panel { min-height: 0; overflow-y: auto; padding: 22px 18px 35px; background: #fafafd; }
.project-panel { border-right: 1px solid #dfe1e8; }
.inspector-panel { border-left: 1px solid #dfe1e8; }
.studio-page .panel-kicker { color: #8a8b9b; }
.field-stack { display: grid; gap: 7px; margin-top: 18px; }
.field-stack label { color: #515063; font-size: 12px; font-weight: 800; }
.field-stack input, .field-stack textarea, .field-stack select { width: 100%; border: 1px solid #d7d9e1; border-radius: 9px; color: #2d2c3e; background: #fff; outline: none; }
.field-stack input, .field-stack select { height: 39px; padding: 0 10px; }
.field-stack textarea { padding: 10px; resize: vertical; line-height: 1.55; }
.field-stack input:focus, .field-stack textarea:focus, .field-stack select:focus { border-color: #ff6334; box-shadow: 0 0 0 3px rgba(255, 99, 52, .11); }
.field-help { margin: 0; color: #858693; font-size: 11px; line-height: 1.55; }
.slug-field { display: flex; align-items: center; overflow: hidden; border: 1px solid #d7d9e1; border-radius: 9px; background: #fff; }
.slug-field span { padding-left: 10px; color: #999aa6; font-size: 11px; }
.slug-field input { border: 0; padding-left: 3px; box-shadow: none !important; }
.color-row { display: flex; align-items: center; gap: 10px; color: #858693; font: 12px ui-monospace, monospace; }
.color-row input { width: 42px; padding: 3px; }
.publish-row { margin-top: 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 0; border-top: 1px solid #e3e4ea; border-bottom: 1px solid #e3e4ea; }
.publish-row > span { display: flex; flex-direction: column; gap: 3px; }
.publish-row strong { font-size: 12px; }
.publish-row small { color: #91929e; font-size: 10px; }
.publish-row input { width: 17px; height: 17px; accent-color: #ff6334; }
.project-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 15px; }
.project-stats span { display: flex; flex-direction: column; padding: 11px; border-radius: 10px; color: #7d7e8c; background: #eceef3; font-size: 10px; }
.project-stats strong { color: #292839; font-size: 20px; }
.live-layer-card { display: grid; gap: 8px; margin-top: 18px; padding: 14px; border: 1px solid #dedfe6; border-radius: 12px; background: #fff; }
.live-layer-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.live-layer-heading > div { display: grid; gap: 3px; }
.live-layer-heading strong { font-size: 13px; }
.live-layer-card > p { margin: 0 0 2px; color: #858693; font-size: 10px; line-height: 1.5; }
.live-layer-card > label { color: #555467; font-size: 10px; font-weight: 800; }
.live-url-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 4px; }
.live-url-row input { min-width: 0; height: 31px; padding: 0 7px; border: 1px solid #d9dbe2; border-radius: 7px; color: #777887; background: #f7f7fa; font: 9px ui-monospace, monospace; }
.live-url-row button { min-height: 31px; padding: 0 7px; border: 1px solid #d5d7df; border-radius: 7px; color: #49485b; background: #fff; font-size: 10px; font-weight: 800; }
.live-layer-card .live-layer-order { margin-top: 3px; padding-top: 9px; border-top: 1px solid #ececf1; color: #686979; }

.map-panel { min-width: 0; overflow: auto; background-color: #eceef3; background-image: radial-gradient(#c5c8d1 1px, transparent 1px); background-size: 18px 18px; }
.map-toolbar { position: sticky; top: 0; z-index: 5; min-width: 760px; display: flex; justify-content: space-between; align-items: center; padding: 23px 26px 14px; background: linear-gradient(#eceef3 76%, rgba(236, 238, 243, 0)); }
.map-toolbar h1 { margin: 4px 0 0; font-size: 22px; letter-spacing: -.04em; }
.node-map { min-width: 780px; display: grid; grid-template-columns: repeat(2, minmax(290px, 1fr)); gap: 16px; align-items: start; padding: 4px 26px 70px; }
.node-column { display: grid; gap: 12px; align-content: start; }
.column-heading { display: flex; align-items: center; gap: 8px; padding: 3px 1px; color: #747583; font-size: 11px; font-weight: 900; letter-spacing: .07em; }
.column-heading span { color: #ff6334; }
.map-node { position: relative; width: 100%; display: grid; gap: 8px; padding: 14px; border: 1px solid #d8dae2; border-radius: 13px; color: #2a293a; background: rgba(255, 255, 255, .94); box-shadow: 0 5px 18px rgba(26, 26, 48, .05); text-align: left; transition: .16s ease; }
.map-node:hover { transform: translateY(-2px); border-color: #b8bac5; box-shadow: 0 10px 28px rgba(26, 26, 48, .09); }
.map-node.selected { border-color: #ff6334; box-shadow: 0 0 0 2px rgba(255, 99, 52, .13), 0 10px 28px rgba(26, 26, 48, .09); }
.map-node.result { border-top: 3px solid #5e59a6; }
.map-node img { width: 100%; height: 92px; border-radius: 8px; object-fit: cover; }
.node-meta { display: flex; align-items: center; justify-content: space-between; color: #898a97; font-size: 10px; }
.node-meta em { color: #ff6334; font-style: normal; font-weight: 900; }
.map-node strong { font-size: 14px; line-height: 1.4; }
.map-node p { margin: 0; overflow: hidden; color: #797a88; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.choice-preview { display: grid; gap: 5px; padding-top: 8px; border-top: 1px solid #ececf1; }
.choice-preview span { display: flex; justify-content: space-between; gap: 8px; color: #686978; font-size: 10px; }
.choice-preview i { color: #a1a2ad; font-style: normal; }

.empty-inspector { min-height: 240px; display: grid; place-items: center; color: #92939f; font-size: 12px; text-align: center; }
.inspector-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 1px solid #e1e3e9; }
.inspector-heading > div { display: flex; align-items: center; gap: 7px; font-size: 12px; }
.type-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff6334; }
.type-dot.result { background: #5e59a6; }
.node-media { display: grid; gap: 10px; margin-top: 20px; padding: 16px 0 20px; border-top: 1px solid #e3e4e9; border-bottom: 1px solid #e3e4e9; }
.node-media strong, .choice-editor-title strong { font-size: 12px; }
.node-media p { margin: 4px 0 0; color: #91929e; font-size: 10px; }
.image-preview { min-height: 104px; display: grid; place-items: center; overflow: hidden; border: 1px dashed #cdd0d9; border-radius: 10px; color: #9697a3; background: #fff; font-size: 11px; }
.image-preview img { width: 100%; height: 132px; object-fit: cover; }
.choice-editor { margin-top: 20px; }
.choice-editor-title { display: flex; align-items: center; justify-content: space-between; }
.choice-row { display: grid; grid-template-columns: 26px 1fr 30px; gap: 7px; align-items: center; padding: 11px 0; border-bottom: 1px solid #e7e8ed; }
.choice-index { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; color: #ff6334; background: #fff0eb; font-size: 10px; font-weight: 900; }
.choice-row input, .choice-row select { width: 100%; height: 34px; border: 1px solid #d9dbe2; border-radius: 8px; padding: 0 8px; color: #353446; background: #fff; outline: none; }
.choice-target-row { grid-column: 2 / 4; display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 5px; color: #888995; font-size: 10px; }
.remove-choice { width: 30px; height: 30px; border: 0; border-radius: 8px; color: #ad5252; background: #fff2f2; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
