/* 和许愿池一致：池水蓝为主，硬币金只用在最主要的按钮上 */
:root {
  --bg: #f3f6fa;
  --surface: #ffffff;
  --ink: #1b2433;
  --ink-2: #465267;
  --muted: #6b7489;
  --line: #e2e7ef;
  --line-strong: #cdd5e2;
  --soft: #f5f8fc;

  --pool-1: #0a3556;
  --pool-2: #125c93;
  --pool-3: #2a83c2;
  --pool-soft: #e8f2fb;

  --gold: #efb030;
  --gold-deep: #d99a14;
  --gold-ink: #3a2800;
  --gold-soft: #fff5dc;

  --ok: #15803d;
  --ok-soft: #e9f7ee;
  --warn: #b45309;
  --warn-soft: #fff4e5;
  --bad: #c2410c;
  --bad-soft: #fff1ea;

  --radius: 14px;
  --shadow-md: 0 4px 14px rgba(15, 30, 55, .07), 0 1px 3px rgba(15, 30, 55, .05);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SFMono-Regular", monospace;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); color: var(--ink); font: 14px/1.65 var(--font); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--pool-2); }
h2, h3 { margin: 0; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; margin-top: 10px; }
.small-inline { font-size: 12.5px; }

/* ---------- 顶部：池水 ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  padding: 18px 28px 92px;
  background:
    radial-gradient(ellipse 60% 55% at 50% 120%, rgba(120, 190, 240, .35), transparent 70%),
    linear-gradient(165deg, var(--pool-1) 0%, var(--pool-2) 62%, var(--pool-3) 100%);
}
.hero::after {
  content: ""; position: absolute; left: 50%; bottom: -80px; width: 900px; height: 200px; transform: translateX(-50%);
  border: 1px solid rgba(255, 255, 255, .12); border-radius: 50%; pointer-events: none;
}
.hero-bar { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1040px; margin: 0 auto; }
.brand { display: block; padding: 7px 12px; background: #fff; border-radius: 10px; box-shadow: 0 4px 16px rgba(4, 24, 44, .25); }
.brand img { display: block; height: 28px; width: auto; }
.hero-right { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 13px; color: rgba(255, 255, 255, .85); }
#who-email { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-btn {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .4); color: #fff; font-size: 13px; text-decoration: none;
}
.hero-btn:hover { background: rgba(255, 255, 255, .2); border-color: #fff; }
.hero-text { position: relative; z-index: 1; max-width: 720px; margin: 30px auto 0; text-align: center; }
.hero-text h1 { margin: 0; font-size: 34px; font-weight: 700; letter-spacing: .08em; display: inline-flex; align-items: center; gap: 12px; }
.hero-text p { margin-top: 8px; font-size: 15px; opacity: .85; }
.env { font-size: 12px; font-weight: 600; letter-spacing: 0; color: var(--gold-ink); background: var(--gold); border-radius: 999px; padding: 1px 10px; }
.waves { position: absolute; left: 0; bottom: -1px; width: 100%; height: 64px; display: block; }
.wave-back { fill: rgba(243, 246, 250, .45); }
.wave-front { fill: var(--bg); }

/* ---------- 内容 ---------- */
main { position: relative; z-index: 3; flex: 1; width: 100%; max-width: 760px; margin: -56px auto 0; padding: 0 16px 40px; display: grid; gap: 16px; align-content: start; }
.stack { display: grid; gap: 16px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-md); padding: 24px 26px; min-width: 0; }
.card.narrow { width: 100%; max-width: 460px; justify-self: center; }
.card.center { display: grid; place-items: center; min-height: 180px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 4px; }
.card-title { font-size: 18px; font-weight: 700; }
.card-title + .muted { margin-top: 4px; }
.footer { padding: 8px 16px 28px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- 按钮与表单 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px; border: 1px solid transparent; border-radius: 9px;
  font-weight: 600; font-size: 14px; line-height: 1; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background-color .15s, border-color .15s, box-shadow .15s, transform .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:focus-visible, .tab:focus-visible, .seg-btn:focus-visible, .link:focus-visible, .hero-btn:focus-visible { outline: 3px solid rgba(42, 131, 194, .35); outline-offset: 2px; }
.btn-primary { background: var(--pool-2); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--pool-1); }
.btn-gold { background: var(--gold); color: var(--gold-ink); box-shadow: 0 6px 16px rgba(239, 176, 48, .3); }
.btn-gold:hover:not(:disabled) { background: var(--gold-deep); transform: translateY(-1px); }
.btn-ghost { background: var(--surface); border-color: var(--line-strong); color: var(--ink-2); font-weight: 500; }
.btn-ghost:hover:not(:disabled) { border-color: var(--pool-3); color: var(--pool-2); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 46px; font-size: 16px; letter-spacing: .06em; }
.btn-block { width: 100%; margin-top: 20px; }
.link { border: 0; background: none; padding: 0; color: var(--pool-2); cursor: pointer; white-space: nowrap; }
.link:hover { text-decoration: underline; }
.row-links { display: flex; justify-content: space-between; gap: 12px; margin-top: 14px; font-size: 13px; }

.label { display: block; margin: 16px 0 6px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
input {
  width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 9px;
  background: var(--surface); outline: none; transition: border-color .15s, box-shadow .15s;
}
input:focus { border-color: var(--pool-3); box-shadow: 0 0 0 3px rgba(42, 131, 194, .15); }
input::placeholder { color: #9aa3b5; }
.email-input { display: flex; }
.email-input input { border-radius: 9px 0 0 9px; min-width: 0; }
.suffix { display: grid; place-items: center; padding: 0 12px; border: 1px solid var(--line-strong); border-left: 0; border-radius: 0 9px 9px 0; background: var(--soft); color: var(--muted); white-space: nowrap; }
.code { font-size: 22px; letter-spacing: 8px; text-align: center; font-variant-numeric: tabular-nums; }
.turnstile { margin-top: 16px; min-height: 65px; }
.form-title { font-size: 18px; font-weight: 700; margin-top: 6px; }
.form-hint { margin-top: 14px; }
.form-title:not([hidden]) + .form-hint { margin-top: 4px; }

.tabs { display: flex; gap: 4px; padding: 4px; margin-bottom: 4px; background: var(--soft); border: 1px solid var(--line); border-radius: 11px; }
.tab { flex: 1; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); font-weight: 600; cursor: pointer; }
.tab.active { background: var(--surface); color: var(--pool-1); box-shadow: 0 1px 3px rgba(15, 30, 55, .1); }

.notice { margin-top: 14px; padding: 10px 12px; border-radius: 9px; background: var(--pool-soft); color: var(--pool-1); font-size: 13px; }
.notice.warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- 申请 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin-top: 18px; }
.stat { padding: 12px 14px; border-radius: 11px; background: var(--soft); border: 1px solid var(--line); }
.stat-label { display: block; font-size: 12px; color: var(--muted); }
.stat-value { display: block; margin-top: 2px; font-size: 14px; font-weight: 600; }
.stat-value b { font-size: 22px; margin-right: 2px; font-variant-numeric: tabular-nums; }
.stat-value small { font-weight: 400; color: var(--muted); margin-left: 2px; }

/* ---------- Key与额度 ---------- */
.badge { font-size: 12px; font-weight: 600; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.badge.ok { color: var(--ok); background: var(--ok-soft); }
.badge.warn { color: var(--warn); background: var(--warn-soft); }
.badge.bad { color: var(--bad); background: var(--bad-soft); }
.key-box { display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 8px 8px 8px 14px; border-radius: 11px; background: var(--soft); border: 1px solid var(--line); }
.key-box code { flex: 1; min-width: 0; font: 13.5px/1.5 var(--mono); word-break: break-all; color: var(--ink); }
.key-actions { display: flex; gap: 6px; flex: none; }

.quota { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.quota-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.quota-main { display: flex; align-items: baseline; gap: 8px; font-variant-numeric: tabular-nums; }
.quota-label { font-size: 13px; color: var(--muted); }
.quota-main b { font-size: 30px; line-height: 1.1; color: var(--pool-1); }
.quota-side { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#q-result { margin-bottom: 2px; }
#q-result .small { margin-top: 8px; }
.chip { font-size: 12.5px; color: var(--pool-2); background: var(--pool-soft); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.meter { height: 8px; background: #e9eef5; border-radius: 999px; overflow: hidden; }
#meter-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--pool-3), var(--pool-2)); border-radius: 999px; transition: width .4s; }
#meter-bar.high { background: var(--gold-deep); }
#meter-bar.full { background: var(--bad); }

/* ---------- 使用步骤 ---------- */
.steps { list-style: none; margin: 18px 0 0; padding: 0; counter-reset: step; }
.steps li { position: relative; display: flex; align-items: center; gap: 16px; padding: 0 0 22px 46px; counter-increment: step; }
.steps li:last-child { padding-bottom: 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--pool-soft); color: var(--pool-2); font-weight: 700; font-size: 14px;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 14.5px; top: 36px; bottom: 6px; width: 1px; background: var(--line-strong); }
.step-body { flex: 1; min-width: 0; padding-top: 4px; }
.step-body h3 { font-size: 15px; font-weight: 700; }
.step-body p { margin-top: 2px; }
.steps .btn { flex: none; min-width: 132px; }
.fields { margin: 10px 0 0; border: 1px solid var(--line); border-radius: 11px; background: var(--soft); overflow: hidden; }
.fields > div { display: grid; grid-template-columns: 96px 1fr; align-items: center; gap: 12px; padding: 6px 6px 6px 14px; }
.fields > div + div { border-top: 1px solid var(--line); }
.fields dt { font-size: 12.5px; color: var(--muted); }
.fields dd { margin: 0; display: flex; align-items: center; gap: 10px; min-width: 0; min-height: 32px; }
.fields code { flex: 1; min-width: 0; font: 13px var(--mono); color: var(--ink); word-break: break-all; }
.fields .btn { min-width: 0; }
.fields dd > span { padding-right: 8px; }

.more { margin-top: 22px; border: 1px solid var(--line); border-radius: 11px; padding: 0 14px; background: var(--soft); }
.more summary { cursor: pointer; padding: 11px 0; font-size: 13px; color: var(--ink-2); list-style: none; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: '›'; display: inline-block; width: 14px; transition: transform .15s; }
.more[open] summary::before { transform: rotate(90deg); }
.more[open] { padding-bottom: 14px; }
.more .small { margin: 0 0 10px; }
.urls { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.urls li { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); }
.urls code { flex: 1; min-width: 0; font: 13px var(--mono); word-break: break-all; }

/* ---------- 价格 ---------- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.seg-btn { height: 32px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; white-space: nowrap; }
.seg-btn:hover { border-color: var(--pool-3); color: var(--pool-2); }
.seg-btn.active { background: var(--pool-2); border-color: var(--pool-2); color: #fff; }
.table-wrap { overflow-x: auto; margin-top: 12px; }
.prices { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.prices th { text-align: right; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 10px; background: var(--soft); white-space: nowrap; }
.prices th:first-child { border-radius: 8px 0 0 8px; }
.prices th:last-child { border-radius: 0 8px 8px 0; }
.prices td { text-align: right; padding: 10px; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: top; }
.prices th:first-child, .prices td:first-child { text-align: left; }
.prices tr:last-child td { border-bottom: 0; }
.prices .model { white-space: normal; min-width: 140px; font-weight: 600; }
.prices .note { font-size: 12px; font-weight: 400; color: var(--muted); margin-top: 2px; }
.prices .tag { display: inline-block; margin-left: 6px; font-size: 11px; font-weight: 600; color: var(--warn); background: var(--warn-soft); border-radius: 4px; padding: 0 5px; line-height: 18px; vertical-align: 1px; }
.prices .tag-bad { color: var(--bad); background: var(--bad-soft); }
.prices .pricey { color: var(--bad); font-weight: 700; }
.pricey-box { margin-top: 14px; padding: 14px 16px; border-radius: 11px; background: var(--bad-soft); border: 1px solid #f6c9b3; border-left: 4px solid var(--bad); }
.pricey-box h3 { font-size: 15px; font-weight: 700; color: var(--bad); }
.pricey-box h3::before { content: "⚠"; margin-right: 6px; }
.pricey-box p { margin-top: 4px; color: var(--ink-2); font-size: 13px; }
.pricey-list { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pricey-list li { padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid #f6c9b3; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.pricey-list b { color: var(--ink); font-weight: 600; }
.pricey-list .times { margin-left: 6px; color: var(--bad); font-weight: 700; }
#price-notes a { margin-left: 4px; }

/* ---------- 其他 ---------- */
.toast {
  position: fixed; left: 50%; top: 16px; transform: translateX(-50%); z-index: 20;
  max-width: calc(100vw - 32px); padding: 10px 18px; border-radius: 10px;
  background: var(--ink); color: #fff; font-size: 14px; box-shadow: 0 10px 30px rgba(15, 30, 55, .25);
}
.toast.error { background: var(--bad); }
.spinner { width: 28px; height: 28px; border: 3px solid var(--line); border-top-color: var(--pool-3); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .hero { padding: 12px 16px 84px; }
  .brand { padding: 5px 9px; border-radius: 8px; }
  .brand img { height: 22px; }
  .hero-btn { height: 30px; padding: 0 11px; font-size: 12.5px; }
  #who-email { max-width: 40vw; }
  #home-link { display: none; }
  .hero-text { margin-top: 22px; }
  .hero-text h1 { font-size: 26px; }
  .hero-text p { font-size: 13.5px; }
  .card { padding: 20px 16px; }
  .key-box { flex-direction: column; align-items: stretch; }
  .key-actions .btn { flex: 1; }
  .steps li { flex-direction: column; align-items: stretch; gap: 10px; }
  .steps .btn { align-self: flex-start; }
  .steps .fields .btn { align-self: center; }
  .fields > div { grid-template-columns: 1fr; gap: 0; padding: 8px 6px 8px 12px; }
  .prices { font-size: 13px; }
  .prices th, .prices td { padding: 8px 5px; }
  .prices .model { min-width: 0; }
  .prices .note { font-size: 11px; }
}
