:root {
  --navy: #0b2545;
  --blue: #1b6dc1;
  --cyan: #00d4c8;
  --ink: #14233a;
  --muted: #5c6d82;
  --line: #d5e0ec;
  --paper: #eef3f8;
  --card: #ffffff;
  --warn: #8a4b12;
  --warn-bg: #fff6ea;
  --danger: #8d2a2a;
  --danger-bg: #fdeeee;
  --shadow: 0 10px 30px rgba(11, 37, 69, 0.06);
  --radius: 16px;
  color-scheme: light;
  font-family: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

* { box-sizing: border-box; }

html, body { margin: 0; min-height: 100%; }

body {
  background:
    radial-gradient(1200px 400px at 90% -10%, rgba(0, 212, 200, 0.16), transparent 55%),
    var(--paper);
  color: var(--ink);
}

button, input { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--blue); }

.page { min-height: 100vh; display: flex; flex-direction: column; }

.top {
  background: var(--navy);
  color: white;
  position: sticky;
  top: 0;
  z-index: 5;
  box-shadow: 0 1px 0 var(--cyan);
}

.top-inner, .layout, .foot-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
}

.brand { display: flex; gap: 12px; align-items: center; min-width: 0; }

.mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background:
    linear-gradient(var(--cyan), var(--cyan)) 7px 50% / 22px 2px no-repeat,
    linear-gradient(var(--cyan), var(--cyan)) 7px 38% / 14px 2px no-repeat,
    linear-gradient(#7eb6ff, #7eb6ff) 7px 62% / 18px 2px no-repeat,
    rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(0, 212, 200, 0.55);
  flex: none;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.brand h1 span { font-weight: 500; letter-spacing: 0; opacity: 0.92; }

.brand p { margin: 2px 0 0; color: rgba(255, 255, 255, 0.72); font-size: 13px; }

.top-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.badge {
  border: 1px solid rgba(0, 212, 200, 0.7);
  color: var(--cyan);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.lang {
  display: flex;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  padding: 3px;
}

.lang button {
  border: 0;
  background: transparent;
  color: white;
  border-radius: 999px;
  padding: 6px 10px;
  min-width: 52px;
}

.lang button[aria-pressed="true"] { background: var(--cyan); color: var(--navy); font-weight: 650; }

.layout {
  display: grid;
  grid-template-columns: minmax(300px, 400px) minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0 28px;
  align-items: start;
  flex: 1;
}

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

#wizard { padding: 18px 18px 12px; }

.step + .step { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

.step h2 {
  margin: 0 0 10px;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
}

.chips, .presets { display: flex; flex-wrap: wrap; gap: 8px; }

.chip, .preset, .seg button, .switch, .text-btn, .primary-btn {
  border: 1px solid var(--line);
  background: white;
  border-radius: 999px;
  padding: 7px 12px;
}

.chip[aria-pressed="true"], .preset[aria-pressed="true"], .seg button[aria-pressed="true"] {
  border-color: var(--blue);
  background: #eef5fc;
  color: var(--navy);
  font-weight: 650;
  box-shadow: inset 0 -2px 0 var(--cyan);
}

.scenarios { display: grid; gap: 8px; }

.scenario {
  text-align: left;
  border: 1px solid var(--line);
  background: #fbfcfe;
  border-radius: 12px;
  padding: 10px 12px;
  display: grid;
  gap: 2px;
}

.scenario strong { font-size: 15px; }

.scenario span { color: var(--muted); font-size: 13px; }

.scenario[aria-pressed="true"] {
  border-color: var(--blue);
  background: #f3f8fd;
  box-shadow: inset 3px 0 0 var(--cyan);
}

.field { margin: 0 0 14px; }

.field-head, .toolbar, .card-top, .top-actions, .brand {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.field-head label { font-weight: 650; }

.field-head output, .muted { color: var(--muted); font-size: 13px; }

input[type="number"] {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fbfcfe;
}

input[type="range"] { width: 100%; margin-top: 8px; accent-color: var(--blue); }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }

.seg button { border-radius: 10px; padding: 8px 6px; }

.seg small { display: block; color: var(--muted); font-weight: 400; font-size: 11px; }

.toggles { display: grid; gap: 8px; }

.switch {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  text-align: left;
}

.knob {
  width: 36px;
  height: 20px;
  border-radius: 999px;
  background: #d5deea;
  position: relative;
  flex: none;
}

.knob::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  top: 2px;
  left: 2px;
  transition: transform 0.15s ease;
}

.switch[aria-pressed="true"] { border-color: var(--blue); }

.switch[aria-pressed="true"] .knob { background: var(--blue); }

.switch[aria-pressed="true"] .knob::after { transform: translateX(16px); }

.text-btn {
  background: transparent;
  color: var(--blue);
  border: 0;
  padding-left: 0;
}

.results { padding: 18px; min-height: 420px; }

.results-head { align-items: flex-start; margin-bottom: 12px; }

.kicker {
  margin: 0;
  color: var(--blue);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
}

.results-head h2 { margin: 2px 0 0; font-size: 26px; letter-spacing: -0.03em; }

.toolbar { flex-wrap: wrap; justify-content: flex-end; }

.primary-btn, .ghost-btn {
  border-radius: 10px;
  padding: 8px 12px;
  border: 1px solid var(--blue);
}

.primary-btn { background: var(--blue); color: white; }

.ghost-btn { background: white; color: var(--navy); }

.params-readout {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 14px;
  padding: 0;
  list-style: none;
}

.params-readout li {
  background: var(--paper);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 13px;
}

.notice {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 0 0 12px;
  background: #eef7f6;
  border: 1px solid rgba(0, 212, 200, 0.5);
}

.notice.warn { background: var(--warn-bg); border-color: #f0d3b0; color: var(--warn); }

.notice.danger { background: var(--danger-bg); border-color: #f3c7c7; color: var(--danger); }

.card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 14px 12px;
  margin: 0 0 12px;
  background: white;
}

.card.primary {
  border-color: rgba(0, 212, 200, 0.85);
  box-shadow: inset 4px 0 0 var(--cyan);
  background: linear-gradient(180deg, rgba(0, 212, 200, 0.08), white 72px);
}

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

.card .summary { margin: 8px 0 0; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  background: var(--navy);
  color: white;
}

.pill em { font-style: normal; color: var(--cyan); font-weight: 400; }

.card h4 {
  margin: 14px 0 6px;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.card ul { margin: 0; padding-left: 18px; }

.card li + li { margin-top: 4px; }

.acc-note { display: block; color: var(--muted); font-size: 13px; }

.alternates { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 10px; }

.alternates .card h3 { font-size: 18px; }

.disclaimer {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.empty, .loading, .error-box { padding: 12px 4px 8px; }

.empty h2, .error-box h2 { margin: 0 0 8px; font-size: 28px; letter-spacing: -0.03em; }

.ruler {
  height: 28px;
  margin-bottom: 10px;
  background:
    repeating-linear-gradient(90deg, var(--navy) 0 1px, transparent 1px 18px),
    linear-gradient(var(--cyan), var(--cyan)) 0 70% / 100% 2px no-repeat;
  opacity: 0.75;
}

.foot { background: var(--navy); color: rgba(255, 255, 255, 0.78); margin-top: auto; }

.foot-inner { padding: 16px 0 20px; display: flex; justify-content: space-between; gap: 12px; align-items: center; font-size: 13px; }

.foot a { color: var(--cyan); }

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.gate-card {
  width: min(440px, 100%);
  background: white;
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 22px;
}

.gate-card h1 { margin: 8px 0; font-size: 28px; letter-spacing: -0.03em; }

.gate-card label { display: block; font-weight: 650; margin-top: 14px; }

.gate-card input[type="password"] {
  width: 100%;
  margin-top: 6px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.gate-card .primary-btn { width: 100%; margin-top: 14px; border-radius: 10px; padding: 10px 12px; }

.gate .lang { background: var(--paper); margin-top: 8px; }

.gate .lang button { color: var(--navy); }

.staff-block {
  margin-top: 12px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.band {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 8px;
  background: var(--navy);
  color: var(--cyan);
  font-weight: 700;
  letter-spacing: 0.04em;
}

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; width: min(1180px, calc(100% - 20px)); }
  .top-inner { width: min(1180px, calc(100% - 20px)); align-items: flex-start; }
  .brand p { display: none; }
  .results-head, .foot-inner { flex-direction: column; align-items: flex-start; }
  .results-head h2 { font-size: 22px; }
  .seg { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .knob::after { transition: none; }
}

@media print {
  body { background: white; }
  .top, #wizard, .toolbar, .foot, .text-btn { display: none !important; }
  .layout { display: block; width: auto; padding: 0; }
  .panel { box-shadow: none; border: 0; }
  .card { break-inside: avoid; }
  a { color: var(--ink); text-decoration: none; }
}
