*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif;
  background: linear-gradient(180deg, #f6f7fb 0%, #eef1f8 100%);
  color: #1f2937;
  min-height: 100vh;
  line-height: 1.6;
}
.container { max-width: 960px; margin: 0 auto; padding: 0 20px; }

.hero {
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  color: #fff;
  padding: 56px 0 48px;
  box-shadow: 0 10px 30px rgba(79, 70, 229, 0.15);
}
.hero h1 { margin: 0 0 8px; font-size: 32px; letter-spacing: 1px; }
.tagline { margin: 0; opacity: 0.85; font-size: 15px; }

main { padding: 32px 0 64px; }

.card {
  background: #fff;
  border-radius: 14px;
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(15, 23, 42, 0.05);
}
.card h2 { margin: 0 0 8px; font-size: 18px; }
.hint { color: #6b7280; font-size: 13px; margin: 8px 0 16px; }

.amounts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-top: 16px;
}
.amount-card {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  background: #fafbff;
  transition: all 0.15s;
  position: relative;
}
.amount-card:hover { border-color: #6366f1; transform: translateY(-2px); box-shadow: 0 8px 20px rgba(99, 102, 241, 0.12); }
.amount-card .price { font-size: 28px; font-weight: 700; color: #4f46e5; }
.amount-card .price small { font-size: 14px; color: #6b7280; margin-left: 2px; }
.amount-card .stock { font-size: 12px; color: #6b7280; margin: 4px 0 12px; }
.amount-card .stock.out { color: #ef4444; }
.amount-card button {
  width: 100%;
  padding: 8px 0;
  border: none;
  border-radius: 8px;
  background: #4f46e5;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.amount-card button:hover { background: #4338ca; }
.amount-card button:disabled { background: #d1d5db; cursor: not-allowed; }

.steps { padding-left: 22px; margin: 8px 0 0; color: #374151; }
.steps li { margin: 4px 0; }

.aftersales .qq-box {
  display: flex;
  align-items: center;
  gap: 18px;
  background: #f3f4f6;
  border-radius: 10px;
  padding: 16px 20px;
  flex-wrap: wrap;
}
.qq-name { font-weight: 600; }
.qq-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 18px; color: #4f46e5; letter-spacing: 1px; }
.btn-ghost {
  border: 1px solid #d1d5db;
  background: #fff;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
}
.btn-ghost:hover { background: #f9fafb; }

footer { padding: 24px 0; color: #9ca3af; text-align: center; }

/* Modal */
.modal {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.modal.hidden { display: none; }
.modal-inner {
  background: #fff;
  border-radius: 14px;
  width: 100%;
  max-width: 420px;
  padding: 26px 24px 22px;
  position: relative;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.modal-inner h3 { margin: 0 0 16px; }
.close {
  position: absolute; top: 10px; right: 14px;
  border: none; background: none; font-size: 24px; color: #9ca3af; cursor: pointer; line-height: 1;
}
.close:hover { color: #111827; }
.hidden { display: none !important; }

.field { display: block; margin-bottom: 14px; }
.field span { display: block; font-size: 13px; color: #374151; margin-bottom: 6px; }
.field input {
  width: 100%; padding: 10px 12px;
  border: 1px solid #d1d5db; border-radius: 8px;
  font-size: 14px; font-family: inherit;
}
.field input:focus { outline: none; border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }

.btn-primary {
  width: 100%;
  padding: 11px 0;
  border: none; border-radius: 9px;
  background: #4f46e5; color: #fff;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.15s;
}
.btn-primary:hover { background: #4338ca; }
.btn-primary:disabled { background: #9ca3af; cursor: not-allowed; }

.warn { color: #b45309; background: #fef3c7; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin: 12px 0; }

.order-info { background: #f9fafb; border-radius: 8px; padding: 12px 14px; font-size: 13px; margin-bottom: 14px; }
.order-info > div { margin: 3px 0; }

.qr-wrap { text-align: center; margin: 14px 0; }
.qr-wrap img { max-width: 220px; width: 100%; border-radius: 10px; border: 1px solid #e5e7eb; }
.qr-wrap img:not([src]), .qr-wrap img[src=""] {
  display: inline-block; min-height: 200px; min-width: 200px;
  background: #f3f4f6;
}

.pay-tabs {
  display: flex; gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
}
.pay-tab {
  flex: 1; max-width: 140px;
  border: 1.5px solid #e5e7eb;
  background: #fff;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.15s;
  font-family: inherit;
  color: #4b5563;
}
.pay-tab:hover { border-color: #6366f1; color: #111827; }
.pay-tab.active { border-color: #4f46e5; background: #eef2ff; color: #4f46e5; font-weight: 600; }
.pay-icon { font-size: 16px; }
.pay-tab[data-pay="wechat"].active { border-color: #07c160; background: #ecfdf5; color: #047857; }
.pay-tab[data-pay="alipay"].active { border-color: #1677ff; background: #eff6ff; color: #1d4ed8; }

.success { text-align: center; padding: 8px 0 4px; }
.success .check {
  width: 56px; height: 56px; border-radius: 50%;
  background: #10b981; color: #fff;
  font-size: 32px; line-height: 56px;
  margin: 0 auto 12px;
}
.success h4 { margin: 8px 0; }
.success p { margin: 6px 0; color: #4b5563; }

@media (max-width: 480px) {
  .hero { padding: 40px 0 32px; }
  .hero h1 { font-size: 26px; }
  .card { padding: 18px 18px; }
  .amounts { grid-template-columns: repeat(2, 1fr); }
}
