:root {
  --gold: #e3c07b;
  --gold-soft: rgba(227, 192, 123, 0.55);
  --ink: #241a10;
  --panel: rgba(22, 19, 16, 0.5);
  --panel-line: rgba(230, 205, 155, 0.2);
  --text: #f1e6cf;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #10151b;
}

body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

#scene {
  position: fixed;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  touch-action: none;
}

/* 画面压角，让 UI 更稳 */
.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, rgba(0, 0, 0, 0) 55%, rgba(8, 12, 18, 0.42) 100%),
    linear-gradient(to bottom, rgba(8, 10, 14, 0.32) 0%, rgba(8, 10, 14, 0) 22%, rgba(8, 10, 14, 0) 72%, rgba(8, 10, 14, 0.4) 100%);
  z-index: 2;
}

/* ---------------- 标题 ---------------- */
.masthead {
  position: fixed;
  top: clamp(24px, 5vh, 54px);
  left: clamp(22px, 4vw, 64px);
  z-index: 4;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 1.4s ease 0.35s, transform 1.4s ease 0.35s;
}

body.ready .masthead {
  opacity: 1;
  transform: none;
}

.masthead h1 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-weight: 500;
  font-size: clamp(30px, 4.2vw, 54px);
  letter-spacing: 0.24em;
  color: #f7ecd4;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.55), 0 0 2px rgba(0, 0, 0, 0.4);
}

.masthead p {
  margin-top: 10px;
  padding-left: 4px;
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: 0.34em;
  color: rgba(243, 231, 205, 0.78);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.6);
}

.masthead::after {
  content: "";
  display: block;
  width: 46px;
  height: 1px;
  margin-top: 16px;
  background: linear-gradient(to right, var(--gold), rgba(227, 192, 123, 0));
}

/* ---------------- 操作提示 ---------------- */
.hint {
  position: fixed;
  left: clamp(22px, 4vw, 64px);
  bottom: clamp(22px, 4vh, 40px);
  z-index: 4;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: rgba(240, 230, 210, 0.66);
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 1.2s ease 0.9s;
  pointer-events: none;
}

body.ready .hint {
  opacity: 1;
}

/* ---------------- 控制坞 ---------------- */
.dock {
  position: fixed;
  left: 50%;
  bottom: clamp(18px, 3.4vh, 34px);
  transform: translate(-50%, 12px);
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  opacity: 0;
  transition: opacity 1.1s ease 0.5s, transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1) 0.5s;
  max-width: calc(100vw - 24px);
}

body.ready .dock {
  opacity: 1;
  transform: translate(-50%, 0);
}

.dock .group {
  display: flex;
  gap: 2px;
}

.dock .divider {
  width: 1px;
  height: 18px;
  margin: 0 6px;
  background: linear-gradient(to bottom, rgba(230, 205, 155, 0), rgba(230, 205, 155, 0.35), rgba(230, 205, 155, 0));
}

.dock button {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(240, 230, 210, 0.82);
  font-family: inherit;
  font-size: 12.5px;
  letter-spacing: 0.14em;
  padding: 8px 15px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s, background 0.25s, border-color 0.25s, box-shadow 0.25s;
  white-space: nowrap;
}

.dock button:hover {
  color: #fff6e2;
  background: rgba(255, 240, 210, 0.08);
}

.dock button.active {
  color: #2a1d0d;
  background: linear-gradient(180deg, #f0d69a, #d9b264);
  box-shadow: 0 2px 14px rgba(220, 178, 100, 0.35);
}

.dock button.tour {
  border-color: rgba(230, 205, 155, 0.28);
}

.dock button.tour.active {
  color: #2a1d0d;
  background: linear-gradient(180deg, #f0d69a, #d9b264);
  border-color: transparent;
}

.dock button.ghost {
  color: rgba(240, 230, 210, 0.62);
}

/* ---------------- 页脚 ---------------- */
.footnote {
  position: fixed;
  right: clamp(22px, 4vw, 64px);
  bottom: clamp(22px, 4vh, 40px);
  z-index: 4;
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: rgba(240, 230, 210, 0.45);
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.7);
  opacity: 0;
  transition: opacity 1.2s ease 1s;
  pointer-events: none;
}

body.ready .footnote {
  opacity: 1;
}

/* ---------------- 载入 ---------------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  background: radial-gradient(80% 80% at 50% 40%, #1b2027, #0b0e12 75%);
  transition: opacity 1.1s ease, visibility 1.1s;
}

body.ready .loader {
  opacity: 0;
  visibility: hidden;
}

.loader-inner {
  text-align: center;
}

.seal {
  width: 62px;
  height: 62px;
  margin: 0 auto 22px;
  display: grid;
  place-items: center;
  border: 1.5px solid rgba(200, 74, 55, 0.85);
  border-radius: 4px;
  color: #d0553c;
  font-family: "Songti SC", "STSong", serif;
  font-size: 19px;
  letter-spacing: 0.05em;
  line-height: 1.05;
  padding: 6px;
  background: rgba(160, 46, 33, 0.08);
}

.loader-text {
  font-family: "Songti SC", "STSong", serif;
  font-size: 13px;
  letter-spacing: 0.6em;
  color: rgba(232, 214, 180, 0.75);
  padding-left: 0.6em;
}

.bar {
  width: 148px;
  height: 1px;
  margin: 20px auto 0;
  background: rgba(232, 214, 180, 0.16);
  overflow: hidden;
}

.bar i {
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(to right, rgba(227, 192, 123, 0), var(--gold), rgba(227, 192, 123, 0));
  animation: sweep 1.5s ease-in-out infinite;
}

@keyframes sweep {
  0% {
    transform: translateX(-110%);
  }
  100% {
    transform: translateX(360%);
  }
}

/* ---------------- 小屏 ---------------- */
@media (max-width: 760px) {
  .dock {
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 20px;
    gap: 2px;
    padding: 8px;
    bottom: 12px;
  }
  .dock .divider {
    display: none;
  }
  .dock button {
    font-size: 11.5px;
    padding: 7px 11px;
    letter-spacing: 0.08em;
  }
  .hint,
  .footnote {
    display: none;
  }
  .masthead p {
    letter-spacing: 0.24em;
  }
}
