/* 收银台公共样式：窄栏居中，像结账流程，不像营销页 */

* { margin: 0; padding: 0; box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: var(--fs-16);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 背景一层极淡的品牌光，不喧宾夺主 */
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(0, 200, 83, 0.07), transparent 70%);
  pointer-events: none;
  z-index: 0;
}

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

.icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.shell {
  position: relative;
  z-index: 1;
  max-width: 520px;
  margin: 0 auto;
  padding: 0 var(--sp-4) 120px;
  min-height: 100vh;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: linear-gradient(var(--bg) 70%, rgba(8, 8, 15, 0));
  margin: 0 calc(var(--sp-4) * -1);
  padding: 0 var(--sp-4);
}

.icon-btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--r-full);
  color: var(--muted);
  transition: color var(--dur-fast), background var(--dur-fast);
  flex: none;
}
.icon-btn:hover { color: var(--text-bright); background: var(--surface-2); }
.icon-btn:active { transform: scale(0.94); }

.brand {
  margin-left: 2px;
  font-size: var(--fs-14);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-bright);
  display: flex;
  align-items: baseline;
  gap: 7px;
}
.brand span {
  font-size: var(--fs-12);
  font-weight: 400;
  color: var(--muted-soft);
  letter-spacing: 0.06em;
}

.secure {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: var(--fs-12);
  color: var(--muted);
}
.secure .icon { width: 15px; height: 15px; color: var(--primary); }
.secure a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 4px;
  margin-right: -4px;
  border-radius: var(--r-sm);
}

/* ---------- 产品头 ---------- */
.product {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-5) 0 var(--sp-4);
}
.product-mark {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(160deg, var(--surface-3), var(--surface));
  border: 1px solid var(--line-strong);
  font-size: var(--fs-20);
  font-weight: 700;
  color: var(--text-bright);
  flex: none;
}
.product h1 {
  font-size: var(--fs-20);
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.product p {
  font-size: var(--fs-13);
  color: var(--muted);
  margin-top: 2px;
}

/* ---------- 区块标题 ---------- */
.section-title {
  font-size: var(--fs-13);
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.03em;
  margin: var(--sp-5) 0 var(--sp-3);
}

/* ---------- 套餐 ---------- */
.plans { display: grid; gap: var(--sp-2); }

.plan {
  position: relative;
  display: block;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
  transition: border-color var(--dur), background var(--dur);
}
.plan:hover { border-color: var(--line-strong); }
.plan input { position: absolute; opacity: 0; pointer-events: none; }

.plan-row { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); }
.plan-name { font-size: var(--fs-16); font-weight: 500; color: var(--text-bright); }
.plan-note { font-size: var(--fs-12); color: var(--muted-soft); margin-top: 2px; }

.plan-price { text-align: right; white-space: nowrap; }
.plan-price b {
  font-size: var(--fs-24);
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.plan-price .cur { font-size: var(--fs-14); color: var(--muted); margin-right: 1px; }
.plan-price span { font-size: var(--fs-12); color: var(--muted-soft); margin-left: 2px; }

.plan-tag {
  position: absolute;
  top: -1px;
  right: var(--sp-4);
  transform: translateY(-50%);
  background: var(--primary);
  color: var(--primary-ink);
  font-size: var(--fs-12);
  font-weight: 600;
  padding: 2px 10px;
  border-radius: var(--r-full);
}

/* 选中态 */
.plan:has(input:checked) {
  border-color: var(--primary-line);
  background: linear-gradient(180deg, rgba(0, 200, 83, 0.07), rgba(0, 200, 83, 0.02));
  box-shadow: inset 0 0 0 1px rgba(0, 200, 83, 0.18);
}
.plan .tick {
  width: 18px; height: 18px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
  transition: all var(--dur);
  flex: none;
}
.plan .tick .icon { width: 12px; height: 12px; stroke-width: 3; }
.plan:has(input:checked) .tick { background: var(--primary); border-color: var(--primary); color: var(--primary-ink); }

/* ---------- 权益 ---------- */
.benefits { list-style: none; display: grid; gap: var(--sp-2); margin-top: var(--sp-2); }
.benefits li {
  display: flex;
  gap: var(--sp-2);
  font-size: var(--fs-13);
  color: var(--muted);
  align-items: center;
}
.benefits .icon { width: 16px; height: 16px; color: var(--primary); }

/* ---------- 底部操作栏 ---------- */
.action-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: calc(100% - 28px);
  max-width: 520px;
  z-index: 30;
  background: rgba(23, 23, 32, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 9px 9px 9px 20px;
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}
.action-inner {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}
.sum { display: flex; flex-direction: column; gap: 0; line-height: 1.2; }
.sum-label { font-size: var(--fs-12); color: var(--muted-soft); }
.sum-money {
  font-size: var(--fs-20);
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.sum-money .cur { font-size: var(--fs-14); font-weight: 400; color: var(--muted); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  height: 48px;
  padding: 0 var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: var(--fs-16);
  font-weight: 500;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), transform var(--dur-fast), color var(--dur);
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:disabled { background: var(--surface-3); color: var(--muted-soft); cursor: not-allowed; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--muted-soft); color: var(--text-bright); }

.btn-block { width: 100%; flex: 1; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: var(--sp-4);
}

/* ---------- 表单 ---------- */
.field { margin-top: var(--sp-4); }
.label {
  display: block;
  font-size: var(--fs-13);
  color: var(--muted);
  margin-bottom: var(--sp-2);
}
.input {
  width: 100%;
  height: 48px;
  padding: 0 var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  color: var(--text-bright);
  font-family: inherit;
  font-size: var(--fs-16);
  outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.input::placeholder { color: var(--muted-soft); }
.input:focus { border-color: var(--primary-line); box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1); }

.input-row { display: flex; gap: var(--sp-2); }
.input-row .input { flex: 1; }

/* ---------- 状态标签 ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--fs-12);
  padding: 2px 8px;
  border-radius: var(--r-full);
  background: var(--surface-3);
  color: var(--muted);
  white-space: nowrap;
}
.badge-green { background: var(--primary-soft); color: var(--primary); }
.badge-warn { background: var(--warning-soft); color: var(--warning); }

/* ---------- 页脚说明 ---------- */
.footnote {
  font-size: var(--fs-12);
  color: var(--muted-soft);
  text-align: center;
  margin-top: var(--sp-4);
  line-height: 1.6;
}
.footnote a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 移动端 ---------- */
@media (max-width: 480px) {
  .shell { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .action-inner { gap: var(--sp-3); }
}

/* ---------- 订单摘要 ---------- */
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.summary-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 12px var(--sp-4); font-size: var(--fs-14);
}
.summary-row + .summary-row { border-top: 1px solid var(--line); }
.summary-row dt { color: var(--muted); }
.summary-row dd { color: var(--text-bright); font-variant-numeric: tabular-nums; }
.summary-row.total dd { font-size: var(--fs-20); font-weight: 600; }

/* ---------- 二维码 ---------- */
.qr-wrap { display: grid; place-items: center; padding: var(--sp-6) 0 var(--sp-4); }
.qr-plate {
  background: #fff;
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--shadow-md);
  line-height: 0;
}
.qr-plate svg { width: 184px; height: 184px; display: block; }

.pay-clock {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font-size: var(--fs-13); color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.pay-clock .icon { width: 15px; height: 15px; }
.pay-clock b { color: var(--text-bright); font-weight: 500; }

/* ---------- 支付方式 ---------- */
.channels { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-top: var(--sp-3); }
.channel {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 12px var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); cursor: pointer;
  font-size: var(--fs-14); color: var(--muted);
  transition: border-color var(--dur), color var(--dur), background var(--dur);
}
.channel:hover { border-color: var(--line-strong); }
.channel input { position: absolute; opacity: 0; pointer-events: none; }
.channel:has(input:checked) {
  border-color: var(--primary-line);
  background: var(--primary-soft);
  color: var(--text-bright);
}
.channel-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.channel-dot.wx { background: #07c160; }
.channel-dot.ali { background: #1677ff; }

/* ---------- 成功页 ---------- */
.success-head { text-align: center; padding: var(--sp-7) 0 var(--sp-5); }
.success-mark {
  width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; margin: 0 auto var(--sp-4);
  background: var(--primary-soft);
  border: 1px solid var(--primary-line);
  color: var(--primary);
}
.success-mark .icon { width: 30px; height: 30px; stroke-width: 2; }
.success-head h1 { font-size: var(--fs-24); font-weight: 600; color: var(--text-bright); letter-spacing: -0.01em; }
.success-head p { font-size: var(--fs-14); color: var(--muted); margin-top: 4px; }

/* ---------- 卡密 ---------- */
.key-card {
  background: linear-gradient(180deg, rgba(0,200,83,0.08), rgba(0,200,83,0.02));
  border: 1px solid var(--primary-line);
  border-radius: var(--r-lg);
  padding: var(--sp-5) var(--sp-4);
  text-align: center;
}
.key-label { font-size: var(--fs-12); color: var(--primary); letter-spacing: 0.08em; font-weight: 500; }
.key-value {
  font-family: var(--font-mono);
  font-size: var(--fs-24);
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-bright);
  margin: var(--sp-3) 0 var(--sp-4);
  word-break: break-all;
  font-variant-numeric: tabular-nums;
}
.key-hint { font-size: var(--fs-12); color: var(--muted); }

/* ---------- 步骤 ---------- */
.steps { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); }
.step { display: flex; gap: var(--sp-3); align-items: flex-start; }
.step-num {
  width: 22px; height: 22px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--muted);
  font-size: var(--fs-12); font-weight: 600;
}
.step p { font-size: var(--fs-13); color: var(--muted); line-height: 1.6; padding-top: 2px; }
.step b { color: var(--text-bright); font-weight: 500; }

/* ---------- 订单列表 ---------- */
.order-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: var(--sp-4);
  display: grid; gap: var(--sp-3);
}
.order-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-3); }
.order-name { font-size: var(--fs-16); font-weight: 500; color: var(--text-bright); }
.order-name small { font-weight: 400; color: var(--muted); font-size: var(--fs-13); margin-left: 6px; }
.order-meta {
  font-size: var(--fs-12); color: var(--muted-soft); margin-top: 2px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.order-top > div:first-child { min-width: 0; }
.order-amount { font-size: var(--fs-18); font-weight: 600; color: var(--text-bright); font-variant-numeric: tabular-nums; white-space: nowrap; }

.key-line {
  display: flex; align-items: center; gap: var(--sp-2);
  background: var(--surface-2); border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm); padding: 10px var(--sp-3);
}
.key-line code {
  font-family: var(--font-mono); font-size: var(--fs-13);
  color: var(--text-bright); letter-spacing: 0.04em; flex: 1;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.copy-btn {
  display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: var(--r-sm); border: none; background: transparent;
  color: var(--muted); cursor: pointer; transition: color var(--dur-fast), background var(--dur-fast);
}
.copy-btn:hover { color: var(--primary); background: var(--primary-soft); }
.copy-btn .icon { width: 16px; height: 16px; }

.order-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); }
.order-actions { display: flex; gap: var(--sp-2); }
.btn-sm { height: 34px; padding: 0 14px; font-size: var(--fs-13); border-radius: var(--r-sm); }

/* ---------- 选项卡 ---------- */
.tabs { display: flex; gap: var(--sp-1); padding: 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-full); margin: var(--sp-4) 0; }
.tab {
  flex: 1; text-align: center; padding: 7px 0; border-radius: var(--r-full);
  font-size: var(--fs-13); color: var(--muted); cursor: pointer;
  transition: background var(--dur), color var(--dur);
}
.tab.active { background: var(--surface-3); color: var(--text-bright); }

/* ---------- 账户条 ---------- */
.me-bar { display: flex; align-items: center; justify-content: space-between; margin: var(--sp-4) 0 0; }
.me-badge { display: flex; align-items: center; gap: 8px; font-size: var(--fs-13); color: var(--muted); }
.me-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; color: var(--text-bright); font-size: var(--fs-12); font-weight: 600; }

/* ---------- 桌面两栏（手机优先，>=1024 才切成结算台） ---------- */
.checkout { display: block; }
.checkout-main { min-width: 0; }
.checkout-side { display: none; }

@media (min-width: 1024px) {
  .shell:has(.checkout) { max-width: 980px; padding-bottom: 72px; }
  .checkout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 40px;
    align-items: start;
    margin-top: 8px;
  }
  .checkout-side { display: block; position: sticky; top: 88px; }
  .action-bar { display: none; }
  .shell:has(.checkout) .topbar { margin: 0; padding: 0; }
}

.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--shadow-md);
}
.side-label { font-size: var(--fs-13); color: var(--muted); }
.side-money {
  font-size: var(--fs-32);
  font-weight: 600;
  color: var(--text-bright);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  margin: 4px 0 var(--sp-5);
}
.side-money .cur { font-size: var(--fs-16); font-weight: 400; color: var(--muted); margin-right: 2px; }
.side-note {
  font-size: var(--fs-12);
  color: var(--muted);
  text-align: center;
  margin-top: var(--sp-3);
  line-height: 1.6;
}

/* 平板：略宽，但仍是单列 */
@media (min-width: 640px) and (max-width: 1023px) {
  .shell { max-width: 600px; }
}

/* ---------- 首页 ---------- */
.shell.shell-home { padding-bottom: var(--sp-7); }
.home-foot { margin-top: var(--sp-7); }
.hero { margin: var(--sp-6) 0 var(--sp-6); }
.hero h1 {
  font-size: var(--fs-32);
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.hero p {
  font-size: var(--fs-14);
  color: var(--muted);
  margin-top: var(--sp-2);
  line-height: 1.7;
}

.product-grid { display: grid; gap: var(--sp-3); }

.product-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  transition: border-color var(--dur), transform var(--dur-fast), background var(--dur);
}
.product-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.product-card:active { transform: scale(0.99); }
.product-card .product-mark { width: 44px; height: 44px; border-radius: 12px; font-size: var(--fs-18); }
.product-card .icon { color: var(--muted-soft); }
.product-body { flex: 1; min-width: 0; }
.product-name { font-size: var(--fs-16); font-weight: 500; color: var(--text-bright); }
.product-desc {
  font-size: var(--fs-13); color: var(--muted); margin-top: 2px; line-height: 1.5;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

@media (min-width: 640px) {
  .product-grid { grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
}
@media (min-width: 1024px) {
  .shell.shell-home { max-width: 980px; }
}

/* ---------- 发票申请 ---------- */
.invoice-head { margin-top: var(--sp-5); }
.invoice-head h1 {
  font-size: var(--fs-32);
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: -0.02em;
  line-height: 1.25;
}
.invoice-head p { font-size: var(--fs-14); color: var(--muted); margin-top: var(--sp-2); line-height: 1.7; }
.invoice-form { margin-top: var(--sp-5); }
.invoice-note { margin-top: var(--sp-5); }
.invoice-note p { font-size: var(--fs-13); color: var(--muted); line-height: 1.7; }
.reveal-btn {
  height: 26px;
  padding: 0 8px;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: var(--fs-12);
  cursor: pointer;
  transition: color var(--dur-fast), background var(--dur-fast);
  flex: none;
}
.reveal-btn:hover { color: var(--primary); background: var(--primary-soft); }
code.revealed { color: var(--primary); }
