:root {
  --bg: #f6f6f7;
  --card: #ffffff;
  --line: #e8e8e8;
  --text: #0d0d0d;
  --muted: #8a8a8a;
  --muted2: #b0b0b0;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 3px rgba(0,0,0,0.05), 0 6px 20px rgba(0,0,0,0.07);
}

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

html { font-size: 15px; scroll-behavior: smooth; }

body {
  font-family: -apple-system, "PingFang SC", "Noto Sans SC", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── 页面容器 ─── */
.page {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 48px 0 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ─── HERO ─── */
.hero {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 44px;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.brand {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
}

.badge-green {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.hero h1 {
  font-size: clamp(28px, 3.8vw, 42px);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.hero h1 em {
  font-style: normal;
  color: var(--text);
  border-bottom: 2.5px solid var(--text);
  padding-bottom: 1px;
}

.hero-sub {
  font-size: 14.5px;
  color: var(--muted);
  max-width: 480px;
  margin-bottom: 22px;
  line-height: 1.65;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 12px;
}

.trust-row svg {
  color: var(--green);
  flex-shrink: 0;
}

/* ─── 价格卡片 ─── */
.price-card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 22px;
}

.price-card-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin-bottom: 14px;
}

.price-rows { display: flex; flex-direction: column; gap: 10px; }

.price-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.price-model { font-weight: 600; }

.price-official {
  color: var(--muted2);
  text-decoration: line-through;
  font-size: 12px;
}

.price-arrow { color: var(--muted2); font-size: 11px; }

.price-ours { font-weight: 700; font-size: 13.5px; }

.price-save {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  white-space: nowrap;
}

/* ─── 主体双栏 ─── */
.body-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
}

/* ─── 左栏 ─── */
.info-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.info-section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 28px;
}

.info-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin-bottom: 14px;
}

.model-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.model-tag {
  font-size: 12.5px;
  font-weight: 500;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--text);
}

.feature-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feature-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.feat-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--text);
}

.feature-list li div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.feature-list li strong {
  font-size: 14px;
  font-weight: 700;
}

.feature-list li span {
  font-size: 13px;
  color: var(--muted);
}

/* ─── 右栏购买区 ─── */
.checkout-col {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  overflow-x: visible;
  border-radius: var(--radius);
  /* 隐藏滚动条但保留功能 */
  scrollbar-width: none;
}

.checkout-col::-webkit-scrollbar { display: none; }

.checkout-inner {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkout-inner h2 {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.checkout-sub {
  font-size: 13px;
  color: var(--muted);
  margin-top: -14px;
}

/* ─── 套餐 ─── */
.plan-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.plan-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.12s, background 0.12s;
  position: relative;
}

.plan-option:hover { border-color: #ccc; }

.plan-option-selected {
  border-color: var(--text) !important;
  background: #fafafa;
}

.plan-option-disabled { opacity: 0.38; cursor: not-allowed; pointer-events: none; }

.plan-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.plan-name {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}

.plan-desc {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.plan-price {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.plan-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--text);
  color: #fff;
  letter-spacing: 0.02em;
}

.plan-unavail {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 1px 8px;
  font-style: normal;
}

/* ─── 表单 ─── */
form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
}

input[type="email"],
input[type="text"] {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  background: var(--card);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}

input[type="email"]:focus,
input[type="text"]:focus {
  border-color: var(--text);
  box-shadow: 0 0 0 3px rgba(0,0,0,0.07);
}

input::placeholder { color: var(--muted2); }

/* ─── 提交按钮 ─── */
.btn-submit {
  width: 100%;
  padding: 13px;
  background: var(--text);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: -0.01em;
  transition: background 0.12s, transform 0.08s, opacity 0.12s;
}

.btn-submit:hover { background: #222; }
.btn-submit:active { transform: scale(0.99); }
.btn-submit:disabled { opacity: 0.45; cursor: not-allowed; }

/* ─── 通用按钮 ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--text);
  text-decoration: none;
  transition: background 0.12s, border-color 0.12s, transform 0.08s;
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  background: var(--text);
  color: #fff;
  border-color: var(--text);
}

.btn-primary:hover { background: #222; border-color: #222; }

.btn-ghost {
  background: var(--bg);
  border-color: var(--line);
}

.btn-ghost:hover { border-color: #bbb; }

.btn:disabled { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

.form-hint {
  font-size: 12px;
  color: var(--muted2);
  text-align: center;
  margin-top: -4px;
}

/* ─── 状态 ─── */
.status {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  min-height: 16px;
}

.status.error { color: var(--red); }
.status.success { color: var(--green); }

.hidden { display: none !important; }

/* ─── 支付面板 ─── */
.pay-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.pay-panel-header { display: flex; flex-direction: column; gap: 4px; }

.pay-panel h3 {
  font-size: 15px;
  font-weight: 700;
}

.pay-grid {
  display: grid;
  grid-template-columns: 136px 1fr;
  gap: 16px;
  align-items: start;
}

.qr-wrap {
  width: 136px;
  height: 136px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-wrap img { width: 100%; height: 100%; object-fit: contain; display: block; }

.pay-info { display: flex; flex-direction: column; gap: 7px; }

.pay-info-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
}

.pay-info-row span { color: var(--muted); white-space: nowrap; min-width: 48px; }
.pay-info-row strong { color: var(--text); font-weight: 600; }

.pay-info-row code {
  font-size: 11.5px;
  font-family: "SFMono-Regular", monospace;
  word-break: break-all;
  padding: 1px 6px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 4px;
  user-select: all;
}

.pay-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 2px; }

/* ─── 完成面板 ─── */
.done-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.done-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.done-header h3 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.done-email { font-size: 13.5px; color: var(--muted); }
.done-email strong { color: var(--text); }

.card-key-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px;
}

.card-key-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
}

.card-key-box code {
  font-size: 13.5px;
  font-family: "SFMono-Regular", "Menlo", monospace;
  color: var(--text);
  word-break: break-all;
  line-height: 1.6;
  user-select: all;
}

.card-key-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── 历史订单 ─── */
.history-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.history-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
}

.history-list { list-style: none; display: flex; flex-direction: column; gap: 6px; }

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.1s;
}

.history-item:hover { background: var(--bg); }

.history-main { display: flex; flex-direction: column; gap: 2px; }
.history-title { font-weight: 600; }
.history-meta { font-size: 12px; color: var(--muted); }
.history-actions { flex-shrink: 0; }
.history-empty { font-size: 13px; color: var(--muted2); }

/* ─── 底部备注 ─── */
.notes-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.notes-item {
  flex: 1;
  min-width: 200px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.notes-item summary {
  padding: 14px 20px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
}

.notes-item summary::-webkit-details-marker { display: none; }

.notes-item summary::after {
  content: "+";
  font-size: 17px;
  font-weight: 300;
  color: var(--muted);
  line-height: 1;
}

.notes-item[open] summary::after { content: "−"; }

.notes-body {
  padding: 0 20px 16px;
  font-size: 13px;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--line);
}

.notes-body p { padding-top: 6px; }
.notes-body a { color: var(--text); text-decoration: underline; }
.notes-body ul { padding-left: 16px; display: flex; flex-direction: column; gap: 4px; padding-top: 6px; }

/* ─── 页脚 ─── */
.site-footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted2);
  padding: 8px 0 24px;
}

/* ─── 弹窗 ─── */
.modal-wrap {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(5px);
}

.modal-box {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  width: calc(100% - 40px);
  max-width: 400px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.modal-box h3 { font-size: 17px; font-weight: 800; }

.modal-order-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.modal-order-label { color: var(--muted); white-space: nowrap; }

.modal-order-row code {
  font-size: 12px;
  font-family: "SFMono-Regular", monospace;
  word-break: break-all;
}

.modal-input { margin: 0; }

.modal-checks { display: flex; flex-direction: column; gap: 8px; }

.modal-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  cursor: pointer;
}

.modal-check input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--text);
}

.modal-warn {
  font-size: 12px;
  color: var(--red);
  padding: 8px 12px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 6px;
}

.modal-actions { display: flex; gap: 8px; }

.modal-footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.link-btn:hover { color: var(--text); }

.faq-list { display: flex; flex-direction: column; gap: 12px; font-size: 13.5px; color: var(--muted); }
.faq-list p { margin: 0; }
.faq-list strong { display: block; color: var(--text); margin-bottom: 2px; font-size: 14px; }

/* ─── 彩纸 ─── */
.done-panel { position: relative; overflow: visible; }

.celebration-layer {
  position: absolute;
  inset: -20px;
  pointer-events: none;
  overflow: hidden;
  border-radius: var(--radius);
}

.confetti-piece {
  position: absolute;
  top: -14px;
  width: var(--piece-size, 8px);
  height: var(--piece-size, 8px);
  background: var(--piece-color, #f00);
  border-radius: 2px;
  animation: confetti-fall var(--fall-duration, 2s) var(--fall-delay, 0s) ease-in forwards;
}

@keyframes confetti-fall {
  0%   { transform: translateY(0) translateX(0) rotate(0); opacity: 1; }
  100% { transform: translateY(340px) translateX(var(--drift,0)) rotate(var(--rotate-end,360deg)); opacity: 0; }
}

/* ─── 响应式 ─── */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding: 28px 24px; }
  .hero-right { display: none; }
  .body-grid { grid-template-columns: 1fr; }
  .checkout-col { position: static; }
  .page { width: calc(100% - 32px); padding: 28px 0 60px; }
  .notes-row { flex-direction: column; }
  .pay-grid { grid-template-columns: 1fr; }
  .qr-wrap { width: 100%; height: 180px; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 26px; }
  .modal-actions { flex-direction: column; }
  .card-key-actions { flex-direction: column; }
}
