/* ============================================================
   GARDEN — 滚轮穿梭的花园 · UI 覆盖层样式
   ============================================================ */

:root {
  --ink: #fbf7ec;
  --ink-dim: rgba(251, 247, 236, 0.62);
  --ink-faint: rgba(251, 247, 236, 0.34);
  --serif: "Songti SC", "Noto Serif SC", "STSong", "SimSun", Georgia, serif;
  --sans: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --pad-x: clamp(24px, 5vw, 72px);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  background: #1c2b1e;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

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

/* ---------- 加载遮罩 ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 26px;
  background: radial-gradient(120% 120% at 50% 60%, #24361f 0%, #131f15 70%);
  transition: opacity 1.1s var(--ease-out), visibility 1.1s;
}
.loader.is-done { opacity: 0; visibility: hidden; }
.loader__word {
  font-family: var(--serif);
  font-size: clamp(22px, 3vw, 34px);
  letter-spacing: 0.55em;
  text-indent: 0.55em;
  color: var(--ink);
}
.loader__line {
  width: min(240px, 50vw);
  height: 1px;
  background: var(--ink-faint);
  overflow: hidden;
}
.loader__line span {
  display: block;
  height: 100%;
  width: 40%;
  background: var(--ink);
  animation: load 1.2s ease-in-out infinite;
}
@keyframes load {
  0% { transform: translateX(-110%); }
  100% { transform: translateX(260%); }
}

/* ---------- 兜底 ---------- */
.fallback {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background:
    radial-gradient(90% 70% at 50% 100%, rgba(122, 158, 84, 0.5), transparent 70%),
    linear-gradient(180deg, #9fc3d9 0%, #e6dfc0 55%, #52703f 100%);
  color: #22331f;
}
.fallback[hidden] { display: none; }
.fallback__inner h1 { font-family: var(--serif); font-size: clamp(28px, 5vw, 56px); margin-bottom: 14px; }
.fallback__inner p { font-size: 14px; opacity: 0.75; }

/* ---------- 顶部导航 ---------- */
.site-head {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px var(--pad-x);
  text-shadow: 0 1px 16px rgba(20, 35, 18, 0.5);
}
.site-head__logo {
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0.32em;
}
.site-head__logo span { font-size: 10px; vertical-align: super; margin-left: 2px; }

/* ---------- 右侧进度 ---------- */
.progress {
  position: fixed;
  right: clamp(18px, 3vw, 44px);
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 16px;
  filter: drop-shadow(0 1px 8px rgba(20, 35, 18, 0.5));
}
.progress__track {
  position: relative;
  width: 1px;
  height: 132px;
  background: var(--ink-faint);
}
.progress__dot {
  position: absolute;
  left: 50%;
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px rgba(251, 247, 236, 0.8);
}
.progress__marks {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.progress__marks li {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  border: 1px solid var(--ink-faint);
  cursor: pointer;
  transition: background 0.4s, border-color 0.4s, transform 0.4s;
  pointer-events: auto;
}
.progress__marks li.is-on {
  background: var(--ink);
  border-color: var(--ink);
  transform: scale(1.35);
}

/* ---------- 滚动提示 ---------- */
.scroll-hint {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--ink-dim);
  text-shadow: 0 1px 12px rgba(20, 35, 18, 0.5);
  transition: opacity 0.9s var(--ease-out);
}
.scroll-hint.is-hidden { opacity: 0; }
.scroll-hint__mouse {
  width: 22px;
  height: 34px;
  border: 1px solid var(--ink-dim);
  border-radius: 12px;
  display: flex;
  justify-content: center;
  padding-top: 6px;
}
.scroll-hint__mouse i {
  width: 2px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
  animation: wheel 1.6s ease-in-out infinite;
}
@keyframes wheel {
  0% { transform: translateY(0); opacity: 1; }
  70% { transform: translateY(9px); opacity: 0; }
  100% { transform: translateY(0); opacity: 0; }
}

/* ---------- 页脚 ---------- */
.site-foot {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  padding: 22px var(--pad-x);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  text-shadow: 0 1px 12px rgba(20, 35, 18, 0.45);
  pointer-events: none;
}

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .site-head { padding-top: 20px; }
  .progress { right: 14px; }
  .progress__track { height: 96px; }
  .site-foot span:last-child { display: none; }
}

/* ---------- 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  .loader__line span,
  .scroll-hint__mouse i { animation: none; }
  .chapter > * { transition-duration: 0.01s; }
}
