* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f8;
  color: #222;
}
.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
}
.top h1 {
  margin: 0;
  font-size: 24px;
}
.top p {
  margin: 8px 0 16px;
  color: #6b7280;
}
.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}
.card h2 {
  margin: 0 0 12px;
  font-size: 18px;
}
.section-title {
  margin: 0 0 8px;
  font-size: 17px;
}
.redeem-hint {
  margin: 0 0 10px;
}
.section-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 20px 0 16px;
}
.pkg-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  cursor: pointer;
}
.pkg-item.active {
  border-color: #1d4ed8;
  background: #eff6ff;
}
.pkg-name { font-weight: 700; }
.pkg-sub { color: #6b7280; font-size: 13px; margin-top: 2px; }
.pkg-price-col { text-align: right; }
.pkg-price { color: #d97706; font-weight: 700; font-size: 20px; line-height: 1.15; }
.pkg-price-tip { font-size: 11px; color: #64748b; margin-top: 2px; }
.pkg-sub strong { color: #334155; }
.buy-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 10px;
}
.buy-row label {
  min-width: 88px;
}
#username,
#password {
  width: 220px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
}
#qty {
  width: 120px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
}
.buy-row input[type="text"] {
  width: 220px;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
}
.btn {
  width: 100%;
  border: 0;
  border-radius: 999px;
  height: 42px;
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(90deg, #1d4ed8, #0ea5e9);
  font-size: 15px;
  cursor: pointer;
}
.btn-secondary {
  background: #fff;
  color: #1d4ed8;
  border: 2px solid #1d4ed8;
  margin-top: 10px;
}
.btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
#cardCodeInput {
  flex: 1;
  max-width: 100%;
  min-width: 0;
  height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 10px;
  font-size: 14px;
}
.hint {
  margin: 10px 0 0;
  font-size: 12px;
  color: #6b7280;
}
.shop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.link-btn {
  border: none;
  background: transparent;
  color: #2563eb;
  cursor: pointer;
}
.order-item {
  border-bottom: 1px solid #f1f5f9;
  padding: 10px 0;
}
.order-item:last-child { border-bottom: 0; }
.ord-title { font-size: 14px; margin: 0; }
.ord-sub { margin: 4px 0 0; font-size: 12px; color: #6b7280; }
.ord-code {
  margin: 6px 0 0;
  font-size: 13px;
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
  color: #111827;
}
.empty { color: #9ca3af; font-size: 14px; }
.order-summary {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  line-height: 1.55;
}
.order-summary.empty-sum { color: #64748b; }
.order-summary .sum-strong { font-weight: 700; color: #0f172a; }
.hint strong { font-weight: 700; color: #1e293b; }
.hint-warn {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  color: #b45309;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  max-width: 88vw;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  padding: 10px 14px;
  border-radius: 10px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
}
.toast.show { opacity: 1; }
