/* ============================================================
   吃什么盲盒 · 礼盒舞台主题
   深色夜幕 + 柔光晕 + 发光礼盒按钮，营造「想拆开」的仪式感
   纯样式改动，不影响任何功能与 DOM
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d201c;   /* 深邃墨绿夜色 */
  --bg-2:      #173a31;
  --card:      rgba(255, 255, 255, .055);   /* 玻璃卡片 */
  --card-solid:#16362d;
  --ink:       #f4f1e6;   /* 奶油白文字 */
  --muted:     #a9bdb3;
  --primary:   #46b391;   /* 青绿 */
  --gold:      #f2c879;   /* 香槟金 */
  --accent:    #ff8a5b;   /* 珊瑚橙 */
  --line:      rgba(255, 255, 255, .12);
  --shadow:    0 14px 38px rgba(0, 0, 0, .30);
}

html { -webkit-text-size-adjust: 100%; }

body {
  min-height: 100vh;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at 18% 6%,  rgba(242, 200, 121, .15), transparent 40%),
    radial-gradient(circle at 86% 16%, rgba(70, 179, 145, .18), transparent 42%),
    radial-gradient(circle at 50% 100%, rgba(255, 138, 91, .10), transparent 55%),
    linear-gradient(165deg, var(--bg), var(--bg-2) 58%, var(--bg));
  background-attachment: fixed;
  position: relative;
  overflow-x: hidden;
}

/* 舞台上的点点星光 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: .55;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 22%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.5px 1.5px at 78% 12%, rgba(255,255,255,.6), transparent),
    radial-gradient(2px 2px   at 90% 42%, rgba(242,200,121,.55), transparent),
    radial-gradient(1.5px 1.5px at 30% 68%, rgba(255,255,255,.5), transparent),
    radial-gradient(2px 2px   at 62% 84%, rgba(70,179,145,.5), transparent),
    radial-gradient(1.5px 1.5px at 8%  88%, rgba(255,255,255,.45), transparent);
  animation: twinkle 5s ease-in-out infinite alternate;
}
@keyframes twinkle { from { opacity: .3; } to { opacity: .7; } }

.wrap {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 26px 16px 44px;
}

/* ---------------- 头部 ---------------- */
.header { display: flex; align-items: center; gap: 15px; margin-bottom: 22px; }
.logo {
  width: 58px; height: 58px;
  border-radius: 17px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 0 2px rgba(242, 200, 121, .45), 0 10px 26px rgba(0, 0, 0, .4), 0 0 30px rgba(242, 200, 121, .18);
  animation: floaty 4.5s ease-in-out infinite;
}
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

.header h1 {
  font-size: 24px;
  letter-spacing: 1px;
  font-weight: 800;
  background: linear-gradient(100deg, #fff6e2 10%, var(--gold) 55%, #ffd9a8 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 2px 18px rgba(242, 200, 121, .15);
}
.tagline { font-size: 12.5px; color: var(--muted); margin-top: 3px; }

/* ---------------- 卡片 ---------------- */
.card {
  background: linear-gradient(150deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .025));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 15px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .06);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: rise .45s cubic-bezier(.2, .7, .3, 1) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.card h2 { font-size: 18px; margin: 4px 0 6px; font-weight: 700; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------------- 建档步骤 ---------------- */
.step-badge {
  display: inline-block;
  background: rgba(242, 200, 121, .14);
  color: var(--gold);
  border: 1px solid rgba(242, 200, 121, .3);
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  margin-bottom: 10px;
  font-weight: 600;
}
.field { margin-top: 17px; }
.field-label { font-size: 14px; font-weight: 600; margin-bottom: 9px; color: #f0ede0; }
.opts { display: flex; flex-wrap: wrap; gap: 9px; }
.opt {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, .04);
  color: var(--ink);
  padding: 8px 15px;
  border-radius: 22px;
  font-size: 13px;
  cursor: pointer;
  transition: transform .18s, border-color .18s, background .18s, box-shadow .18s;
}
.opt:hover {
  border-color: var(--primary);
  background: rgba(70, 179, 145, .12);
  transform: translateY(-2px);
}
.opt.sel {
  background: linear-gradient(135deg, var(--primary), #2c8c70);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(70, 179, 145, .32);
}
.build-actions { display: flex; gap: 10px; margin-top: 22px; }

/* ---------------- 按钮 ---------------- */
.btn {
  border: none;
  border-radius: 12px;
  padding: 11px 17px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), #2c8c70);
  color: #fff;
  box-shadow: 0 6px 18px rgba(70, 179, 145, .28);
}
.btn.primary:hover { box-shadow: 0 9px 24px rgba(70, 179, 145, .40); }
.btn.ghost { background: rgba(255, 255, 255, .07); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost:hover { background: rgba(255, 255, 255, .13); }
.btn.tiny { padding: 6px 11px; font-size: 12px; border-radius: 9px; }

/* ===== 主角：开今日盲盒按钮 ===== */
.action-card { display: grid; gap: 11px; position: relative; padding-top: 34px; }
.action-card::before {
  content: "✦ 准备好了吗？点一下，揭晓今日惊喜 ✦";
  position: absolute;
  top: 11px; left: 0; right: 0;
  text-align: center;
  font-size: 12px;
  letter-spacing: .5px;
  color: var(--gold);
  opacity: .85;
}
.btn.big { width: 100%; padding: 15px; font-size: 16px; border-radius: 14px; }

.action-card .btn.primary.big {
  position: relative;
  overflow: hidden;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 20px 16px;
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, #ffb27a 0%, #ff8a5b 42%, #ef5f45 100%);
  border: 1px solid rgba(255, 210, 170, .5);
  box-shadow:
    0 12px 34px rgba(255, 110, 70, .40),
    0 0 0 1px rgba(255, 138, 91, .25),
    inset 0 1px 0 rgba(255, 255, 255, .45);
  animation: ctaBreathe 2.8s ease-in-out infinite;
}
/* 光泽扫过 */
.action-card .btn.primary.big::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: -60%;
  width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
  transform: skewX(-20deg);
  animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0%, 55% { left: -60%; } 85%, 100% { left: 130%; } }
@keyframes ctaBreathe {
  0%, 100% { box-shadow: 0 12px 34px rgba(255,110,70,.38), 0 0 0 1px rgba(255,138,91,.25), inset 0 1px 0 rgba(255,255,255,.45); }
  50%      { box-shadow: 0 14px 42px rgba(255,110,70,.58), 0 0 26px rgba(255,138,91,.35), inset 0 1px 0 rgba(255,255,255,.5); }
}
.action-card .btn.primary.big:hover { transform: translateY(-3px) scale(1.01); }
.action-card .btn.ghost { font-size: 14px; }

/* ---------------- 档案卡 ---------------- */
.profile-card { border-left: 3px solid var(--accent); }
.profile-head { display: flex; justify-content: space-between; align-items: center; font-weight: 600; margin-bottom: 9px; gap: 8px; flex-wrap: wrap; }
.head-actions { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.profile-line { font-size: 13px; color: var(--muted); margin: 3px 0; }

/* ---------------- 菜单结果 ---------------- */
.menu-card {
  position: relative;
  overflow: hidden;
  border-color: rgba(242, 200, 121, .28);
  animation: reveal .6s cubic-bezier(.2, .8, .3, 1) both;
}
.menu-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--accent));
}
@keyframes reveal {
  from { opacity: 0; transform: translateY(16px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
.menu-title {
  font-size: 20px;
  font-weight: 800;
  margin: 2px 0 12px;
  background: linear-gradient(100deg, #fff6e2, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.why {
  font-size: 13px;
  color: #dbe9e2;
  background: rgba(70, 179, 145, .10);
  border-left: 3px solid var(--primary);
  padding: 11px 13px;
  border-radius: 10px;
  margin-bottom: 16px;
}
.meal {
  position: relative;
  border-top: 1px dashed var(--line);
  padding: 14px 0 14px 15px;
}
.why + .meal { border-top: none; }
.meal::before {
  content: "";
  position: absolute;
  left: 0; top: 14px; bottom: 14px;
  width: 4px;
  border-radius: 4px;
  background: var(--primary);
}
.why + .meal + .meal::before { background: var(--accent); }
.why + .meal + .meal + .meal::before { background: var(--gold); }
.meal-label { font-size: 12px; color: var(--gold); font-weight: 700; margin-bottom: 4px; letter-spacing: .5px; }
.meal-name { font-size: 16px; font-weight: 700; margin-bottom: 5px; color: #fff8ea; }
.meal-line { font-size: 13px; color: #c9d8d0; margin: 2px 0; }
.meal-line b { color: var(--muted); font-weight: 600; }
.snack { background: rgba(255, 255, 255, .05); border: 1px dashed var(--line); border-radius: 12px; padding: 12px 14px; margin-top: 10px; font-size: 13px; }

.nutri-title { font-size: 13px; font-weight: 700; margin: 18px 0 8px; color: var(--gold); }
.nutri { font-size: 13px; color: #c9d8d0; }
.nutri div { margin: 4px 0; }

.groceries {
  background: rgba(255, 255, 255, .045);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  margin-top: 14px;
  font-size: 13px;
}
.groceries-title { font-weight: 700; margin-bottom: 7px; color: #fff3dd; }
.groceries div { margin: 4px 0; color: #c9d8d0; }

.copybox { background: rgba(255, 255, 255, .045); border: 1px solid var(--line); border-radius: 12px; padding: 13px; margin-top: 14px; }
.copy-title { font-weight: 700; font-size: 13px; margin-bottom: 7px; color: #fff3dd; }
.copy-text { font-size: 13px; color: #c9d8d0; word-break: break-all; margin-bottom: 10px; }
.disclaimer { font-size: 12px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 11px; margin-top: 16px; }
.menu-actions { display: flex; gap: 10px; margin-top: 17px; }
.menu-actions .btn { flex: 1; }

/* ---------------- 7天 / 历史 / 导出 ---------------- */
.overview { background: rgba(255, 255, 255, .045); border: 1px solid var(--line); border-radius: 12px; padding: 13px; font-size: 13px; margin-bottom: 12px; }
.overview div { margin: 4px 0; }
.day-block { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 14px; }
.day-title { font-weight: 700; color: var(--gold); margin-bottom: 7px; }
.hist { font-size: 13px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.export { white-space: pre-wrap; font-family: inherit; font-size: 13px; background: rgba(255,255,255,.045); border: 1px solid var(--line); padding: 13px; border-radius: 12px; margin: 11px 0; color: #dbe9e2; }

/* ---------------- 页脚 / 提示 ---------------- */
.footer { text-align: center; font-size: 12px; color: var(--muted); margin-top: 30px; letter-spacing: .3px; }
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(135deg, #f4f1e6, #e6dfc9);
  color: var(--bg);
  padding: 11px 20px;
  border-radius: 24px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 99;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 适配 ---------------- */
@media (max-width: 420px) {
  .wrap { padding: 20px 12px 36px; }
  .card { padding: 17px; border-radius: 18px; }
  .logo { width: 52px; height: 52px; border-radius: 15px; }
  .header h1 { font-size: 21px; }
  .action-card .btn.primary.big { font-size: 17px; padding: 18px 14px; }
  .head-actions { width: 100%; justify-content: flex-start; }
}
/* ============================================================
   拆盲盒交互舞台
   ============================================================ */
.reveal-stage {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 42%, rgba(23, 58, 49, .96), rgba(6, 18, 15, .985));
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  animation: stageIn .35s ease both;
}
.reveal-stage.fade-out { animation: stageOut .28s ease both; }
@keyframes stageIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes stageOut { from { opacity: 1; } to { opacity: 0; } }

.reveal-scene {
  text-align: center;
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.reveal-hint {
  font-size: 15px;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 34px;
  animation: hintPulse 1.7s ease-in-out infinite;
}
@keyframes hintPulse { 0%, 100% { opacity: .65; } 50% { opacity: 1; } }

/* 礼盒本体 */
.gift-box {
  position: relative;
  width: 156px;
  height: 132px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  transform-style: preserve-3d;
  filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .5));
  animation: boxEnter .55s cubic-bezier(.2, 1.5, .4, 1) both, boxShake 1.9s .55s ease-in-out infinite;
}
@keyframes boxEnter {
  from { opacity: 0; transform: translateY(60px) scale(.7) rotate(-8deg); }
  to   { opacity: 1; transform: none; }
}
@keyframes boxShake {
  0%, 100% { transform: rotate(0); }
  18% { transform: rotate(-6deg); }
  38% { transform: rotate(6deg); }
  58% { transform: rotate(-4deg); }
  78% { transform: rotate(4deg); }
}
.gift-body {
  position: absolute;
  bottom: 0; left: 0;
  width: 156px; height: 96px;
  background: linear-gradient(155deg, #ffa878, #f2704f 55%, #e2563d);
  border-radius: 10px 10px 15px 15px;
  overflow: hidden;
  box-shadow: inset 0 -12px 22px rgba(0, 0, 0, .16), inset 0 2px 0 rgba(255, 255, 255, .25);
}
.gift-body i { position: absolute; display: block; }
.gift-ribbon-v {
  left: 50%; top: 0; bottom: 0; width: 24px;
  transform: translateX(-50%);
  background: linear-gradient(90deg, #e0b25f, #fff0c8 45%, #e0b25f);
  box-shadow: 0 0 10px rgba(242, 200, 121, .4);
}
.gift-ribbon-h {
  left: 0; right: 0; top: 40px; height: 20px;
  background: linear-gradient(180deg, #fff0c8, #e0b25f);
  box-shadow: 0 0 10px rgba(242, 200, 121, .4);
}
.gift-lid {
  position: absolute;
  top: 20px; left: -10px;
  width: 176px; height: 36px;
  background: linear-gradient(155deg, #ffb687, #ef6448);
  border-radius: 10px;
  z-index: 3;
  box-shadow: 0 8px 16px rgba(0, 0, 0, .3), inset 0 2px 0 rgba(255, 255, 255, .3);
  transform-origin: 50% 100%;
  transition: transform .55s cubic-bezier(.3, -.2, .4, 1.3), opacity .45s;
}
.gift-bow {
  position: absolute;
  top: -30px; left: 50%;
  transform: translateX(-50%);
  font-size: 34px;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .3));
}

/* 拆开状态 */
.gift-box.opened { animation: none; transform: none; }
.gift-box.opened .gift-lid {
  transform: translateY(-150px) rotate(22deg) scale(.8);
  opacity: 0;
}
.gift-box.opened .gift-body { animation: bodyPop .5s ease-out both; }
@keyframes bodyPop {
  0%   { transform: scaleY(1); }
  35%  { transform: scaleY(1.08) scaleX(.96); }
  100% { transform: scaleY(1); }
}

/* 开盒光芒 */
.reveal-flash {
  position: absolute;
  left: 50%; top: 86px;
  width: 20px; height: 20px;
  margin-left: -10px; margin-top: -10px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0%, #ffe6a8 35%, rgba(242, 200, 121, 0) 72%);
  opacity: 0;
  transform: scale(0);
  pointer-events: none;
}
.gift-box.opened ~ .reveal-flash { animation: flash .75s ease-out .06s both; }
@keyframes flash {
  0%   { opacity: 0; transform: scale(0); }
  35%  { opacity: 1; transform: scale(16); }
  100% { opacity: 0; transform: scale(26); }
}

/* 彩带迸发 */
.reveal-burst {
  position: absolute;
  left: 50%; top: 86px;
  width: 0; height: 0;
  pointer-events: none;
}
.burst-piece {
  position: absolute;
  left: 0; top: 0;
  font-size: 22px;
  opacity: 0;
  animation: burst 1s cubic-bezier(.15, .7, .3, 1) forwards;
}
@keyframes burst {
  0%   { opacity: 0; transform: translate(-50%, -50%) rotate(0) scale(.3); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) rotate(var(--rot)) scale(1.15); }
}

.reveal-tap {
  margin-top: 40px;
  font-size: 13px;
  color: var(--muted);
  animation: hintPulse 1.7s ease-in-out infinite;
}
.reveal-skip {
  margin-top: 16px;
  background: none;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  padding: 6px 16px;
  border-radius: 20px;
  cursor: pointer;
  transition: .18s;
}
.reveal-skip:hover { color: var(--ink); border-color: var(--gold); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------------- 跨设备同步 ---------------- */
.sync-card { margin-top: 12px; }
.sync-code {
  margin: 10px 0 6px;
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(0, 0, 0, .18);
  color: var(--gold);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 15px;
  letter-spacing: 1.5px;
  text-align: center;
  word-break: break-all;
  user-select: all;
}
.sync-state { margin-top: 8px; font-size: 12px; color: var(--muted); }

/* ---------------- 分享海报 ---------------- */
.header-share { margin-left: auto; flex: none; }

.poster-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 10, 9, .84);
  backdrop-filter: blur(4px);
}
.poster-modal {
  width: 100%;
  max-width: 420px;
  max-height: 92vh;
  overflow: auto;
  background: var(--card-solid);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.poster-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 10px;
}
.poster-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  padding: 2px 8px;
}
.poster-close:hover { color: var(--ink); }
.poster-preview img { display: block; width: 100%; border-radius: 12px; }
.poster-tip { margin: 10px 0; font-size: 12px; color: var(--muted); }
.poster-actions { display: flex; gap: 10px; }
.poster-actions .btn { flex: 1; }
body.poster-open { overflow: hidden; }

@media (max-width: 420px) {
  .header { gap: 10px; }
  .header-share { padding: 6px 10px; font-size: 12px; }
}


