/* 碎碎念专属 · 七夕特辑 — 基础设计系统 */

:root {
  /* 取色自 background photo：暖灰墙面 + 深棕发丝 + 唇色玫瑰 */
  --ink-900: #080706;
  --ink-800: #0f0c0b;
  --ink-700: #171211;
  --ink-600: #221a18;
  --ink-500: #362a27;

  --paper: #f6efe9;
  --paper-dim: #cbbdb4;
  --paper-faint: #8d7f78;

  --rose: #e79aad;
  --rose-hot: #ff9ec4;
  --rose-pale: #ffdfe9;
  --gold: #d9b78c;
  --gold-pale: #f3ddbd;
  --jade: #7f9c86;

  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-serif: "Songti SC", "STSong", "SimSun", "Noto Serif SC", Georgia, serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

* { box-sizing: border-box; }

/* .chip 等设了 display 的类会盖掉 hidden 属性，这里强制回来 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--ink-900);
  color: var(--paper);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}

canvas { display: block; }

button {
  font-family: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

a { color: inherit; text-decoration: none; }

/* ── 屏幕阅读器专用 ───────────────────────────── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── 通用浮层控件 ─────────────────────────────── */
/* 只有图标，没有文字：说明都在 aria-label / title 里 */
.chip {
  position: fixed;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--paper-dim);
  background: rgba(12, 9, 8, 0.5);
  border: 1px solid rgba(246, 239, 233, 0.16);
  border-radius: 999px;
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  transition: color 0.3s, border-color 0.3s, background 0.3s, transform 0.3s var(--ease-out);
}
.chip:hover, .chip:focus-visible {
  color: var(--paper);
  border-color: rgba(231, 154, 173, 0.55);
  background: rgba(24, 15, 18, 0.68);
  transform: translateY(-1px);
}
.chip:focus-visible { outline: 2px solid var(--rose); outline-offset: 3px; }
.chip svg { width: 16px; height: 16px; flex: none; display: block; }
/* 返回箭头的视觉重心偏右，往左挪一点才居中 */
.chip--back svg { margin-right: 2px; }

.chip--back  { top: max(18px, env(safe-area-inset-top)); left: max(18px, env(safe-area-inset-left)); }
.chip--sound { top: max(18px, env(safe-area-inset-top)); right: max(18px, env(safe-area-inset-right)); }

/* ── 特效页页眉 ───────────────────────────────── */
.stage-title {
  position: fixed;
  left: 0; right: 0;
  bottom: max(30px, env(safe-area-inset-bottom));
  z-index: 50;
  text-align: center;
  pointer-events: none;
  animation: rise-in 1.4s var(--ease-out) both 0.4s;
}
.stage-title h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(20px, 4.4vw, 30px);
  font-weight: 500;
  letter-spacing: 0.42em;
  text-indent: 0.42em;
  color: var(--paper);
  text-shadow: 0 2px 26px rgba(0, 0, 0, 0.9);
}
.stage-title p {
  margin: 0.7em 0 0;
  font-size: clamp(11px, 2.5vw, 13px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--paper-faint);
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.9);
}

@keyframes rise-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}

/* ── 页面进出场遮罩 ───────────────────────────── */
.veil {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink-900);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.85s var(--ease-in-out);
}
.veil.lifted { opacity: 0; }
.veil.falling { opacity: 1; pointer-events: auto; }

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