/* ===================================================================
 * css/style.css — 公共视觉层（大屏 / 手机端共用）
 * 风格基线：中国红·酒红渐变 + 金色点缀，真实晚会主视觉质感
 * 设计原则：深色舞台底色 + 极简金线结构 + 克制的光效，避免扁平渐变与塑料感
 * =================================================================== */

/* ---------------- 1. 设计变量 ---------------- */
:root {
  /* 红：舞台底色（暗部更暗，拉开层次） */
  --red-950: #2E0409;
  --red-900: #45060E;
  --red-850: #560913;
  --red-800: #6A0C18;
  --red-700: #84101F;
  --red-600: #9E1526;
  /* 金：主光与描边 */
  --gold-100: #FDF3D6;
  --gold-200: #F7E6B0;
  --gold-300: #EFD188;
  --gold-400: #E3B95F;
  --gold-500: #CFA03C;
  --gold-600: #A87B26;
  /* 中性 */
  --ink-900: #14171C;
  --ink-700: #2A303A;
  --ink-500: #566072;
  --ink-300: #8B95A6;
  --paper: #FFFFFF;

  --gold-line: rgba(227, 185, 95, .42);
  --gold-line-soft: rgba(227, 185, 95, .20);
  --panel: linear-gradient(180deg, rgba(255, 255, 255, .075) 0%, rgba(255, 255, 255, .025) 100%);

  --font-sans: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  --font-num: "DIN Alternate", "Bebas Neue", "Helvetica Neue", Arial, sans-serif;

  --shadow-stage: 0 30px 80px -30px rgba(0, 0, 0, .85);
  --ease-out: cubic-bezier(.16, .84, .36, 1);
}

/* ---------------- 2. 基础重置 ---------------- */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
}

body {
  font-family: var(--font-sans);
  color: #FFEFE3;
  background: var(--red-900);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, p, ul, ol, li { margin: 0; padding: 0; }
ul, ol { list-style: none; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; outline: none; }
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* 金色渐变文字（标题用，靠字重与字距撑起质感） */
.gold-text {
  background: linear-gradient(178deg, var(--gold-100) 0%, var(--gold-300) 42%, var(--gold-500) 78%, var(--gold-200) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 2px 0 rgba(68, 6, 14, .55)) drop-shadow(0 10px 26px rgba(0, 0, 0, .45));
}

/* 细金线分隔（带两端渐隐，比实线更高级） */
.gold-rule {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line) 22%, var(--gold-300) 50%, var(--gold-line) 78%, transparent);
  opacity: .8;
}

/* ---------------- 3. 按钮 ---------------- */
.btn-gold {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  padding: .85em 2.4em;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #4A1206;
  background:
    linear-gradient(180deg, var(--gold-200) 0%, var(--gold-400) 46%, var(--gold-500) 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -2px 0 rgba(120, 72, 10, .35),
    0 10px 26px -8px rgba(0, 0, 0, .6),
    0 0 0 1px rgba(255, 236, 190, .55);
  transition: transform .18s var(--ease-out), box-shadow .22s var(--ease-out), filter .2s;
  overflow: hidden;
  user-select: none;
}
.btn-gold::after {
  /* 掠过式高光，替代廉价的持续闪光 */
  content: '';
  position: absolute;
  top: -40%;
  left: -60%;
  width: 40%;
  height: 180%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .75), transparent);
  transform: skewX(-18deg);
  transition: left .55s var(--ease-out);
}
.btn-gold:hover { transform: translateY(-1px); filter: brightness(1.04); }
.btn-gold:hover::after { left: 120%; }
.btn-gold:active { transform: translateY(1px) scale(.995); }
.btn-gold:disabled { filter: grayscale(.45) brightness(.85); cursor: not-allowed; transform: none; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4em;
  padding: .62em 1.5em;
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--gold-200);
  background: rgba(255, 255, 255, .04);
  border: 1px solid var(--gold-line);
  transition: all .2s var(--ease-out);
}
.btn-ghost:hover { background: rgba(227, 185, 95, .14); border-color: var(--gold-300); color: var(--gold-100); }
.btn-ghost:disabled { opacity: .45; cursor: not-allowed; }

/* 加载态（抽奖提交时防重复点击） */
.is-loading { pointer-events: none; position: relative; color: transparent !important; }
.is-loading::before {
  content: '';
  position: absolute;
  width: 1.1em;
  height: 1.1em;
  border-radius: 50%;
  border: 2px solid rgba(74, 18, 6, .28);
  border-top-color: #4A1206;
  animation: ug-spin .7s linear infinite;
}
@keyframes ug-spin { to { transform: rotate(360deg); } }

/* ---------------- 4. 等级徽章（分级配色） ---------------- */
.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: .18em .72em;
  border-radius: 999px;
  font-size: .74em;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
  color: #2A1A02;
  background: linear-gradient(180deg, var(--tc-l, #F3E2B4), var(--tc, #D9B45E));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8), 0 2px 8px -2px rgba(0, 0, 0, .5);
}
/* 各等级取色：金 / 银 / 铜 / 紫 / 青 */
.tier-1 { --tc: #D9A93C; --tc-l: #FBEEC0; }
.tier-2 { --tc: #B9C3CF; --tc-l: #EDF2F7; }
.tier-3 { --tc: #C58A55; --tc-l: #F3DCC4; }
.tier-4 { --tc: #A07FC0; --tc-l: #E7DAF2; }
.tier-5 { --tc: #7FAFB0; --tc-l: #D8EBEB; }
.tier-0 { --tc: #7B8494; --tc-l: #C9D0DA; }

/* ---------------- 5. 弹窗 ---------------- */
.ug-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background:
    radial-gradient(ellipse at 50% 40%, rgba(105, 12, 24, .55) 0%, rgba(12, 3, 5, .88) 68%, rgba(6, 2, 3, .96) 100%);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.ug-modal.is-open { display: flex; }

.ug-dialog {
  position: relative;
  width: 100%;
  max-width: 560px;
  max-height: 92vh;
  overflow: auto;
  padding: 30px 32px 26px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(124, 16, 30, .96) 0%, rgba(72, 7, 15, .98) 55%, rgba(48, 4, 9, 1) 100%);
  border: 1px solid var(--gold-line);
  box-shadow:
    inset 0 1px 0 rgba(255, 232, 180, .18),
    0 0 0 1px rgba(0, 0, 0, .5),
    0 40px 90px -30px rgba(0, 0, 0, .95);
  transform: translateY(14px) scale(.98);
  opacity: 0;
  transition: transform .32s var(--ease-out), opacity .28s var(--ease-out);
  animation: ug-dialog-in .34s var(--ease-out) forwards;
}
@keyframes ug-dialog-in {
  to { transform: translateY(0) scale(1); opacity: 1; }
}
/* 顶部金色饰线 + 中心菱形 */
.ug-dialog::before {
  content: '';
  position: absolute;
  left: 22px; right: 22px; top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-400) 30%, var(--gold-100) 50%, var(--gold-400) 70%, transparent);
}
.ug-dialog-close {
  position: absolute;
  top: 12px; right: 14px;
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 20px; line-height: 1;
  color: rgba(255, 238, 214, .6);
  background: rgba(0, 0, 0, .18);
  transition: all .18s;
}
.ug-dialog-close:hover { color: var(--gold-200); background: rgba(0, 0, 0, .38); }

.ug-dialog-title {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .1em;
  text-align: center;
  margin-bottom: 4px;
}
.ug-dialog-sub {
  font-size: 12.5px;
  letter-spacing: .08em;
  text-align: center;
  color: rgba(255, 234, 210, .55);
  margin-bottom: 20px;
}
.ug-dialog-foot {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}
.ug-dialog-foot .btn-gold,
.ug-dialog-foot .btn-ghost { flex: 1; padding: .8em 1em; }

/* 表单（节庆风输入框，聚焦金边） */
.ug-field { margin-bottom: 16px; }
.ug-field label {
  display: block;
  font-size: 12.5px;
  letter-spacing: .14em;
  color: rgba(255, 232, 200, .72);
  margin-bottom: 7px;
}
.ug-field label i { font-style: normal; color: var(--gold-400); margin-left: 3px; }
.ug-input {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 16px;
  letter-spacing: .04em;
  color: var(--gold-100);
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(227, 185, 95, .28);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.ug-input::placeholder { color: rgba(255, 235, 210, .28); letter-spacing: .06em; }
.ug-input:focus {
  border-color: var(--gold-400);
  background: rgba(0, 0, 0, .42);
  box-shadow: 0 0 0 3px rgba(227, 185, 95, .14);
}

/* 次数步进器 */
.ug-stepper {
  display: flex;
  align-items: center;
  gap: 0;
  height: 52px;
  border-radius: 11px;
  overflow: hidden;
  background: rgba(0, 0, 0, .3);
  border: 1px solid rgba(227, 185, 95, .28);
}
.ug-stepper button {
  width: 58px;
  height: 100%;
  font-size: 24px;
  font-weight: 400;
  color: var(--gold-200);
  background: rgba(227, 185, 95, .07);
  transition: background .16s, color .16s;
  flex: none;
}
.ug-stepper button:hover { background: rgba(227, 185, 95, .2); color: var(--gold-100); }
.ug-stepper button:active { background: rgba(227, 185, 95, .3); }
.ug-stepper button:disabled { opacity: .3; cursor: not-allowed; }
.ug-stepper input {
  flex: 1;
  width: 100%;
  height: 100%;
  text-align: center;
  font-family: var(--font-num);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gold-100);
  background: transparent;
  border: 0;
  -moz-appearance: textfield;
}
.ug-stepper input::-webkit-outer-spin-button,
.ug-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ug-tip-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  letter-spacing: .04em;
  color: rgba(255, 232, 200, .5);
  margin-top: 8px;
}
.ug-tip-line b { color: var(--gold-300); font-family: var(--font-num); font-size: 14px; }

/* 阻断 / 错误提示条 */
.ug-alert {
  display: none;
  padding: 12px 14px;
  margin-bottom: 16px;
  border-radius: 9px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #FFE2C6;
  background: rgba(158, 21, 38, .28);
  border: 1px solid rgba(255, 132, 132, .32);
  border-left: 3px solid #FF8A6B;
}
.ug-alert.is-show { display: block; animation: ug-shake .4s; }
@keyframes ug-shake {
  0%, 100% { transform: translateX(0); }
  22% { transform: translateX(-5px); }
  44% { transform: translateX(4px); }
  68% { transform: translateX(-3px); }
  86% { transform: translateX(2px); }
}

/* ---------------- 6. Toast ---------------- */
.ug-toast-wrap {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9900;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.ug-toast {
  padding: 11px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  letter-spacing: .04em;
  color: #FFF1DC;
  background: linear-gradient(180deg, rgba(126, 18, 32, .96), rgba(70, 8, 16, .98));
  border: 1px solid var(--gold-line);
  box-shadow: 0 14px 34px -12px rgba(0, 0, 0, .8);
  animation: ug-toast-in .3s var(--ease-out);
  max-width: 82vw;
  text-align: center;
}
.ug-toast.is-out { animation: ug-toast-out .3s var(--ease-out) forwards; }
@keyframes ug-toast-in { from { opacity: 0; transform: translateY(-12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes ug-toast-out { to { opacity: 0; transform: translateY(-10px) scale(.97); } }

/* ---------------- 7. Canvas 彩带礼花层 ---------------- */
.ug-confetti-layer {
  position: fixed;
  inset: 0;
  z-index: 9500;
  pointer-events: none;
  display: none;
}
.ug-confetti-layer.is-active { display: block; }

/* ---------------- 8. 通用小动画 ---------------- */
@keyframes ug-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes ug-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}
.ug-fade-up { animation: ug-fade-up .5s var(--ease-out) both; }

/* 滚动条（大屏演示机上避免白色系统滚动条破坏画面） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, .25); }
::-webkit-scrollbar-thumb { background: rgba(227, 185, 95, .3); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(227, 185, 95, .5); }

/* ---------------- 9. 真实产品图（后台上传替换后使用） ---------------- */
.pimg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}
