:root {
  color-scheme: dark;
  --bg: #0b0d0e;
  --panel: #141719;
  --panel-2: #1a1f22;
  --line: #31373a;
  --line-soft: #24292c;
  --text: #ece7dc;
  --muted: #a9a196;
  --gold: #c7a85b;
  --red: #b84b45;
  --green: #6fae72;
  --blue: #5a8db8;
  --purple: #8b6ab7;
  --orange: #c1773a;
  --missing: #74777a;
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans CJK SC",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% 0%, rgba(123, 82, 41, 0.16), transparent 34rem),
    linear-gradient(180deg, #0f1112 0%, var(--bg) 42%);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.15rem 1.4rem;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(10, 12, 13, 0.82);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(10px);
}

.eyebrow {
  color: var(--gold);
  font-size: 0.76rem;
  margin: 0 0 0.25rem;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: 1.45rem;
  margin-bottom: 0;
  font-weight: 700;
}

h2 {
  font-size: 1rem;
  margin-bottom: 0;
}

h3 {
  font-size: 0.94rem;
  margin-bottom: 0.55rem;
}

.search {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--muted);
}

.search input {
  width: min(28vw, 22rem);
  min-width: 15rem;
  border: 1px solid var(--line);
  background: #0f1214;
  color: var(--text);
  border-radius: 6px;
  padding: 0.65rem 0.8rem;
  outline: none;
}

.search input:focus {
  border-color: var(--gold);
}

.top-action {
  border: 1px solid var(--line);
  background: #101315;
  color: var(--text);
  border-radius: 6px;
  padding: 0.62rem 0.75rem;
  cursor: pointer;
}

.layout {
  display: grid;
  grid-template-columns: minmax(16rem, 21rem) minmax(0, 1fr) minmax(18rem, 24rem);
  gap: 1rem;
  padding: 1rem;
  min-height: calc(100vh - 5rem);
}

.route-panel,
.detail-panel,
.map-stage {
  background: rgba(20, 23, 25, 0.9);
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  min-width: 0;
}

.route-panel,
.detail-panel {
  overflow: hidden;
}

.panel-header,
.stage-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem;
  border-bottom: 1px solid var(--line-soft);
}


.creator-signature {
  position: relative;
  justify-self: center;
  overflow: hidden;
  min-width: min(28rem, 42vw);
  border: 1px solid rgba(199, 168, 91, 0.28);
  border-radius: 6px;
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 219, 126, 0.16), transparent 62%),
    linear-gradient(90deg, rgba(199, 168, 91, 0.1), rgba(184, 75, 69, 0.08)),
    rgba(10, 12, 13, 0.62);
  color: var(--muted);
  padding: 0.48rem 1rem 0.58rem;
  text-align: center;
  letter-spacing: 0;
  box-shadow: inset 0 0 1.5rem rgba(199, 168, 91, 0.05);
}

.creator-signature::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 -40%;
  width: 34%;
  background: linear-gradient(90deg, transparent, rgba(255, 232, 170, 0.2), transparent);
  transform: skewX(-18deg);
  animation: signature-sheen 4.5s ease-in-out infinite;
}

.creator-signature span,
.creator-signature strong {
  position: relative;
  z-index: 1;
}

.creator-signature span {
  display: inline-block;
  font-family: "Garamond", "Times New Roman", "Microsoft YaHei", serif;
  font-size: 1rem;
  font-style: italic;
  margin-right: 0.42rem;
  color: #e9d9ad;
  text-shadow: 0 0 0.7rem rgba(199, 168, 91, 0.24);
}

.creator-signature strong {
  font-family: "STXingkai", "KaiTi", "Microsoft YaHei", serif;
  font-size: 1.32rem;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fff2b4, #d0a644 55%, #8e6427);
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 0.75rem rgba(199, 168, 91, 0.52);
}

@keyframes signature-sheen {
  0%,
  46% {
    left: -42%;
  }

  72%,
  100% {
    left: 112%;
  }
}

.panel-header.compact {
  padding: 0.65rem 0;
  border-bottom: 0;
}

.panel-header span,
#stageKicker {
  color: var(--muted);
  font-size: 0.78rem;
}

.chapter-tabs {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  padding: 0.8rem;
}

.audit-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.75rem 0.8rem 0;
}

.health-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.75rem 0.8rem 0;
}

.health-summary div {
  border: 1px solid rgba(199, 168, 91, 0.24);
  background: rgba(199, 168, 91, 0.08);
  border-radius: 7px;
  padding: 0.55rem;
}

.health-summary strong {
  color: var(--gold);
  display: block;
  font-size: 1rem;
}

.health-summary span {
  color: var(--muted);
  font-size: 0.72rem;
}

.audit-summary button {
  border: 1px solid var(--line-soft);
  background: #101315;
  border-radius: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  padding: 0.42rem 0.35rem;
  text-align: center;
  cursor: pointer;
}

.audit-summary button.active {
  color: var(--text);
  border-color: var(--gold);
  background: rgba(199, 168, 91, 0.12);
}

.view-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.75rem 0.8rem 0;
}

.view-tabs button,
.route-filters button {
  border: 1px solid var(--line);
  background: #101315;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.5rem;
  cursor: pointer;
}

.view-tabs button.active,
.route-filters button.active {
  color: var(--text);
  border-color: var(--gold);
  background: rgba(199, 168, 91, 0.12);
}

.route-filters {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.35rem;
  padding: 0.65rem 0.8rem 0;
}

.route-filters button {
  font-size: 0.72rem;
  padding: 0.42rem 0.2rem;
}

.chapter-tabs button {
  border: 1px solid var(--line);
  background: #101315;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.52rem 0.35rem;
  cursor: pointer;
  display: grid;
  gap: 0.12rem;
}

.chapter-tabs button em {
  color: var(--muted);
  font-style: normal;
  font-size: 0.68rem;
}

.chapter-tabs button.active {
  border-color: var(--gold);
  color: var(--text);
  background: rgba(199, 168, 91, 0.12);
}

.route-list {
  list-style: none;
  margin: 0;
  padding: 0 0.8rem 0.8rem;
  max-height: calc(100vh - 12.4rem);
  overflow: auto;
}

.route-item {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  align-items: center;
  gap: 0.55rem;
  padding: 0.62rem 0.55rem;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
  color: var(--muted);
}

.route-item:hover,
.route-item.selected {
  color: var(--text);
  background: var(--panel-2);
  border-color: var(--line);
}

.route-item.selected {
  border-color: rgba(199, 168, 91, 0.65);
}

.route-item.optional .step-title::after {
  content: " 可选";
  color: var(--green);
  font-size: 0.72rem;
}

.route-item.audit-item {
  grid-template-columns: 2.4rem minmax(0, 1fr) auto;
}

.step-number {
  color: var(--gold);
  font-size: 0.78rem;
}

.step-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-copy {
  min-width: 0;
  display: grid;
  gap: 0.12rem;
}

.step-meta {
  color: var(--muted);
  font-size: 0.7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-chips,
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1;
  padding: 0.18rem 0.38rem;
  white-space: nowrap;
}

.chip.reward {
  color: var(--gold);
  border-color: rgba(199, 168, 91, 0.45);
  background: rgba(199, 168, 91, 0.1);
}

.chip.boss {
  color: #e7b0ad;
  border-color: rgba(184, 75, 69, 0.45);
  background: rgba(184, 75, 69, 0.1);
}

.chip.trial {
  color: #c9b5ed;
  border-color: rgba(139, 106, 183, 0.45);
  background: rgba(139, 106, 183, 0.1);
}

.chip.optional {
  color: var(--green);
  border-color: rgba(111, 174, 114, 0.42);
  background: rgba(111, 174, 114, 0.08);
}

.mini-badge,
.status-badge {
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: 0.16rem 0.45rem;
  font-size: 0.72rem;
  white-space: nowrap;
}

.mini-badge.ok,
.status-badge.ok {
  color: var(--green);
  border-color: rgba(111, 174, 114, 0.35);
}

.mini-badge.alias,
.status-badge.alias {
  color: var(--blue);
  border-color: rgba(90, 141, 184, 0.35);
}

.mini-badge.missing,
.status-badge.missing {
  color: var(--missing);
}

.map-stage {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}


.map-canvas {
  flex: 1;
  min-height: 32rem;
  display: grid;
  place-items: center;
  padding: 1rem;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 36px 36px;
}

.map-figure {
  margin: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.map-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
}

.map-figure img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 10rem);
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid rgba(199, 168, 91, 0.22);
  box-shadow: 0 1rem 4rem rgba(0, 0, 0, 0.35);
}

.calibration-mode .map-image-wrap {
  cursor: crosshair;
}

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

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

.route-arrow-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.route-arrow-head-main {
  fill: #e45b52;
}

.route-arrow-head-optional {
  fill: #78c77a;
}

.route-arrow-head-reward {
  fill: #f0cb68;
}

.route-arrow-head-trial {
  fill: #c3a4ff;
}

.route-arrow-head-town {
  fill: #89b3cf;
}

.route-arrow-underlay {
  fill: none;
  stroke: rgba(4, 7, 8, 0.9);
  stroke-width: 1.42;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0.45rem rgba(0, 0, 0, 0.95));
}

.route-arrow {
  fill: none;
  stroke: var(--gold);
  stroke-width: 0.52;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 0.28rem rgba(0, 0, 0, 0.9)) drop-shadow(0 0 0.34rem rgba(199, 168, 91, 0.62));
  stroke-dasharray: 2.45 1.2;
  animation: route-arrow-flow 1.7s linear infinite;
}

.route-arrow-main {
  stroke: #e45b52;
}

.route-arrow-optional {
  stroke: #78c77a;
}

.route-arrow-reward {
  stroke: #f0cb68;
}

.route-arrow-trial {
  stroke: #c3a4ff;
}

.route-arrow-town {
  stroke: #89b3cf;
}

.route-arrow-label,
.route-arrow-note {
  position: absolute;
  border: 1px solid rgba(199, 168, 91, 0.4);
  border-radius: 5px;
  background: rgba(7, 11, 13, 0.9);
  box-shadow: 0 0.5rem 1.6rem rgba(0, 0, 0, 0.32);
  color: #f4e5b7;
  font-size: 0.7rem;
  line-height: 1.2;
  padding: 0.2rem 0.38rem;
  text-shadow: 0 0 0.4rem rgba(0, 0, 0, 0.88);
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.route-arrow-label {
  display: none;
}

.route-arrow-layer.dense .route-arrow-label {
  display: none;
}

.route-arrow-label.main {
  border-color: rgba(228, 91, 82, 0.5);
  color: #ffbbb6;
}

.route-arrow-label.optional {
  border-color: rgba(120, 199, 122, 0.48);
  color: #c9efc6;
}

.route-arrow-label.reward {
  color: #f5d678;
}

.route-arrow-label.trial {
  border-color: rgba(195, 164, 255, 0.5);
  color: #dacaff;
}

.route-arrow-label.town {
  border-color: rgba(137, 179, 207, 0.5);
  color: #c4e3f7;
}

.route-arrow-note {
  left: 50%;
  bottom: 1rem;
  top: auto;
  max-width: min(26rem, 72%);
  text-align: center;
  transform: translateX(-50%);
  white-space: normal;
}

.route-arrow-note strong,
.route-arrow-note span {
  display: block;
}

@keyframes route-arrow-flow {
  to {
    stroke-dashoffset: -3.35;
  }
}

.blue-point {
  position: absolute;
  isolation: isolate;
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid #cdeeff;
  border-radius: 50%;
  background: radial-gradient(circle, #6dc8ff 0 34%, #1268a0 35% 62%, rgba(9, 16, 20, 0.92) 63%);
  box-shadow:
    0 0 0.35rem rgba(109, 200, 255, 0.9),
    0 0 0 0.22rem rgba(8, 12, 14, 0.7);
  color: #dff5ff;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-50%, -50%);
  animation: waypoint-breathe 2.35s ease-in-out infinite;
}

.blue-point::before,
.blue-point::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.blue-point::before {
  inset: -0.5rem;
  z-index: -1;
  background: radial-gradient(circle, rgba(109, 200, 255, 0.36), rgba(109, 200, 255, 0.12) 42%, transparent 68%);
  animation: waypoint-halo 2.35s ease-in-out infinite;
}

.blue-point::after {
  inset: -0.18rem;
  z-index: 0;
  border: 1px solid rgba(205, 238, 255, 0.52);
  animation: waypoint-ring 2.35s ease-in-out infinite;
}

.public-annotations .blue-point {
  cursor: pointer;
  pointer-events: auto;
}

.public-annotations .blue-point.draft {
  opacity: 1;
  border-style: solid;
  animation-duration: 2.35s;
}

.blue-point.selected {
  border-color: var(--gold);
  box-shadow:
    0 0 0.55rem rgba(199, 168, 91, 0.95),
    0 0 0 0.24rem rgba(8, 12, 14, 0.72);
}

.blue-point.route-target {
  border-color: rgba(109, 200, 255, 0.95);
  box-shadow:
    0 0 0.62rem rgba(109, 200, 255, 0.9),
    0 0 0 0.22rem rgba(8, 12, 14, 0.66);
}

.blue-point.draft {
  opacity: 0.78;
  border-style: dashed;
  animation-duration: 2.8s;
}

.blue-point.draft::before,
.blue-point.draft::after {
  animation-duration: 2.8s;
}

.blue-point.confirmed {
  box-shadow:
    0 0 0.5rem rgba(109, 200, 255, 0.95),
    0 0 0 0.24rem rgba(8, 12, 14, 0.72);
}

.blue-point.confirmed::before {
  background: radial-gradient(circle, rgba(109, 200, 255, 0.48), rgba(109, 200, 255, 0.14) 44%, transparent 70%);
}

.blue-point.optional {
  border-color: #a7df9a;
}

.blue-point.reward {
  border-color: #f0cb68;
}

.blue-point.trial {
  border-color: #d0b2ff;
}

.blue-point.town {
  border-color: #9fb4c4;
}

.blue-point span {
  position: absolute;
  z-index: 2;
  left: 1.2rem;
  top: -0.45rem;
  width: max-content;
  max-width: 11rem;
  border: 1px solid rgba(109, 200, 255, 0.38);
  border-radius: 5px;
  background: rgba(7, 11, 13, 0.86);
  padding: 0.18rem 0.36rem;
  color: #e5f7ff;
  font-size: 0.72rem;
  line-height: 1.25;
  text-shadow: 0 0 0.4rem rgba(0, 0, 0, 0.85);
  text-align: left;
}

.public-annotations .blue-point span {
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.15rem) scale(0.96);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
}

.public-annotations .blue-point.selected span,
.public-annotations .blue-point.route-target span,
.public-annotations .blue-point:focus-visible span {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.public-annotations .blue-point.cycling-label span {
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.15rem) scale(0.96);
}

.public-annotations .blue-point.cycling-label.cycle-visible span,
.public-annotations .blue-point.cycling-label:hover span,
.public-annotations .blue-point.cycling-label:focus-visible span {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.public-annotations:has(.blue-point.cycling-label:hover) .blue-point.cycling-label.cycle-visible:not(:hover) span,
.public-annotations:has(.blue-point.cycling-label:focus-visible) .blue-point.cycling-label.cycle-visible:not(:focus-visible) span {
  opacity: 0;
  visibility: hidden;
  transform: translateY(0.15rem) scale(0.96);
}

.public-annotations .blue-point.cycle-visible,
.public-annotations .blue-point:hover,
.public-annotations .blue-point:focus-visible {
  z-index: 7;
}

.public-annotations .blue-point.route-target span {
  border-color: rgba(109, 200, 255, 0.58);
  background: rgba(8, 17, 22, 0.9);
}

.public-annotations .blue-point.compact-label span {
  max-width: 7.5rem;
  padding: 0.16rem 0.34rem;
}

.public-annotations .blue-point.short-label span {
  left: 50%;
  right: auto;
  top: -1.35rem;
  bottom: auto;
  display: grid;
  place-items: center;
  min-width: 1.28rem;
  height: 1.28rem;
  max-width: none;
  border-color: rgba(109, 200, 255, 0.64);
  border-radius: 999px;
  background: rgba(5, 12, 16, 0.94);
  padding: 0 0.34rem;
  color: #e5f7ff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  transform: translate(-50%, 0.15rem) scale(0.96);
}

.public-annotations .blue-point.short-label.selected span,
.public-annotations .blue-point.short-label.route-target span,
.public-annotations .blue-point.short-label:focus-visible span {
  transform: translate(-50%, 0) scale(1);
}

.public-annotations .blue-point.short-label span strong {
  display: block;
  color: inherit;
  font-size: inherit;
}

.public-annotations .blue-point.current-label span {
  top: -1.5rem;
  height: 1.34rem;
  border-color: rgba(199, 168, 91, 0.7);
  background: rgba(24, 18, 8, 0.94);
  color: #f5d678;
}

.public-annotations .blue-point.route-target-main span {
  border-color: rgba(228, 91, 82, 0.7);
  color: #ffbbb6;
}

.public-annotations .blue-point.route-target-optional span {
  border-color: rgba(120, 199, 122, 0.68);
  color: #c9efc6;
}

.public-annotations .blue-point.route-target-reward span {
  border-color: rgba(240, 203, 104, 0.72);
  color: #f5d678;
}

.public-annotations .blue-point.route-target-trial span {
  border-color: rgba(195, 164, 255, 0.7);
  color: #dacaff;
}

.public-annotations .blue-point.route-target-town span {
  border-color: rgba(137, 179, 207, 0.68);
  color: #c4e3f7;
}

@keyframes waypoint-breathe {
  0%,
  100% {
    filter: brightness(0.92) saturate(1);
    transform: translate(-50%, -50%) scale(0.94);
  }

  50% {
    filter: brightness(1.35) saturate(1.22);
    transform: translate(-50%, -50%) scale(1.08);
  }
}

@keyframes waypoint-halo {
  0%,
  100% {
    opacity: 0.24;
    transform: scale(0.78);
  }

  50% {
    opacity: 0.82;
    transform: scale(1.18);
  }
}

@keyframes waypoint-ring {
  0%,
  100% {
    opacity: 0.34;
    transform: scale(0.92);
  }

  50% {
    opacity: 0.9;
    transform: scale(1.42);
  }
}

.blue-point.label-left span {
  left: auto;
  right: 1.2rem;
  text-align: right;
}

.blue-point.label-up span {
  top: auto;
  bottom: -0.45rem;
}

.public-annotations .blue-point.short-label span {
  left: 50%;
  right: auto;
  top: -1.35rem;
  bottom: auto;
  text-align: center;
}

.public-annotations .blue-point.short-label.current-label span {
  top: -1.5rem;
}

.blue-point span strong,
.blue-point span em,
.blue-point span small {
  display: block;
}

.blue-point span strong {
  color: #f3fbff;
  font-size: 0.76rem;
}

.blue-point span em {
  color: var(--gold);
  font-style: normal;
  margin-top: 0.08rem;
}

.blue-point span small {
  color: var(--muted);
  font-size: 0.66rem;
  margin-top: 0.08rem;
}

.calibration-dock {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  width: min(21rem, calc(100vw - 2rem));
  border: 1px solid rgba(90, 141, 184, 0.45);
  border-radius: 8px;
  background: rgba(12, 16, 18, 0.96);
  box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.45);
  padding: 0.9rem;
}

.calibration-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.55rem;
}

.calibration-head span {
  color: var(--text);
  font-weight: 700;
}

.calibration-head strong {
  color: var(--blue);
  font-size: 0.8rem;
}

.calibration-dock p {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  margin-bottom: 0.75rem;
}

.calibration-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}

.calibration-stats span {
  border: 1px solid rgba(90, 141, 184, 0.26);
  border-radius: 6px;
  background: rgba(90, 141, 184, 0.08);
  color: var(--muted);
  font-size: 0.7rem;
  padding: 0.34rem;
  text-align: center;
}

.calibration-dock label {
  color: var(--muted);
  display: grid;
  gap: 0.25rem;
  font-size: 0.74rem;
  margin-bottom: 0.55rem;
}

.calibration-dock select,
.calibration-dock input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f1214;
  color: var(--text);
  padding: 0.5rem 0.55rem;
}

.calibration-nav,
.calibration-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
}

.calibration-nav {
  margin-bottom: 0.45rem;
}

.calibration-nav button,
.calibration-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101315;
  color: var(--text);
  cursor: pointer;
  padding: 0.5rem 0.45rem;
}

.calibration-nav button.active {
  color: var(--gold);
  border-color: rgba(199, 168, 91, 0.48);
  background: rgba(199, 168, 91, 0.1);
}

.calibration-nav button:disabled,
.calibration-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}


.icon-action {
  border: 1px solid var(--line);
  background: #101315;
  color: var(--muted);
  border-radius: 6px;
  padding: 0.48rem 0.7rem;
  cursor: pointer;
}

.icon-action.active {
  color: var(--text);
  border-color: var(--gold);
  background: rgba(199, 168, 91, 0.12);
}

.icon-action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.detail-content {
  padding: 0.9rem;
  display: grid;
  gap: 1rem;
  max-height: calc(100vh - 9rem);
  overflow: auto;
}

.coord-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.detail-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: #0f1214;
}

.detail-thumb.placeholder,
.empty-state {
  display: grid;
  place-items: center;
  color: var(--muted);
}

.map-summary {
  border: 1px solid rgba(199, 168, 91, 0.22);
  background: rgba(199, 168, 91, 0.07);
  border-radius: 7px;
  padding: 0.75rem;
}

.map-summary p:last-child {
  margin-bottom: 0;
}

.reward-callout {
  border: 1px solid rgba(199, 168, 91, 0.36);
  background: rgba(199, 168, 91, 0.1);
  border-radius: 7px;
  padding: 0.75rem;
}

.reward-callout h3 {
  color: var(--gold);
}

.empty-state {
  gap: 0.35rem;
  min-height: 14rem;
  text-align: center;
}

.muted,
.detail-content p {
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.9rem;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.info-grid div {
  background: #101315;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 0.65rem;
}

.info-grid span {
  color: var(--muted);
  display: block;
  font-size: 0.74rem;
  margin-bottom: 0.25rem;
}

.info-grid strong {
  font-size: 0.86rem;
}

.todo-list {
  color: var(--muted);
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.75;
}

.fact-list {
  color: var(--muted);
  display: grid;
  gap: 0.42rem;
  margin: 0;
  padding-left: 1.1rem;
  line-height: 1.55;
}

.fact-list li::marker {
  color: var(--gold);
}

.entrance-list {
  display: grid;
  gap: 0.75rem;
}

.entrance-group {
  display: grid;
  gap: 0.45rem;
}

.entrance-group h4 {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  margin: 0;
}

.entrance-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.6rem;
  border: 1px solid var(--line-soft);
  background: #101315;
  border-radius: 7px;
  padding: 0.65rem;
}

.entrance-index {
  grid-row: 1 / span 2;
  display: grid;
  place-items: center;
  width: 1.45rem;
  height: 1.45rem;
  border: 1px solid rgba(109, 200, 255, 0.5);
  border-radius: 999px;
  color: #e5f7ff;
  font-size: 0.75rem;
  font-weight: 800;
  line-height: 1;
}

.entrance-item strong,
.entrance-item span {
  display: block;
}

.entrance-item > strong,
.entrance-item > span:not(.entrance-index) {
  grid-column: 2;
}

.entrance-item strong {
  color: var(--text);
  line-height: 1.35;
}

.entrance-item span {
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
  margin-top: 0.2rem;
}

.entrance-item .entrance-index {
  display: grid;
  margin-top: 0;
  color: #e5f7ff;
  line-height: 1;
}

.entrance-item.main {
  border-color: rgba(184, 75, 69, 0.45);
}

.entrance-index.main {
  border-color: rgba(228, 91, 82, 0.64);
  color: #ffbbb6;
}

.entrance-item.optional {
  border-color: rgba(111, 174, 114, 0.42);
}

.entrance-index.optional {
  border-color: rgba(120, 199, 122, 0.62);
  color: #c9efc6;
}

.entrance-item.back {
  border-color: rgba(90, 141, 184, 0.35);
}

.entrance-item.trial {
  border-color: rgba(139, 106, 183, 0.45);
}

.entrance-index.trial {
  border-color: rgba(195, 164, 255, 0.62);
  color: #dacaff;
}

.entrance-item.reward {
  border-color: rgba(199, 168, 91, 0.45);
}

.entrance-index.reward {
  border-color: rgba(240, 203, 104, 0.66);
  color: #f5d678;
}

.entrance-item.town {
  border-color: rgba(90, 141, 184, 0.45);
}

.entrance-index.town,
.entrance-index.back {
  border-color: rgba(137, 179, 207, 0.62);
  color: #c4e3f7;
}

.entrance-item.candidate {
  opacity: 0.72;
  border-style: dashed;
}

.point-guide {
  border: 1px solid rgba(90, 141, 184, 0.38);
  background: rgba(90, 141, 184, 0.08);
  border-radius: 7px;
  padding: 0.75rem;
}

.point-guide h3 {
  color: #dff5ff;
}

.point-guide p {
  margin-bottom: 0.65rem;
}

.route-flow-hint,
.point-guide-note {
  color: var(--muted);
  font-size: 0.77rem;
  line-height: 1.55;
}

.point-guide-note {
  border-top: 1px solid var(--line-soft);
  margin-top: 0.55rem;
  padding-top: 0.55rem;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}

.tag,
.inline-status {
  border: 1px solid rgba(199, 168, 91, 0.28);
  background: rgba(199, 168, 91, 0.08);
  color: var(--gold);
  border-radius: 999px;
  font-size: 0.72rem;
  padding: 0.13rem 0.45rem;
  white-space: nowrap;
}

.inline-status {
  margin-left: 0.4rem;
  color: var(--blue);
  border-color: rgba(90, 141, 184, 0.32);
  background: rgba(90, 141, 184, 0.08);
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 17rem minmax(0, 1fr);
  }

  .detail-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 780px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
    position: static;
  }

  .search input {
    width: 100%;
    min-width: 0;
  }

  .layout {
    grid-template-columns: 1fr;
    padding: 0.65rem;
    gap: 0.65rem;
  }

  .route-list,
  .detail-content {
    max-height: none;
  }

  .chapter-tabs,
  .route-filters {
    grid-template-columns: repeat(5, minmax(4rem, 1fr));
    overflow-x: auto;
  }

  .stage-toolbar {
    align-items: stretch;
    flex-direction: column;
  }


  .creator-signature {
    min-width: 0;
    width: 100%;
  }

  .map-canvas {
    min-height: 20rem;
    padding: 0.5rem;
    justify-content: start;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }

  .map-figure {
    min-width: min(52rem, 190vw);
    height: auto;
  }

  .map-figure img {
    width: 100%;
    height: auto;
    max-width: none;
    max-height: 68vh;
  }

  .map-image-wrap {
    width: 100%;
    max-width: none;
    max-height: 68vh;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 480px) {
  h1 {
    font-size: 1.2rem;
  }

  .route-item {
    grid-template-columns: 1.8rem minmax(0, 1fr);
  }

  .chapter-tabs,
  .route-filters {
    grid-template-columns: repeat(5, 4.2rem);
  }

  .map-figure {
    min-width: 43rem;
  }
}
