:root {
  color-scheme: light;
  --page: #f2f5f7;
  --surface: #ffffff;
  --surface-soft: #f7f9fb;
  --ink: #101820;
  --muted: #5d6b78;
  --line: #d6dee5;
  --line-strong: #b9c5cf;
  --accent: #155eef;
  --accent-dark: #1249b8;
  --accent-soft: #edf3ff;
  --success: #147d64;
  --success-soft: #e9f7f2;
  --warning: #a15c00;
  --warning-soft: #fff6e5;
  --danger: #b42318;
  --shadow: 0 18px 44px rgba(16, 24, 32, 0.08);
  --radius-lg: 22px;
  --radius-md: 15px;
  --content: 1160px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(rgba(16, 24, 32, 0.035) 1px, transparent 1px),
    var(--page);
  background-size: 100% 48px;
  font-family:
    "Noto Sans CJK SC",
    "Source Han Sans SC",
    "Microsoft YaHei",
    sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  width: min(var(--content), calc(100% - 36px));
  margin: 0 auto;
  padding: 20px 0 48px;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto minmax(210px, 1fr);
  align-items: center;
  gap: 20px;
  min-height: 68px;
  padding: 10px 12px;
  border: 1px solid rgba(185, 197, 207, 0.86);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 28px rgba(16, 24, 32, 0.07);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 11px;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--ink);
  font-size: 17px;
  font-weight: 850;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 1px;
  color: var(--muted);
  font-size: 11px;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-links a {
  padding: 8px 11px;
  border-radius: 9px;
  color: #43515e;
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}

.nav-links a:hover {
  color: var(--ink);
  background: var(--surface-soft);
}

.nav-actions {
  display: flex;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: var(--ink);
  background: var(--surface);
  cursor: pointer;
  font-weight: 720;
  text-decoration: none;
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    transform 150ms ease;
}

.button:hover:not(:disabled) {
  border-color: #8fa0ae;
  transform: translateY(-1px);
}

.button.primary {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.button.primary:hover:not(:disabled) {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.button.subtle {
  color: #34414d;
  background: var(--surface-soft);
}

.button.wide {
  width: 100%;
}

.button:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.54;
  transform: none;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(21, 94, 239, 0.26);
  outline-offset: 3px;
}

main {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(310px, 0.72fr);
  overflow: hidden;
}

.hero-copy {
  min-width: 0;
  padding: clamp(30px, 5vw, 62px);
}

.eyebrow,
.capability-code,
.flow-label,
.card-kicker {
  margin: 0;
  color: var(--accent-dark);
  font-family: "JetBrains Mono", "Noto Sans Mono CJK SC", monospace;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  margin: 16px 0 0;
  font-size: clamp(36px, 5.1vw, 68px);
  font-weight: 820;
  letter-spacing: -0.055em;
  line-height: 1.04;
}

.lead {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 1.6vw, 19px);
  line-height: 1.75;
}

.account-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: stretch;
  margin-top: 38px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.flow-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 11px;
  min-width: 0;
  padding: 22px 8px 22px 0;
}

.flow-index {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #4d5c68;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  font-weight: 800;
}

.flow-node h2 {
  margin: 5px 0 0;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.flow-node p:not(.flow-label) {
  min-height: 56px;
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.flow-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  color: var(--success);
  font-size: 12px;
  font-weight: 750;
}

.flow-state::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.flow-state.neutral {
  color: #657684;
}

.flow-connector {
  display: grid;
  place-items: center;
  color: #93a0ab;
  font-size: 19px;
}

.account-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 28px;
  border-left: 1px solid var(--line);
  background: #101820;
  color: #f7f9fb;
}

.summary-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 9px;
  border: 1px solid rgba(67, 213, 170, 0.34);
  border-radius: 999px;
  color: #8ce7c7;
  background: rgba(20, 125, 100, 0.18);
  font-size: 12px;
  font-weight: 800;
}

.state-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.state-pill.signed-out {
  border-color: rgba(255, 198, 109, 0.32);
  color: #ffd188;
  background: rgba(161, 92, 0, 0.2);
}

.summary-kind {
  color: #9cabb7;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-identity {
  margin-top: 44px;
}

.summary-identity > p:first-child {
  margin: 0;
  color: #91a1ae;
  font-size: 12px;
}

.summary-identity h2 {
  margin: 8px 0 0;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.04em;
  line-height: 1.15;
}

.summary-identity > p:last-child {
  margin: 14px 0 0;
  color: #b8c3cc;
  font-size: 13px;
  line-height: 1.65;
}

.summary-facts {
  display: grid;
  gap: 0;
  margin: 34px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.summary-facts div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.summary-facts dt {
  color: #91a1ae;
  font-size: 12px;
}

.summary-facts dd {
  max-width: 170px;
  margin: 0;
  text-align: right;
  font-size: 13px;
  font-weight: 760;
}

.quota-hint {
  margin: 12px 0 0;
  color: #91a1ae;
  font-size: 12px;
  line-height: 1.6;
}

.summary-actions {
  margin-top: auto;
  padding-top: 30px;
}

.account-summary .button.primary {
  border-color: #fff;
  color: var(--ink);
  background: #fff;
}

.account-summary .button.primary:hover {
  border-color: #dbe5eb;
  background: #dbe5eb;
}

.message {
  min-height: 20px;
  margin-top: 14px;
  color: #aab6c0;
  font-size: 12px;
  line-height: 1.55;
}

.message.ok {
  color: #8ce7c7;
}

.message.error {
  color: #ffaaa3;
}

.section-block {
  padding: 30px 0 6px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  padding: 0 4px 18px;
}

.section-heading.compact {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--line);
}

.section-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(27px, 3vw, 40px);
  letter-spacing: -0.04em;
  line-height: 1.12;
}

.section-heading > p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--surface);
}

.capability-card {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  padding: 23px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.capability-card.important {
  box-shadow: inset 0 3px 0 var(--accent);
}

.capability-card.quota-card {
  background: var(--accent-soft);
}

.capability-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status-text {
  color: var(--success);
  font-size: 11px;
  font-weight: 760;
}

.status-text.neutral {
  color: #657684;
}

.capability-card h3 {
  margin: 28px 0 0;
  font-size: 21px;
  letter-spacing: -0.025em;
}

.capability-card > p:not(.card-note) {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.card-note {
  margin: auto 0 0;
  padding-top: 24px;
  color: #768692;
  font-size: 12px;
  line-height: 1.6;
}

.text-action {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 7px;
  margin-top: auto;
  padding-top: 24px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 780;
  text-decoration: none;
}

.text-action:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.card-value {
  display: block;
  margin-top: 18px;
  font-size: clamp(27px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.session-guide,
.recharge-section {
  padding: clamp(24px, 4vw, 38px);
}

.scope-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.scope-list article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  padding: 24px 24px 4px 0;
}

.scope-list article + article {
  padding-left: 24px;
  border-left: 1px solid var(--line);
}

.scope-marker {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: #536371;
  font-size: 11px;
  font-weight: 800;
}

.scope-list h3 {
  margin: 0;
  font-size: 17px;
}

.scope-list p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.login-gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 20px;
  padding: 16px;
  border: 1px solid #f0cf91;
  border-radius: var(--radius-md);
  color: #6f4307;
  background: var(--warning-soft);
}

.login-gate p {
  margin: 0;
  line-height: 1.6;
}

.recharge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.recharge-card {
  display: grid;
  gap: 26px;
  min-height: 280px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

body:not(.is-signed-in) .recharge-card {
  background: #fafbfc;
}

.recharge-card h3 {
  margin: 7px 0 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.recharge-card > div > p:not(.card-kicker) {
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.65;
}

.form {
  display: grid;
  align-content: end;
  gap: 11px;
}

.form label {
  color: #45545f;
  font-size: 12px;
  font-weight: 760;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 9px;
}

input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface);
  outline: none;
}

input:focus {
  border-color: var(--accent);
}

.amounts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  color: #40505d;
  background: var(--surface);
  cursor: pointer;
  font-size: 12px;
  font-weight: 740;
}

.chip.active {
  border-color: var(--accent);
  color: #fff;
  background: var(--accent);
}

.method-list {
  display: grid;
  gap: 8px;
}

.method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
}

.muted {
  color: var(--muted);
}

footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

footer p {
  max-width: 720px;
  margin: 0;
}

footer a {
  white-space: nowrap;
  color: var(--accent-dark);
  font-weight: 750;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

body.is-signed-in .signed-out-only,
body:not(.is-signed-in) .signed-in-only {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
  }

  .account-summary {
    min-height: 420px;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .capability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  html {
    scroll-padding-top: 84px;
  }

  .shell {
    width: min(100% - 22px, 620px);
    padding-top: 10px;
  }

  .topbar {
    top: 7px;
    min-height: 62px;
    border-radius: 14px;
  }

  .brand small {
    display: none;
  }

  .nav-actions .button {
    min-height: 40px;
    padding: 0 12px;
    font-size: 12px;
  }

  main {
    margin-top: 14px;
  }

  .hero-copy,
  .account-summary,
  .session-guide,
  .recharge-section {
    padding: 23px;
  }

  h1 {
    font-size: clamp(34px, 11vw, 48px);
  }

  .account-flow {
    grid-template-columns: 1fr;
    border-bottom: 0;
  }

  .flow-node {
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
  }

  .flow-node p:not(.flow-label) {
    min-height: auto;
  }

  .flow-connector {
    display: none;
  }

  .section-heading,
  .section-heading.compact {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .capability-grid,
  .recharge-grid,
  .scope-list {
    grid-template-columns: 1fr;
  }

  .capability-card {
    min-height: 250px;
  }

  .scope-list article,
  .scope-list article + article {
    padding: 20px 0;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .scope-list article:first-child {
    border-top: 0;
  }

  .login-gate,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .input-row {
    grid-template-columns: 1fr;
  }

  .input-row .button,
  .login-gate .button {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
  }

  .brand strong {
    font-size: 13px;
  }

  .nav-actions .button {
    padding: 0 9px;
  }

  .summary-facts div {
    grid-template-columns: 1fr;
    gap: 5px;
  }

  .summary-facts dd {
    max-width: none;
    text-align: left;
  }
}
