/* ==========================================================
   生日心愿单 · 设计令牌 & 通用组件
   视觉概念：奶油蛋糕 × 礼物兑换券
   ========================================================== */
:root {
  /* 底色：奶油 */
  --bg: #FFF6EA;
  --bg-deep: #FCE8D4;
  --card: #FFFDF9;
  --line: #F1E1D2;
  --line-strong: #E6CFBC;

  /* 文字：可可 */
  --ink: #4A2C24;
  --ink-2: #7A5B4F;
  --ink-3: #B49E93;

  /* 主色：草莓 */
  --berry: #EE6B67;
  --berry-deep: #D24C48;
  --berry-soft: #FFE1DC;

  /* 点缀：蜂蜜 / 薄荷 / 天空 / 香芋 */
  --honey: #F5B53F;
  --honey-deep: #D9961E;
  --honey-soft: #FFF0CC;
  --mint: #45A77A;
  --mint-deep: #2F8A60;
  --mint-soft: #DCF2E5;
  --sky: #7DB9E0;
  --sky-soft: #E1F0FA;
  --lilac: #A98FDB;
  --lilac-soft: #EFE8FB;

  /* 状态 */
  --taken: #EEE7E0;
  --taken-ink: #A8978D;

  /* 圆角 */
  --r-xl: 28px;
  --r-l: 20px;
  --r-m: 14px;
  --r-s: 10px;

  /* 阴影：带暖色调，避免灰黑脏感 */
  --shadow-1: 0 1px 2px rgba(110, 62, 40, .06), 0 6px 16px -8px rgba(110, 62, 40, .22);
  --shadow-2: 0 2px 6px rgba(110, 62, 40, .08), 0 18px 40px -14px rgba(110, 62, 40, .35);

  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC", "MiSans",
          "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --ease-pop: cubic-bezier(.34, 1.56, .64, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
h1, h2, h3, h4, p { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
.icon { width: 1em; height: 1em; flex: none; display: inline-block; vertical-align: -0.125em; }
.num { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }
.still *, .still *::before, .still *::after { animation-delay: 0s !important; animation-duration: 0s !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- 彩纸背景纹理 ---------- */
.confetti-bg {
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg opacity='.55'%3E%3Ccircle cx='20' cy='24' r='3' fill='%23F5B53F'/%3E%3Ccircle cx='132' cy='40' r='2.5' fill='%23EE6B67'/%3E%3Crect x='86' y='96' width='9' height='3.5' rx='1.75' fill='%2345A77A' transform='rotate(35 90 98)'/%3E%3Crect x='30' y='130' width='9' height='3.5' rx='1.75' fill='%237DB9E0' transform='rotate(-30 34 132)'/%3E%3Ccircle cx='160' cy='150' r='3' fill='%23A98FDB'/%3E%3Crect x='150' y='92' width='8' height='3.5' rx='1.75' fill='%23EE6B67' transform='rotate(70 154 94)'/%3E%3Ccircle cx='70' cy='60' r='2' fill='%237DB9E0'/%3E%3Ccircle cx='96' cy='160' r='2' fill='%23F5B53F'/%3E%3C/g%3E%3C/svg%3E");
}

/* ---------- 按钮 ---------- */
.btn {
  --btn-bg: #fff;
  --btn-fg: var(--ink);
  --btn-edge: var(--line-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 42px; padding: 0 18px;
  border: 0; border-radius: 999px;
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: 15px; font-weight: 600; white-space: nowrap;
  box-shadow: 0 3px 0 var(--btn-edge);
  transition: transform .12s ease, box-shadow .12s ease, background .2s;
  user-select: none;
}
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--btn-edge); }
.btn-primary { --btn-bg: var(--berry); --btn-fg: #fff; --btn-edge: var(--berry-deep); }
.btn-mint    { --btn-bg: var(--mint);  --btn-fg: #fff; --btn-edge: var(--mint-deep); }
.btn-honey   { --btn-bg: var(--honey); --btn-fg: var(--ink); --btn-edge: var(--honey-deep); }
.btn-ghost   { --btn-bg: #fff; box-shadow: inset 0 0 0 1.5px var(--line-strong), 0 3px 0 var(--line); }
.btn-ghost:active { box-shadow: inset 0 0 0 1.5px var(--line-strong), 0 1px 0 var(--line); }
.btn-text    { background: none; box-shadow: none; color: var(--ink-2); padding: 0 8px; }
.btn-text:active { transform: none; box-shadow: none; opacity: .6; }
.btn-sm  { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-lg  { height: 52px; padding: 0 24px; font-size: 16px; }
.btn-block { display: flex; width: 100%; }
.btn[disabled] { --btn-bg: var(--taken); --btn-fg: var(--taken-ink); --btn-edge: #DDD3CA; cursor: not-allowed; }

/* ---------- 输入框 ---------- */
.field {
  display: block; width: 100%;
  height: 50px; padding: 0 16px;
  font-size: 16px; /* ≥16px 防止 iOS 微信聚焦放大 */
  background: #fff;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-m);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.field::placeholder { color: var(--ink-3); }
.field:focus { border-color: var(--berry); box-shadow: 0 0 0 4px var(--berry-soft); }
textarea.field { height: auto; padding: 12px 16px; resize: none; line-height: 1.6; }
.field.is-error { border-color: var(--berry); background: #FFF6F4; }
.label { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 8px; }
.label em { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.hint { font-size: 12px; color: var(--ink-3); margin-top: 6px; }

/* ---------- 筛选胶囊 ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  height: 32px; padding: 0 14px;
  border: 0; border-radius: 999px;
  background: #fff; color: var(--ink-2);
  font-size: 14px; white-space: nowrap;
  box-shadow: inset 0 0 0 1.2px var(--line);
}
.chip b { font-weight: 600; font-size: 12px; color: var(--ink-3); }
.chip.on { background: var(--ink); color: #fff; box-shadow: none; }
.chip.on b { color: rgba(255,255,255,.6); }

/* ---------- 开关 ---------- */
.switch { position: relative; width: 46px; height: 28px; flex: none; }
.switch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #E9DDD2; transition: background .2s; }
.switch span::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 4px rgba(74,44,36,.2); transition: transform .25s var(--ease-pop);
}
.switch input:checked + span { background: var(--mint); }
.switch input:checked + span::after { transform: translateX(18px); }

/* ---------- 动画 ---------- */
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-8px) } }
@keyframes shake { 10%,90% { transform: translateX(-1px) } 20%,80% { transform: translateX(3px) } 30%,50%,70% { transform: translateX(-6px) } 40%,60% { transform: translateX(6px) } }
@keyframes stamp-in { 0% { opacity: 0; transform: rotate(-14deg) scale(2.2) } 60% { opacity: 1; transform: rotate(-14deg) scale(.92) } 100% { opacity: 1; transform: rotate(-14deg) scale(1) } }
@keyframes pop-in { 0% { opacity: 0; transform: scale(.85) } 100% { opacity: 1; transform: scale(1) } }
@keyframes slide-up { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes fade-in { from { opacity: 0 } to { opacity: 1 } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -16px) } to { opacity: 1; transform: translate(-50%, 0) } }
@keyframes confetti-fall {
  0% { transform: translate3d(0, -20px, 0) rotate(0); opacity: 1 }
  100% { transform: translate3d(var(--dx, 0), 620px, 0) rotate(var(--rot, 540deg)); opacity: 0 }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
