/* ============================================================
   入站动画（v=go）
   - 先看到正常页面 → 暖色背景不透明度慢慢升高 → 文字逐行「歌词式」显现
   - 落款 → 无色毛玻璃「知豆了!」按钮 → 点掉后文字先淡出、背景再淡出
   背景色每天都不同：.bg-0 … .bg-4 由 JS 按北京日期轮换
   ============================================================ */

.splash {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  visibility: hidden;
}

.splash.is-on { visibility: visible; }

/* 背景：从全透明开始，只动 opacity，绝不动 background-position，避免掉帧 */
.splash-bg {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 900ms cubic-bezier(0.4, 0, 0.2, 1);
}

.splash.is-on .splash-bg { opacity: 1; }

/* 五种暖色，每天一个（深棕 → 陶土 → 赭金 → 暖梅 → 暖炭） */
.splash-bg.bg-0 {
  background:
    radial-gradient(120% 80% at 18% 6%, rgba(238, 171, 96, 0.30), transparent 62%),
    radial-gradient(90% 70% at 86% 94%, rgba(160, 84, 40, 0.26), transparent 66%),
    linear-gradient(160deg, #34220f 0%, #1a1008 56%, #0c0704 100%);
}

.splash-bg.bg-1 {
  background:
    radial-gradient(110% 78% at 80% 8%, rgba(226, 132, 92, 0.28), transparent 62%),
    radial-gradient(95% 75% at 12% 92%, rgba(150, 70, 48, 0.26), transparent 68%),
    linear-gradient(165deg, #3a1e18 0%, #1d0f0c 58%, #0e0706 100%);
}

.splash-bg.bg-2 {
  background:
    radial-gradient(120% 82% at 22% 10%, rgba(226, 186, 108, 0.28), transparent 60%),
    radial-gradient(90% 70% at 88% 88%, rgba(158, 116, 44, 0.22), transparent 66%),
    linear-gradient(158deg, #342812 0%, #1b1408 58%, #0d0a05 100%);
}

.splash-bg.bg-3 {
  background:
    radial-gradient(115% 80% at 84% 6%, rgba(214, 148, 138, 0.26), transparent 62%),
    radial-gradient(95% 72% at 10% 94%, rgba(128, 62, 60, 0.24), transparent 68%),
    linear-gradient(162deg, #33201f 0%, #1a0f10 58%, #0b0607 100%);
}

.splash-bg.bg-4 {
  background:
    radial-gradient(120% 80% at 16% 88%, rgba(198, 154, 92, 0.24), transparent 62%),
    radial-gradient(95% 72% at 86% 10%, rgba(120, 104, 70, 0.26), transparent 66%),
    linear-gradient(160deg, #2b2318 0%, #17130d 58%, #0a0906 100%);
}

/* ---------- 内容 ---------- */
.splash-inner {
  position: relative;
  width: 100%;
  max-width: 360px;
  padding: 0 6px;
  text-align: center;
  transition: opacity 460ms ease, transform 460ms ease;
}

.splash.is-out .splash-inner {
  opacity: 0;
  transform: translateY(-10px);
}

.splash-mark {
  display: block;
  text-align: left;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 64px;
  line-height: 0.7;
  color: rgba(236, 170, 104, 0.6);
  opacity: 0;
}

.splash.is-on .splash-mark {
  animation: splashFade 700ms ease forwards;
  animation-delay: 620ms;
}

.splash-quote {
  margin-top: 10px;
  color: #f3e7d8;
  font-size: 18px;
  line-height: 1.95;
  letter-spacing: 0.04em;
  text-align: center;
}

.splash-line {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  will-change: opacity, transform, filter;
}

/* 非空行才加动画；--i 是行序号，逐行错开（歌词感） */
.splash-line.is-text {
  animation: splashLineIn 780ms cubic-bezier(0.22, 0.7, 0.24, 1) forwards;
  animation-delay: calc(680ms + var(--i, 0) * 230ms);
}

/* 段落之间留白 */
.splash-para + .splash-para { margin-top: 18px; }

/* v=hb：只有文案里用 [ ] 括起来的部分才变暖橙（不再按段落自动高亮）。
   颜色沿用原来的 #eaa25c，和左上角引号、背景暖色同一族。 */
.splash-accent { color: #eaa25c; }

@keyframes splashLineIn {
  0% { opacity: 0; transform: translateY(14px); filter: blur(6px); }
  55% { opacity: 1; filter: blur(0); }
  100% { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.splash-by {
  margin-top: 26px;
  color: rgba(243, 231, 216, 0.72);
  font-size: 12px;
  letter-spacing: 0.08em;
  opacity: 0;
}

.splash.is-on .splash-by {
  animation: splashFade 700ms ease forwards;
}

@keyframes splashFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* 无色毛玻璃按钮（v=gr：与文字拉开距离，去掉描边） */
.splash-ok {
  margin-top: 64px;
  min-height: 46px;
  padding: 0 34px;
  border-radius: 999px;
  border: none;
  /* 关闭按钮会拿到焦点，浏览器默认会画一圈 outline，看起来仍像描边 → 明确去掉 */
  outline: none;
  background: rgba(255, 255, 255, 0.08);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  color: rgba(255, 255, 255, 0.94);
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 0.18em;
  cursor: pointer;
  opacity: 0;
  -webkit-tap-highlight-color: transparent;
}

.splash.is-on .splash-ok {
  animation: splashBtnIn 700ms cubic-bezier(0.22, 0.7, 0.24, 1) forwards;
}

@keyframes splashBtnIn {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.splash-ok:active { background: rgba(255, 255, 255, 0.18); }
.splash-ok:focus { outline: none; }

/* 关闭：文字先淡出（在 .splash-inner 上），背景再淡出 */
.splash.is-out .splash-bg {
  opacity: 0;
  transition: opacity 700ms ease 360ms;
}

/* 减少动态效果：直接静态显示，不做逐行动画 */
@media (prefers-reduced-motion: reduce) {
  .splash-line,
  .splash-mark,
  .splash-by,
  .splash-ok {
    opacity: 1;
    transform: none;
    filter: none;
    animation: none !important;
  }
  .splash-bg { transition: none; }
  .splash.is-out .splash-inner { opacity: 0; transition: opacity 200ms ease; }
}
