:root {
  --bg: #f6fbef;
  --panel: rgba(255, 255, 255, 0.92);
  --panel-2: rgba(255, 255, 255, 0.96);
  --gold: #ffcb05;
  --gold-2: #ff9300;
  --green: #21cf62;
  --green-2: #88d624;
  --blue: #298df2;
  --red: #ff5a2a;
  --cream: #fff7dd;
  --text: #2e2f22;
  --muted: #6c765d;
  --line: rgba(255, 147, 0, 0.28);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  position: relative;
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(43, 215, 100, 0.18), transparent 28rem),
    radial-gradient(circle at 86% 9%, rgba(255, 203, 5, 0.24), transparent 30rem),
    linear-gradient(180deg, #fff9df 0%, #f4fbec 38%, #fff 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  z-index: 0;
  pointer-events: none;
  background: url("/static/membership_card/mascot.png") center / contain no-repeat;
  filter: drop-shadow(0 24px 50px rgba(33, 207, 98, 0.24));
}

main {
  position: relative;
  z-index: 1;
}

body::before {
  width: 360px;
  height: 360px;
  right: -78px;
  top: 106px;
  opacity: 0.16;
  transform: rotate(-10deg);
}

body::after {
  width: 250px;
  height: 250px;
  left: -80px;
  bottom: 70px;
  opacity: 0.1;
  transform: rotate(16deg);
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

/* ===== 顶部导航 ===== */
.topbar {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(18px, 5vw, 70px);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  box-shadow: 0 8px 28px rgba(42, 78, 26, 0.1);
}

.brand {
  font-size: 18px;
  font-weight: 800;
  color: var(--gold-2);
  letter-spacing: 0;
}

.top-actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

.top-actions button,
.hero-cta a,
.plan button {
  border: 0;
  cursor: pointer;
  color: #4a1207;
  font-weight: 800;
  background: linear-gradient(180deg, #fff5d8 0%, #ffc178 50%, #f26b22 100%);
  box-shadow: inset 0 2px 0 rgba(255, 255, 255, 0.7), 0 8px 24px rgba(255, 147, 0, 0.28);
}

.top-actions button {
  min-width: 86px;
  min-height: 34px;
  border-radius: 999px;
  padding: 0 18px;
}

.top-actions button:last-child {
  color: #fff;
  background: linear-gradient(180deg, #55b9ff, var(--blue));
}

.nav-user {
  font-size: 15px;
  font-weight: 800;
  color: #2c5b28;
  padding: 0 4px;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 760px;
  display: grid;
  align-items: center;
  overflow: hidden;
  padding: 100px clamp(18px, 5vw, 80px) 70px;
  isolation: isolate;
}


.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 247, 218, 0.76) 45%, rgba(245, 255, 233, 0.9) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), #f7fff1 94%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(980px, 100%);
  margin: 0 auto;
  text-align: center;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--gold-2);
  font-size: clamp(18px, 2.2vw, 30px);
  font-weight: 800;
}

h1,
h2,
p {
  margin-top: 0;
}

.hero h1 {
  margin-bottom: 22px;
  font-size: clamp(52px, 8.4vw, 112px);
  line-height: 1;
  color: #ff8a00;
  text-shadow: 0 3px 0 #ffe784, 0 0 24px rgba(33, 207, 98, 0.28);
}

.hero-copy {
  max-width: 820px;
  margin: 0 auto 34px;
  font-size: clamp(20px, 3.2vw, 38px);
  line-height: 1.35;
  font-weight: 700;
  color: #234126;
}

.hero-cta {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.hero-cta a {
  min-width: 220px;
  min-height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0 34px;
  font-size: 22px;
}

.hero-cta .ghost-btn {
  color: #ff8a00;
  border: 1px solid rgba(255, 147, 0, 0.38);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.benefit-nav {
  width: min(860px, 100%);
  margin: 38px auto 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.benefit-nav a {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 211, 138, 0.68);
  border-radius: 999px;
  font-size: 20px;
  font-weight: 800;
  color: #34502a;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 18px rgba(255, 203, 5, 0.15), 0 10px 24px rgba(33, 207, 98, 0.1);
}

.gold-card {
  position: absolute;
  z-index: 1;
  right: clamp(18px, 7vw, 108px);
  top: 205px;
  width: 230px;
  height: 330px;
  border-radius: 22px;
  padding: 28px;
  transform: translateX(48px) rotate(-16deg);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #7a390a;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.35), transparent 32%),
    linear-gradient(135deg, #fff1a7, #ffcb05 45%, #24d468 100%);
  box-shadow: 0 22px 52px rgba(33, 130, 70, 0.22), 0 0 70px rgba(255, 203, 5, 0.34);
  opacity: 0.58;
}

.mascot-orbit {
  position: absolute;
  z-index: 1;
  left: clamp(12px, 7vw, 86px);
  bottom: 96px;
  width: clamp(150px, 18vw, 250px);
  opacity: 0.26;
  filter: drop-shadow(0 0 30px rgba(33, 207, 98, 0.55));
  transform: rotate(-8deg);
  pointer-events: none;
}

.gold-card span {
  font-size: 34px;
  font-weight: 900;
}

.gold-card strong {
  font-size: 18px;
  line-height: 1.8;
  writing-mode: vertical-rl;
  align-self: center;
  letter-spacing: 5px;
}

.gold-card em {
  font-style: normal;
  font-weight: 800;
}

/* ===== 通用 Section ===== */
.section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 64px;
  padding: clamp(28px, 5vw, 52px);
  border: 1px solid rgba(255, 147, 0, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(245, 255, 237, 0.94)),
    var(--panel);
  box-shadow: inset 0 0 36px rgba(255, 203, 5, 0.08), 0 24px 60px rgba(51, 118, 43, 0.12);
}

.section-title {
  text-align: center;
  margin-bottom: 30px;
}

.section-title span {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 7px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--gold);
  font-weight: 800;
  background: linear-gradient(180deg, #fff9d6, #fff);
}

.section-title h2 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5vw, 58px);
  color: #ff8a00;
  text-shadow: 0 3px 0 #fff1a8;
}

.section-title p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
}

/* ===== 代金券网格 ===== */
.coupon-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 18px;
}

.coupon {
  grid-column: span 3;
  min-height: 114px;
  display: grid;
  grid-template-columns: 38% 1fr;
  overflow: hidden;
  border: 1px solid #e0b07a;
  border-radius: 8px;
  background: linear-gradient(90deg, #fff 0 38%, #fff1d0 38% 100%);
  color: #74300d;
  box-shadow: 0 10px 22px rgba(255, 147, 0, 0.13);
}

.coupon:nth-child(5) {
  grid-column: 2 / span 3;
}

.coupon:nth-child(6) {
  grid-column: 5 / span 3;
}

.coupon:nth-child(7) {
  grid-column: 8 / span 3;
}

.coupon div {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-right: 1px dashed #d79669;
}

.coupon div::before,
.coupon div::after {
  content: "";
  position: absolute;
  right: -8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #f9fff3;
}

.coupon div::before {
  top: -8px;
}

.coupon div::after {
  bottom: -8px;
}

.coupon b {
  color: #ff5a2a;
  font-size: 34px;
  line-height: 1;
}

.coupon span {
  margin-top: 8px;
  font-size: 13px;
  color: #9c755e;
}

.coupon strong {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  font-size: 24px;
  white-space: nowrap;
  color: #6b3500;
}

/* ===== 卡计划 ===== */
.plans {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.plan {
  position: relative;
  min-height: 456px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid rgba(255, 147, 0, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 251, 223, 0.96), rgba(255, 255, 255, 0.96)),
    var(--panel-2);
  box-shadow: 0 14px 34px rgba(46, 139, 60, 0.1);
}

.plan.featured {
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(33, 207, 98, 0.18), 0 18px 40px rgba(33, 207, 98, 0.18);
}

.badge {
  position: absolute;
  top: -15px;
  right: 18px;
  padding: 5px 14px;
  border-radius: 999px;
  color: #5c1606;
  font-weight: 900;
  background: linear-gradient(180deg, #fff4c9, var(--gold));
}

.plan-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.plan-head span {
  font-size: 30px;
  font-weight: 900;
  color: #2c5b28;
}

.plan-head strong {
  color: var(--gold-2);
  font-size: 42px;
  line-height: 1;
}

.plan p {
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 17px;
}

.plan p b {
  color: #ff7b00;
  font-size: 22px;
}

.plan ul {
  flex: 1;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 9px;
}

.plan li {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 6px;
  color: #385530;
  background: rgba(33, 207, 98, 0.08);
}

.plan button {
  width: 100%;
  min-height: 48px;
  border-radius: 999px;
  font-size: 18px;
}

/* ===== 新人福利 ===== */
.gift-panel {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 22px;
  align-items: stretch;
}

.gift-total {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px;
  border-radius: 8px;
  color: #1f4d22;
  background: linear-gradient(135deg, #fff26d, #46e878);
}

.gift-total span {
  font-weight: 800;
}

.gift-total strong {
  font-size: 52px;
  line-height: 1.15;
}

.gift-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.gift-list span {
  min-height: 84px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
  border: 1px solid rgba(255, 214, 139, 0.34);
  border-radius: 8px;
  color: #2f5529;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.78);
}

/* ===== 计算表 ===== */
.calc-table {
  overflow: hidden;
  border: 1px solid rgba(255, 213, 137, 0.3);
  border-radius: 8px;
}

.row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  align-items: center;
  min-height: 58px;
  padding: 0;
  border-bottom: 1px solid rgba(255, 213, 137, 0.18);
  background: rgba(255, 255, 255, 0.62);
}

.row > * {
  padding: 14px 16px;
  text-align: center;
  border-right: 1px solid rgba(255, 213, 137, 0.15);
}

.row > *:last-child {
  border-right: 0;
}

.row:last-child {
  border-bottom: 0;
}

.row.head {
  color: var(--gold);
  font-weight: 900;
  background: rgba(255, 203, 5, 0.15);
}

.row strong {
  color: #ff7600;
}

/* ===== 规则 ===== */
.rules ol {
  margin: 0;
  padding-left: 24px;
  display: grid;
  gap: 14px;
  color: #536147;
  font-size: 17px;
  line-height: 1.7;
}

/* ===== 返回顶部 ===== */
.back-top {
  position: fixed;
  right: 22px;
  bottom: 24px;
  z-index: 15;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  font-size: 26px;
  font-weight: 900;
  background: linear-gradient(180deg, #8b67ff, #5537d8);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 76px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast-item {
  padding: 12px 24px;
  border-radius: 8px;
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}
.toast-success { background: linear-gradient(135deg, #21cf62, #18a84c); }
.toast-error { background: linear-gradient(135deg, #ff5a2a, #d43815); }
.toast-info { background: linear-gradient(135deg, #298df2, #1a6bc4); }
@keyframes toastIn { from { opacity: 0; transform: translateX(60px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* ===== 支付弹窗（通用） ===== */
.pay-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0,0,0,0.5);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.2s ease;
}
.pay-modal-overlay.active {
  display: flex;
}
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.pay-modal {
  background: #fff;
  border-radius: 16px;
  padding: 36px 32px 28px;
  width: min(440px, calc(100% - 40px));
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
  position: relative;
}
.pay-modal h3 {
  margin: 0 0 22px;
  font-size: 24px;
  color: #ff8a00;
  text-align: center;
}
.pay-modal-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  margin: 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
}
.pay-modal-item strong {
  color: #ff7b00;
  font-size: 18px;
}

/* 关闭按钮 */
.modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: 0;
  background: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  line-height: 1;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s, background 0.2s;
}
.modal-close:hover {
  color: #333;
  background: #f0f0f0;
}

/* ===== 支付方式选择弹窗 ===== */
.pay-method-btns {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
.pay-method-btns button {
  flex: 1;
  min-height: 80px;
  border: 2px solid #eee;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s ease;
  color: #333;
  padding: 16px 12px;
}
.pay-method-btns button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}
.pay-method-btns button:active {
  transform: translateY(0);
}
.pay-method-btns button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}
.btn-pay-weixin:hover {
  border-color: #09BB07;
  background: #f0fff0;
}
.btn-pay-alipay:hover {
  border-color: #1677FF;
  background: #f0f5ff;
}
.btn-pay-weixin span {
  color: #09BB07;
}
.btn-pay-alipay span {
  color: #1677FF;
}
.pay-method-tip {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13px;
  color: #999;
}

/* ===== 二维码弹窗 ===== */
.qrcode-modal {
  text-align: center;
}
.qrcode-box {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 18px auto;
  border: 2px solid #f0f0f0;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
}
.qrcode-box img {
  max-width: 200px;
  max-height: 200px;
  display: block;
}
.qrcode-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #999;
  font-size: 14px;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e8e8e8;
  border-top-color: #ff8a00;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.qrcode-tip {
  margin: 12px 0 6px;
  font-size: 15px;
  font-weight: 700;
  color: #2c5b28;
}
.qrcode-amount {
  margin: 0 0 18px;
  font-size: 20px;
  font-weight: 900;
  color: #ff7b00;
}
.qrcode-cancel {
  display: block;
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  color: #666;
  background: #f5f5f5;
}

/* 旧样式兼容 */
.btn-cancel {
  color: #666;
  background: #f5f5f5;
}
.btn-confirm {
  color: #4a1207;
  background: linear-gradient(180deg, #fff5d8, #ffc178 50%, #f26b22 100%);
}
.pay-modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}
.pay-modal-actions button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .gold-card {
    opacity: 0.35;
    right: 24px;
  }
  .mascot-orbit {
    opacity: 0.18;
    left: -30px;
  }
  .plans {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .coupon-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .coupon,
  .coupon:nth-child(5),
  .coupon:nth-child(6),
  .coupon:nth-child(7) {
    grid-column: auto;
  }
  .gift-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }
  .topbar {
    height: 52px;
    padding: 0 14px;
  }
  .brand {
    font-size: 16px;
  }
  .top-actions button {
    min-width: 58px;
    padding: 0 12px;
    font-size: 13px;
  }
  .hero {
    min-height: 700px;
    padding-top: 88px;
    padding-left: 18px;
    padding-right: 18px;
  }
  .hero h1 {
    font-size: 40px;
    line-height: 1.12;
  }
  .hero-inner {
    width: 100%;
    max-width: 300px;
  }
  .hero-copy {
    font-size: 16px;
    max-width: 280px;
  }
  .hero-cta {
    width: 100%;
  }
  .hero-cta a {
    width: 100%;
    min-width: 0;
    max-width: 280px;
  }
  .benefit-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    max-width: 300px;
  }
  .benefit-nav a {
    min-height: 50px;
    font-size: 16px;
  }
  .gold-card {
    display: none;
  }
  .mascot-orbit {
    width: 150px;
    left: -48px;
    bottom: 118px;
    opacity: 0.14;
  }
  .section {
    width: min(100% - 20px, 1180px);
    padding: 24px 14px;
    margin-bottom: 34px;
  }
  .section-title h2 {
    font-size: 34px;
  }
  .section-title p {
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    font-size: 15px;
    line-height: 1.6;
  }
  .coupon-grid,
  .plans,
  .gift-list {
    grid-template-columns: 1fr;
  }
  .coupon,
  .coupon:nth-child(5),
  .coupon:nth-child(6),
  .coupon:nth-child(7) {
    grid-column: auto;
  }
  .plan {
    min-height: 0;
  }
  .row {
    grid-template-columns: repeat(4, 1fr);
    font-size: 13px;
  }
  .row > * {
    padding: 10px 6px;
    font-size: 13px;
  }
}
