:root {
  --ink: #0a0a0a;
  --blue: #0271e4;
  --blue-hover: #0264cc;
  --mint: #e0f2ef;
  --muted: #5c6b6b;
  --footer-ink: #0f1a1a;
  --gray: #9ca3af;
  --line: rgba(15, 26, 26, 0.12);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  color: var(--ink);
  font-family: system-ui, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #fff;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar {
  position: fixed;
  z-index: 40;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-size: 18px;
}
.brand svg { display: block; }
.topbar.on-dark .brand { color: #fff; }
.topbar.on-dark .brand-mark { stroke: #fff; }
.actions { display: flex; align-items: center; gap: 10px; }
.pill, .pill-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #000;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow);
  text-decoration: none;
}
.pill:hover, .pill-link:hover { background: #f7f7f7; }

.hero {
  display: flex;
  min-height: 100dvh;
  justify-content: center;
  background: radial-gradient(120% 90% at 50% 12%, #d9efff, #eef7ff 32%, #bbe0fc 68%, #76c1fd);
}
.hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 760px;
  padding: clamp(148px, 24vh, 250px) 24px 88px;
  text-align: center;
}
.hero h1 {
  margin: 0;
  font-family: Ubuntu, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 38px;
  font-weight: 400;
  line-height: 1.15;
}
.hero h2 {
  margin: 16px 0 0;
  font-family: Ubuntu, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 48px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.hero .sub {
  max-width: 520px;
  margin: 22px 0 0;
  color: #1f2937;
  font-size: 16px;
  line-height: 1.6;
  text-wrap: balance;
}
.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 36px;
  min-width: 176px;
  height: 48px;
  padding: 0 22px;
  border-radius: 7px;
  background: var(--blue);
  color: #fff;
  font-size: 20px;
  font-weight: 500;
  text-decoration: none;
}
.cta:hover { background: var(--blue-hover); }

.features { background: #000; padding: 96px 40px; }
.feature-grid {
  display: grid;
  max-width: 1100px;
  margin: 0 auto;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px;
  text-align: center;
}
.feature h3 { margin: 22px 0 12px; color: #fff; font-size: 24px; }
.feature p { margin: 0; color: var(--gray); font-size: 17px; line-height: 1.6; }

.steps { padding: 88px 24px; background: #fff; }
.steps-inner { max-width: 1100px; margin: 0 auto; }
.steps h2 {
  margin: 0 0 28px;
  font-family: Ubuntu, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 32px;
  font-weight: 700;
  text-align: center;
}
.step-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}
.step {
  padding: 22px 20px 20px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
}
.step b {
  display: block;
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 13px;
  letter-spacing: 0.04em;
}
.step h3 { margin: 0 0 8px; font-size: 18px; }
.step p { margin: 0; color: #4b5563; font-size: 15px; line-height: 1.6; }

.site-footer { background: var(--mint); padding: 56px 24px 40px; }
.footer-inner { max-width: 1100px; margin: 0 auto; }
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #111;
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
}
.company {
  margin: 28px 0 48px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}
.copy { margin: 0; color: var(--muted); font-size: 14px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 28px; }
.footer-nav a { color: var(--footer-ink); font-size: 14px; text-decoration: none; }
.footer-nav a:hover { opacity: 0.6; }

.page {
  min-height: 100dvh;
  background: radial-gradient(120% 90% at 50% 0%, #eef7ff, #d7ecff 72%, #b9ddfb);
}
.card {
  width: min(440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 24px 24px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 40, 70, 0.12);
}
.page-center {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100dvh;
  padding: 96px 16px 40px;
}
.card h1 {
  margin: 0 0 8px;
  font-family: Ubuntu, "Segoe UI", "PingFang SC", sans-serif;
  font-size: 28px;
}
.lede { margin: 0 0 18px; color: #4b5563; font-size: 14px; line-height: 1.6; }
label { display: block; margin: 14px 0 6px; font-size: 13px; color: #374151; }
input[type="text"],
input[type="password"],
input[type="number"],
input:not([type]) {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  background: #fff;
  color: #111;
  font-size: 15px;
  font-family: inherit;
  appearance: none;
}
input:focus { outline: 2px solid rgba(2, 113, 228, 0.35); border-color: var(--blue); }
.submit {
  width: 100%;
  height: 46px;
  margin-top: 18px;
  border: 0;
  border-radius: 10px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
}
.submit:hover { background: var(--blue-hover); }
.submit:disabled { background: #93c5fd; cursor: not-allowed; }
.switch { margin: 16px 0 0; text-align: center; font-size: 14px; color: #4b5563; }
.switch a { color: var(--blue); text-decoration: none; }
.msg { margin: 0 0 14px; padding: 10px 12px; border-radius: 8px; font-size: 13px; line-height: 1.5; }
.msg.error { background: #fde8e8; color: #9f1239; }
.msg.ok { background: #e8f6ee; color: #166534; }

.dash { min-height: 100dvh; padding: 108px 16px 64px; background: radial-gradient(120% 90% at 50% 0%, #eef7ff, #d7ecff 70%, #c5e4fb); }
.dash-wrap { width: min(760px, 100%); margin: 0 auto; }
.hello { margin: 0 0 14px; color: #374151; font-size: 15px; }
.balance {
  padding: 22px 22px 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(15, 40, 70, 0.1);
}
.balance-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.recharge-btn { width: auto; min-width: 88px; height: 40px; margin: 8px 0 0; padding: 0 18px; }
.recharge-form { margin-top: 16px; padding-top: 4px; border-top: 1px solid #eef2f7; }
.recharge-form[hidden] { display: none; }
.secret-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.amount-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
.recharge-form .submit { width: auto; min-width: 120px; padding: 0 18px; }
.turnstile-wrap { display: flex; justify-content: center; min-height: 65px; margin: 14px 0 4px; }
.recharge-list { margin-top: 14px; }
.recharge-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid #eef2f7;
  font-size: 13px;
}
.recharge-item .key-meta { white-space: nowrap; }
.status {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 12px;
}
.status.ok { background: #e8f6ee; color: #166534; }
.status.queue { background: #eef4ff; color: #1d4ed8; }
.status.wait { background: #e0f2fe; color: #075985; }
.status.fail { background: #fde8e8; color: #9f1239; }
.status.muted { background: #f3f4f6; color: #4b5563; }
.preview-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 13px;
  line-height: 1.5;
}
.preview-note a { color: #c2410c; }
.admin-sub { margin: 28px 0 12px; font-size: 18px; }
.balance span { color: #6b7280; font-size: 13px; }
.balance strong {
  display: block;
  margin-top: 4px;
  font-family: Ubuntu, "Segoe UI", sans-serif;
  font-size: 42px;
  letter-spacing: -0.03em;
}
.balance p { margin: 8px 0 0; color: #6b7280; font-size: 13px; }
.block {
  margin-top: 16px;
  padding: 20px 22px 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(15, 40, 70, 0.06);
}
.block h2 { margin: 0 0 14px; font-size: 18px; }
.create-row { display: flex; gap: 10px; }
.create-row input { flex: 1; }
.create-row .submit { width: auto; min-width: 96px; margin-top: 0; padding: 0 18px; }
.empty { margin: 0; color: #6b7280; font-size: 14px; }
.key {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 14px 0;
  border-top: 1px solid #eef2f7;
}
.key:first-of-type { border-top: 0; padding-top: 0; }
.key.is-new { margin: 0 -10px; padding: 12px 10px; border: 1px solid #86efac; border-radius: 12px; background: #f0fdf4; }
.key-name { font-weight: 600; font-size: 14px; }
.key-meta { color: #9ca3af; font-weight: 400; font-size: 12px; }
.key code {
  grid-column: 1 / -1;
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f8fafc;
  color: #111827;
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 13px;
  word-break: break-all;
}
.key-actions { display: flex; gap: 8px; }
.text-btn, .danger-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: #fff;
  font-size: 13px;
}
.text-btn:hover { background: #f9fafb; }
.danger-btn { color: #9f1239; }
.admin-card { width: min(840px, calc(100% - 32px)); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px 8px; border-bottom: 1px solid #eef2f7; text-align: left; vertical-align: middle; }
th { color: #6b7280; font-weight: 600; font-size: 12px; }
.balance-form { display: flex; gap: 8px; align-items: center; }
.balance-form input { width: 120px; height: 36px; }
.balance-form .submit { width: auto; height: 36px; margin: 0; padding: 0 12px; font-size: 13px; }
.table-wrap { overflow-x: auto; }

@media (min-width: 768px) {
  .hero { min-height: clamp(680px, 51.4vw, 920px); }
}
@media (max-width: 800px) {
  .hero h1 { font-size: 30px; }
  .hero h2 { font-size: 34px; }
  .feature-grid, .step-grid { grid-template-columns: 1fr; max-width: 520px; }
  .features { padding: 72px 24px; }
  .footer-bottom { align-items: flex-start; flex-direction: column; }
  .secret-row, .amount-row { grid-template-columns: 1fr; }
  .recharge-item { align-items: flex-start; flex-direction: column; }
  .create-row { flex-direction: column; }
  .create-row .submit { width: 100%; }
  .key { grid-template-columns: 1fr; }
}
