:root {
  color-scheme: dark;
  --paper: #f4ead5;
  --muted: #aeb8ba;
  --line: rgba(244, 234, 213, 0.22);
  --panel: rgba(8, 12, 16, 0.58);
  --panel-deep: rgba(8, 12, 16, 0.82);
  --gold: #caa15f;
  --white-tide: #edf2ee;
  font-family: "Noto Serif SC", "Songti SC", "Microsoft YaHei", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #05070a;
  color: var(--paper);
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button,
.overlay-page,
.profile-settings,
.avatar-picker {
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.lobby {
  position: relative;
  width: 100vw;
  height: 100svh;
  min-width: 320px;
  min-height: 620px;
  overflow: hidden;
  isolation: isolate;
}

.hall-bg,
.shade {
  position: absolute;
  inset: 0;
  z-index: -3;
}

.hall-bg {
  background-image: url("./assets/optimized/main-hall-bg.webp");
  background-size: cover;
  background-position: center;
}

.shade {
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(4, 7, 10, 0.82), rgba(4, 7, 10, 0.18) 42%, rgba(4, 7, 10, 0.78)),
    linear-gradient(0deg, rgba(4, 7, 10, 0.8), rgba(4, 7, 10, 0.06) 48%, rgba(4, 7, 10, 0.46));
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 220;
  overflow: hidden;
  background: #040608;
  opacity: 1;
  visibility: visible;
  transition: opacity 520ms ease, visibility 520ms ease;
}

.loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.loading-visual,
.loading-veil {
  position: absolute;
  inset: 0;
}

.loading-visual {
  background-image: url("./assets/optimized/loading-memory-corridor.webp");
  background-position: center;
  background-size: cover;
  transform: scale(1.04);
  opacity: 0.78;
  transition: opacity 620ms ease, transform 2600ms ease, background-image 620ms ease;
}

.loading-screen.slide-shift .loading-visual {
  opacity: 0.9;
  transform: scale(1.08);
}

.loading-veil {
  background:
    radial-gradient(circle at 64% 44%, rgba(202, 161, 95, 0.14), transparent 28%),
    linear-gradient(90deg, rgba(4, 7, 10, 0.88), rgba(4, 7, 10, 0.24) 44%, rgba(4, 7, 10, 0.72)),
    linear-gradient(0deg, rgba(4, 7, 10, 0.92), rgba(4, 7, 10, 0.1) 56%, rgba(4, 7, 10, 0.66));
}

.loading-copy {
  position: absolute;
  left: clamp(28px, 7vw, 96px);
  bottom: clamp(150px, 23vh, 240px);
  max-width: 620px;
}

.loading-copy span,
.loading-copy p,
.loading-meta,
.wake-button {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.loading-copy span {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.12em;
}

.loading-copy strong {
  display: block;
  margin-top: 10px;
  color: var(--gold);
  font-size: clamp(48px, 7vw, 104px);
  font-weight: 700;
  letter-spacing: 0;
  text-shadow: 0 0 34px rgba(202, 161, 95, 0.26);
}

.loading-copy p {
  margin: 14px 0 0;
  color: rgba(244, 234, 213, 0.86);
  font-size: clamp(16px, 1.6vw, 22px);
}

.loading-footer {
  position: absolute;
  right: clamp(28px, 7vw, 96px);
  bottom: clamp(44px, 8vh, 78px);
  left: clamp(28px, 7vw, 96px);
}

.loading-progress {
  height: 8px;
  border: 1px solid rgba(244, 234, 213, 0.32);
  background: rgba(0, 0, 0, 0.34);
}

.loading-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(244, 234, 213, 0.95), rgba(202, 161, 95, 0.98), rgba(129, 184, 195, 0.72));
  box-shadow: 0 0 22px rgba(202, 161, 95, 0.46);
  transition: width 180ms ease;
}

.loading-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.loading-meta span {
  color: var(--paper);
  font-size: 18px;
}

.wake-button {
  min-width: 190px;
  min-height: 48px;
  border: 1px solid rgba(202, 161, 95, 0.72);
  background: rgba(0, 0, 0, 0.35);
  color: var(--muted);
  font-size: 17px;
}

.wake-button:not(:disabled) {
  background: var(--gold);
  color: #111;
  box-shadow: 0 0 28px rgba(202, 161, 95, 0.28);
}

.wake-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.player-card,
.resource-panel,
.info-ribbon,
.menu-button,
.confirm-box,
.detail-box,
.assistant-dialogue,
.assistant-editor,
.overlay-page {
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(14px);
}

.player-card {
  position: absolute;
  z-index: 24;
  top: 24px;
  left: 28px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 13px;
  align-items: center;
  width: 310px;
  padding: 13px;
  text-align: left;
}

.player-card:hover {
  border-color: rgba(202, 161, 95, 0.74);
  background:
    linear-gradient(135deg, rgba(202, 161, 95, 0.12), rgba(8, 12, 16, 0.44)),
    var(--panel);
}

.resource-panel {
  position: absolute;
  z-index: 24;
  top: 24px;
  right: 30px;
  display: grid;
  grid-template-columns: repeat(3, 116px) 250px;
  gap: 14px;
  align-items: center;
  padding: 12px;
  background: rgba(8, 12, 16, 0.62);
}

.currency {
  min-height: 48px;
  padding: 8px 13px;
  border: 1px solid rgba(202, 161, 95, 0.44);
  background:
    linear-gradient(135deg, rgba(202, 161, 95, 0.18), rgba(8, 12, 16, 0.16)),
    rgba(0, 0, 0, 0.18);
}

.currency span,
.currency strong,
.meter-label span,
.meter-label strong {
  display: block;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.currency span,
.meter-label span {
  color: var(--muted);
  font-size: 11px;
}

.currency strong {
  margin-top: 4px;
  color: var(--gold);
  font-size: 20px;
  line-height: 1;
}

.currency.material strong {
  color: #b9c4bf;
}

.currency.contract strong {
  color: #d7c3ff;
}

.tide-meter {
  min-width: 0;
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.meter-label strong {
  color: var(--white-tide);
  font-size: 12px;
}

.meter-track {
  height: 10px;
  border: 1px solid rgba(237, 242, 238, 0.28);
  background: rgba(237, 242, 238, 0.08);
  overflow: hidden;
}

.meter-track span {
  display: block;
  height: 100%;
  background:
    linear-gradient(90deg, rgba(237, 242, 238, 0.95), rgba(129, 184, 195, 0.9)),
    var(--white-tide);
  box-shadow: 0 0 18px rgba(237, 242, 238, 0.38);
}

.avatar {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border: 1px solid var(--gold);
  color: var(--gold);
  background: rgba(0, 0, 0, 0.28);
  font-size: 22px;
}

.profile-page {
  z-index: 90;
  padding: 42px clamp(28px, 5vw, 72px);
  overflow: hidden;
  background: #05070a;
}

.profile-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("./assets/optimized/main-hall-bg.webp");
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
}

.profile-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.86), rgba(5, 7, 10, 0.28) 48%, rgba(5, 7, 10, 0.8)),
    linear-gradient(0deg, rgba(5, 7, 10, 0.86), rgba(5, 7, 10, 0.18) 54%, rgba(5, 7, 10, 0.5));
}

.profile-header {
  position: relative;
  z-index: 6;
}

.profile-header-actions {
  display: flex;
  gap: 10px;
}

.profile-close {
  position: fixed;
  top: 42px;
  right: clamp(28px, 5vw, 72px);
  z-index: 12;
}

.profile-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(340px, 520px) minmax(300px, 1fr);
  grid-auto-rows: min-content;
  gap: 18px;
  align-content: start;
  height: calc(100% - 86px);
  max-width: 1380px;
  margin: 0 auto;
  padding-top: clamp(42px, 8vh, 96px);
  padding-bottom: 96px;
}

.profile-identity,
.profile-panel,
.profile-settings {
  border: 1px solid rgba(244, 234, 213, 0.22);
  background: rgba(8, 12, 16, 0.72);
  backdrop-filter: blur(14px);
}

.profile-identity {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 22px;
}

.profile-avatar {
  display: grid;
  place-items: center;
  width: 112px;
  height: 112px;
  border: 1px solid var(--gold);
  background:
    radial-gradient(circle, rgba(202, 161, 95, 0.22), transparent 60%),
    rgba(0, 0, 0, 0.35);
  color: var(--gold);
  font-size: 48px;
  overflow: hidden;
}

.avatar img,
.profile-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--avatar-y, 50%);
}

.profile-avatar:hover {
  border-color: rgba(244, 234, 213, 0.74);
  box-shadow: 0 0 26px rgba(202, 161, 95, 0.22);
}

.profile-fields {
  display: grid;
  gap: 14px;
}

.profile-fields label,
.profile-settings label {
  display: grid;
  gap: 7px;
}

.profile-fields span,
.profile-panel > span,
.profile-settings span,
.profile-settings strong {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.profile-fields span,
.profile-panel > span,
.profile-settings span {
  color: var(--muted);
  font-size: 12px;
}

.profile-fields input,
.profile-fields textarea,
.profile-settings select {
  width: 100%;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(0, 0, 0, 0.3);
  color: var(--paper);
  font: 16px Arial, "Microsoft YaHei", sans-serif;
}

.profile-fields input {
  min-height: 44px;
  padding: 0 12px;
}

.profile-fields textarea {
  min-height: 84px;
  padding: 10px 12px;
  resize: none;
  line-height: 1.6;
}

.profile-panel {
  padding: 18px;
}

.avatar-picker {
  position: absolute;
  left: 0;
  top: 146px;
  z-index: 7;
  display: block;
  width: min(620px, 100%);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
}

.avatar-picker.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-panel > span {
  display: block;
  margin-bottom: 12px;
}

.avatar-options,
.background-options {
  display: grid;
  gap: 10px;
}

.avatar-options {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.avatar-choice {
  display: grid;
  place-items: center;
  min-height: 92px;
  border: 1px solid rgba(202, 161, 95, 0.42);
  background: rgba(0, 0, 0, 0.3);
  color: var(--gold);
  overflow: hidden;
}

.avatar-choice.image-choice {
  position: relative;
  padding: 0;
}

.avatar-choice img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center var(--avatar-y, 50%);
  filter: saturate(0.9) contrast(1.04);
}

.avatar-choice span {
  position: absolute;
  left: 6px;
  right: 6px;
  bottom: 6px;
  padding: 3px 5px;
  background: rgba(0, 0, 0, 0.62);
  color: rgba(244, 234, 213, 0.9);
  font: 11px Arial, "Microsoft YaHei", sans-serif;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar-choice.active,
.background-choice.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px rgba(202, 161, 95, 0.3), 0 0 24px rgba(202, 161, 95, 0.18);
}

.background-options {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.background-choice {
  min-height: 92px;
  padding: 9px;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background-size: cover;
  background-position: center;
  color: var(--paper);
  text-align: left;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  overflow: hidden;
}

.background-choice span {
  display: inline-block;
  padding: 4px 7px;
  background: rgba(0, 0, 0, 0.58);
  color: rgba(244, 234, 213, 0.88);
  font-size: 12px;
}

.profile-settings {
  position: absolute;
  right: 0;
  bottom: 74px;
  z-index: 9;
  display: grid;
  width: min(360px, 100%);
  padding: 20px;
  gap: 16px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.profile-settings.open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.profile-settings strong {
  color: var(--gold);
  font-size: 24px;
}

.profile-settings input[type="range"] {
  accent-color: var(--gold);
}

.profile-settings select {
  min-height: 42px;
  padding: 0 10px;
}

.profile-settings-fab {
  position: absolute;
  right: 0;
  bottom: 18px;
  z-index: 10;
  min-width: 92px;
  min-height: 42px;
  border: 1px solid rgba(202, 161, 95, 0.68);
  background: rgba(8, 12, 16, 0.78);
  color: var(--paper);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.player-card span,
.player-card small,
.menu-button span,
.info-ribbon p {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.player-card span,
.player-card strong,
.player-card small {
  display: block;
}

.player-card span,
.player-card small {
  color: var(--muted);
  font-size: 12px;
}

.player-card strong {
  margin: 3px 0;
  overflow: hidden;
  font-size: 19px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.side-menu {
  position: absolute;
  z-index: 24;
  display: grid;
  gap: 12px;
}

.left-menu {
  left: 28px;
  top: 150px;
  width: 178px;
}

.right-menu {
  right: 30px;
  top: 130px;
  width: 218px;
}

.menu-button {
  position: relative;
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 60px;
  padding: 11px 14px;
  border-width: 1px;
  border-style: solid;
  border-image: linear-gradient(135deg, rgba(244, 234, 213, 0.28), rgba(202, 161, 95, 0.82), rgba(119, 185, 178, 0.24)) 1;
  color: rgba(244, 234, 213, 0.78);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.menu-button::before,
.menu-button::after {
  content: "";
  position: absolute;
  width: 13px;
  height: 13px;
  border-color: var(--gold);
  pointer-events: none;
  opacity: 0.82;
}

.menu-button::before {
  top: -1px;
  left: -1px;
  border-top: 2px solid;
  border-left: 2px solid;
}

.menu-button::after {
  right: -1px;
  bottom: -1px;
  border-right: 2px solid;
  border-bottom: 2px solid;
}

.menu-button span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(202, 161, 95, 0.42);
  color: var(--gold);
  font-size: 11px;
}

.menu-button strong {
  font-size: 17px;
  line-height: 1.2;
}

.menu-button.primary {
  min-height: 68px;
}

.menu-button:hover,
.menu-button.active {
  border-color: rgba(202, 161, 95, 0.88);
  background:
    linear-gradient(90deg, rgba(202, 161, 95, 0.2), rgba(20, 24, 28, 0.74)),
    rgba(20, 24, 28, 0.76);
  color: var(--paper);
  transform: translateX(2px);
}

.left-menu .menu-button:hover,
.left-menu .menu-button.active {
  transform: translateX(-2px);
}

.executor-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: auto;
  touch-action: none;
}

.executor-stage::before {
  content: "";
  position: absolute;
  left: 40%;
  right: 25%;
  bottom: 1vh;
  height: 12vh;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(238, 242, 238, 0.2), transparent 70%);
  filter: blur(10px);
}

.home-assistant {
  position: absolute;
  left: var(--home-x, 50%);
  bottom: var(--home-y, -5vh);
  width: min(38vw, 500px);
  height: 91vh;
  transform: translateX(-50%) scale(var(--home-scale, 1));
  transform-origin: center bottom;
  pointer-events: auto;
}

.home-assistant img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
  filter: drop-shadow(0 24px 26px rgba(0, 0, 0, 0.72));
  user-select: none;
  -webkit-user-drag: none;
}

.home-assistant.highlight img {
  filter:
    drop-shadow(0 0 18px rgba(202, 161, 95, 0.42))
    drop-shadow(0 24px 26px rgba(0, 0, 0, 0.72));
}

.assistant-editor {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 12;
  display: none;
  width: min(440px, calc(100% - 32px));
  padding: 14px;
  transform: translateX(-50%);
  background: rgba(8, 12, 16, 0.78);
}

.assistant-editor.open {
  display: block;
}

.editor-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.editor-head span,
.assistant-editor p,
.scale-control,
.assistant-option,
.editor-actions button {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.editor-head span,
.assistant-editor p,
.scale-control span {
  color: var(--muted);
  font-size: 11px;
}

.editor-head strong {
  color: var(--gold);
  font-size: 18px;
}

.assistant-list {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow: auto;
}

.assistant-option {
  min-width: 86px;
  min-height: 36px;
  border: 1px solid rgba(202, 161, 95, 0.4);
  background: rgba(0, 0, 0, 0.2);
  color: var(--paper);
}

.assistant-option.visible::after {
  content: " 已显示";
  color: var(--gold);
  font-size: 11px;
}

.assistant-option.active {
  border-color: var(--gold);
  background: rgba(202, 161, 95, 0.18);
}

.scale-control {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.scale-control input {
  width: 100%;
  accent-color: var(--gold);
}

.editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}

.editor-actions button {
  min-height: 36px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(0, 0, 0, 0.24);
}

.editor-actions button:last-child {
  background: var(--gold);
  color: #111;
}

.assistant-editor p {
  margin: 10px 0 0;
}

.assistant-dialogue {
  position: absolute;
  left: 50%;
  bottom: clamp(92px, 11vh, 132px);
  z-index: 13;
  display: none;
  width: min(620px, calc(100% - 360px));
  min-width: 420px;
  padding: 16px 20px;
  transform: translateX(-50%);
  background:
    linear-gradient(90deg, rgba(8, 12, 16, 0.92), rgba(8, 12, 16, 0.78)),
    rgba(8, 12, 16, 0.78);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.36);
  pointer-events: none;
}

.assistant-dialogue.open {
  display: block;
}

.assistant-dialogue strong {
  display: block;
  color: var(--gold);
  font-size: 20px;
}

.assistant-dialogue p {
  margin: 8px 0 0;
  color: rgba(244, 234, 213, 0.86);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.7;
}

.info-ribbon {
  display: none;
  position: absolute;
  left: 240px;
  right: 284px;
  bottom: 34px;
  min-height: 82px;
  padding: 16px 20px;
  background: rgba(8, 12, 16, 0.64);
}

.info-ribbon span {
  color: var(--gold);
  font-size: 20px;
}

.info-ribbon p {
  max-width: 760px;
  margin: 8px 0 0;
  color: rgba(244, 234, 213, 0.82);
  font-size: 14px;
  line-height: 1.7;
}

.overlay-page {
  position: absolute;
  z-index: 70;
  inset: 0;
  display: block;
  padding: 42px clamp(28px, 5vw, 72px);
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.98), rgba(5, 7, 10, 0.86) 54%, rgba(5, 7, 10, 0.94)),
    var(--panel-deep);
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.48);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.overlay-page.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.overlay-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  max-width: 1320px;
  margin: 0 auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.overlay-header span,
.overlay-header strong,
.close-button,
.executor-card strong {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.overlay-header span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.overlay-header strong {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 24px;
}

.tide-page {
  padding: 42px clamp(28px, 5vw, 72px);
  overflow: hidden;
}

.tide-scene {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-size: cover;
  background-position: center;
  transform: scale(1.01);
}

.tide-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.84), rgba(5, 7, 10, 0.24) 48%, rgba(5, 7, 10, 0.78)),
    linear-gradient(0deg, rgba(5, 7, 10, 0.78), rgba(5, 7, 10, 0.08) 50%, rgba(5, 7, 10, 0.54));
}

.tide-scene.mainline {
  background-image: url("./assets/optimized/white-tide-mainline-bg.webp");
}

.tide-scene.dispatch {
  background-image: url("./assets/optimized/white-tide-dispatch-map.webp");
}

.tide-header {
  position: relative;
  z-index: 1;
}

.tide-content {
  position: relative;
  z-index: 1;
  display: block;
  max-width: 1320px;
  height: calc(100% - 86px);
  margin: 0 auto;
  padding-bottom: 48px;
}

.tide-tabs {
  position: absolute;
  left: 0;
  bottom: 250px;
  display: flex;
  gap: 12px;
  width: min(520px, 100%);
}

.tide-tab {
  min-width: 128px;
  min-height: 46px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(8, 12, 16, 0.58);
  color: rgba(244, 234, 213, 0.82);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.tide-tab.active {
  background: var(--gold);
  color: #111;
}

.tide-copy {
  position: absolute;
  left: 0;
  bottom: 64px;
  width: min(520px, 100%);
  padding: 18px 20px;
  border: 1px solid rgba(244, 234, 213, 0.2);
  background: rgba(8, 12, 16, 0.6);
  backdrop-filter: blur(12px);
}

.tide-copy span,
.tide-copy p {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.tide-copy span {
  color: var(--muted);
  font-size: 12px;
}

.tide-copy strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: clamp(28px, 3.2vw, 42px);
}

.tide-copy p {
  margin: 12px 0 0;
  color: rgba(244, 234, 213, 0.86);
  font-size: 15px;
  line-height: 1.7;
}

.mainline-shell.hidden,
.chapter-detail-card.hidden,
.dispatch-shell.hidden {
  display: none;
}

.mainline-shell {
  position: absolute;
  inset: 68px 0 0;
  pointer-events: auto;
}

.chapter-route {
  position: absolute;
  right: 0;
  bottom: 112px;
  width: min(760px, 58vw);
  height: min(440px, 54vh);
  min-height: 360px;
  pointer-events: none;
}

.chapter-route::before {
  content: "";
  position: absolute;
  left: 7%;
  top: 50%;
  width: 84%;
  height: 1px;
  border-top: 2px solid rgba(202, 161, 95, 0.44);
  border-radius: 0;
  transform: rotate(-8deg);
  filter: drop-shadow(0 0 18px rgba(202, 161, 95, 0.22));
}

.chapter-node {
  position: absolute;
  left: var(--chapter-x);
  top: var(--chapter-y);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 112px;
  transform: translate(-50%, -50%);
  background: transparent;
  pointer-events: auto;
}

.chapter-node i {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border: 1px solid rgba(244, 234, 213, 0.36);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(237, 242, 238, 0.28), transparent 60%),
    rgba(5, 7, 10, 0.72);
  color: var(--paper);
  font-style: normal;
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 24px;
  box-shadow: 0 0 0 8px rgba(202, 161, 95, 0.05), 0 0 32px rgba(237, 242, 238, 0.18);
}

.chapter-node span {
  display: block;
  padding: 4px 10px;
  border: 1px solid rgba(202, 161, 95, 0.38);
  background: rgba(8, 12, 16, 0.72);
  color: rgba(244, 234, 213, 0.86);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 14px;
  white-space: nowrap;
}

.chapter-node.active i,
.chapter-node:hover i {
  border-color: var(--gold);
  color: var(--gold);
  box-shadow: 0 0 0 10px rgba(202, 161, 95, 0.08), 0 0 36px rgba(202, 161, 95, 0.36);
}

.chapter-node.completed i {
  background:
    radial-gradient(circle, rgba(202, 161, 95, 0.34), transparent 58%),
    rgba(5, 7, 10, 0.78);
}

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

.chapter-detail-card {
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 5;
  width: min(540px, 46vw);
  padding: 20px 22px;
  border: 1px solid rgba(244, 234, 213, 0.22);
  background: rgba(8, 12, 16, 0.82);
  backdrop-filter: blur(14px);
  pointer-events: auto;
}

.chapter-detail-card span,
.chapter-detail-card p,
.chapter-rewards,
.story-enter {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.chapter-detail-card > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.chapter-detail-card > strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: clamp(22px, 2.4vw, 34px);
}

.chapter-detail-card p {
  margin: 12px 0 0;
  color: rgba(244, 234, 213, 0.86);
  font-size: 15px;
  line-height: 1.75;
}

.chapter-rewards {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.chapter-rewards span {
  padding: 6px 10px;
  border: 1px solid rgba(202, 161, 95, 0.34);
  background: rgba(202, 161, 95, 0.12);
  color: rgba(244, 234, 213, 0.88);
  font-size: 13px;
}

.story-enter {
  width: 100%;
  min-height: 48px;
  margin-top: 18px;
  background: var(--gold);
  color: #111;
}

.story-enter:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.dispatch-shell {
  position: absolute;
  inset: 68px 0 0;
}

.dispatch-tabs {
  position: absolute;
  left: 0;
  top: 16px;
  z-index: 3;
  display: flex;
  gap: 12px;
}

.dispatch-tab {
  min-width: 136px;
  min-height: 44px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(8, 12, 16, 0.62);
  color: rgba(244, 234, 213, 0.82);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.dispatch-tab.active {
  background: var(--gold);
  color: #111;
}

.dispatch-map {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(244, 234, 213, 0.2);
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.52);
}

.dispatch-map::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 45%, transparent 0 35%, rgba(5, 7, 10, 0.36) 76%),
    linear-gradient(0deg, rgba(5, 7, 10, 0.42), transparent 38%);
}

.dispatch-spot {
  position: absolute;
  left: var(--spot-x);
  top: var(--spot-y);
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 122px;
  background: transparent;
  transform: translate(-50%, -50%);
}

.dispatch-spot i {
  display: block;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(237, 242, 238, 0.72);
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(237, 242, 238, 0.96), rgba(202, 161, 95, 0.62) 38%, rgba(202, 161, 95, 0.08) 68%, transparent 72%);
  box-shadow: 0 0 20px rgba(237, 242, 238, 0.72), 0 0 42px rgba(202, 161, 95, 0.42);
}

.dispatch-spot span {
  padding: 4px 9px;
  border: 1px solid rgba(202, 161, 95, 0.4);
  background: rgba(8, 12, 16, 0.76);
  color: rgba(244, 234, 213, 0.9);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 13px;
  white-space: nowrap;
}

.dispatch-spot:hover i {
  border-color: var(--gold);
  box-shadow: 0 0 24px rgba(237, 242, 238, 0.86), 0 0 54px rgba(202, 161, 95, 0.62);
}

.dispatch-panel {
  position: absolute;
  right: 0;
  bottom: 42px;
  z-index: 4;
  width: min(520px, 44vw);
  padding: 20px 22px;
  border: 1px solid rgba(244, 234, 213, 0.22);
  background: rgba(8, 12, 16, 0.82);
  backdrop-filter: blur(14px);
}

.dispatch-panel span,
.dispatch-panel p,
.dispatch-actions button {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.dispatch-panel span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.dispatch-panel strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: clamp(24px, 2.5vw, 36px);
}

.dispatch-panel p {
  margin: 12px 0 0;
  color: rgba(244, 234, 213, 0.86);
  font-size: 15px;
  line-height: 1.75;
}

.dispatch-panel .dispatch-note {
  color: rgba(214, 173, 103, 0.92);
}

.dispatch-panel .dispatch-status {
  border: 1px solid rgba(202, 161, 95, 0.38);
  padding: 10px 12px;
  color: var(--paper);
  background: rgba(202, 161, 95, 0.12);
}

.dispatch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.dispatch-actions button {
  min-height: 42px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(0, 0, 0, 0.24);
  color: var(--paper);
}

.dispatch-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.dispatch-actions button:last-child {
  background: var(--gold);
  color: #111;
}

.story-stage {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: block;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: #05070a;
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 200ms ease;
}

.story-stage.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.story-scene {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(5, 7, 10, 0.88), rgba(5, 7, 10, 0.16) 48%, rgba(5, 7, 10, 0.78)),
    url("./assets/optimized/white-tide-mainline-bg.webp") center / cover;
}

.story-cast {
  position: absolute;
  inset: 0;
}

.story-character {
  position: absolute;
  bottom: -8vh;
  width: min(36vw, 520px);
  height: 92vh;
  margin: 0;
  pointer-events: none;
}

.story-character img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: bottom center;
  filter: drop-shadow(0 28px 34px rgba(0, 0, 0, 0.58));
}

.story-character.c1 {
  left: 16%;
}

.story-character.c2 {
  left: 38%;
  opacity: 0.9;
}

.story-character.c3 {
  right: 10%;
  opacity: 0.82;
}

.story-panel {
  position: absolute;
  left: 50%;
  bottom: 36px;
  width: min(900px, calc(100% - 64px));
  min-height: 148px;
  padding: 20px 24px;
  border: 1px solid rgba(244, 234, 213, 0.22);
  background: rgba(8, 12, 16, 0.84);
  transform: translateX(-50%);
  backdrop-filter: blur(14px);
}

.story-panel.repair-mode {
  width: min(1040px, calc(100% - 64px));
  max-height: min(70vh, 680px);
  overflow: auto;
}

.story-panel span,
.story-panel p,
.story-next,
.repair-helper,
.repair-game small {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.story-panel > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.story-panel > strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 22px;
}

.story-panel > p {
  margin: 10px 0 0;
  color: rgba(244, 234, 213, 0.88);
  font-size: 17px;
  line-height: 1.65;
}

.story-next {
  float: right;
  min-width: 150px;
  min-height: 44px;
  margin-top: 16px;
  background: var(--gold);
  color: #111;
}

.repair-game {
  display: none;
  margin-top: 16px;
}

.repair-game.open {
  display: block;
}

.repair-helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.repair-helper {
  min-width: 150px;
  min-height: 46px;
  padding: 8px 12px;
  border: 1px solid rgba(202, 161, 95, 0.42);
  background: rgba(0, 0, 0, 0.28);
  text-align: left;
}

.repair-helper small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.repair-interrogate {
  display: grid;
  gap: 10px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(244, 234, 213, 0.16);
  background: rgba(0, 0, 0, 0.2);
}

.repair-interrogate > span,
.repair-code span,
.repair-code input,
.repair-code button,
.repair-interrogate button,
.repair-interrogate p {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.repair-interrogate > span,
.repair-code span {
  color: var(--muted);
  font-size: 12px;
}

.repair-interrogate div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.repair-interrogate button {
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(202, 161, 95, 0.42);
  background: rgba(0, 0, 0, 0.24);
  color: var(--paper);
}

.repair-interrogate button.asked {
  border-color: rgba(202, 161, 95, 0.86);
  color: var(--gold);
}

.repair-interrogate p {
  margin: 0;
  color: rgba(244, 234, 213, 0.78);
  font-size: 14px;
  line-height: 1.6;
}

.repair-code {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 10px;
  align-items: end;
  margin-top: 12px;
}

.repair-code label {
  display: grid;
  gap: 6px;
}

.repair-code input {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(0, 0, 0, 0.32);
  color: var(--paper);
  font-size: 20px;
  letter-spacing: 0.16em;
}

.repair-code button {
  min-height: 42px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: var(--gold);
  color: #111;
}

.repair-board {
  display: grid;
  grid-template-columns: repeat(6, 72px);
  gap: 12px;
  margin-top: 14px;
}

.repair-chip {
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(244, 234, 213, 0.26);
  background:
    linear-gradient(135deg, rgba(202, 161, 95, 0.18), rgba(237, 242, 238, 0.06)),
    rgba(0, 0, 0, 0.34);
  transform: rotate(var(--chip-turn));
}

.repair-chip span {
  color: rgba(244, 234, 213, 0.86);
  font-size: 28px;
}

.repair-chip i {
  position: absolute;
  inset: 14px;
  border-top: 2px solid rgba(237, 242, 238, 0.5);
  border-left: 2px solid rgba(202, 161, 95, 0.56);
}

.repair-game small {
  display: block;
  margin-top: 10px;
  color: rgba(244, 234, 213, 0.68);
}

.close-button {
  min-width: 78px;
  min-height: 38px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(0, 0, 0, 0.24);
  color: var(--paper);
}

.executor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 18px;
  max-width: 1320px;
  height: calc(100% - 86px);
  margin: 0 auto;
  padding-top: 22px;
  overflow: auto;
}

.owned-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 18px;
  max-width: 1320px;
  height: calc(100% - 86px);
  margin: 0 auto;
  padding-top: 22px;
  overflow: auto;
}

.owned-card {
  min-height: 320px;
  padding: 14px;
  border: 1px solid rgba(202, 161, 95, 0.52);
  background:
    linear-gradient(180deg, rgba(202, 161, 95, 0.12), rgba(8, 12, 16, 0.72)),
    rgba(8, 12, 16, 0.62);
  color: var(--paper);
}

.owned-card .portrait {
  margin-bottom: 12px;
}

.owned-card strong,
.owned-card span,
.owned-card small {
  display: block;
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.owned-card strong {
  font-size: 18px;
}

.owned-card span {
  margin-top: 5px;
  color: var(--gold);
  font-size: 12px;
}

.owned-card small {
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.45;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(180px, 1fr));
  gap: 18px;
  max-width: 980px;
  margin: 28px auto 0;
}

.shop-card {
  min-height: 220px;
  padding: 22px;
  border: 1px solid rgba(202, 161, 95, 0.56);
  border-image: linear-gradient(135deg, rgba(244, 234, 213, 0.32), rgba(202, 161, 95, 0.9), rgba(119, 185, 178, 0.24)) 1;
  background:
    linear-gradient(180deg, rgba(202, 161, 95, 0.13), rgba(8, 12, 16, 0.74)),
    rgba(8, 12, 16, 0.74);
  color: var(--paper);
  text-align: left;
}

.shop-card span,
.shop-card small {
  display: block;
  color: var(--muted);
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.shop-card span {
  font-size: 11px;
}

.shop-card strong {
  display: block;
  margin-top: 24px;
  color: var(--gold);
  font-size: 26px;
}

.shop-card small {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.executor-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 300px;
  padding: 14px;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(8, 12, 16, 0.62);
  color: var(--paper);
  overflow: hidden;
}

.executor-card.acquired {
  border-color: rgba(202, 161, 95, 0.7);
  background:
    linear-gradient(180deg, rgba(202, 161, 95, 0.14), rgba(8, 12, 16, 0.72)),
    rgba(8, 12, 16, 0.62);
}

.executor-card.locked {
  color: rgba(244, 234, 213, 0.72);
}

.executor-card.locked:hover {
  border-color: rgba(202, 161, 95, 0.72);
  background:
    linear-gradient(180deg, rgba(202, 161, 95, 0.12), rgba(8, 12, 16, 0.74)),
    rgba(8, 12, 16, 0.7);
}

.portrait {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(202, 161, 95, 0.34);
  background: rgba(0, 0, 0, 0.42);
  clip-path: inset(0);
}

.portrait img {
  position: absolute;
  left: 50%;
  top: var(--crop-top, 104%);
  width: auto;
  height: var(--crop-height, 245%);
  max-width: none;
  transform: translate(-50%, -50%);
  object-fit: contain;
}

.portrait.unowned img,
.detail-portrait.unowned img {
  filter: grayscale(1) brightness(0.34) contrast(1.05);
}

.portrait.unowned::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle, rgba(244, 234, 213, 0.08), transparent 42%),
    rgba(0, 0, 0, 0.34);
}

.portrait.unowned em {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: clamp(62px, 7vw, 92px);
  height: clamp(62px, 7vw, 92px);
  border: 1px solid rgba(244, 234, 213, 0.22);
  border-radius: 50%;
  color: rgba(244, 234, 213, 0.62);
  font-style: normal;
  font-size: clamp(34px, 4.3vw, 58px);
  line-height: 1;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.28);
}

.portrait.cutout {
  background:
    linear-gradient(180deg, rgba(244, 234, 213, 0.05), rgba(0, 0, 0, 0.12)),
    rgba(0, 0, 0, 0.18);
}

.portrait.cutout img {
  left: 50%;
  top: 50%;
  width: auto;
  height: 112%;
  transform: translate(-50%, -50%);
}

.portrait.secret {
  display: grid;
  place-items: center;
  border-color: rgba(244, 234, 213, 0.12);
  background:
    radial-gradient(circle, rgba(244, 234, 213, 0.1), transparent 38%),
    #050607;
  color: rgba(244, 234, 213, 0.48);
  font-size: clamp(42px, 5vw, 68px);
}

.portrait.secret::before,
.portrait.secret::after {
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  top: 50%;
  height: 2px;
  background: rgba(244, 234, 213, 0.18);
}

.portrait.secret::before {
  transform: rotate(90deg);
}

.card-footer {
  display: grid;
  gap: 4px;
  margin-top: 10px;
}

.card-footer strong,
.card-footer small,
.card-footer b {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.card-footer strong {
  font-size: 17px;
}

.card-footer small {
  color: var(--muted);
  font-size: 12px;
}

.card-footer b {
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
}

.confirm-modal {
  position: absolute;
  inset: 0;
  z-index: 120;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.54);
}

.executor-detail {
  position: absolute;
  inset: 0;
  z-index: 110;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.46);
}

.executor-detail.open {
  display: grid;
}

.detail-box {
  position: relative;
  width: min(720px, 100%);
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(14, 18, 22, 0.97), rgba(7, 10, 13, 0.92)),
    var(--panel-deep);
}

.detail-close {
  position: absolute;
  top: 18px;
  right: 18px;
  min-width: 66px;
  min-height: 34px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(0, 0, 0, 0.22);
}

.detail-head span,
.detail-head small,
.stat-name,
.stat-value,
.detail-action,
.detail-close,
#detailSummary {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.detail-head span,
.detail-head small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-head strong {
  display: block;
  margin: 7px 0;
  color: var(--gold);
  font-size: 34px;
}

.detail-body {
  display: grid;
  grid-template-columns: 210px 1fr;
  gap: 22px;
  margin-top: 20px;
}

.detail-portrait {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border: 1px solid rgba(202, 161, 95, 0.5);
  background: #050607;
  clip-path: inset(0);
}

.detail-portrait img {
  position: absolute;
  left: 50%;
  top: var(--crop-top, 104%);
  width: auto;
  height: var(--crop-height, 245%);
  max-width: none;
  transform: translate(-50%, -50%);
}

.detail-portrait.secret {
  display: grid;
  place-items: center;
  color: rgba(244, 234, 213, 0.48);
  font-size: 80px;
}

.detail-portrait.unowned::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.54));
}

.detail-portrait.unowned em {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 2;
  padding: 5px 9px;
  border: 1px solid rgba(202, 161, 95, 0.44);
  color: var(--gold);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-style: normal;
  background: rgba(0, 0, 0, 0.42);
}

.repair-layout {
  display: grid;
  grid-template-columns: minmax(230px, 300px) minmax(0, 1fr);
  gap: 22px;
  max-width: 1320px;
  height: calc(100% - 86px);
  margin: 0 auto;
  padding-top: 22px;
}

.repair-index,
.repair-detail {
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(8, 12, 16, 0.62);
}

.repair-index {
  min-height: 0;
  padding: 18px;
  overflow: hidden;
}

.repair-index > span,
.repair-index > strong,
.repair-entry,
.artifact-copy,
.repair-action {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.repair-index > span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.repair-index > strong {
  display: block;
  margin-top: 6px;
  color: var(--gold);
  font-size: 24px;
}

.repair-list {
  display: grid;
  gap: 10px;
  max-height: calc(100% - 56px);
  margin-top: 18px;
  overflow: auto;
}

.repair-entry {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 8px;
  border: 1px solid rgba(202, 161, 95, 0.26);
  background: rgba(0, 0, 0, 0.18);
  text-align: left;
}

.repair-entry > span:first-child {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(202, 161, 95, 0.4);
  color: var(--gold);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: 20px;
}

.artifact-thumb {
  background-repeat: no-repeat;
  background-size: contain;
  background-position: var(--artifact-x, 50%) var(--artifact-y, 50%);
  filter: grayscale(1) brightness(0.58) contrast(1.08);
  transform: rotate(var(--artifact-rotate, 0deg));
}

.artifact-thumb.repaired {
  filter: none;
}

.repair-entry-copy {
  display: block;
}

.repair-entry strong,
.repair-entry small {
  display: block;
}

.repair-entry strong {
  font-size: 14px;
}

.repair-entry small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.repair-entry.active {
  border-color: rgba(202, 161, 95, 0.84);
  background: linear-gradient(90deg, rgba(202, 161, 95, 0.18), rgba(0, 0, 0, 0.22));
}

.repair-detail {
  display: grid;
  grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
  gap: 26px;
  min-height: 0;
  height: 100%;
  padding: 26px;
  overflow: hidden;
}

.artifact-frame {
  display: grid;
  place-items: center;
  min-height: 0;
  height: 100%;
  border: 1px solid rgba(202, 161, 95, 0.52);
  background:
    radial-gradient(circle, rgba(202, 161, 95, 0.16), transparent 38%),
    linear-gradient(180deg, rgba(244, 234, 213, 0.04), rgba(0, 0, 0, 0.16)),
    rgba(0, 0, 0, 0.34);
  color: rgba(244, 234, 213, 0.7);
  font-size: clamp(90px, 11vw, 160px);
}

.artifact-frame.has-image {
  background-repeat: no-repeat;
  background-size: contain;
  background-position: var(--artifact-x, 50%) var(--artifact-y, 50%);
  filter: grayscale(1) brightness(0.62) contrast(1.05);
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.5);
}

.artifact-frame.has-image.repaired {
  filter: none;
}

.artifact-copy {
  align-self: stretch;
  min-height: 0;
  padding-right: 12px;
  overflow-y: auto;
  scrollbar-color: rgba(202, 161, 95, 0.7) rgba(244, 234, 213, 0.08);
}

.artifact-copy span,
.artifact-copy small,
.artifact-copy p,
.material-line,
.reward-line {
  color: var(--muted);
}

.artifact-copy > span {
  font-size: 13px;
}

.artifact-copy > strong {
  display: block;
  margin: 10px 0 8px;
  color: var(--gold);
  font-family: "Noto Serif SC", "Songti SC", serif;
  font-size: clamp(32px, 4vw, 54px);
}

.artifact-copy > small {
  font-size: 15px;
}

.artifact-copy p {
  max-width: 680px;
  margin: 24px 0 0;
  color: rgba(244, 234, 213, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

.artifact-analysis {
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(244, 234, 213, 0.16);
  background: rgba(0, 0, 0, 0.22);
}

.artifact-analysis span,
.artifact-analysis p,
.artifact-steps button {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.artifact-analysis span {
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.artifact-analysis p {
  margin: 8px 0 0;
  color: rgba(244, 234, 213, 0.78);
  font-size: 14px;
  line-height: 1.7;
}

.artifact-analysis small {
  display: block;
  margin-top: 10px;
  color: rgba(244, 234, 213, 0.62);
  font: 12px/1.6 Arial, "Microsoft YaHei", sans-serif;
}

.artifact-options {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.artifact-options button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid rgba(244, 234, 213, 0.16);
  background: rgba(0, 0, 0, 0.24);
  color: rgba(244, 234, 213, 0.84);
  font: 13px Arial, "Microsoft YaHei", sans-serif;
  text-align: left;
}

.artifact-options button:hover {
  border-color: rgba(202, 161, 95, 0.7);
  background: rgba(202, 161, 95, 0.12);
}

.artifact-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.artifact-steps button {
  min-height: 42px;
  border: 1px solid rgba(202, 161, 95, 0.42);
  background: rgba(0, 0, 0, 0.24);
  color: rgba(244, 234, 213, 0.82);
}

.artifact-steps button span {
  margin-right: 8px;
  color: var(--gold);
}

.artifact-steps button.active {
  border-color: var(--gold);
  background: rgba(202, 161, 95, 0.18);
}

.artifact-steps button.solved {
  border-color: rgba(119, 185, 178, 0.62);
  color: rgba(215, 244, 235, 0.88);
}

.material-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.material-line span {
  padding: 7px 10px;
  border: 1px solid rgba(202, 161, 95, 0.34);
  color: rgba(244, 234, 213, 0.78);
  background: rgba(0, 0, 0, 0.2);
}

.reward-line {
  margin-top: 18px;
  color: var(--gold);
}

.repair-action {
  display: block;
  min-width: 260px;
  min-height: 46px;
  margin-top: 26px;
  margin-bottom: 8px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #111;
}

.repair-mini-game,
.repair-cinematic {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: grid;
  place-items: center;
  background: rgba(2, 4, 6, 0.78);
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
  transition: opacity 360ms ease, visibility 360ms ease;
}

.repair-mini-game.open,
.repair-cinematic.open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.repair-mini-box {
  width: min(640px, calc(100vw - 42px));
  padding: 28px;
  border: 1px solid rgba(202, 161, 95, 0.62);
  background: rgba(8, 12, 16, 0.94);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(16px);
}

.repair-mini-box span,
.repair-mini-box p,
.repair-mini-box input,
.repair-mini-box small,
.repair-mini-options button,
.repair-mini-actions button,
.repair-cinematic span,
.repair-cinematic p {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.repair-mini-box > span {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.repair-mini-box > strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 34px;
}

.repair-mini-box p {
  color: rgba(244, 234, 213, 0.82);
  line-height: 1.7;
}

.repair-mini-box label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
}

.repair-mini-box label span {
  color: var(--muted);
  font-size: 12px;
}

.repair-mini-box input {
  width: 160px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid rgba(244, 234, 213, 0.22);
  background: rgba(0, 0, 0, 0.34);
  color: var(--paper);
  font-size: 26px;
  letter-spacing: 0.16em;
}

.repair-mini-options {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.repair-mini-options button {
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid rgba(202, 161, 95, 0.36);
  background: rgba(0, 0, 0, 0.24);
  color: rgba(244, 234, 213, 0.84);
  text-align: left;
}

.repair-mini-options button.active {
  border-color: var(--gold);
  background: rgba(202, 161, 95, 0.18);
  color: var(--paper);
}

.repair-mini-box small {
  display: block;
  margin-top: 14px;
  color: rgba(244, 234, 213, 0.7);
  line-height: 1.6;
}

.repair-mini-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 22px;
}

.repair-mini-actions button {
  min-height: 46px;
  border: 1px solid rgba(202, 161, 95, 0.58);
  background: rgba(0, 0, 0, 0.22);
  color: var(--paper);
}

.repair-mini-actions button:last-child {
  background: var(--gold);
  color: #111;
}

.repair-cinematic {
  z-index: 170;
  background:
    radial-gradient(circle at 50% 42%, rgba(202, 161, 95, 0.16), transparent 34%),
    rgba(2, 4, 6, 0.94);
}

.repair-cinematic div {
  width: min(1180px, calc(100vw - 72px));
  text-align: center;
}

.repair-cinematic span {
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.14em;
}

.repair-cinematic strong {
  display: block;
  margin-top: 20px;
  color: var(--gold);
  font-size: clamp(82px, 12vw, 168px);
  line-height: 1.05;
  text-shadow: 0 0 40px rgba(202, 161, 95, 0.26);
  transition: opacity 900ms ease, transform 900ms ease;
}

.repair-cinematic p {
  max-width: 840px;
  margin: 24px auto 0;
  color: rgba(244, 234, 213, 0.82);
  font-size: clamp(18px, 2vw, 28px);
  line-height: 1.7;
}

.repair-cinematic.complete strong {
  transform: scale(0.86);
  opacity: 0.76;
}

.stat-list {
  display: grid;
  gap: 12px;
}

.stat-row {
  display: grid;
  grid-template-columns: 92px 1fr 38px;
  gap: 10px;
  align-items: center;
}

.stat-name,
.stat-value {
  color: var(--muted);
  font-size: 12px;
}

.stat-track {
  height: 9px;
  border: 1px solid rgba(244, 234, 213, 0.18);
  background: rgba(244, 234, 213, 0.07);
}

.stat-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), rgba(119, 185, 178, 0.88));
}

#detailSummary {
  margin: 20px 0 0;
  color: rgba(244, 234, 213, 0.84);
  line-height: 1.8;
}

.detail-action {
  width: 100%;
  min-height: 44px;
  margin-top: 20px;
  border: 1px solid var(--gold);
  background: var(--gold);
  color: #111;
}

.detail-action.acquired {
  background: rgba(0, 0, 0, 0.2);
  color: var(--paper);
}

.confirm-modal.open {
  display: grid;
}

.confirm-box {
  width: min(420px, calc(100% - 32px));
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(14, 18, 22, 0.96), rgba(7, 10, 13, 0.92)),
    var(--panel-deep);
}

.confirm-box span,
.confirm-box p,
.cancel-button,
.confirm-button {
  font-family: Arial, "Microsoft YaHei", sans-serif;
}

.confirm-box span {
  color: var(--muted);
  font-size: 11px;
}

.confirm-box strong {
  display: block;
  margin-top: 8px;
  color: var(--gold);
  font-size: 24px;
}

.confirm-box p {
  margin: 18px 0 0;
  color: rgba(244, 234, 213, 0.84);
  line-height: 1.7;
}

.confirm-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.cancel-button,
.confirm-button {
  min-height: 42px;
  border: 1px solid rgba(202, 161, 95, 0.58);
}

.cancel-button {
  background: rgba(0, 0, 0, 0.2);
}

.confirm-button {
  background: var(--gold);
  color: #111;
}

@media (max-width: 980px) {
  .player-card {
    top: 14px;
    left: 14px;
    width: 260px;
  }

  .profile-layout {
    grid-template-columns: 1fr;
    align-content: start;
    overflow: auto;
    padding-bottom: 24px;
  }

  .profile-settings {
    position: fixed;
    right: 18px;
    bottom: 74px;
    width: min(360px, calc(100% - 36px));
  }

  .profile-settings-fab {
    position: fixed;
    right: 18px;
    bottom: 18px;
  }

  .avatar-picker {
    position: fixed;
    left: 18px;
    right: 18px;
    top: 164px;
    width: auto;
  }

  .resource-panel {
    top: 14px;
    right: 14px;
    grid-template-columns: repeat(3, 104px);
  }

  .tide-meter {
    grid-column: 1 / -1;
  }

  .left-menu {
    left: 14px;
    top: 116px;
    width: 152px;
  }

  .right-menu {
    right: 14px;
    top: 104px;
    width: 184px;
  }

  .home-assistant {
    width: min(54vw, 440px);
    height: 82vh;
  }

  .assistant-dialogue {
    width: min(620px, calc(100% - 32px));
    min-width: 0;
    bottom: clamp(84px, 10vh, 118px);
  }

  .info-ribbon {
    left: 14px;
    right: 14px;
    bottom: 14px;
  }

  .executor-grid,
  .owned-grid {
    grid-template-columns: repeat(3, minmax(140px, 1fr));
  }

  .shop-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
  }

  .repair-layout,
  .repair-detail {
    grid-template-columns: 1fr;
  }

  .repair-index {
    max-height: 210px;
  }

  .artifact-frame {
    min-height: 240px;
  }

  .tide-content {
    padding-bottom: 28px;
  }

  .tide-tabs {
    bottom: 222px;
  }

  .tide-copy {
    bottom: 42px;
    width: min(460px, 46vw);
  }

  .chapter-route {
    width: min(560px, 50vw);
    height: 360px;
    bottom: 120px;
  }

  .chapter-route::before {
    left: 8%;
    width: 82%;
  }

  .chapter-node i {
    width: 60px;
    height: 60px;
    font-size: 20px;
  }

  .chapter-detail-card {
    width: min(460px, 48vw);
    bottom: 34px;
  }

  .story-character {
    width: min(42vw, 420px);
  }

  .story-character.c1 {
    left: 6%;
  }

  .story-character.c2 {
    left: 32%;
  }

  .story-character.c3 {
    right: 2%;
  }
}

@media (max-width: 640px) {
  .lobby {
    min-height: 720px;
  }

  .player-card {
    width: calc(100% - 28px);
    grid-template-columns: 44px 1fr;
    padding: 10px;
  }

  .profile-page {
    padding: 12px;
  }

  .profile-header-actions {
    gap: 6px;
  }

  .profile-layout {
    height: calc(100% - 70px);
    gap: 10px;
  }

  .profile-identity {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .profile-avatar {
    width: 74px;
    height: 74px;
    font-size: 32px;
  }

  .background-options {
    grid-template-columns: 1fr 1fr;
  }

  .background-choice {
    min-height: 72px;
  }

  .avatar {
    width: 44px;
    height: 44px;
  }

  .resource-panel {
    top: 84px;
    left: 14px;
    right: 14px;
    grid-template-columns: repeat(3, 1fr);
    padding: 9px;
  }

  .currency {
    padding: 7px;
  }

  .currency strong {
    font-size: 16px;
  }

  .left-menu,
  .right-menu {
    top: auto;
    width: auto;
  }

  .left-menu {
    left: 12px;
    right: 52%;
    bottom: 136px;
  }

  .right-menu {
    left: 52%;
    right: 12px;
    bottom: 136px;
  }

  .menu-button,
  .menu-button.primary {
    grid-template-columns: 30px 1fr;
    min-height: 48px;
    padding: 8px;
  }

  .menu-button span {
    width: 28px;
    height: 28px;
  }

  .menu-button strong {
    font-size: 14px;
  }

  .home-assistant {
    width: 74vw;
    height: 58vh;
    opacity: 0.9;
  }

  .assistant-editor {
    bottom: 12px;
  }

  .assistant-dialogue {
    width: calc(100% - 24px);
    min-width: 0;
    bottom: 110px;
    padding: 12px 14px;
  }

  .info-ribbon {
    min-height: 106px;
    padding: 13px;
  }

  .overlay-page {
    padding: 12px;
  }

  .tide-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    left: 0;
    right: 0;
    bottom: 236px;
    width: 100%;
  }

  .tide-tab {
    min-width: 0;
  }

  .tide-copy {
    padding: 16px;
    left: 0;
    right: 0;
    bottom: 58px;
    width: 100%;
  }

  .mainline-shell {
    inset: 88px 0 0;
  }

  .chapter-route {
    right: 0;
    left: 0;
    bottom: 310px;
    width: 100%;
    height: 220px;
    min-height: 220px;
  }

  .chapter-route::before {
    top: 50%;
    height: 1px;
  }

  .chapter-node {
    min-width: 84px;
  }

  .chapter-node i {
    width: 50px;
    height: 50px;
    font-size: 16px;
  }

  .chapter-node span {
    font-size: 12px;
  }

  .chapter-detail-card {
    left: 0;
    right: 0;
    bottom: 50px;
    width: 100%;
    padding: 16px;
  }

  .chapter-detail-card > strong {
    font-size: 24px;
  }

  .story-panel {
    width: calc(100% - 24px);
    bottom: 18px;
    padding: 16px;
  }

  .story-character {
    width: 58vw;
    height: 78vh;
    opacity: 0.74;
  }

  .story-character.c1 {
    left: -16%;
  }

  .story-character.c2 {
    left: 20%;
  }

  .story-character.c3 {
    right: -18%;
  }

  .repair-board {
    grid-template-columns: repeat(4, 56px);
  }

  .repair-chip {
    width: 56px;
    height: 56px;
  }

  .executor-grid,
  .owned-grid {
    grid-template-columns: repeat(2, minmax(112px, 1fr));
    gap: 10px;
  }

  .executor-card {
    min-height: 176px;
  }

  .detail-body {
    grid-template-columns: 1fr;
  }

  .detail-portrait {
    width: 170px;
  }

  .shop-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .shop-card {
    min-height: 128px;
  }

  .card-footer {
    display: block;
  }

  .card-footer small,
  .card-footer b {
    display: block;
    margin-top: 4px;
  }

  .repair-layout {
    gap: 12px;
    height: calc(100% - 74px);
  }

  .repair-detail {
    gap: 14px;
    padding: 14px;
    overflow: auto;
  }

  .artifact-copy p {
    margin-top: 16px;
    font-size: 15px;
  }
}
