/* ==========================================================
   Birthday3D · 基础样式
   ========================================================== */
:root {
  --ink: #f7f1e8;
  --ink-dim: rgba(247, 241, 232, 0.62);
  --ink-faint: rgba(247, 241, 232, 0.35);
  --gold: #f2d39b;
  --gold-deep: #c99a52;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(255, 255, 255, 0.055);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --bg-0: #080609;
  --bg-1: #150f1c;
  --danger: #ff7a8a;
  --ok: #8be0b0;
  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --radius: 18px;
  --ease: cubic-bezier(0.22, 0.61, 0.24, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

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

body {
  overflow-x: hidden;
  user-select: none;
}

h1, h2, h3, .serif { font-family: var(--serif); font-weight: 500; letter-spacing: 0.02em; }

button { font-family: inherit; color: inherit; border: 0; background: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }
input, textarea, select { font-family: inherit; }

/* ---------- 装饰层 ---------- */
.grain {
  position: fixed; inset: 0; z-index: 60; pointer-events: none; opacity: 0.055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/></filter><rect width='160' height='160' filter='url(%23n)' opacity='0.9'/></svg>");
  mix-blend-mode: overlay;
}
.vignette {
  position: fixed; inset: 0; z-index: 55; pointer-events: none;
  background: radial-gradient(120% 85% at 50% 42%, transparent 38%, rgba(0, 0, 0, 0.55) 100%);
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: 999px;
  font-size: 15px; letter-spacing: 0.06em;
  border: 1px solid var(--line); background: var(--glass); color: var(--ink);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s var(--ease), background 0.25s, border-color 0.25s;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: linear-gradient(135deg, #fff2d2, #e6bd77 55%, #c9984c);
  color: #2a1a05; border-color: transparent; font-weight: 600;
  box-shadow: 0 8px 30px -10px rgba(233, 190, 120, 0.65);
}
.btn-ghost { background: transparent; }
.btn[disabled] { opacity: 0.4; pointer-events: none; }

/* ---------- 图标按钮 ---------- */
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: rgba(12, 9, 16, 0.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: background 0.25s, transform 0.2s;
}
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- 弹出层 ---------- */
.sheet-mask {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-end;
  background: rgba(4, 3, 6, 0.62); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity 0.3s var(--ease);
}
.sheet-mask.on { opacity: 1; pointer-events: auto; }
.sheet {
  width: 100%; max-width: 560px; margin: 0 auto;
  background: linear-gradient(180deg, #191320, #0e0a13);
  border-radius: 26px 26px 0 0; border: 1px solid var(--line); border-bottom: 0;
  padding: 22px 20px calc(24px + var(--safe-b));
  transform: translateY(24px); transition: transform 0.35s var(--ease);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6);
}
.sheet-mask.on .sheet { transform: translateY(0); }
.sheet h3 { margin: 0 0 6px; font-size: 19px; }
.sheet p.sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-dim); line-height: 1.7; }

/* ---------- Toast ---------- */
.toast-wrap {
  position: fixed; left: 0; right: 0; bottom: calc(30px + var(--safe-b)); z-index: 200;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none;
}
.toast {
  padding: 11px 20px; border-radius: 999px; font-size: 13.5px; letter-spacing: 0.04em;
  background: rgba(20, 15, 26, 0.92); border: 1px solid var(--line); color: var(--ink);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: toastIn 0.3s var(--ease) both;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}
.toast.out { animation: toastOut 0.3s var(--ease) both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(-8px); } }

/* ---------- 表单 ---------- */
.field { margin-bottom: 16px; }
.field > label {
  display: block; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-faint); margin-bottom: 9px;
}
.input, .textarea {
  width: 100%; padding: 14px 16px; font-size: 16px; color: var(--ink);
  background: rgba(255, 255, 255, 0.045); border: 1px solid var(--line);
  border-radius: 14px; outline: none; transition: border-color 0.25s, background 0.25s;
}
.input::placeholder, .textarea::placeholder { color: rgba(247, 241, 232, 0.28); }
.input:focus, .textarea:focus { border-color: rgba(242, 211, 155, 0.5); background: rgba(255, 255, 255, 0.07); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.7; }
.counter { text-align: right; font-size: 11px; color: var(--ink-faint); margin-top: 6px; letter-spacing: 0.06em; }

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
