/* ── Token overrides (loaded after styles.css; later :root wins) ── */
:root{
  --primary:#1A1A1A;
  --primary-dark:#333333;
  --primary-light:#9A9A9A;
  --accent:#9B8B6E;
  /* Accent used as TEXT on a light surface must be darker than --accent:
     #9B8B6E on the promo tint only reaches ~2.9:1. #6E5F45 reaches ~5.4:1 (WCAG AA). */
  --accent-strong:#6E5F45;
  --accent-soft:#F4F3F0;
  --bg:#FAFAF8;
  --bg-soft:#F4F3F0;
  --bg-card:#FFFFFF;
  --ink:#1A1A1A;
  --muted:#6B6B6B;
  --border:#E6E3DD;
  --success:#2D8B5A;
  /* --error, --info, --z-modal left untouched */
  --gradient-primary:#1A1A1A;
  --gradient-accent:#9B8B6E;
  --gradient-hero:#FAFAF8;
  --gradient-footer:#141414;
  --gradient-cta:#1A1A1A;
  --shadow-sm:0 1px 2px rgba(26,26,26,.04);
  --shadow-md:0 1px 3px rgba(26,26,26,.06);
  --shadow-lg:0 4px 12px rgba(26,26,26,.08);
  --shadow-xl:0 8px 24px rgba(26,26,26,.10);
  --shadow-glow:none;
  --radius-sm:2px;
  --radius-md:2px;
  --radius-lg:2px;
  --radius-xl:2px;
  --radius-2xl:2px;
  /* --radius-full intentionally left at 9999px */
  --transition-fast:280ms ease;
  --transition-base:280ms ease;
  --transition-slow:280ms ease;
  --font-display:"Songti SC","Noto Serif CJK SC","Source Han Serif SC","STSong","SimSun","PMingLiU",Georgia,"Times New Roman",serif;
  --font-body:-apple-system,BlinkMacSystemFont,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Segoe UI",sans-serif;
}

/* ── Gate (login) ── */
.gate-wrap { display: flex; align-items: center; justify-content: center; min-height: 80vh; padding: 24px; }
.gate-card {
  background: var(--bg-card); border-radius: var(--radius-xl); padding: 40px 32px;
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  width: 100%; max-width: 400px; text-align: center;
}
.gate-card h2 {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl); font-weight: 700; color: var(--ink); margin-bottom: 8px;
}
.gate-card p { font-size: var(--font-size-sm); color: var(--muted); margin-bottom: 24px; }
.gate-card .gate-switch { font-size: var(--font-size-sm); color: var(--muted); margin: 16px 0 0; }
.gate-card .gate-switch a { color: var(--primary); font-weight: 600; text-decoration: none; }
.form-group { margin-bottom: 16px; text-align: left; }
.form-group label { display: block; font-size: var(--font-size-sm); font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.form-input {
  width: 100%; padding: 10px 14px; font-size: var(--font-size-md); font-family: inherit;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--ink); transition: var(--transition-fast); outline: none;
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,26,26,0.08); }
.form-error { font-size: var(--font-size-xs); color: var(--error); margin-top: 4px; min-height: 18px; }

/* ── Main body ── */
.rc-body { max-width: 860px; margin: 0 auto; padding: 32px 16px 80px; }
.rc-section-title {
  font-family: var(--font-display);
  font-size: var(--font-size-xl); font-weight: 700; color: var(--ink);
  margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
  display: inline-block;
}

/* ── Balance card ── */
.balance-card {
  background: #141414;
  border-radius: var(--radius-xl); padding: 32px; color: #fff;
  margin-bottom: 32px; box-shadow: 0 8px 32px rgba(26,26,26,0.25);
  position: relative; overflow: hidden;
}
.balance-card::after {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 120px; height: 120px; background: rgba(255,255,255,0.06);
  border-radius: 50%; pointer-events: none;
}
.balance-card-label { font-size: var(--font-size-sm); opacity: 0.8; margin-bottom: 4px; }
.balance-card-total { font-size: 36px; font-weight: 700; line-height: 1.2; margin-bottom: 20px; }
.balance-card-total span { font-size: 18px; font-weight: 500; }
.balance-row {
  display: flex; gap: 16px; flex-wrap: wrap;
}
.balance-item {
  flex: 1; min-width: 120px; background: rgba(255,255,255,0.1);
  border-radius: var(--radius-md); padding: 14px 18px;
}
.balance-item-label { font-size: var(--font-size-xs); opacity: 0.75; margin-bottom: 2px; }
.balance-item-value { font-size: var(--font-size-xl); font-weight: 600; }

/* ── Redeem code section ── */
.redeem-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.redeem-input-row {
  display: flex; gap: 10px; align-items: center;
}
.redeem-input-row .form-input { flex: 1; }
.btn-redeem-verify {
  padding: 10px 20px; font-size: var(--font-size-md); font-weight: 600;
  color: #fff; background: var(--gradient-primary); border: none;
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  white-space: nowrap;
}
.btn-redeem-verify:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,26,26,0.15); }
.btn-redeem-verify:active { transform: translateY(0); }
.btn-redeem-verify:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.redeem-result {
  margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border);
}
.redeem-product-name { font-size: var(--font-size-lg); font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.redeem-product-price { font-size: var(--font-size-xl); font-weight: 700; color: var(--primary); margin-bottom: 16px; }

/* ── Group buy section ── */
.gb-active-card, .gb-create-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.gb-active-header {
  font-size: var(--font-size-md); font-weight: 700; color: var(--ink); margin-bottom: 16px;
}
.gb-progress { margin-bottom: 12px; }
.gb-progress-text { font-size: var(--font-size-sm); color: var(--muted); margin-bottom: 6px; }
.gb-progress-text strong { color: var(--ink); }
.gb-progress-bar {
  height: 6px; background: var(--bg-soft); border-radius: 3px; overflow: hidden;
}
.gb-progress-fill {
  height: 100%; background: var(--gradient-accent); border-radius: 3px;
  transition: width 0.5s ease;
}
.gb-countdown-row {
  font-size: var(--font-size-sm); color: var(--muted); margin-bottom: 16px;
}
.gb-countdown-row strong { color: var(--ink); }
.gb-participants { margin-bottom: 16px; }
.gb-participant {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-size: var(--font-size-sm);
}
.gb-participant:last-child { border-bottom: none; }
.gb-participant-phone { color: var(--ink); }
.gb-participant-status { font-weight: 600; }
.gb-participant.paid .gb-participant-status { color: var(--success); }
.gb-participant.pending .gb-participant-status { color: var(--muted); }
.gb-participant.refunded .gb-participant-status { color: var(--error); }
.gb-share-row { margin-top: 8px; }
.btn-gb-share {
  width: 100%; padding: 10px 20px; font-size: var(--font-size-md); font-weight: 600;
  color: var(--ink); background: var(--bg-soft); border: 1.5px solid var(--border);
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
}
.btn-gb-share:hover { border-color: var(--primary); background: rgba(26,26,26,0.03); }
.gb-create-desc {
  font-size: var(--font-size-sm); color: var(--muted); margin-bottom: 16px; line-height: 1.6;
}
.gb-create-desc strong { color: var(--ink); }
.btn-gb-create {
  width: 100%; padding: 12px 20px; font-size: var(--font-size-md); font-weight: 600;
  color: #fff; background: var(--gradient-accent); border: none;
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  box-shadow: 0 4px 16px rgba(155,139,110,0.2);
}
.btn-gb-create:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(155,139,110,0.3); }
.btn-gb-create:active { transform: translateY(0); }
.btn-gb-create:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }
.gb-joinable-title {
  font-size: var(--font-size-sm); font-weight: 600; color: var(--muted);
  margin-top: 20px; margin-bottom: 10px;
}
.gb-joinable-list { display: flex; flex-direction: column; gap: 8px; }
.gb-joinable-item {
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 12px 16px;
}
.gb-joinable-info { display: flex; flex-direction: column; gap: 2px; }
.gb-joinable-progress { font-size: var(--font-size-sm); font-weight: 600; color: var(--ink); }
.gb-joinable-time { font-size: var(--font-size-xs); color: var(--muted); }
.btn-gb-join {
  padding: 8px 16px; font-size: var(--font-size-sm); font-weight: 600;
  color: #fff; background: var(--gradient-primary); border: none;
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  white-space: nowrap;
}
.btn-gb-join:hover { transform: translateY(-1px); }
.btn-gb-join:active { transform: translateY(0); }
.btn-gb-join:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ── Pay-as-you-go fee schedule ── */
.fee-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.fee-row {
  display: flex; flex-wrap: wrap; gap: 6px 16px; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--border); font-size: var(--font-size-sm);
}
.fee-row:last-of-type { border-bottom: none; }
.fee-label { color: var(--muted); }
.fee-value { color: var(--ink); font-weight: 600; }
.fee-hint { margin-top: 12px; font-size: var(--font-size-xs); color: var(--muted); }

/* ── 面试资费 / 笔试资费: two side-by-side cards (left 面试, right 笔试) ── */
.fee-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 640px) { .fee-grid { grid-template-columns: repeat(2, 1fr); } }
.fee-card-title {
  font-size: var(--font-size-lg); font-weight: 700; color: var(--ink);
  padding-bottom: 10px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
}
.fee-card-shared { margin-top: 16px; }

/* ── Packages grid ── */
.pkg-grid {
  display: grid; grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px;
}
@media (min-width: 640px) { .pkg-grid { grid-template-columns: repeat(2, 1fr); } }
.pkg-card {
  background: var(--bg-card); border-radius: var(--radius-lg); padding: 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; justify-content: space-between;
  transition: var(--transition-base);
}
.pkg-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--primary-light); }
.pkg-name { font-size: var(--font-size-lg); font-weight: 700; color: var(--ink); margin-bottom: 6px; }
.pkg-price { font-size: var(--font-size-2xl); font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.pkg-price-line { font-size: var(--font-size-xs); color: var(--muted); margin-bottom: 4px; }
.pkg-quota { font-size: var(--font-size-xs); color: var(--muted); line-height: 1.7; margin-bottom: 16px; }
.pkg-quota strong { color: var(--ink); }
.pkg-remaining {
  font-size: var(--font-size-xs); color: var(--success); background: rgba(45,139,90,0.08);
  padding: 6px 10px; border-radius: var(--radius-sm); margin-bottom: 12px;
  border: 1px solid rgba(45,139,90,0.15);
}
.btn-buy {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 10px 20px; font-size: var(--font-size-md); font-weight: 600;
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  background: var(--gradient-primary); color: #fff; border: none;
  box-shadow: 0 4px 16px rgba(26,26,26,0.15);
}
.btn-buy:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,26,26,0.2); }
.btn-buy:active { transform: translateY(0); }
.btn-buy:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.pkg-qty {
  display: inline-flex; align-items: center; gap: 0; margin-bottom: 10px;
}
.qty-minus, .qty-plus {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  font-size: var(--font-size-md); font-weight: 700; cursor: pointer;
  background: var(--bg-soft); color: var(--ink); border: 1px solid var(--border);
  transition: var(--transition-fast); user-select: none; line-height: 1;
}
.qty-minus { border-radius: var(--radius-full) 0 0 var(--radius-full); }
.qty-plus { border-radius: 0 var(--radius-full) var(--radius-full) 0; }
.qty-minus:hover, .qty-plus:hover { background: rgba(26,26,26,0.04); color: var(--primary); }
.qty-val {
  min-width: 36px; text-align: center; font-size: var(--font-size-md); font-weight: 600;
  color: var(--ink); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  height: 32px; line-height: 32px; padding: 0 4px;
}
.btn-balance {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 10px 20px; font-size: var(--font-size-md); font-weight: 600;
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  background: var(--bg-card); color: var(--primary); border: 2px solid var(--primary);
  margin-bottom: 8px;
}
.btn-balance:hover { background: rgba(26,26,26,0.03); transform: translateY(-1px); }
.btn-balance:active { transform: translateY(0); }
.btn-balance:disabled { opacity: 0.45; cursor: not-allowed; transform: none; color: var(--muted); border-color: var(--border); }

/* ── Recharge section ── */
.recharge-card {
  background: var(--bg-card); border-radius: var(--radius-xl); padding: 32px;
  border: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.preset-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px;
}
@media (max-width: 420px) { .preset-grid { grid-template-columns: repeat(2, 1fr); } }
.preset-btn {
  padding: 14px 0; font-size: var(--font-size-md); font-weight: 600;
  color: var(--ink); background: var(--bg-soft); border: 2px solid var(--border);
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  text-align: center;
}
.preset-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(26,26,26,0.03); }
.preset-btn.active { border-color: var(--primary); background: rgba(26,26,26,0.04); color: var(--primary); box-shadow: 0 0 0 3px rgba(26,26,26,0.08); }
.custom-amount-wrap { display: flex; align-items: center; gap: 8px; margin-bottom: 20px; }
.custom-amount-wrap label { font-size: var(--font-size-sm); font-weight: 600; color: var(--ink); white-space: nowrap; }
.custom-amount-wrap input {
  flex: 1; padding: 10px 14px; font-size: var(--font-size-md); font-family: inherit;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--bg-card); color: var(--ink); outline: none; transition: var(--transition-fast);
  min-width: 0;
}
.custom-amount-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,26,26,0.08); }
.custom-amount-wrap .unit { font-size: var(--font-size-sm); color: var(--muted); }
.btn-pay {
  width: 100%; padding: 14px 24px; font-size: var(--font-size-md); font-weight: 600;
  border-radius: 2px; cursor: pointer; transition: var(--transition-fast);
  background: var(--gradient-accent); color: var(--ink); border: none;
  box-shadow: 0 4px 16px rgba(155,139,110,0.2);
}
.btn-pay:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(155,139,110,0.3); }
.btn-pay:active { transform: translateY(0); }
.btn-pay:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

/* ── Usage section ── */
.usage-table {
  width: 100%; border-collapse: collapse; font-size: var(--font-size-sm);
}
.usage-table th,
.usage-table td {
  padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--border);
  color: var(--ink);
}
.usage-table th {
  font-weight: 600; color: var(--muted); font-size: var(--font-size-xs);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.usage-table tr:last-child td { border-bottom: none; }
.usage-table tr:hover td { background: var(--bg-soft); }

/* ── QR Modal ── */
.qr-overlay {
  position: fixed; inset: 0; background: rgba(26,26,26,0.55);
  display: none; align-items: center; justify-content: center;
  z-index: var(--z-modal); padding: 24px;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.qr-overlay.open { display: flex; }
.qr-modal {
  background: var(--bg-card); border-radius: var(--radius-xl); padding: 36px 32px;
  max-width: 380px; width: 100%; text-align: center; position: relative;
  animation: scaleIn 0.25s ease; box-shadow: var(--shadow-xl);
}
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
.qr-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: var(--radius-full); display: flex; align-items: center; justify-content: center;
  color: var(--muted); transition: var(--transition-fast); background: transparent; cursor: pointer;
}
.qr-close:hover { background: var(--bg-soft); color: var(--ink); }
.qr-title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg); font-weight: 700; color: var(--ink); margin-bottom: 8px;
}
.qr-amount { font-size: var(--font-size-2xl); font-weight: 700; color: var(--primary); margin-bottom: 16px; }
.qr-box {
  display: flex; align-items: center; justify-content: center;
  width: 220px; height: 220px; margin: 0 auto 16px;
  background: var(--bg-card); border: 2px solid var(--border); border-radius: var(--radius-lg);
  overflow: hidden; position: relative;
}
.qr-box img, .qr-box canvas { max-width: 100%; max-height: 100%; }
.qr-countdown { font-size: var(--font-size-sm); color: var(--muted); margin-bottom: 12px; }
.qr-countdown strong { color: var(--ink); }
.qr-status {
  font-size: var(--font-size-sm); padding: 10px 16px; border-radius: var(--radius-sm);
  background: var(--bg-soft); color: var(--muted); border: 1px solid var(--border);
  min-height: 20px;
}
.qr-status.waiting { color: var(--info); background: rgba(59,130,246,0.06); border-color: rgba(59,130,246,0.15); }
.qr-status.success { color: var(--success); background: rgba(45,139,90,0.06); border-color: rgba(45,139,90,0.15); }
.qr-status.expired { color: var(--error); background: rgba(239,68,68,0.06); border-color: rgba(239,68,68,0.15); }

/* ── Toast ── */
.toast {
  position: fixed; top: 20px; right: 20px; z-index: 9999;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: var(--font-size-sm); font-weight: 600; color: #fff;
  box-shadow: var(--shadow-lg); transform: translateX(120%);
  transition: transform 0.3s ease; max-width: 360px; word-break: break-word;
}
.toast.show { transform: translateX(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--error); }

/* ── Responsive ── */
@media (max-width: 480px) {
  .gate-card { padding: 32px 20px; }
  .balance-card { padding: 24px; }
  .balance-card-total { font-size: 28px; }
  .recharge-card { padding: 24px; }
}

/* ── Marketing box (beside packages) ── */
.pkg-with-mkt {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}
@media (min-width: 700px) {
  .pkg-with-mkt { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  .pkg-with-mkt .pkg-grid { grid-template-columns: 1fr; margin-bottom: 0; height: 100%; }
  .pkg-with-mkt #pkg-content { height: 100%; }
}
.rc-mkt-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 14px 16px;
}
.rc-mkt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.rc-mkt-row:last-child { border-bottom: none; }
.rc-mkt-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--ink);
}
.rc-mkt-check {
  flex: 0 0 auto;
  color: var(--success);
  font-size: var(--font-size-md);
  font-weight: 700;
  line-height: 1;
}

/* ── Payment method selector ── */
.pay-method { margin-bottom: 12px; }
.pay-method-label { font-size: var(--font-size-sm); font-weight: 600; color: var(--ink); margin-bottom: 8px; }
.pm-opts { display: flex; gap: 10px; flex-wrap: wrap; }
.pm-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 16px; font-size: var(--font-size-md); font-weight: 600;
  color: var(--ink); background: var(--bg-soft); border: 2px solid var(--border);
  border-radius: var(--radius-sm); cursor: pointer; transition: var(--transition-fast);
}
.pm-btn:hover { border-color: var(--primary); color: var(--primary); background: rgba(26,26,26,0.03); }
.pm-btn.active { border-color: var(--primary); background: rgba(26,26,26,0.04); color: var(--primary); box-shadow: 0 0 0 3px rgba(26,26,26,0.08); }
.pm-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.pm-badge {
  display: inline-block; margin-left: 6px; padding: 1px 6px;
  font-size: 11px; font-weight: 700; line-height: 1.5; vertical-align: middle;
  color: #fff; background: var(--accent-strong); border-radius: 2px;
}
.pm-hint { margin-top: 6px; font-size: var(--font-size-xs); color: var(--muted); }
.pm-current {
  display: inline-flex; align-items: center;
  padding: 10px 16px; font-weight: 600; color: var(--primary);
  background: rgba(26,26,26,0.04); border: 2px solid var(--primary);
  border-radius: var(--radius-sm); box-shadow: 0 0 0 3px rgba(26,26,26,0.08); cursor: default;
}
@media (max-width: 420px) { .pm-opts { gap: 8px; } .pm-btn { flex: 1; } }
