/* ===========================================================
   公共主题：红金喜庆风格（纯 CSS 光效，无外部图片依赖）
   所有页面引入此文件后再引入各自的页面样式
   =========================================================== */

:root {
  --red-deep: #6e0206;
  --red-dark: #a3060b;
  --red: #cf0d12;
  --red-bright: #f1211c;
  --gold: #f6cc5a;
  --gold-light: #fff3bf;
  --gold-dark: #c98a1c;
  --gold-text: #ffe484;
  --cream: #fff4dc;
  --ink: #7a1a06;

  --font-calligraphy: "STXingkai", "华文行楷", "STKaiti", "KaiTi", "楷体", "Songti SC", serif;
  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  --radius-card: 22px;
  --shadow-card: 0 12px 34px rgba(52, 0, 0, 0.5), inset 0 1px 0 rgba(255, 230, 160, 0.22);

  /* ---------- 流体字号 / 间距（设计基准 390px 宽度） ----------
     窄屏自动收紧，宽屏封顶，避免 320px 拥挤与 430px+ 松散 */
  --fs-2xs: clamp(9px, 2.5vw, 11px);
  --fs-xs:  clamp(10px, 2.8vw, 12px);
  --fs-sm:  clamp(11px, 3.1vw, 13px);
  --fs-md:  clamp(13px, 3.6vw, 15px);
  --fs-lg:  clamp(15px, 4.1vw, 17px);
  --fs-xl:  clamp(18px, 4.9vw, 21px);
  --fs-2xl: clamp(24px, 6.7vw, 30px);

  --sp-1: clamp(5px, 1.3vw, 7px);
  --sp-2: clamp(8px, 2.1vw, 11px);
  --sp-3: clamp(11px, 2.9vw, 15px);
  --sp-4: clamp(15px, 3.9vw, 20px);
  --sp-5: clamp(19px, 5.0vw, 26px);
  --sp-6: clamp(26px, 6.7vw, 36px);

  /* 安全区域：刘海屏顶部、底部手势条，PC 上 env() 自动为 0 */
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

/* 统一盒模型与点击高亮（移动端） */
* { -webkit-tap-highlight-color: transparent; }

html {
  /* 禁止横竖屏切换时系统放大文字，保证流体布局一致 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  background: #3d0204;
  color: var(--cream);
}

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

/* ---------- 红金放射光背景 ---------- */
.festive-bg {
  position: relative;
  isolation: isolate;
  background-color: var(--red-deep);
  background-image:
    radial-gradient(ellipse 62% 40% at 50% -4%, rgba(255, 246, 186, 0.92) 0%, rgba(255, 195, 72, 0.45) 26%, rgba(255, 92, 12, 0.12) 56%, transparent 76%),
    repeating-conic-gradient(from 0deg at 50% -4%, rgba(255, 232, 158, 0.19) 0deg 2deg, transparent 2deg 7deg),
    radial-gradient(ellipse 75% 28% at 50% 106%, rgba(255, 216, 104, 0.85) 0%, rgba(232, 82, 10, 0.32) 36%, transparent 72%),
    radial-gradient(ellipse 125% 85% at 50% 42%, #e31112 0%, #b5070c 46%, #690207 100%);
  overflow: hidden;
}

.festive-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.75;
  background-image:
    radial-gradient(2px 2px at 8% 18%, rgba(255, 236, 170, .95) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 19% 9%, rgba(255, 236, 170, .8) 50%, transparent 51%),
    radial-gradient(2px 2px at 84% 14%, rgba(255, 236, 170, .9) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 92% 30%, rgba(255, 236, 170, .7) 50%, transparent 51%),
    radial-gradient(2px 2px at 12% 52%, rgba(255, 236, 170, .7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 90% 62%, rgba(255, 236, 170, .8) 50%, transparent 51%),
    radial-gradient(2px 2px at 6% 78%, rgba(255, 236, 170, .65) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 95% 84%, rgba(255, 236, 170, .7) 50%, transparent 51%),
    radial-gradient(2px 2px at 40% 12%, rgba(255, 236, 170, .7) 50%, transparent 51%),
    radial-gradient(1.5px 1.5px at 66% 8%, rgba(255, 236, 170, .6) 50%, transparent 51%);
}

/* ---------- 金色书法标题 ---------- */
.gold-title {
  font-family: var(--font-calligraphy);
  font-weight: 700;
  line-height: 1.18;
  background: linear-gradient(180deg, #fff9d4 0%, #ffe68c 26%, #f7c13e 52%, #d98a12 80%, #ffeaa0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 2px 0 rgba(120, 28, 0, .95)) drop-shadow(0 8px 16px rgba(50, 0, 0, .6));
  letter-spacing: .04em;
}

/* 标题用容器宽度而非视口宽度计算：PC 预览时按 480px 画幅缩放，不会过度放大 */
.gold-title--sm { font-size: clamp(24px, 7cqw, 38px); }
.gold-title--lg { font-size: clamp(38px, 11cqw, 62px); }

.subtitle-gold {
  color: var(--gold-text);
  font-size: var(--fs-md);
  letter-spacing: .18em;
  font-weight: 600;
  text-shadow: 0 2px 8px rgba(60, 0, 0, .7);
}

/* ---------- 半透明玻璃卡片 ---------- */
.glass-card {
  background: linear-gradient(158deg, rgba(126, 18, 11, .88) 0%, rgba(76, 5, 7, .93) 100%);
  border: 1px solid rgba(255, 208, 110, .5);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* ---------- 金色按钮 ---------- */
.gold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  padding: 0 clamp(20px, 5cqw, 28px);
  border: 1px solid #fff0b8;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffeeb0 0%, #f7cf5d 42%, #e6a51f 100%);
  color: #801806;
  font-size: var(--fs-lg);
  font-weight: 800;
  letter-spacing: .08em;
  box-shadow: 0 10px 24px rgba(70, 8, 0, .5), inset 0 1px 0 rgba(255, 255, 255, .75);
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
  user-select: none;
}
.gold-btn:active { transform: translateY(2px) scale(.99); box-shadow: 0 5px 14px rgba(70, 8, 0, .5); }
.gold-btn:hover { filter: brightness(1.05); }
.gold-btn[disabled] { opacity: .55; cursor: not-allowed; filter: grayscale(.3); }
.gold-btn--block { display: flex; width: 100%; }

.gold-btn--ghost {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid rgba(255, 220, 130, .6);
  box-shadow: none;
}

/* ---------- 小标签 ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid rgba(255, 216, 130, .65);
  border-radius: 999px;
  color: var(--gold-light);
  font-size: var(--fs-xs);
  letter-spacing: .08em;
  background: rgba(120, 20, 8, .35);
}
.pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #ffd76a; box-shadow: 0 0 8px #ffd76a;
  animation: blink 1.6s infinite;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  top: 22%;
  transform: translate(-50%, -12px);
  z-index: 9999;
  min-width: 180px;
  max-width: 82vw;
  padding: 12px 20px;
  border-radius: 12px;
  background: rgba(30, 4, 4, .94);
  border: 1px solid rgba(255, 210, 120, .55);
  color: var(--cream);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.toast--error { border-color: #ff8a7a; color: #ffd5cf; }

/* ---------- 动画 ---------- */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes floatUp {
  0% { transform: translateY(14px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 214, 106, .45); }
  50% { box-shadow: 0 0 0 12px rgba(255, 214, 106, 0); }
}
.fade-in { animation: floatUp .45s ease both; }

/* ---------- 表单通用（页面3 / 页面5） ---------- */
.field { margin-bottom: 16px; }
.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: var(--fs-md);
  font-weight: 700;
}
.field-input {
  width: 100%;
  height: 50px; /* 触摸目标 ≥44px */
  padding: 0 14px;
  border: 1.5px solid rgba(190, 120, 40, .55);
  border-radius: 12px;
  background: #fffdf6;
  color: #4a230c;
  /* 固定 16px：低于 16px 时 iOS Safari 聚焦会自动缩放页面，破坏自适应 */
  font-size: 16px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field-input::placeholder { color: #c9b8a4; }
.field-input:focus { border-color: #d99a25; box-shadow: 0 0 0 3px rgba(240, 184, 70, .22); }
.field-input.is-invalid { border-color: #d8382a; background: #fff8f6; }
.field-input.is-valid { border-color: #4fae72; }
.field-error {
  display: none;
  margin-top: 5px;
  color: #b52418;
  font-size: var(--fs-xs);
  line-height: 1.4;
}
.field-error.is-visible { display: block; }

/* ---------- 工具 ---------- */
.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;
}
.center { text-align: center; }
.muted { opacity: .72; }
