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

:root {
  --bg: #f3f6fb;
  --surface: #ffffff;
  --surface-soft: #f3f7fb;
  --text: #0f172a;
  --muted: #64748b;
  --border: #cfdae7;
  --border-strong: #bdcbdd;
  --blue: #2563eb;
  --blue-soft: #dbeafe;
  --blue-strong: #1d4ed8;
  --accent: #334155;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --yellow: #d97706;
  --yellow-soft: #fef3c7;
  --green: #15803d;
  --green-soft: #dcfce7;
  --shadow: 0 18px 48px rgba(15, 23, 42, 0.07);
  --shadow-soft: 0 8px 24px rgba(15, 23, 42, 0.045);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 14px;
}

body {
  font-family: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.08), transparent 30%),
    radial-gradient(circle at 88% 10%, rgba(59, 130, 246, 0.035), transparent 22%),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 100%);
  color: var(--text);
  min-height: 100vh;
}

a { color: inherit; }

main {
  max-width: 720px;
  margin: 40px auto;
  padding: 0 16px;
}

header {
  background: #fff;
  border-bottom: 1px solid #e8e8e8;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 10;
}

header h1 { font-size: 18px; font-weight: 700; color: #1a1a1a; }
header h1 span { color: #1677ff; }

#credit-badge {
  font-size: 13px;
  background: #f0f5ff;
  color: #1677ff;
  border: 1px solid #adc6ff;
  border-radius: 20px;
  padding: 4px 12px;
  display: none;
}

#credit-badge.warn { background: #fff1f0; color: #cf1322; border-color: #ffa39e; }

.packages-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.package-card {
  background: #fff;
  border: 1.5px solid #e8e8e8;
  border-radius: 12px;
  padding: 20px 16px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.package-card:hover { border-color: #1677ff; box-shadow: 0 2px 12px rgba(22,119,255,.1); }

.package-card .price {
  font-size: 22px;
  font-weight: 700;
  color: #1677ff;
  margin-bottom: 2px;
}

.package-card .searches {
  font-size: 13px;
  color: #888;
  margin-bottom: 14px;
}

.stripe-checkout-btn {
  width: 100%;
  min-height: 42px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue) 0%, #4f8cff 100%);
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.18);
  transition: transform 0.16s ease, opacity 0.16s ease, box-shadow 0.16s ease;
}

.stripe-checkout-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.24);
}

.stripe-checkout-btn:disabled {
  cursor: wait;
  opacity: 0.68;
  transform: none;
}

.package-card .label {
  font-size: 12px;
  color: #aaa;
  margin-top: 10px;
}

#toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  z-index: 100;
}

.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 24px 0;
}

.modal-overlay.open { display: flex; }

.modal-box {
  background: #fff;
  border-radius: 16px;
  padding: 32px 28px 28px;
  max-width: 560px;
  width: calc(100% - 32px);
  position: relative;
}

.modal-box h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 24px;
  color: #222;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: none;
  border: none;
  font-size: 18px;
  color: #aaa;
  cursor: pointer;
  line-height: 1;
}

.modal-close:hover { color: #444; }

@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 480px) {
  .packages-grid { grid-template-columns: 1fr; }
}
