:root {
  color-scheme: light dark;
  --canvas: #f5f8f8;
  --surface: #ffffff;
  --surface-soft: #eef5f4;
  --ink: #173338;
  --muted: #61777b;
  --line: #d8e5e3;
  --brand: #0b7381;
  --brand-strong: #075560;
  --brand-soft: #dcefee;
  --good: #14734d;
  --warn: #a24b14;
  --danger: #b42318;
  --shadow: 0 16px 44px rgb(17 61 63 / 8%);
  --radius-card: 16px;
  --radius-control: 10px;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 3px solid rgb(11 115 129 / 28%);
  outline-offset: 3px;
}

.topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 max(24px, calc((100vw - 1180px) / 2));
  background: rgb(255 255 255 / 88%);
  border-bottom: 1px solid rgb(216 229 227 / 86%);
  position: sticky;
  top: 0;
  z-index: 5;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.035em;
  white-space: nowrap;
}
.brand-mark {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--brand);
  border-radius: var(--radius-control);
  font-size: 13px;
  letter-spacing: -0.05em;
}
.topbar nav { display: flex; align-items: center; gap: 3px; }
.topbar nav button, .text-button {
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 11px;
  cursor: pointer;
  font-weight: 650;
  transition: color .16s ease, background-color .16s ease, transform .16s ease;
}
.topbar nav button:hover, .topbar nav button.is-active, .text-button:hover {
  color: var(--brand-strong);
  background: var(--brand-soft);
}
.topbar nav button:active, .text-button:active { transform: translateY(1px); }
.account { margin-left: auto; display: flex; align-items: center; gap: 12px; font-weight: 750; white-space: nowrap; }
.account span { color: var(--brand-strong); font-variant-numeric: tabular-nums; }

.page { display: none; max-width: 1180px; margin: 0 auto; padding: 58px 30px 86px; }
.page.active { display: block; }
.hero { padding: 22px 0 50px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(300px, .75fr); gap: 54px; align-items: end; }
.hero-copy { max-width: 710px; }
.eyebrow { color: var(--brand); font-size: 12px; font-weight: 800; letter-spacing: .055em; margin: 0 0 13px; }
.hero h1, .page-heading h1 { margin: 0; letter-spacing: -0.055em; line-height: 1.12; }
.hero h1 { font-size: clamp(38px, 5vw, 62px); max-width: 690px; }
.page-heading h1 { font-size: clamp(34px, 4vw, 46px); }
.lead { max-width: 630px; margin: 21px 0 25px; color: #486168; font-size: 17px; }
.subtle, .hint { color: var(--muted); font-size: 13px; }
.subtle { margin: 14px 0 0; }
.actions, .config-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.button {
  min-height: 42px;
  padding: 8px 15px;
  border: 1px solid #b9cdcb;
  border-radius: var(--radius-control);
  background: var(--surface);
  color: #28454a;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.3;
  transition: color .16s ease, background-color .16s ease, border-color .16s ease, transform .16s ease, box-shadow .16s ease;
}
.button[href] { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.button:hover { border-color: var(--brand); color: var(--brand-strong); box-shadow: 0 5px 14px rgb(11 115 129 / 10%); }
.button:active { transform: translateY(1px); box-shadow: none; }
.button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button.primary:hover { color: #fff; background: var(--brand-strong); border-color: var(--brand-strong); }
.button.small { min-height: 36px; padding: 6px 11px; }
.button.wide { width: 100%; margin-top: 18px; }
.button:disabled { opacity: .48; cursor: not-allowed; box-shadow: none; transform: none; }

.hero-summary {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.hero-summary h2 { margin: 0 0 15px; font-size: 16px; letter-spacing: -0.02em; }
.hero-summary dl { margin: 0; display: grid; gap: 14px; }
.hero-summary div { padding-left: 14px; border-left: 3px solid var(--brand-soft); }
.hero-summary dt { color: var(--muted); font-size: 13px; }
.hero-summary dd { margin: 2px 0 0; font-weight: 750; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps article, .key-panel, .card, .records, .notice { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card); }
.steps article { min-height: 212px; padding: 23px; box-shadow: 0 8px 22px rgb(17 61 63 / 4%); }
.steps article:first-child { grid-column: span 2; background: var(--surface-soft); }
.steps span { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--brand); color: #fff; font-size: 13px; font-weight: 800; }
.steps h2, .card h2, .records h2, .notice h2 { margin: 16px 0 5px; font-size: 17px; letter-spacing: -0.02em; }
.steps p, .card > p { margin: 0 0 15px; color: var(--muted); }
.trust { margin-top: 19px; padding: 7px 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; }
.trust div { padding: 15px 22px; border-left: 1px solid var(--line); }
.trust div:first-child { padding-left: 0; border-left: 0; }
.trust strong, .trust span { display: block; }
.trust strong { font-size: 14px; }
.trust span { margin-top: 3px; color: var(--muted); font-size: 13px; }

.page-heading { max-width: 690px; margin-bottom: 30px; }
.page-heading > p:last-child { margin: 13px 0 0; color: var(--muted); font-size: 16px; }
.key-panel, .card { padding: 25px; box-shadow: var(--shadow); }
.key-panel label, .card label, .dialog-card label { display: block; margin-bottom: 7px; font-weight: 750; }
.key-input { display: flex; gap: 8px; }
.key-input input { flex: 1; }
.key-panel input, .card input, .dialog-card input {
  width: 100%; min-height: 43px; padding: 9px 12px;
  border: 1px solid #b9cdcb; border-radius: var(--radius-control);
  color: var(--ink); background: var(--surface); outline: none;
}
.key-panel input::placeholder, .card input::placeholder, .dialog-card input::placeholder { color: #849698; }
.key-panel input:focus, .card input:focus, .dialog-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(11 115 129 / 14%); }
.metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 18px; }
.metric-grid article { padding: 19px; border: 1px solid var(--line); border-radius: var(--radius-card); background: var(--surface); }
.metric-grid article:first-child { background: var(--brand); border-color: var(--brand); color: #fff; }
.metric-grid span { display: block; color: var(--muted); font-size: 13px; }
.metric-grid article:first-child span { color: rgb(255 255 255 / 76%); }
.metric-grid strong { font-size: 28px; letter-spacing: -0.045em; font-variant-numeric: tabular-nums; }
.records { margin-top: 18px; padding: 23px; }
.section-title, .key-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.section-title h2, .key-row h2 { margin: 0; }
.record { display: grid; grid-template-columns: 1fr auto auto; gap: 15px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.record:last-child { border-bottom: 0; }
.record small { display: block; color: var(--muted); }
.positive { color: var(--good); }.negative { color: var(--danger); }

.two-column { display: grid; grid-template-columns: minmax(0, .84fr) minmax(0, 1.16fr); gap: 18px; align-items: start; }
.tiers { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 16px; }
.payment-methods { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 13px; }
.tier {
  min-height: 70px; padding: 11px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface); color: var(--ink);
  transition: border-color .16s ease, background-color .16s ease, transform .16s ease;
}
.tier:hover { border-color: #78aeb5; background: #f8fcfc; }
.tier:active { transform: translateY(1px); }
.tier.selected { border-color: var(--brand); background: var(--brand-soft); box-shadow: inset 0 0 0 1px var(--brand); }
.tier b, .tier small { display: block; }
.tier small { margin-top: 2px; color: var(--muted); }
.payment-methods .tier { min-height: 54px; min-width: 170px; }
.config-card { max-width: 900px; }
.model-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin: 22px 0; }
.model { display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-control); cursor: pointer; transition: border-color .16s ease, background-color .16s ease; }
.model:hover { border-color: #78aeb5; background: #f8fcfc; }
.model:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.model input { width: auto; min-height: auto; margin-top: 4px; accent-color: var(--brand); }
.model small { display: block; color: var(--muted); }
.config-actions { padding-top: 20px; border-top: 1px solid var(--line); }
.desktop-bridge { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; padding: 17px; border: 1px solid var(--line); border-radius: var(--radius-control); background: var(--surface-soft); }
.desktop-bridge strong, .desktop-bridge span { display: block; }.desktop-bridge span { margin-top: 3px; color: var(--muted); font-size: 13px; }
.manual-config { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.manual-config summary { color: var(--muted); cursor: pointer; font-weight: 700; }
.manual-config summary:hover { color: var(--brand-strong); }
.manual-config > p { color: var(--muted); margin: 13px 0 0; }
.manual-config .config-actions { margin-top: 16px; padding-top: 0; border-top: 0; }
pre { margin: 20px 0 0; padding: 18px; overflow: auto; border-radius: var(--radius-control); background: #15353a; color: #def1ee; font: 12px/1.55 ui-monospace, Consolas, monospace; }
.notice { max-width: 900px; margin-top: 20px; padding: 23px; box-shadow: none; }
.notice h2 { margin-top: 0; }.notice li { margin: 7px 0; }.notice ol { padding-left: 20px; }
code { font-family: ui-monospace, Consolas, monospace; }

dialog { width: min(500px, calc(100% - 32px)); max-width: none; padding: 0; border: 0; background: transparent; }
dialog::backdrop { background: rgb(18 45 48 / 52%); backdrop-filter: blur(4px); }
.dialog-card { padding: 28px; border-radius: var(--radius-card); background: var(--surface); box-shadow: 0 24px 70px rgb(5 42 46 / 30%); }
.dialog-card h2 { margin: 0 0 10px; letter-spacing: -0.03em; }.dialog-card p { color: var(--muted); }.dialog-card input { margin-bottom: 15px; }
.dialog-card code { display: block; word-break: break-all; margin: 17px 0; padding: 13px; border-radius: 8px; background: var(--surface-soft); color: var(--brand-strong); font-size: 13px; }
.warning { color: var(--warn) !important; font-size: 13px; }.close { float: right; border: 0; background: none; color: var(--muted); font-size: 25px; cursor: pointer; }
.toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; padding: 11px 16px; transform: translate(-50%, 20px); border-radius: var(--radius-control); background: #173338; color: #fff; box-shadow: 0 12px 30px rgb(17 61 63 / 24%); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-color-scheme: dark) {
  :root { --canvas: #102427; --surface: #173136; --surface-soft: #1b3c40; --ink: #e5f1ef; --muted: #a6c1bd; --line: #315357; --brand: #38aab5; --brand-strong: #72d4dc; --brand-soft: #1d4d52; --good: #73d6a0; --warn: #f1a86f; --danger: #ff998e; --shadow: 0 16px 42px rgb(0 0 0 / 18%); }
  .topbar { background: rgb(16 36 39 / 88%); border-color: rgb(49 83 87 / 80%); }.brand-mark { color: #08282c; }.lead { color: #bfd3d0; }
  .button, .tier, .key-panel input, .card input, .dialog-card input { color: var(--ink); background: var(--surface); border-color: #48696b; }
  .button:hover, .tier:hover, .model:hover { background: #1a3c40; }.button.primary { color: #08282c; }.metric-grid article:first-child { color: #08282c; }.metric-grid article:first-child span { color: rgb(8 40 44 / 72%); }
  .model:has(input:checked), .tier.selected { background: var(--brand-soft); }.dialog-card code { color: var(--brand-strong); }.toast { background: #dff0ed; color: #153136; }.notice, .hero-summary, .steps article, .metric-grid article, .records, .key-panel, .card { background: var(--surface); }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; } }
@media (max-width: 820px) {
  .topbar { gap: 16px; padding: 0 18px; }.topbar nav { order: 3; width: 100%; overflow-x: auto; margin: -4px 0 10px; }.topbar { flex-wrap: wrap; padding-top: 10px; }.account { margin-left: auto; }
  .page { padding: 42px 18px 70px; }.hero-grid, .two-column { grid-template-columns: 1fr; gap: 22px; }.hero { padding-top: 4px; }.hero-summary { max-width: 680px; }.steps article:first-child { grid-column: span 1; }.steps, .metric-grid, .model-list { grid-template-columns: repeat(2, 1fr); }.trust { grid-template-columns: 1fr; }.trust div, .trust div:first-child { padding: 14px 0; border-left: 0; border-top: 1px solid var(--line); }.trust div:first-child { border-top: 0; }
}
@media (max-width: 560px) {
  .topbar { min-height: 64px; }.brand { font-size: 16px; }.account span { display: none; }.page { padding: 34px 16px 62px; }.hero h1 { font-size: 39px; }.lead { font-size: 16px; }.steps, .metric-grid, .model-list, .tiers { grid-template-columns: 1fr; }.steps article { min-height: 0; }.key-input { flex-wrap: wrap; }.key-input input { flex: auto; width: 100%; }.key-input .button { flex: 1; }.record { grid-template-columns: 1fr auto; }.record small { grid-column: 1 / -1; grid-row: 2; }.record > span:last-child { grid-column: 2; grid-row: 1; font-size: 12px; }.key-row, .section-title, .desktop-bridge { align-items: flex-start; flex-direction: column; }.payment-methods .tier { width: 100%; }.actions .button, .desktop-bridge .button { width: 100%; }.dialog-card { padding: 23px; }
}
