:root {
  color-scheme: light;
  --ink: #172026;
  --muted: #63717a;
  --line: #d8e2e5;
  --paper: #f6faf8;
  --white: #ffffff;
  --green: #138a57;
  --green-deep: #0d6d46;
  --blue: #1f5f8f;
  --amber: #f6c95e;
  --red: #b8463d;
  --shadow: 0 18px 48px rgba(25, 45, 54, 0.14);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(120deg, rgba(19, 138, 87, 0.08), transparent 34%),
    linear-gradient(300deg, rgba(31, 95, 143, 0.09), transparent 38%),
    var(--paper);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  overflow: hidden;
}

a {
  color: var(--blue);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.wizard-shell {
  width: min(1180px, calc(100% - 28px));
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0 auto;
  padding: 12px 0;
  overflow: hidden;
}

.wizard-header,
.wizard-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(25, 45, 54, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
  color: var(--ink);
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: var(--white);
  background: var(--green);
  border-radius: 8px;
  font-weight: 900;
}

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

.brand small {
  color: var(--muted);
  font-size: 12px;
}

.progress-summary {
  display: grid;
  grid-template-columns: auto minmax(160px, 280px);
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-weight: 800;
}

.progress-track {
  height: 10px;
  overflow: hidden;
  background: #e3ecef;
  border-radius: 999px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--green);
  transition: width 180ms ease;
}

.screen {
  display: none;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(18px, 3vw, 42px);
  align-items: center;
  padding: clamp(18px, 3.4vw, 40px);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.screen.active {
  display: grid;
}

.screen-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(36px, 5.2vw, 68px);
  line-height: 1.04;
  letter-spacing: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green-deep);
  font-weight: 900;
  letter-spacing: 0;
}

.lead {
  max-width: 720px;
  margin: 14px 0 0;
  color: #38474f;
  font-size: clamp(17px, 1.8vw, 21px);
}

.action-box,
.device-grid,
.help-grid {
  padding: 20px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 16px 40px rgba(25, 45, 54, 0.1);
}

.action-box h2 {
  margin: 0 0 10px;
  font-size: 22px;
}

.action-box ul,
.test-list {
  margin: 0;
  padding-left: 22px;
}

.action-box li + li,
.test-list li + li {
  margin-top: 6px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 2px solid transparent;
  border-radius: 8px;
  font: inherit;
  font-weight: 900;
  text-align: center;
  cursor: pointer;
}

.button:hover {
  text-decoration: none;
}

.button.primary {
  color: var(--white);
  background: var(--green);
}

.button.primary:hover {
  background: var(--green-deep);
}

.button.primary:disabled {
  color: #6e7a80;
  background: #d8e2e5;
  cursor: not-allowed;
}

.button.secondary {
  color: var(--green-deep);
  background: var(--white);
  border-color: var(--green);
}

.button.subtle {
  color: var(--muted);
  background: transparent;
  border-color: var(--line);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.confirm-line {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  margin-top: 16px;
  padding: 12px;
  color: #143323;
  background: #e9f8ef;
  border: 1px solid #b8dfc5;
  border-radius: 8px;
  font-size: 17px;
  font-weight: 900;
  cursor: pointer;
}

.confirm-line input {
  width: 20px;
  height: 20px;
  margin-top: 3px;
  accent-color: var(--green);
}

.device-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.device-card {
  min-height: 82px;
  padding: 14px;
  color: var(--ink);
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.device-card strong,
.device-card span {
  display: block;
}

.device-card strong {
  font-size: 19px;
}

.device-card span {
  margin-top: 4px;
  color: var(--muted);
}

.device-card.active {
  color: var(--white);
  background: var(--blue);
  border-color: var(--blue);
}

.device-card.active span {
  color: rgba(255, 255, 255, 0.86);
}

.warning,
.plain-tip,
.big-note {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 8px;
}

.guide-shot {
  margin: 14px 0 0;
  padding: 10px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.guide-shot img {
  display: block;
  width: 100%;
  max-height: 170px;
  object-fit: contain;
  border-radius: 6px;
}

.guide-shot figcaption {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.warning {
  color: #4a3308;
  background: #fff3d0;
  border: 1px solid #f1d07c;
}

.plain-tip {
  color: var(--muted);
  background: #f2f6f7;
  border: 1px solid var(--line);
}

.big-note {
  color: #123925;
  background: #e7f6ed;
  border: 1px solid #afd9bd;
  font-size: 20px;
  font-weight: 900;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.help-grid article {
  padding: 14px;
  background: #fbfdfc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.help-grid h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.help-grid p {
  margin: 0;
  color: var(--muted);
}

.wizard-footer {
  justify-content: flex-end;
}

.wizard-footer .button.subtle {
  margin-right: auto;
}

@media (max-width: 900px) {
  .screen {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .screen-copy h1 {
    font-size: clamp(34px, 8vw, 52px);
  }

  .progress-summary {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .wizard-shell {
    width: min(100% - 16px, 1180px);
    gap: 8px;
    padding: 8px 0;
  }

  .wizard-header {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
  }

  .wizard-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 10px;
  }

  .screen {
    padding: 16px;
  }

  .screen-copy h1 {
    font-size: clamp(30px, 9vw, 42px);
  }

  .lead {
    font-size: 16px;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
    font-size: 13px;
  }

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

  .progress-summary {
    gap: 6px;
    font-size: 13px;
  }

  .action-box,
  .device-grid,
  .help-grid {
    padding: 14px;
  }

  .device-card {
    min-height: 72px;
    padding: 12px;
  }

  .warning,
  .plain-tip,
  .big-note,
  .guide-shot {
    margin-top: 12px;
  }

  .guide-shot img {
    max-height: 120px;
  }

  .big-note {
    font-size: 17px;
  }

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

  .button {
    width: 100%;
  }

  .wizard-footer .button.subtle {
    grid-column: 1 / -1;
    margin-right: 0;
  }

  #back-button {
    grid-column: 1;
    grid-row: 1;
  }

  #next-button {
    grid-column: 2;
    grid-row: 1;
  }

  #restart-button {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}
