:root {
  color-scheme: dark;
  --night: #071c24;
  --deep-sea: #123e47;
  --moon: #f2e9ce;
  --starlight: #ffd27d;
  --blue-light: #9fb7ff;
  --tideline: #6ed6bf;
  --muted: #9bb5b9;
  --hairline: rgba(190, 222, 220, 0.24);
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--night);
  color: var(--moon);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-width: 0;
  min-height: 100vh;
  background: var(--night);
}

button { font: inherit; }
button, summary { -webkit-tap-highlight-color: transparent; }
button:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 2px solid var(--starlight);
  outline-offset: 4px;
}

.experience {
  width: min(1080px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 116px;
}
.experience > * { min-width: 0; }

.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.brand h1 {
  margin: 0 0 12px;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(50px, 7vw, 76px);
  font-weight: 500;
  line-height: 0.95;
  letter-spacing: 0.14em;
}
.brand p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}

.star-count {
  flex: 0 0 auto;
  padding: 2px 0 4px 20px;
  border-left: 1px solid var(--hairline);
  text-align: right;
}
.star-count span {
  display: block;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
}
.star-count strong {
  color: var(--starlight);
  font-family: "Songti SC", "STSong", serif;
  font-size: 27px;
  font-weight: 500;
}

.sky {
  position: relative;
  height: 500px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 48% 48% 4px 4px / 18% 18% 4px 4px;
  background: var(--deep-sea);
}
#harbor {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.chart-note {
  position: absolute;
  top: 28px;
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  color: rgba(216, 237, 240, 0.52);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.verse {
  position: absolute;
  top: 22%;
  left: clamp(24px, 6%, 66px);
  width: min(56%, 520px);
  display: grid;
  gap: 8px;
}
.verse-slot {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 62px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 1px dashed rgba(242, 233, 206, 0.42);
  border-radius: 3px 18px 3px 3px;
  background: rgba(7, 28, 36, 0.26);
  color: var(--moon);
  text-align: left;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.verse-slot:hover { background: rgba(18, 62, 71, 0.62); }
.verse-slot[aria-pressed="true"] {
  border-bottom-style: solid;
  border-bottom-color: var(--starlight);
  background: rgba(7, 28, 36, 0.68);
}
.verse-slot.drop-target {
  border-color: var(--tideline);
  background: rgba(55, 123, 115, 0.62);
  outline: 2px solid var(--tideline);
  outline-offset: 2px;
}
.line-number {
  flex: 0 0 25px;
  display: grid;
  place-items: center;
  width: 25px;
  height: 25px;
  border: 1px solid rgba(242, 233, 206, 0.35);
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
}
.line-text {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: clamp(23px, 3.1vw, 34px);
  line-height: 1.35;
  letter-spacing: 0.06em;
}
.sky-hint {
  position: absolute;
  left: clamp(24px, 6%, 66px);
  bottom: 20px;
  max-width: calc(100% - 48px);
  margin: 0;
  color: rgba(216, 237, 240, 0.72);
  font-size: 12px;
  line-height: 1.6;
}

.controls { padding: 18px 0 8px; }
.action-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.action-row button { min-height: 46px; cursor: pointer; }
.launch {
  padding: 0 28px;
  border: 1px solid var(--starlight);
  border-radius: 3px 18px 3px 3px;
  background: var(--starlight);
  color: #17313a;
  font-weight: 700;
}
.launch:hover { background: #ffe2a6; }
.launch:active { transform: translateY(1px); }
.shuffle, .sound-toggle {
  padding: 0 18px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  background: transparent;
  color: var(--moon);
}
.shuffle:hover, .sound-toggle:hover { border-color: var(--tideline); }
.sound-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-left: auto;
}
.sound-light {
  width: 8px;
  height: 8px;
  border: 1px solid var(--muted);
  border-radius: 50%;
}
.sound-toggle[aria-pressed="true"] .sound-light {
  border-color: var(--tideline);
  background: var(--tideline);
  box-shadow: 0 0 10px rgba(110, 214, 191, 0.65);
}
.echo-output {
  display: block;
  min-height: 48px;
  margin: 14px 0 0;
  color: #c9dadd;
  font-family: "Songti SC", "STSong", "SimSun", serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.word-dock, .star-atlas {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--hairline);
}
.dock-heading, .atlas-heading {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 16px;
}
.dock-heading h2, .atlas-heading h2 {
  flex: 0 0 auto;
  margin: 0;
  font-family: "Songti SC", "STSong", serif;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.dock-heading p, .atlas-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.word-tile {
  --word: var(--moon);
  max-width: 100%;
  min-height: 44px;
  padding: 8px 15px;
  border: 1px solid var(--word);
  border-radius: 2px 14px 2px 14px;
  background: rgba(18, 62, 71, 0.38);
  color: var(--word);
  line-height: 1.4;
  cursor: grab;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 140ms ease, transform 140ms ease;
}
.word-tile:hover { background: rgba(39, 85, 91, 0.72); }
.word-tile:active { cursor: grabbing; }
.word-tile.drag-source { opacity: 0.35; }
.word-tile.drag-ghost {
  position: fixed;
  z-index: 1000;
  margin: 0;
  pointer-events: none;
  opacity: 0.96;
  transform: translate(-50%, -50%) rotate(-2deg);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34);
}

.discovered-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 34px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}
.discovered-list li {
  padding: 6px 12px;
  border: 1px solid rgba(255, 210, 125, 0.48);
  border-radius: 50% 50% 4px 4px / 28% 28% 4px 4px;
  color: var(--starlight);
  font-family: "Songti SC", "STSong", serif;
  font-size: 14px;
}
.discovered-list .empty-discovery {
  padding-left: 0;
  border: 0;
  color: var(--muted);
  font-family: inherit;
  font-size: 12px;
}
.clues {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.clues summary {
  width: fit-content;
  min-height: 44px;
  padding: 10px 0;
  color: #c9dadd;
  cursor: pointer;
}
.clues ol {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 28px;
  max-width: 760px;
  margin: 8px 0 0;
  padding-left: 24px;
}

@media (max-width: 560px) {
  .experience {
    width: calc(100% - 24px);
    padding-top: 20px;
  }
  .masthead { gap: 12px; margin-bottom: 16px; }
  .brand h1 { font-size: 52px; }
  .brand p { max-width: 19em; font-size: 13px; }
  .star-count { padding-left: 12px; }
  .star-count strong { font-size: 22px; }
  .sky {
    height: 470px;
    border-radius: 120px 120px 3px 3px;
  }
  .chart-note { top: 18px; font-size: 11px; }
  .verse {
    top: 20%;
    left: 18px;
    width: calc(100% - 36px);
    gap: 10px;
  }
  .verse-slot { min-height: 64px; padding: 8px 10px; gap: 10px; }
  .line-text { font-size: 23px; }
  .sky-hint { left: 18px; bottom: 16px; max-width: calc(100% - 36px); }
  .action-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .action-row button { min-width: 0; padding-right: 12px; padding-left: 12px; }
  .launch { grid-column: 1 / -1; }
  .sound-toggle { margin-left: 0; }
  .dock-heading, .atlas-heading { display: block; }
  .dock-heading h2, .atlas-heading h2 { margin-bottom: 6px; }
  .word-bank { gap: 8px; }
  .word-tile { padding: 8px 11px; font-size: 14px; }
  .clues ol { grid-template-columns: 1fr; gap: 4px; }
}

/* 站点导航条固定在页面顶部正中，窄屏时会压住标题，给它让出位置 */
@media (max-width: 760px) {
  .experience { padding-top: 92px; }
}

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