:root {
  color-scheme: dark;
  --gold: #d9b568;
  --text: #f5f1e8;
  --muted: rgba(245, 241, 232, 0.72);
  --line: rgba(217, 181, 104, 0.42);
  --choice-bg: url("./assets/original_ui_refs/-6092492218303357341_20260302-133604.png");
  --choice-bg-hover: url("./assets/original_ui_refs/6639666567587838164_20260302-135046.png");
  --control-bg: url("./assets/original_ui_refs/5456224632422458507_未标题-24.png");
  --control-select: url("./assets/original_ui_refs/-3527864682878101736_未标题-25.png");
  --app-width: 100vw;
  --app-height: 100vh;
}

@media (max-width: 900px) and (orientation: portrait) {
  .player-controls {
    bottom: max(18px, env(safe-area-inset-bottom));
    width: min(48vh, 420px);
    height: 52px;
    gap: min(4.2vh, 34px);
    align-items: center;
    overflow: visible;
  }

  .control-group {
    gap: min(0.65vh, 5px);
    align-items: center;
    overflow: visible;
  }

  .control-button {
    width: min(6.6vh, 46px);
    height: min(6.6vh, 46px);
    flex: 0 0 min(6.6vh, 46px);
    opacity: 0.58;
    place-items: center;
  }

  .control-button::before,
  .control-button::after {
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    transform-origin: center center;
  }

  .control-button::before {
    width: min(8.4vh, 58px);
    height: min(8.4vh, 58px);
  }

  .control-button::after {
    width: min(4.4vh, 31px);
    height: min(5.6vh, 39px);
  }

  .control-button img {
    display: block;
    width: min(4.7vh, 33px);
    height: min(4.7vh, 33px);
    max-width: none;
    max-height: none;
    object-fit: contain;
    transform: none;
  }

  .control-button:hover img,
  .control-button:focus-visible img,
  .control-button.active img {
    transform: scale(1.03);
  }
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  background: #050606;
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
}

button {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
}

button:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 4px;
}

[hidden] {
  display: none !important;
}

.startup-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(126, 75, 35, 0.24), transparent 34%),
    linear-gradient(180deg, #090b0c, #020303 72%);
  color: #f8eed2;
  transition: opacity 420ms ease, visibility 420ms ease;
}

.startup-loader.done {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.startup-loader-panel {
  width: min(520px, 82vw);
  display: grid;
  justify-items: center;
  gap: 18px;
  text-align: center;
}

.startup-loader-ring {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  border: 2px solid rgba(217, 181, 104, 0.2);
  border-top-color: rgba(255, 232, 155, 0.95);
  box-shadow: 0 0 24px rgba(217, 181, 104, 0.24), inset 0 0 18px rgba(217, 181, 104, 0.1);
  animation: startupSpin 1.05s linear infinite;
}

.startup-loader-title {
  font-family: KaiTi, STKaiti, "KaiTi_GB2312", "Microsoft YaHei", serif;
  font-size: 30px;
  letter-spacing: 0;
  text-shadow: 0 0 14px rgba(217, 181, 104, 0.42), 0 2px 6px #000;
}

.startup-loader-text {
  min-height: 24px;
  color: rgba(248, 238, 210, 0.72);
  font-size: 15px;
}

.startup-loader-track {
  width: min(420px, 76vw);
  height: 4px;
  background: rgba(255, 255, 255, 0.12);
  overflow: hidden;
}

.startup-loader-track i {
  display: block;
  width: 8%;
  height: 100%;
  background: linear-gradient(90deg, rgba(162, 105, 42, 0.4), #f1cd74, rgba(255, 240, 174, 0.95));
  transition: width 360ms ease;
}

@keyframes startupSpin {
  to {
    transform: rotate(360deg);
  }
}

.app,
.menu-screen,
.chapter-screen,
.storyline-screen,
.player-screen,
.modal-screen {
  position: fixed;
  inset: 0;
  overflow: hidden;
}

.menu-screen {
  display: block;
  background: #000;
}

.screen-stage,
.menu-stage {
  position: absolute;
  inset: 0;
  width: var(--app-width);
  height: var(--app-height);
  overflow: hidden;
  background: #000;
}

.chapter-screen,
.storyline-screen,
.player-screen,
.modal-screen {
  display: block;
  background: #000;
}

.menu-bg-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.menu-dim {
  position: absolute;
  inset: 0;
  background: transparent;
  pointer-events: none;
}

.menu-screen::after,
.chapter-screen::after,
.storyline-screen::after,
.modal-screen::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: min(36vw, 470px);
  background:
    radial-gradient(circle at 28% 66%, rgba(217, 181, 104, 0.22), transparent 2px),
    linear-gradient(90deg, rgba(2, 5, 6, 0.96), rgba(2, 5, 6, 0.78) 58%, rgba(2, 5, 6, 0));
  pointer-events: none;
}

.menu-screen::after {
  opacity: 0;
}

.storyline-screen::after {
  display: none;
}

.ink-panel {
  position: absolute;
  z-index: 2;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  transform-origin: left top;
}

.unity-layer {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.unity-layer img {
  position: absolute;
  display: block;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}

.menu-screen .game-logo {
  position: absolute;
  display: block;
  object-fit: contain;
  max-width: none;
  opacity: 1;
  pointer-events: none;
  filter: none;
}

.menu-screen .game-logo,
.menu-screen .menu-item[data-menu-key="Collection"],
.menu-screen .menu-item[data-menu-key="Character"],
.menu-screen .menu-item[data-menu-key="GuGu"] {
  display: none !important;
}

.menu-screen .menu-icon-item[data-menu-key="Settings"] {
  display: none !important;
  pointer-events: none !important;
}

.menu-screen .menu-item[data-menu-key="Storyline"] {
  left: 4.2% !important;
  top: 48.5% !important;
  width: 24.5% !important;
  height: 8.8% !important;
  transform: scale(1);
  transform-origin: left center;
  z-index: 5;
}

.menu-screen .menu-item[data-menu-key="Storyline"] .menu-spark {
  left: -4% !important;
  top: -24% !important;
  width: 112% !important;
  height: 148% !important;
}

.menu-screen .menu-item[data-menu-key="Storyline"] .menu-line {
  left: 7% !important;
  top: 7% !important;
  width: 98% !important;
  height: 92% !important;
}

.menu-screen .menu-item[data-menu-key="Storyline"] .menu-label {
  left: 26% !important;
  top: 48% !important;
  font-size: min(2.65vw, calc(100vh * 0.047)) !important;
  color: #fff7d7;
  text-shadow:
    0 3px 8px rgba(0, 0, 0, 0.9),
    0 0 16px rgba(255, 210, 110, 0.35);
}

.main-menu {
  position: absolute;
  inset: 0;
}

.main-menu::before {
  content: "";
  position: absolute;
  left: -52px;
  top: -28px;
  bottom: -30px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(217, 181, 104, 0.75), transparent);
  transform: rotate(-8deg);
}

.menu-screen .main-menu::before {
  opacity: 0;
}

.menu-item {
  position: absolute;
  min-width: 0;
  overflow: visible;
  text-align: left;
  color: #fff;
}

.menu-screen .menu-item,
.menu-screen .menu-icon-item {
  position: absolute;
  min-width: 0;
}

.menu-item::before {
  content: none;
}

.menu-item img,
.menu-icon-item img {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
}

.menu-spark {
  opacity: 1;
  mix-blend-mode: screen;
  transition: transform 140ms ease, opacity 140ms ease;
}

.menu-line {
  opacity: 0;
  transition: opacity 120ms ease;
}

.menu-label {
  position: absolute;
  left: 29.3%;
  top: 48%;
  transform: translateY(-50%);
  z-index: 2;
  white-space: nowrap;
  font-size: min(2.08vw, calc(100vh * 0.037));
  line-height: 1;
  font-weight: 400;
  letter-spacing: 0;
  color: #fff;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.88);
  transition: color 120ms ease, transform 140ms ease;
}

.menu-item:hover .menu-line,
.menu-item:focus-visible .menu-line {
  opacity: 1;
}

.menu-item:hover .menu-label,
.menu-item:focus-visible .menu-label {
  color: #ffe9a8;
  transform: translateY(-50%) translateX(2.5%);
}

.menu-item:hover .menu-spark,
.menu-item:focus-visible .menu-spark {
  opacity: 0.92;
  transform: scale(1.015);
}

.menu-icon-item {
  overflow: visible;
}

.menu-continue {
  position: absolute;
  overflow: visible;
}

.menu-continue img {
  position: absolute;
  display: block;
  object-fit: contain;
  pointer-events: none;
  user-select: none;
  transition: opacity 140ms ease, transform 160ms ease;
}

.continue-bg {
  left: 5.6%;
  top: -2.4%;
  width: 116.2%;
  height: 108.8%;
  opacity: 1;
}

.continue-bg2 {
  left: 18.4%;
  top: 7.5%;
  width: 89.1%;
  height: 83%;
  opacity: 1;
}

.continue-normal-art {
  left: -15.9%;
  top: 4.8%;
  width: 139.4%;
  height: 99.6%;
  opacity: 0;
}

.continue-normal-text {
  left: -29.7%;
  top: 23.8%;
  width: 77.9%;
  height: 70.5%;
  opacity: 0;
}

.continue-hover-art {
  left: -6.9%;
  top: -18.7%;
  width: 138.6%;
  height: 137.4%;
  opacity: 1;
}

.continue-bird-1 {
  left: 18.4%;
  top: 73.2%;
  width: 25%;
  height: 20.6%;
  opacity: 1;
}

.continue-bird-2 {
  left: 11.9%;
  top: 61.3%;
  width: 18.5%;
  height: 18.5%;
  opacity: 1;
}

.continue-bird-3 {
  left: 7.9%;
  top: 49.6%;
  width: 15.9%;
  height: 16.9%;
  opacity: 1;
}

.menu-continue:hover .continue-bg,
.menu-continue:focus-visible .continue-bg,
.menu-continue:hover .continue-bg2,
.menu-continue:focus-visible .continue-bg2,
.menu-continue:hover .continue-hover-art,
.menu-continue:focus-visible .continue-hover-art {
  transform: scale(1.02);
}

.menu-icon-bg {
  left: 6.5%;
  top: 5.6%;
  width: 86.8%;
  height: 88.8%;
  opacity: 0;
}

.menu-icon-bg-select {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 120ms ease;
}

.menu-icon-symbol {
  left: 26%;
  top: 29%;
  width: 45%;
  height: 45%;
  opacity: 0.92;
  transition: transform 140ms ease, opacity 120ms ease;
}

.menu-icon-item:hover .menu-icon-bg-select,
.menu-icon-item:focus-visible .menu-icon-bg-select {
  opacity: 1;
}

.menu-icon-item:hover .menu-icon-symbol,
.menu-icon-item:focus-visible .menu-icon-symbol {
  opacity: 1;
  transform: scale(1.06);
}

.chapter-screen,
.modal-screen {
  background: #000;
}

.chapter-stage {
  --chapter-bg: url("./assets/chapter_selection/bg_1.png");
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.32) 20%, rgba(0, 0, 0, 0) 42%),
    var(--chapter-bg) center / cover no-repeat;
  transition: background-image 220ms ease;
}

.modal-stage {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9), transparent 42%),
    url("./assets/original_ui/Sprite/mainBg.png") center / cover no-repeat;
}

.chapter-detail {
  display: none !important;
}

.chapter-detail p,
.chapter-detail h1 {
  margin: 0;
}

.chapter-detail h1 {
  order: 2;
  writing-mode: vertical-rl;
  text-orientation: upright;
  margin-top: 6.2vh;
  font-family: KaiTi, STKaiti, "Kaiti SC", serif;
  font-size: min(3vw, 48px);
  font-weight: 500;
  color: #fff8e8;
  line-height: 1.12;
  letter-spacing: 0;
  text-shadow: 0 3px 8px #000, 0 0 8px rgba(255, 245, 205, 0.28);
  white-space: nowrap;
}

.chapter-detail p {
  order: 1;
  writing-mode: vertical-rl;
  text-orientation: upright;
  margin-top: 3.2vh;
  color: rgba(245, 241, 232, 0.82);
  font-family: KaiTi, STKaiti, "Kaiti SC", serif;
  font-size: min(1.45vw, 23px);
  line-height: 1.05;
  letter-spacing: 0;
  text-shadow: 0 2px 7px #000;
  white-space: nowrap;
}

#chapterProfile {
  display: none;
}

.chapter-enter {
  position: absolute;
  z-index: 4;
  display: none;
  min-width: 0;
  height: auto;
  border: 0;
  color: transparent;
  background: transparent;
  text-shadow: none;
}

.chapter-enter:hover,
.chapter-enter:focus-visible {
  filter: drop-shadow(0 0 12px rgba(255, 225, 150, 0.48));
}

.chapter-logo {
  position: absolute;
  z-index: 2;
  left: 48px;
  top: 42px;
  width: 132px;
}

.chapter-screen .chapter-logo,
.modal-screen .chapter-logo {
  display: none;
}

.back-link {
  position: absolute;
  z-index: 5;
  left: 1%;
  top: 1.3%;
  width: 21.5%;
  height: 6.7%;
  display: flex;
  align-items: center;
  gap: 3.2%;
  padding: 0;
  border: 0;
  color: #fff8d9;
  background: transparent;
  font-size: min(2.55vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.78);
}

.back-link::before {
  content: "";
  flex: 0 0 auto;
  width: min(7.9vh, 54px);
  height: min(7.5vh, 52px);
  background: url("./assets/original_ui_refs/-8998326272317709677_未标题-1.png") center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.46));
}

.chapter-screen .back-link {
  bottom: auto;
  overflow: visible;
  text-align: left;
}

.back-link:hover,
.back-link:focus-visible {
  color: #ffe9a8;
  filter: drop-shadow(0 0 10px rgba(255, 226, 150, 0.38));
}

.chapter-board {
  position: absolute;
  z-index: 3;
  left: 0;
  right: 0;
  bottom: 0;
  height: 36%;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 3.9%;
  padding: 5.2% 2.2% 2.8%;
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: none;
  scrollbar-width: none;
  background: transparent;
  cursor: grab;
  overscroll-behavior-x: contain;
  touch-action: pan-x;
  user-select: none;
}

.chapter-board::-webkit-scrollbar {
  display: none;
}

.chapter-board.dragging {
  cursor: grabbing;
  scroll-behavior: auto;
}

.chapter-node {
  position: relative;
  flex: 0 0 min(18.4vw, 360px);
  aspect-ratio: 1.56;
  min-height: 0;
  padding: 0;
  border: 2px solid rgba(214, 160, 57, 0.82);
  background: #050505;
  overflow: visible;
  text-align: left;
  scroll-snap-align: none;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.48);
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease;
}

.chapter-node:not(.selected) {
  filter: brightness(0.82) saturate(0.9);
}

.chapter-node.selected {
  z-index: 4;
  border-color: rgba(255, 213, 108, 1);
  border-width: 3px;
  transform: translateY(-1.5%) scale(1.05);
  filter: brightness(1.08) saturate(1.08);
  box-shadow: 0 0 0 2px rgba(255, 238, 166, 0.5), 0 0 28px rgba(255, 210, 100, 0.78), 0 20px 48px rgba(0, 0, 0, 0.62);
}

.chapter-thumb {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  pointer-events: none;
}

.chapter-node::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.08), rgba(0, 0, 0, 0.42));
  pointer-events: none;
}

.chapter-node.selected::before {
  inset: -1px;
  border: 1px solid rgba(255, 243, 174, 0.82);
  background: linear-gradient(180deg, rgba(255, 226, 120, 0.08), rgba(0, 0, 0, 0.26));
  box-shadow: inset 0 0 24px rgba(255, 221, 113, 0.28);
}

.chapter-node::after {
  content: "";
  position: absolute;
  left: -10%;
  right: -5%;
  bottom: -16%;
  height: 34%;
  background: url("./assets/chapter_selection/未标题-15.png") center / 100% 100% no-repeat;
  opacity: 0;
  pointer-events: none;
}

.chapter-node.selected::after {
  opacity: 1;
}

.chapter-node.selected span {
  color: #ffe28a;
  text-shadow: 0 0 8px rgba(255, 210, 96, 0.9), 0 2px 5px #000;
}

.chapter-node.selected strong {
  color: #fffdf2;
  text-shadow: 0 0 10px rgba(255, 220, 112, 0.82), 0 2px 7px #000;
}

.chapter-node span {
  position: absolute;
  left: 8%;
  bottom: 28%;
  z-index: 1;
  color: var(--gold);
  font-size: min(1.15vw, 22px);
  margin: 0;
  text-shadow: 0 2px 5px #000;
}

.chapter-node strong {
  position: absolute;
  left: 8%;
  right: 5%;
  bottom: 8%;
  z-index: 1;
  display: block;
  font-size: min(1.55vw, 30px);
  font-weight: 500;
  color: #fff8e8;
  line-height: 1.2;
  text-shadow: 0 2px 7px #000;
}

.chapter-node.locked {
  opacity: 0.45;
}

.storyline-stage {
  background: #101718;
}

.storyline-ui-layer {
  z-index: 1;
}

.storyline-node-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
}

.storyline-link-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.storyline-link-layer path {
  fill: none;
  stroke: rgba(237, 213, 116, 0.78);
  stroke-width: 0.13;
  filter: drop-shadow(0 0 0.45px rgba(255, 236, 148, 0.85));
}

.storyline-node {
  position: absolute;
  z-index: 2;
  pointer-events: auto;
  color: #fff4d5;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.82);
  filter: drop-shadow(0 0 12px rgba(229, 204, 111, 0.42));
  transform: translate(-50%, -50%);
}

.storyline-node-current {
  width: min(19vw, 310px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(242, 221, 150, 0.26), rgba(31, 23, 11, 0.72) 64%, transparent 68%),
    url("./assets/original_ui_refs/6416857487336492606_未标题-22.png") center / contain no-repeat;
  display: grid;
  place-items: center;
}

.storyline-node-current img {
  width: 58%;
  aspect-ratio: 0.78;
  object-fit: cover;
  border: 1px solid rgba(236, 210, 130, 0.75);
}

.storyline-node-current span {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: -4%;
  min-height: 42px;
  display: grid;
  place-items: center;
  background: rgba(84, 46, 10, 0.82);
  border: 1px solid rgba(222, 174, 88, 0.72);
  font-size: min(1.35vw, 24px);
}

.storyline-node-choice,
.storyline-node-video {
  width: min(7vw, 118px);
  aspect-ratio: 1;
  background: rgba(42, 31, 23, 0.92);
  border: 3px solid rgba(230, 205, 116, 0.78);
  box-shadow: inset 0 0 18px rgba(234, 206, 122, 0.35), 0 0 18px rgba(234, 206, 122, 0.45);
}

.storyline-node-choice {
  transform: translate(-50%, -50%) rotate(45deg);
}

.storyline-node-video {
  width: min(8vw, 132px);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(84, 53, 22, 0.92), rgba(22, 17, 14, 0.94));
}

.storyline-node-choice span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  transform: rotate(-45deg);
  font-size: min(1vw, 18px);
}

.storyline-node-video span {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: min(1vw, 18px);
  color: #f7e5a6;
}

.storyline-node-layer {
  inset: 0;
  overflow-x: auto;
  overflow-y: auto;
  pointer-events: auto;
  scrollbar-width: none;
  cursor: grab;
  overscroll-behavior: contain;
  touch-action: none;
}

.storyline-node-layer:active {
  cursor: grabbing;
}

.storyline-node-layer::-webkit-scrollbar {
  display: none;
}

.storyline-flow-canvas {
  position: relative;
  min-width: 100%;
  height: 100%;
}

.storyline-flow-content {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.storyline-link-layer {
  z-index: 0;
}

.storyline-link-layer path {
  stroke-width: 2;
  stroke: rgba(220, 205, 131, 0.5);
  filter: drop-shadow(0 0 4px rgba(237, 213, 116, 0.45));
}

.storyline-node {
  z-index: 2;
}

.storyline-node-current,
.storyline-node-video {
  width: 132px;
  height: 222px;
  border: 0;
  border-radius: 0;
  background:
    linear-gradient(180deg, rgba(255, 238, 162, 0.88), rgba(120, 77, 28, 0.9) 8%, rgba(69, 42, 20, 0.88) 92%, rgba(234, 199, 102, 0.86)),
    rgba(42, 31, 23, 0.92);
  box-shadow: 0 0 18px rgba(229, 204, 111, 0.46);
  padding: 9px 10px 35px;
}

.storyline-node-current img,
.storyline-node-video img,
.storyline-node-video video {
  width: 100%;
  height: 168px;
  object-fit: cover;
  border: 1px solid rgba(246, 220, 128, 0.72);
  background: rgba(18, 14, 10, 0.7);
}

.storyline-node-current span,
.storyline-node-video span {
  left: 8px;
  right: 8px;
  bottom: 9px;
  min-height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(222, 174, 88, 0.42);
  background: rgba(99, 62, 20, 0.78);
  color: #fff0be;
  font-size: 14px;
  white-space: nowrap;
}

.storyline-node-choice {
  width: 74px;
  border-width: 2px;
}

.storyline-node-choice span {
  font-size: 14px;
}

.storyline-node-layer.dragging .storyline-node {
  pointer-events: none;
}

.storyline-node-current,
.storyline-node-video {
  width: 128px;
  height: 222px;
  padding: 13px 10px 36px;
  overflow: visible;
  background:
    linear-gradient(180deg, rgba(247, 222, 136, 0.92) 0 8px, transparent 8px calc(100% - 37px), rgba(128, 81, 30, 0.92) calc(100% - 37px)),
    rgba(45, 28, 12, 0.2);
}

.storyline-node-current::before,
.storyline-node-video::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 2px solid rgba(235, 202, 105, 0.92);
  box-shadow: inset 0 0 0 1px rgba(99, 62, 22, 0.65), 0 0 15px rgba(234, 205, 92, 0.52);
  pointer-events: none;
}

.storyline-node-current img,
.storyline-node-video img {
  position: absolute;
  left: 10px;
  top: 13px;
  width: calc(100% - 20px);
  height: 160px;
  object-fit: cover;
  opacity: 1;
  filter: none;
  border: 1px solid rgba(238, 207, 116, 0.78);
}

.storyline-node-current span,
.storyline-node-video span {
  position: absolute;
  left: 10px;
  right: 10px;
  top: auto;
  bottom: 9px;
  height: 28px;
  min-height: 0;
  display: grid;
  place-items: center;
  background: rgba(78, 49, 20, 0.88);
  border: 1px solid rgba(223, 184, 91, 0.72);
  color: #fff0c1;
  font-size: 14px;
  line-height: 1;
  text-shadow: 0 1px 3px #000;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 2;
}

.storyline-node-current i,
.storyline-node-video i {
  position: absolute;
  right: -6px;
  top: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ffd2db, #e86688 58%, #8f2d43);
  box-shadow: 0 0 6px rgba(255, 238, 180, 0.75);
}

.storyline-node-layer.dragging .storyline-node {
  pointer-events: auto;
}

.storyline-node-current,
.storyline-node-video {
  height: 222px;
  background:
    linear-gradient(180deg, rgba(247, 222, 136, 0.95) 0 8px, rgba(55, 33, 12, 0.05) 8px 172px, rgba(96, 55, 18, 0.96) 172px 100%);
}

.storyline-node-current img,
.storyline-node-video img {
  top: 13px;
  height: 160px;
  opacity: 1;
  filter: none;
}

.storyline-node-current span,
.storyline-node-video span {
  bottom: 9px;
  height: 30px;
  background: rgba(78, 43, 13, 0.96);
  z-index: 3;
}

.storyline-node-current i,
.storyline-node-video i {
  display: none;
}

.player-screen {
  background: #000;
}

.player-stage {
  background: #000;
}

.story-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #000;
}

.player-top {
  position: absolute;
  z-index: 4;
  left: 0;
  right: 0;
  top: 0;
  height: 0;
  display: block;
  pointer-events: none;
}

.icon-button,
.control-button {
  pointer-events: auto;
}

.icon-button img {
  width: 62px;
  height: auto;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.8));
}

.player-top .icon-button {
  position: absolute;
  z-index: 5;
  left: 1vw;
  top: 1.3vh;
  width: 21.5vw;
  height: min(7.5vh, 60px);
  display: flex;
  align-items: center;
  gap: 3.2%;
  padding: 0;
  border: 0;
  color: #fff8d9;
  background: transparent;
  font-size: min(2.55vw, 38px);
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.78);
}

.player-top .icon-button img {
  display: none;
}

.player-top .icon-button::before {
  content: "";
  flex: 0 0 auto;
  width: min(7.9vh, 54px);
  height: min(7.5vh, 52px);
  background: url("./assets/original_ui_refs/-8998326272317709677_未标题-1.png") center / contain no-repeat;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.46));
}

.player-top .icon-button::after {
  content: "返回";
}

.player-top .icon-button:hover,
.player-top .icon-button:focus-visible {
  color: #ffe9a8;
  filter: drop-shadow(0 0 10px rgba(255, 226, 150, 0.38));
}

.back-link,
.player-top .icon-button {
  font-family: KaiTi, STKaiti, "Kaiti SC", "楷体", serif;
  font-size: clamp(24px, 1.75vw, 32px);
  font-weight: 500;
}

.player-logo {
  display: none;
}

.subtitle-line {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 118px;
  transform: translateX(-50%);
  min-height: 38px;
  width: min(86vw, 1180px);
  text-align: center;
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.35;
  text-shadow: 0 3px 8px #000, 0 0 2px #000;
}

.player-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 26px;
  width: min(44vw, 620px);
  height: 78px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: auto auto;
  justify-content: center;
  align-items: center;
  gap: 72px;
  padding: 0;
  overflow: visible;
  background: transparent;
  border-top: 0;
}

.control-group {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow: visible;
}

.control-group-left {
  justify-content: flex-start;
}

.control-group-right {
  justify-content: flex-end;
}

.control-button {
  position: relative;
  width: 74px;
  height: 74px;
  flex: 0 0 74px;
  display: grid;
  place-items: center;
  overflow: visible;
  opacity: 0.82;
}

.control-button::before,
.control-button::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 108px;
  height: 96px;
  transform: translate(-50%, -50%);
  background: var(--control-bg) center / contain no-repeat;
  pointer-events: none;
}

.control-button::after {
  width: 48px;
  height: 66px;
  transform: translate(-50%, -50%);
  background-image: var(--control-select);
  opacity: 0;
  transition: opacity 120ms ease;
}

.control-button img {
  position: relative;
  z-index: 1;
  max-width: 58px;
  max-height: 58px;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.75));
  transition: transform 120ms ease;
}

.control-button:hover::after,
.control-button:focus-visible::after,
.control-button.active::after {
  opacity: 1;
}

.control-button:hover img,
.control-button:focus-visible img,
.control-button.active img {
  transform: scale(1.05);
}

.timebar {
  display: none;
  grid-template-columns: 58px 1fr;
  align-items: center;
  gap: 16px;
  color: var(--muted);
  font-size: 14px;
}

.progress-track {
  height: 6px;
  background: rgba(255, 255, 255, 0.22);
}

.progress-track i {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--gold);
}

.choice-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.32);
}

.choice-box {
  position: absolute;
  inset: 0;
}

.choice-button {
  position: absolute;
  padding: 0 34px;
  text-align: center;
  overflow: visible;
  background: transparent;
  color: #4d1d12;
  font-size: 24px;
  font-weight: 500;
  text-shadow: 0 1px 0 rgba(255, 244, 200, 0.55);
  transition: transform 120ms ease, color 120ms ease;
}

.choice-button::before,
.choice-button::after {
  content: "";
  position: absolute;
  inset: -15% -54% -15% -54%;
  z-index: -1;
  background: var(--choice-bg) center / contain no-repeat;
  pointer-events: none;
}

.choice-button::after {
  background-image: var(--choice-bg-hover);
  opacity: 0;
  transition: opacity 120ms ease;
}

.choice-button:hover,
.choice-button:focus-visible {
  color: #6f1207;
  transform: translateX(0.5%);
}

.choice-button:hover::after,
.choice-button:focus-visible::after {
  opacity: 1;
}

.choice-button:hover {
  color: #6f1207;
}

.modal-card {
  position: absolute;
  z-index: 2;
  left: 26vw;
  top: 24vh;
  width: min(680px, 62vw);
  padding: 34px 38px;
  border: 1px solid var(--line);
  background: rgba(0, 0, 0, 0.58);
}

.modal-card h1 {
  margin: 0 0 16px;
  color: var(--gold);
  font-weight: 500;
}

.modal-card p {
  margin: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

@media (max-width: 0px) {
  .ink-panel {
    left: 24px;
    top: 42px;
    width: 280px;
  }

  .game-logo {
    width: 126px;
  }

  .main-menu {
    left: 96px;
    gap: 34px;
  }

  .chapter-board {
    left: 24px;
    right: 24px;
    top: 150px;
    grid-template-columns: 1fr;
  }

  .player-controls {
    width: min(54vw, 520px);
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 48px;
    padding: 0;
    background: transparent;
  }

  .control-group {
    gap: 4px;
  }

  .control-button {
    width: 58px;
    height: 58px;
    flex-basis: 58px;
  }

  .control-button::before {
    width: 86px;
    height: 76px;
  }

  .control-button img {
    max-width: 44px;
    max-height: 44px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .ink-panel,
  .main-menu {
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    gap: 0 !important;
  }

  .menu-screen .menu-item[data-menu-key="Storyline"] .menu-label {
    font-size: min(4.7vw, 38px) !important;
  }

  .back-link,
  .player-top .icon-button {
    font-family: KaiTi, STKaiti, "Kaiti SC", "楷体", serif !important;
    font-size: min(3.1vw, 24px) !important;
  }

  .player-top .icon-button {
    left: 1% !important;
    top: 1.3% !important;
  }

  .chapter-node span {
    font-size: min(2.05vw, 22px);
  }

  .chapter-node strong {
    font-size: min(2.8vw, 30px);
  }

  .subtitle-line {
    font-size: min(3vw, 24px);
    line-height: 1.18;
  }

  .choice-button {
    font-size: min(3.4vw, 24px);
  }

  .player-top {
    height: 100%;
  }
}

@media (max-width: 900px) and (orientation: portrait) {
  html,
  body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    overscroll-behavior: none;
    touch-action: manipulation;
  }

  .app {
    left: 50%;
    top: 50%;
    right: auto;
    bottom: auto;
    width: var(--app-height);
    height: var(--app-width);
    transform: translate(-50%, -50%) rotate(90deg);
    transform-origin: center center;
  }

  .ink-panel,
  .main-menu {
    left: 0 !important;
    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    gap: 0 !important;
  }

  .menu-screen,
  .chapter-screen,
  .storyline-screen,
  .player-screen,
  .modal-screen,
  .screen-stage,
  .menu-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
  }

  .storyline-node-layer {
    touch-action: none;
    overscroll-behavior: contain;
  }

  .menu-screen .menu-item[data-menu-key="Storyline"] {
    left: 4.2% !important;
    top: 48.5% !important;
    width: 24.5% !important;
    height: 8.8% !important;
  }

  .menu-screen .menu-item[data-menu-key="Storyline"] .menu-label {
    font-size: min(4.7vh, 38px) !important;
  }

  .back-link,
  .player-top .icon-button {
    left: 1% !important;
    top: 1.3% !important;
    width: 18.5% !important;
    height: 6.2% !important;
    font-family: KaiTi, STKaiti, "Kaiti SC", "楷体", serif !important;
    font-size: min(2.9vh, 24px) !important;
    line-height: 1 !important;
  }

  .player-top {
    height: 100%;
  }

  .back-link::before,
  .player-top .icon-button::before {
    width: min(6.4vh, 48px);
    height: min(6.1vh, 46px);
  }

  .chapter-board {
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    bottom: 0 !important;
    height: 43% !important;
    display: flex !important;
    grid-template-columns: none !important;
    align-items: flex-end !important;
    gap: min(3.2vh, 28px) !important;
    padding: 5.6% 2.8% 3.2% !important;
    touch-action: pan-y !important;
    overscroll-behavior: contain !important;
  }

  .chapter-node {
    flex: 0 0 min(28vh, 240px) !important;
    aspect-ratio: 1.56 !important;
    border-width: 2px !important;
  }

  .chapter-node.selected {
    border-width: 3px !important;
    transform: translateY(-0.8%) scale(1.025) !important;
  }

  .chapter-node span {
    left: 7%;
    bottom: 30%;
    font-size: min(1.3vh, 13px);
    line-height: 1.05;
  }

  .chapter-node strong {
    left: 7%;
    right: 4%;
    bottom: 7%;
    font-size: min(2vh, 18px);
    line-height: 1.12;
  }

  .subtitle-line {
    bottom: min(18vw, 118px);
    width: min(86vh, 1180px);
    font-size: min(3vh, 24px);
    line-height: 1.18;
  }

  .player-controls {
    bottom: min(5.4vw, 38px);
    width: min(52vh, 620px);
    height: min(10.8vh, 84px);
    grid-template-columns: auto auto;
    justify-content: center;
    gap: min(7vh, 70px);
    padding: 0;
    background: transparent;
  }

  .control-group {
    gap: min(1vh, 8px);
  }

  .control-button {
    width: min(8.9vh, 72px);
    height: min(8.9vh, 72px);
    flex-basis: min(8.9vh, 72px);
  }

  .control-button::before {
    width: min(12.6vh, 102px);
    height: min(11.2vh, 92px);
    transform: translate(-50%, -50%);
  }

  .control-button::after {
    width: min(6vh, 48px);
    height: min(7.5vh, 60px);
    transform: translate(-50%, -50%);
  }

  .control-button img {
    max-width: min(6.8vh, 55px);
    max-height: min(6.8vh, 55px);
  }

  .choice-button {
    padding: 0 min(2.2vh, 18px);
    font-size: min(2.35vh, 16px);
    line-height: 1;
    white-space: nowrap;
  }

  .choice-button::before,
  .choice-button::after {
    inset: -18% -42% -18% -42%;
  }
}
