
/* SECTION: base */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, #fff3e6 0%, #ffe8f0 45%, #f0e8ff 100%);
  color: #3d3148;
  display: flex;
  justify-content: center;
  min-height: 100vh;
}
.phone {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: linear-gradient(170deg, #fffaf4 0%, #fff4f8 50%, #f6f1ff 100%);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(160, 120, 200, 0.15);
}
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  padding: 24px 22px calc(28px + env(safe-area-inset-bottom));
  animation: fadeIn 0.35s ease;
}
.screen.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.btn-primary {
  width: 100%; max-width: 320px; padding: 16px 0; border: none; border-radius: 999px;
  background: linear-gradient(90deg, #ff8a5c, #ff6fa8);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  box-shadow: 0 10px 24px rgba(255, 111, 168, 0.4);
  cursor: pointer; transition: transform 0.15s ease;
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.5; }
.btn-ghost {
  border: none; background: transparent; color: #a06ad4; font-size: 13px;
  cursor: pointer; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px;
}
.mini-link { border: none; background: none; color: #c3bad0; font-size: 11px; cursor: pointer; padding: 6px; }
.card-white {
  background: #fff; border-radius: 22px; padding: 20px 18px;
  box-shadow: 0 8px 26px rgba(160, 120, 200, 0.12);
}
.back-row { display: flex; align-items: center; margin-bottom: 14px; }
.btn-back-plain {
  border: none; background: rgba(176, 108, 255, 0.12); color: #8a5cc8;
  padding: 8px 16px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.demo-flag {
  display: inline-block; font-size: 11px; color: #c77b2f; background: #fff3e2;
  border: 1px solid #ffe0b8; padding: 3px 10px; border-radius: 999px; margin-left: 8px;
}

/* SECTION: gate-screen */
.gate-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; padding-top: 40px; text-align: center; }
.gate-lock {
  width: 88px; height: 88px; border-radius: 26px; margin-bottom: 22px;
  background: linear-gradient(135deg, #b06cff, #ff6fa8);
  display: flex; align-items: center; justify-content: center; font-size: 44px;
  box-shadow: 0 12px 28px rgba(176, 108, 255, 0.35);
}
.gate-wrap h1 { font-size: 24px; font-weight: 800; color: #3d3148; margin-bottom: 10px; }
.gate-wrap .gate-tip { font-size: 13px; color: #9a8fae; line-height: 1.7; max-width: 280px; margin-bottom: 26px; }
.code-input {
  width: 260px; padding: 15px 0; border: 2px solid #efe4fa; border-radius: 16px;
  text-align: center; font-size: 26px; letter-spacing: 10px; text-indent: 10px;
  color: #6d4fa3; font-weight: 800; outline: none; background: #fff;
  font-family: inherit;
}
.code-input:focus { border-color: #ff6fa8; }
.gate-error { font-size: 13px; color: #e05a6e; min-height: 20px; margin: 12px 0 4px; }
.gate-demo { font-size: 12px; color: #9a8fae; margin-top: 12px; }
.gate-demo b { color: #ff5c7a; font-size: 14px; letter-spacing: 2px; }
.gate-storage-warn { font-size: 12px; color: #c77b2f; background: #fff8ec; border: 1px solid #ffe7c2; border-radius: 12px; padding: 10px 14px; max-width: 300px; line-height: 1.7; margin-bottom: 14px; display: none; }
.gate-storage-warn.show { display: block; }
.gate-wrap .btn-primary { margin-top: 14px; }
.gate-foot { margin-top: auto; padding-top: 30px; display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* SECTION: shop-screen */
.shop-wrap { display: flex; flex-direction: column; }
.shop-wrap h2 { font-size: 19px; font-weight: 800; margin-bottom: 14px; display: flex; align-items: center; }
.product-card { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.product-card .p-icon {
  flex-shrink: 0; width: 64px; height: 64px; border-radius: 18px; font-size: 34px;
  background: linear-gradient(135deg, #ffb86c, #ff7eb3);
  display: flex; align-items: center; justify-content: center;
}
.product-card .p-name { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.product-card .p-price { font-size: 20px; font-weight: 800; color: #ff5c7a; }
.product-card .p-price small { font-size: 12px; font-weight: 400; color: #b6adc2; margin-left: 6px; }
.shop-points { list-style: none; margin: 4px 0 16px; }
.shop-points li { font-size: 13px; color: #6d6280; line-height: 2; }
.shop-points li::before { content: "✓ "; color: #3fb98c; font-weight: 700; }
.shop-note { font-size: 12px; color: #b6adc2; line-height: 1.7; margin-top: 14px; }
.delivery-card { display: none; margin-top: 14px; }
.delivery-card.show { display: block; animation: fadeIn 0.4s ease; }
.delivery-card h3 { font-size: 15px; font-weight: 700; color: #3fb98c; margin-bottom: 12px; }
.delivery-msg {
  background: #f7f4fb; border-radius: 14px; padding: 14px; font-size: 13px;
  line-height: 1.9; color: #4a3f5c; white-space: pre-line; margin-bottom: 12px;
}
.delivery-msg b { color: #ff5c7a; font-size: 16px; letter-spacing: 2px; }
.delivery-actions { display: flex; flex-direction: column; gap: 10px; align-items: center; }
.delivery-actions .btn-primary { max-width: 100%; }

/* SECTION: admin-screen */
.admin-wrap { display: flex; flex-direction: column; }
.admin-wrap h2 { font-size: 19px; font-weight: 800; margin-bottom: 4px; display: flex; align-items: center; }
.admin-sub { font-size: 12px; color: #b6adc2; margin-bottom: 16px; line-height: 1.6; }
.admin-toolbar { display: flex; gap: 10px; margin-bottom: 14px; }
.admin-toolbar .btn-primary { max-width: none; padding: 13px 0; font-size: 15px; }
.code-row {
  display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 4px 14px rgba(160,120,200,0.08);
}
.code-row .c-code { font-size: 16px; font-weight: 800; color: #6d4fa3; letter-spacing: 2px; flex: 1; }
.c-badge { font-size: 11px; padding: 3px 9px; border-radius: 999px; flex-shrink: 0; }
.c-badge.unused { background: #e8f8f1; color: #2f9e74; }
.c-badge.used { background: #f0ecf7; color: #9a8fae; }
.c-badge.void { background: #fdeaea; color: #d05a5a; }
.c-badge.expired { background: #fff3e2; color: #c77b2f; }
.c-left { font-size: 11px; color: #b6adc2; flex-shrink: 0; }
.c-btn { border: none; background: #f3edfa; color: #8a5cc8; font-size: 12px; padding: 7px 10px; border-radius: 999px; cursor: pointer; flex-shrink: 0; }
.c-btn.void-btn { background: #fdeaea; color: #d05a5a; }
.admin-empty { text-align: center; color: #c3bad0; font-size: 13px; padding: 30px 0; }

/* SECTION: start-screen */
.hero { flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 26px; }
.verified-pill {
  font-size: 12px; color: #2f9e74; background: #e8f8f1; border: 1px solid #cdeeda;
  padding: 5px 14px; border-radius: 999px; margin-bottom: 18px;
}
.hero-emoji {
  width: 92px; height: 92px; border-radius: 28px;
  background: linear-gradient(135deg, #ffb86c, #ff7eb3);
  display: flex; align-items: center; justify-content: center;
  font-size: 50px; box-shadow: 0 12px 28px rgba(255, 126, 179, 0.35);
  margin-bottom: 22px;
}
.hero h1 {
  font-size: 26px; line-height: 1.35; font-weight: 800;
  background: linear-gradient(90deg, #ff7eb3, #b06cff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  margin-bottom: 14px;
}
.hero p { font-size: 14px; color: #8a7f96; line-height: 1.7; max-width: 300px; margin-bottom: 24px; }
.hero-tags { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 30px; }
.hero-tags span {
  font-size: 12px; color: #a06ad4; background: rgba(176, 108, 255, 0.1);
  border: 1px solid rgba(176, 108, 255, 0.25);
  padding: 5px 12px; border-radius: 999px;
}
.hero-note { margin-top: 16px; font-size: 12px; color: #b6adc2; }

/* SECTION: quiz-screen */
.quiz-top { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.btn-back {
  border: none; background: rgba(176, 108, 255, 0.12); color: #8a5cc8;
  width: 36px; height: 36px; border-radius: 50%; font-size: 16px; cursor: pointer;
  flex-shrink: 0;
}
.btn-back:disabled { opacity: 0.3; }
.progress-bar { height: 8px; background: rgba(176, 108, 255, 0.12); border-radius: 999px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0;
  background: linear-gradient(90deg, #ff8a5c, #ff6fa8, #b06cff);
  border-radius: 999px; transition: width 0.35s ease;
}
.quiz-card {
  flex: 1; background: #fff; border-radius: 24px; padding: 26px 20px;
  box-shadow: 0 8px 30px rgba(160, 120, 200, 0.12);
  margin-top: 18px; display: flex; flex-direction: column;
}
.q-num { font-size: 12px; color: #ff6fa8; font-weight: 700; margin-bottom: 10px; letter-spacing: 1px; }
.q-text { font-size: 18px; font-weight: 700; line-height: 1.6; margin-bottom: 22px; min-height: 58px; }
.options { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.option {
  display: flex; align-items: flex-start; gap: 12px;
  border: 2px solid #f0e8f8; border-radius: 16px; padding: 14px 14px;
  font-size: 15px; line-height: 1.5; color: #4a3f5c; cursor: pointer;
  background: #fdfcff; transition: all 0.2s ease; text-align: left; width: 100%;
}
.option .opt-key {
  flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%;
  background: #f3edfa; color: #a06ad4; font-size: 13px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; margin-top: 1px;
}
.option.selected {
  border-color: #ff6fa8; background: linear-gradient(135deg, #fff0f6, #fff6f0);
}
.option.selected .opt-key { background: #ff6fa8; color: #fff; }
.quiz-bottom { margin-top: 18px; flex-shrink: 0; }
.quiz-bottom .progress-bar { height: 12px; }
.progress-caption { display: flex; justify-content: space-between; font-size: 12px; color: #8a7f96; margin-top: 8px; font-weight: 600; }
.quiz-hint { text-align: center; font-size: 12px; color: #c3bad0; margin-top: 12px; }

/* SECTION: result-screen */
.result-scroll { margin: 0 -22px; padding: 0 22px; }
.result-badge { text-align: center; margin-top: 8px; }
.result-badge .label { font-size: 13px; color: #a294b5; letter-spacing: 3px; margin-bottom: 14px; }
.result-art {
  width: 100%; max-width: 320px; margin: 0 auto 14px;
  border-radius: 24px; overflow: hidden;
  box-shadow: 0 14px 34px rgba(160, 120, 200, 0.25);
}
.result-art img { display: block; width: 100%; height: auto; }
.result-tag-pill {
  display: inline-block; font-size: 13px; font-weight: 700; color: #fff;
  padding: 6px 18px; border-radius: 999px; margin-bottom: 10px; letter-spacing: 2px;
}
.result-title { font-size: 24px; font-weight: 800; text-align: center; margin-bottom: 8px; }
.result-sub { font-size: 13px; color: #a294b5; text-align: center; margin-bottom: 22px; }
.result-card { margin-bottom: 16px; }
.result-card h3 {
  font-size: 15px; font-weight: 700; color: #6d4fa3; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.result-desc { font-size: 14px; line-height: 1.8; color: #5a4f6b; }
.money-item {
  display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px dashed #f0e8f8;
}
.money-item:last-child { border-bottom: none; }
.money-item .m-icon {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #fff0f6, #f3edfa);
}
.money-item .m-name { font-size: 14px; font-weight: 700; color: #4a3f5c; margin-bottom: 3px; }
.money-item .m-tip { font-size: 12px; color: #9a8fae; line-height: 1.6; }
.dim-bars { display: flex; flex-direction: column; gap: 12px; }
.dim-row { display: flex; align-items: center; gap: 10px; }
.dim-row .d-label { width: 84px; font-size: 12px; color: #7a6f8e; flex-shrink: 0; text-align: right; }
.dim-row .d-bar { flex: 1; height: 10px; background: #f3edfa; border-radius: 999px; overflow: hidden; }
.dim-row .d-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #ffb86c, #ff6fa8); width: 0; transition: width 0.8s ease; }
.dim-row.top .d-fill { background: linear-gradient(90deg, #ff6fa8, #b06cff); }
.dim-row.top .d-label { color: #b06cff; font-weight: 700; }
.dim-row .d-val { width: 30px; font-size: 12px; color: #9a8fae; }
.result-disclaimer {
  font-size: 11px; color: #b6adc2; text-align: center; line-height: 1.7;
  margin: 6px 0 18px; padding: 0 10px;
}
.fun-note {
  font-size: 10px; color: #c9c0d6; text-align: center; line-height: 1.7;
  margin-top: 14px; padding: 0 10px; flex-shrink: 0;
}
.result-actions { display: flex; flex-direction: column; gap: 12px; align-items: center; padding-bottom: 8px; }
.btn-card {
  width: 100%; max-width: 320px; padding: 16px 0; border: none; border-radius: 999px;
  background: linear-gradient(90deg, #b06cff, #7a5cff);
  color: #fff; font-size: 16px; font-weight: 700; letter-spacing: 2px;
  box-shadow: 0 10px 24px rgba(140, 100, 255, 0.4); cursor: pointer;
}
.btn-card:active { transform: scale(0.96); }
.btn-retry { width: 100%; max-width: 320px; background: #fff; color: #ff6fa8; border: 2px solid #ffd0e0; box-shadow: none; }
.result-actions .save-tip { font-size: 12px; color: #b6adc2; }

/* SECTION: overlay */
.overlay {
  display: none; position: fixed; inset: 0; background: rgba(40, 25, 55, 0.82);
  z-index: 50; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px;
}
.overlay.show { display: flex; animation: fadeIn 0.25s ease; }
.overlay img {
  width: 100%; max-width: 330px; border-radius: 18px;
  box-shadow: 0 16px 50px rgba(0,0,0,0.4);
}
.overlay .ov-hint { color: #fff; font-size: 13px; margin-top: 16px; opacity: 0.9; text-align: center; line-height: 1.7; }
.overlay .ov-close {
  margin-top: 18px; border: 1px solid rgba(255,255,255,0.6); background: transparent;
  color: #fff; padding: 10px 34px; border-radius: 999px; font-size: 14px; cursor: pointer;
}

/* SECTION: toast */
.toast {
  position: fixed; left: 50%; bottom: 60px; transform: translateX(-50%);
  background: rgba(50, 35, 65, 0.92); color: #fff; font-size: 13px;
  padding: 10px 22px; border-radius: 999px; z-index: 99; opacity: 0;
  transition: opacity 0.25s ease; pointer-events: none;
}
.toast.show { opacity: 1; }

/* SECTION: gate-form */
.gate-form { display: flex; flex-direction: column; align-items: center; width: 100%; }
.gate-form .btn-primary { margin-top: 14px; }
