:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #647084;
  --soft-muted: #94a0b2;
  --line: #e2e7ef;
  --surface: #fff;
  --page: #f6f7f9;
  --primary: #0f172a;
  --primary-hover: #1e40af;
  --focus: #2563eb;
  --error: #be123c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(214, 177, 91, 0.13), transparent 26rem),
    radial-gradient(circle at 92% 12%, rgba(36, 74, 122, 0.11), transparent 30rem),
    var(--page);
  -webkit-font-smoothing: antialiased;
}
header {
  height: 4.5rem;
  padding: 0 max(1.25rem, calc((100% - 80rem) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(226, 231, 239, 0.8);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(18px);
}
.brand-wrap, .brand-copy { display: flex; align-items: center; }
.brand-wrap { gap: .75rem; }
.brand-copy { flex-direction: column; align-items: flex-start; gap: .1rem; }
.brand-mark {
  display: grid; width: 2.25rem; height: 2.25rem; place-items: center;
  border-radius: .75rem; background: var(--primary); color: #fff; font-size: .9rem;
  font-weight: 800; box-shadow: 0 8px 20px rgba(15, 23, 42, .2);
}
.brand { font-size: .95rem; font-weight: 750; letter-spacing: -.01em; }
.brand-subtitle { color: var(--soft-muted); font-size: .625rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; }
a { color: #1d4ed8; font-size: .875rem; font-weight: 650; text-decoration: none; }
a:hover { color: var(--primary-hover); }
a:focus-visible, button:focus-visible { outline: 3px solid rgba(37, 99, 235, .3); outline-offset: 3px; }
main { width: min(calc(100% - 2rem), 48rem); margin: 3rem auto 5rem; }
.page-intro { margin-bottom: 2rem; }
.eyebrow { margin: 0 0 .5rem; color: #1d4ed8; font-size: .7rem; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
h1 { margin: 0; color: var(--primary); font-size: clamp(2rem, 5vw, 2.75rem); line-height: 1.12; letter-spacing: -.045em; }
.intro { margin: .75rem 0 0; color: var(--muted); font-size: .95rem; line-height: 1.65; }
.status-line { color: var(--muted); font-size: .9rem; }
.card, .state-card {
  margin-bottom: 1rem; border: 1px solid rgba(226, 231, 239, .95); border-radius: 1.5rem;
  background: var(--surface); box-shadow: 0 20px 70px -38px rgba(15, 23, 42, .38);
}
.card { padding: 1.75rem; }
.state-card { padding: 1.5rem 1.75rem; }
.state-card p { margin: 0 0 1rem; color: var(--muted); }
.section-heading { display: flex; align-items: flex-start; gap: .875rem; margin-bottom: 1.5rem; }
.section-icon { display: grid; flex: 0 0 auto; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: .75rem; background: #eff6ff; color: #1d4ed8; font-size: .7rem; font-weight: 800; letter-spacing: .05em; }
h2 { margin: .1rem 0 .25rem; color: var(--primary); font-size: 1.15rem; line-height: 1.35; letter-spacing: -.02em; }
.section-heading p { margin: 0; color: var(--muted); font-size: .8rem; line-height: 1.5; }
.field { min-width: 0; margin-bottom: 1.25rem; }
label { display: block; margin-bottom: .5rem; color: #334155; font-size: .8rem; font-weight: 700; }
input {
  width: 100%; min-width: 0; height: 3rem; padding: .75rem 1rem; border: 1px solid var(--line);
  border-radius: .75rem; background: var(--surface); color: var(--ink); font: inherit; font-size: .95rem;
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
input::placeholder { color: #aab3c1; }
input:focus { border-color: var(--focus); box-shadow: 0 0 0 4px rgba(37, 99, 235, .1); }
input[readonly] { border-color: #e8edf3; background: #f8fafc; color: var(--muted); }
button, .button {
  min-height: 3rem; padding: .75rem 1.25rem; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--primary); border-radius: .75rem; background: var(--primary); color: #fff;
  cursor: pointer; font: inherit; font-size: .875rem; font-weight: 700; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
button:hover, .button:hover { border-color: var(--primary-hover); background: var(--primary-hover); color: #fff; transform: translateY(-1px); }
button:disabled { cursor: wait; opacity: .55; transform: none; }
.secondary { border-color: var(--line); background: #fff; color: #334155; }
.secondary:hover { border-color: #cbd5e1; background: #f8fafc; color: var(--primary); }
.actions { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .25rem; }
.feedback { min-width: 0; margin: 0; color: #1d4ed8; font-size: .8rem; line-height: 1.5; overflow-wrap: anywhere; }
.feedback.error { color: var(--error); }
.hint { margin: .5rem 0 0; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.code-row { display: flex; gap: .75rem; }
.code-row input { flex: 1; width: 0; }
[hidden] { display: none !important; }
@media (max-width: 480px) {
  header { height: 4rem; padding-inline: 1rem; }
  main { width: calc(100% - 2rem); margin-top: 2rem; }
  .card, .state-card { border-radius: 1.25rem; }
  .card, .state-card { padding: 1.25rem; }
  .section-heading { gap: .75rem; }
  .section-heading p { font-size: .75rem; }
  .code-row { gap: .5rem; }
  .code-row button { padding-inline: .75rem; }
  .actions { align-items: flex-start; gap: .75rem; }
  .actions button { flex: 0 0 auto; }
}
