/*
 * 我叫MT · 礼包商城（平台口 /shop/shop.css，版式照灵画师礼包商城）。
 * 手机优先：390px 起无横向滚动，触控区不小于 44px；平板两列、桌面三列，最宽 1080px。
 * 配色与运维后台一致：深蓝头部、青绿按钮，价格与购买用金色。CSP 只允许本域样式，所以没有行内样式，品质色用 q1–q7 类。
 */

:root {
  --ink: #142235;
  --muted: #66768c;
  --faint: #9aa7b8;
  --line: #e3e8ef;
  --paper: #eef2f6;
  --card: #fff;
  --navy: #0f1d31;
  --navy-2: #1b3354;
  --teal: #128776;
  --teal-2: #19a18c;
  --teal-soft: #e5f5f1;
  --gold: #b9861f;
  --gold-2: #e8b54d;
  --gold-soft: #fdf6e6;
  --danger: #c2413a;
  --danger-soft: #fdeeed;
  --radius: 16px;
  --shadow: 0 1px 2px rgb(15 29 49 / 4%), 0 8px 24px rgb(15 29 49 / 7%);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* 底色：浅灰蓝渐变，头图下方右侧淡金光晕、左侧淡青绿光晕（照灵画师商城的简洁风，不用图片） */
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(900px 520px at 100% 300px, rgb(232 181 77 / 11%), transparent 62%),
    radial-gradient(820px 560px at 0% 620px, rgb(25 161 140 / 10%), transparent 62%),
    linear-gradient(180deg, #edf1f6 0%, #f6f8fb 60%, #eef2f6 100%);
  background-color: var(--paper);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--teal); }
[hidden] { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ── 头部 ── */
.hero {
  position: relative;
  overflow: hidden;
  padding: calc(18px + env(safe-area-inset-top)) 16px 64px;
  border-radius: 0 0 28px 28px;
  box-shadow: 0 12px 30px rgb(15 29 49 / 14%);
  background:
    radial-gradient(120% 90% at 100% 0%, rgb(232 181 77 / 20%), transparent 55%),
    radial-gradient(90% 80% at 0% 100%, rgb(25 161 140 / 38%), transparent 60%),
    linear-gradient(160deg, var(--navy-2) 0%, var(--navy) 72%);
  color: #f2f6fb;
}
/* 头图：细斜纹 + 底部一道淡金光，避免整块深色发闷 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 70%, rgb(232 181 77 / 10%) 100%),
    repeating-linear-gradient(135deg, rgb(255 255 255 / 2.5%) 0 1px, transparent 1px 14px);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -70px;
  width: 260px;
  height: 260px;
  border: 1px solid rgb(255 255 255 / 8%);
  border-radius: 50%;
  box-shadow: 0 0 0 26px rgb(255 255 255 / 3%), 0 0 0 52px rgb(255 255 255 / 2%);
}
.hero-inner { position: relative; z-index: 1; max-width: 1080px; margin: 0 auto; }
.hero-top { display: flex; align-items: center; gap: 12px; }
.seal {
  display: grid;
  flex: none;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--gold-2), var(--gold));
  color: #3a2605;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.5px;
  box-shadow: inset 0 0 0 1px rgb(255 255 255 / 35%), 0 6px 16px rgb(0 0 0 / 20%);
}
.brand { flex: 1; min-width: 0; }
.brand strong { display: block; font-size: 18px; letter-spacing: 2px; }
.brand span { display: block; color: #a8b8cc; font-size: 12px; letter-spacing: 1px; }
.who { display: flex; align-items: center; gap: 8px; color: #cdd8e6; font-size: 13px; }
.who b { max-width: 120px; overflow: hidden; color: #fff; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.btn-ghost {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid rgb(255 255 255 / 25%);
  border-radius: 999px;
  background: rgb(255 255 255 / 6%);
  color: #e8eef6;
  font-size: 13px;
}
.hero-title { margin: 26px 0 4px; font-size: 26px; font-weight: 650; letter-spacing: 1px; }
.hero-sub { margin: 0; color: #b4c2d4; font-size: 13px; }

.main { position: relative; z-index: 2; max-width: 1080px; margin: -44px auto 0; padding: 0 16px calc(32px + env(safe-area-inset-bottom)); }

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: transform 0.12s, opacity 0.12s;
}
.btn:active { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; opacity: 0.45; transform: none; }
.btn-primary { background: linear-gradient(180deg, var(--teal-2), var(--teal)); color: #fff; box-shadow: 0 6px 14px rgb(18 135 118 / 24%); }
.btn-gold { background: linear-gradient(180deg, var(--gold-2), var(--gold)); color: #3a2605; box-shadow: 0 6px 14px rgb(185 134 31 / 26%); }
.btn-soft { background: var(--teal-soft); color: var(--teal); }
.btn-plain { border: 1px solid var(--line); background: #fff; color: var(--ink); }
.btn-block { width: 100%; }

/* ── 登录 ── */
.login-card { max-width: 420px; margin: 0 auto; padding: 24px 20px; border: 1px solid rgb(227 232 239 / 70%); border-radius: 20px; background: var(--card); box-shadow: 0 2px 6px rgb(15 29 49 / 4%), 0 24px 60px rgb(15 29 49 / 10%); }
.login-card h2 { margin: 0 0 4px; font-size: 20px; }
.login-card > p { margin: 0 0 18px; color: var(--muted); font-size: 13px; }
.field { display: block; margin-bottom: 14px; }
.field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.input {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfd;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.input:focus { border-color: var(--teal-2); background: #fff; box-shadow: 0 0 0 3px rgb(25 161 140 / 14%); }
.form-error { min-height: 20px; margin: -4px 0 10px; color: var(--danger); font-size: 13px; }
.login-foot { margin: 14px 0 0; color: var(--faint); font-size: 12px; text-align: center; }

/* ── 收货角色 ── */
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 76px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  text-align: left;
}
.step-index {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 14px;
  font-weight: 700;
}
.step.done .step-index { background: var(--teal); color: #fff; }
.step-body { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.step-label { color: var(--muted); font-size: 12px; }
.step-value { overflow: hidden; font-size: 16px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.step-value.placeholder { color: var(--faint); font-weight: 500; }
.step-hint { color: var(--muted); font-size: 12px; }
.step-action { flex: none; padding: 6px 12px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 13px; font-weight: 600; }
.grade { display: inline-block; margin-left: 6px; padding: 0 7px; border-radius: 6px; background: var(--gold-soft); color: var(--gold); font-size: 12px; font-weight: 600; vertical-align: 2px; }

/* ── 标签页与分组栏 ── */
.tabs { display: flex; gap: 6px; margin: 20px 0 14px; padding: 4px; border-radius: 12px; background: #dfe5ec; }
.tab { flex: 1; min-height: 40px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); font-weight: 600; }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgb(0 0 0 / 8%); }

.group-bar {
  display: flex;
  gap: 8px;
  margin: 0 -16px 16px;
  padding: 2px 16px 6px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.group-bar::-webkit-scrollbar { display: none; }
.group-chip {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgb(15 29 49 / 4%);
}
.group-chip.active { border-color: var(--teal); background: var(--teal); color: #fff; }
.group-count { padding: 0 7px; border-radius: 999px; background: var(--teal-soft); color: var(--teal); font-size: 12px; line-height: 20px; }
.group-chip.active .group-count { background: rgb(255 255 255 / 22%); color: #fff; }

/* ── 礼包 ── */
.packs { display: grid; grid-template-columns: 1fr; gap: 14px; }
/* 斜角“限购”飘带伸出卡片：用 clip 而不是 hidden，hidden 的卡片能被聚焦滚动，点购买时内容会整体左移 */
.pack { display: flex; flex-direction: column; overflow: hidden; overflow: clip; border: 1px solid rgb(227 232 239 / 70%); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.pack-head { position: relative; padding: 16px 16px 12px; border-bottom: 1px dashed var(--line); background: linear-gradient(180deg, #f6f9fc, #fff); }
.kind-card .pack-head { background: linear-gradient(180deg, var(--gold-soft), #fff); }
.pack-kind { display: inline-block; margin-bottom: 6px; padding: 0 8px; border-radius: 6px; background: var(--teal-soft); color: var(--teal); font-size: 11px; font-weight: 650; letter-spacing: 1px; }
.kind-card .pack-kind { background: #fbeccb; color: #8a5d0b; }
.pack-ribbon {
  position: absolute;
  top: 12px;
  right: -30px;
  width: 110px;
  padding: 2px 0;
  background: linear-gradient(90deg, #d0442f, #e8743a);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  transform: rotate(35deg);
}
.pack-name { margin: 0; padding-right: 48px; font-size: 17px; font-weight: 650; }
.pack-desc { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.pack-body { display: flex; flex: 1; flex-direction: column; padding: 4px 0 0; }
.pack-sub { padding: 8px 16px 0; color: var(--muted); font-size: 12px; font-weight: 600; }
.pack-items { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; padding: 10px 16px 12px; }
.item { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 10px 4px 8px; border-radius: 8px; background: #f4f6f9; font-size: 13px; }
.item i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: currentcolor; box-shadow: 0 0 0 3px rgb(0 0 0 / 5%); }
.item-name { overflow: hidden; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.item-count { flex: none; color: var(--muted); font-weight: 500; }
.q1 { color: #5f6b7a; }
.q2 { color: #2f9e44; }
.q3 { color: #1c7ed6; }
.q4 { color: #8b3fd1; }
.q5 { color: #d46b08; }
.q6 { color: #d6362b; }
.q7 { color: #b8860b; }
.pack-foot { display: flex; align-items: center; gap: 12px; padding: 12px 16px 16px; margin-top: auto; }
.price { flex: 1; min-width: 0; }
.price-value { color: var(--gold); font-size: 24px; font-weight: 700; letter-spacing: -0.5px; font-variant-numeric: tabular-nums; }
.price-value small { margin-right: 2px; font-size: 14px; }
.price-limit { color: var(--muted); font-size: 12px; }
.price-limit.full { color: var(--danger); }
.pack-foot .btn { min-width: 96px; }

/* ── 福利 ── */
.welfare { display: flex; flex-direction: column; gap: 14px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 6px 2px -2px; font-size: 15px; font-weight: 650; }
.section-title::before { content: ""; width: 4px; height: 16px; border-radius: 2px; background: var(--teal); }
.welfare-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.welfare-card { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.welfare-card.gold { background: linear-gradient(160deg, var(--gold-soft), #fff 60%); }
.welfare-card .pack-items { padding: 2px 0; }
.welfare-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.welfare-head h3 { margin: 0; font-size: 16px; }
.badge { padding: 1px 8px; border-radius: 6px; background: var(--teal); color: #fff; font-size: 12px; font-weight: 600; }
.badge.gold { background: var(--gold); }
.badge.off { background: #e6eaf0; color: var(--muted); }
.welfare-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.welfare-foot .btn { min-height: 40px; }
.naming-now { padding: 8px 10px; border-radius: 10px; background: #f3effb; color: #5b3d7a; font-size: 13px; }
.naming-now b { color: #7a43a6; }
.naming-now.free { background: #e9f6ee; color: #2e7d4f; }
.progress { height: 8px; margin: 4px 0; overflow: hidden; border-radius: 4px; background: #e9edf2; }
.progress span { display: block; width: 0; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold-2), var(--gold)); transition: width 0.4s ease-out; }
.tiers { display: flex; flex-direction: column; }
.tier { display: grid; grid-template-columns: 92px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.tier:first-child { border-top: 0; }
.tier.done { opacity: 0.6; }
.tier-th { color: var(--muted); font-size: 12px; }
.tier-th b { display: block; color: var(--gold); font-size: 16px; font-variant-numeric: tabular-nums; }
.tier-items { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.tier .btn { min-height: 38px; padding: 0 14px; font-size: 14px; }
.muted { color: var(--muted); font-size: 13px; }

/* ── 钱包（平台币，§29） ── */
.wallet-card {
  position: relative;
  overflow: hidden;
  padding: 18px 18px 16px;
  border-radius: var(--radius);
  background: radial-gradient(120% 100% at 100% 0%, rgb(232 181 77 / 32%), transparent 60%), linear-gradient(150deg, var(--navy-2), var(--navy));
  color: #f2f6fb;
  box-shadow: var(--shadow);
}
.wallet-label { color: rgb(242 246 251 / 72%); font-size: 13px; }
.wallet-balance { margin: 2px 0 8px; color: var(--gold-2); font-size: 34px; font-weight: 700; line-height: 1.2; }
.wallet-balance small { margin-right: 2px; font-size: 18px; }
.wallet-note { margin-top: 10px; padding-top: 10px; border-top: 1px solid rgb(255 255 255 / 12%); color: rgb(242 246 251 / 70%); font-size: 12px; }
.topup-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.topup {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 84px;
  padding: 12px 8px;
  border: 1px solid #f0dfb8;
  border-radius: 14px;
  background: linear-gradient(160deg, var(--gold-soft), #fff 70%);
  box-shadow: var(--shadow);
}
.topup:active { transform: scale(0.98); }
.topup b { color: var(--gold); font-size: 24px; line-height: 1.2; }
.topup b small { font-size: 14px; }
.topup span { color: var(--muted); font-size: 12px; }
.ledger { overflow: hidden; border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.ledger-row { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-top: 1px solid var(--line); }
.ledger-row:first-child { border-top: 0; }
.ledger-main { flex: 1; min-width: 0; }
.ledger-main b { display: block; font-size: 14px; }
.ledger-main small, .ledger-fen small { display: block; overflow: hidden; color: var(--muted); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.ledger-fen { flex: none; text-align: right; }
.ledger-fen b { font-size: 16px; }
.ledger-fen.plus b { color: var(--teal); }
.ledger-fen.minus b { color: var(--danger); }
.methods { display: flex; flex-direction: column; gap: 8px; margin: 0 0 14px; }
.method { display: flex; flex-direction: column; gap: 2px; min-height: 56px; padding: 9px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.method b { font-size: 15px; }
.method small { color: var(--muted); font-size: 12px; }
.method.active { border-color: var(--gold); background: var(--gold-soft); box-shadow: inset 0 0 0 1px var(--gold); }
.method:disabled { cursor: not-allowed; opacity: 0.55; }
.pwd-box { margin: 0 0 14px; }

.empty { padding: 40px 16px; border-radius: var(--radius); background: var(--card); color: var(--muted); text-align: center; box-shadow: var(--shadow); }
.empty strong { display: block; margin-bottom: 4px; color: var(--ink); }
.skeleton { height: 210px; border-radius: var(--radius); background: linear-gradient(90deg, #e3e8ee, #f2f5f8, #e3e8ee); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }

/* ── 弹层 ── */
.mask { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; background: rgb(8 16 28 / 55%); animation: fade 0.15s; }
.sheet {
  width: 100%;
  max-height: 86vh;
  overflow-y: auto;
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #fff;
  animation: rise 0.2s ease-out;
}
.sheet-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.sheet-head h3 { flex: 1; margin: 0; font-size: 17px; }
.sheet-close { width: 36px; height: 36px; border: 0; border-radius: 50%; background: #f1f3f6; color: var(--muted); font-size: 18px; }
.sheet-note { margin: 0 0 14px; color: var(--muted); font-size: 12px; }
.role-list { display: flex; flex-direction: column; gap: 8px; }
.role-item { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; background: #fff; text-align: left; }
.role-item.active { border-color: var(--teal); background: var(--teal-soft); box-shadow: inset 0 0 0 1px var(--teal); }
.role-main { flex: 1; min-width: 0; }
.role-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-main small { color: var(--muted); font-size: 12px; }
.confirm-rows { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: #f6f8fa; }
.confirm-row { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; font-size: 14px; }
.confirm-row span { flex: none; color: var(--muted); }
.confirm-row b { min-width: 0; overflow: hidden; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
.confirm-row .price-value { font-size: 20px; }
.loading { padding: 40px 0; color: var(--muted); text-align: center; }

/* 提示条放在顶部：底部弹层的按钮不会被挡住 */
.toast { position: fixed; left: 50%; top: calc(16px + env(safe-area-inset-top)); z-index: 80; max-width: calc(100% - 32px); padding: 10px 16px; border-radius: 12px; background: rgb(15 29 49 / 92%); color: #fff; font-size: 14px; transform: translateX(-50%); animation: fade 0.15s; }
.toast.bad { background: rgb(162 44 38 / 94%); }

@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0.4; } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 420px) {
  .tier { grid-template-columns: 1fr auto; }
  .tier-items { grid-column: 1 / -1; grid-row: 2; }
  .hero-title { font-size: 24px; }
}
@media (min-width: 640px) {
  .packs, .welfare-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topup-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .group-bar { flex-wrap: wrap; margin: 0 0 16px; padding: 0; overflow: visible; }
  .mask { align-items: center; padding: 24px; }
  .sheet { max-width: 460px; border-radius: 20px; }
}
@media (min-width: 960px) {
  .packs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero { padding-bottom: 72px; }
  .hero-title { font-size: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* 联系代理（问题反馈第九轮第 4 条）：收货角色下面一条，文字可长按选中复制 */
.agent {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  color: var(--ink);
}
.agent[hidden] {
  display: none;
}
.agent-label {
  flex: none;
  color: var(--gold);
  font-weight: 600;
}
.agent-text {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  user-select: text;
}
.agent-copy {
  flex: none;
  border-color: var(--gold-2);
  background: transparent;
  color: var(--gold);
}
