:root {
  color-scheme: light;
  --ink: #14211d;
  --muted: #67746f;
  --paper: #f4f1e9;
  --card: rgba(255, 255, 255, 0.82);
  --line: rgba(20, 33, 29, 0.12);
  --accent: #e85d2a;
  --accent-dark: #b93d13;
  --green: #16775a;
  --green-soft: #dcf4e9;
  --red: #b83e3e;
  --red-soft: #fde8e5;
  --amber: #99640b;
  --amber-soft: #fff1cd;
  --shadow: 0 24px 70px rgba(44, 53, 48, 0.11);
  --radius: 24px;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(20, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20, 33, 29, 0.035) 1px, transparent 1px),
    var(--paper);
  background-size: 34px 34px;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.9em;
  color: var(--accent-dark);
  background: rgba(232, 93, 42, 0.08);
  border-radius: 5px;
  padding: 2px 5px;
}

.page-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(1px);
  pointer-events: none;
  z-index: -1;
}

.page-glow-one {
  width: 520px;
  height: 520px;
  top: -260px;
  right: -150px;
  background: radial-gradient(circle, rgba(232, 93, 42, 0.19), transparent 69%);
}

.page-glow-two {
  width: 620px;
  height: 620px;
  top: 520px;
  left: -380px;
  background: radial-gradient(circle, rgba(22, 119, 90, 0.16), transparent 67%);
}

.topbar,
.shell,
footer {
  width: min(1180px, calc(100% - 40px));
  margin-inline: auto;
}

.topbar {
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 23px;
  background: var(--ink);
  border-radius: 12px 12px 12px 4px;
}

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

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

.brand small {
  margin-top: 2px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.online-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  font-size: 12px;
  color: var(--muted);
}

.online-pill span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2aad79;
  box-shadow: 0 0 0 4px rgba(42, 173, 121, 0.12);
}

.shell {
  padding: 72px 0 80px;
}

.hero {
  max-width: 820px;
  margin-bottom: 54px;
}

.eyebrow,
.step {
  margin: 0 0 13px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(48px, 7vw, 84px);
  font-weight: 500;
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 680px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.panel,
.summary-card,
.help-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.config-panel {
  padding: 32px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2,
.help-panel h2,
.summary-card h2 {
  margin: 0;
  font-family: Georgia, "Songti SC", serif;
  font-size: clamp(25px, 3vw, 34px);
  font-weight: 500;
  letter-spacing: -0.025em;
}

.secure-note {
  padding: 7px 11px;
  color: var(--green);
  background: var(--green-soft);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.config-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 18px;
}

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

.field-wide:last-child {
  grid-column: 1 / -1;
}

.field > span,
.model-field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field em {
  color: #9ba39f;
  font-style: normal;
  font-weight: 400;
}

input,
select {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.82);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input:focus,
select:focus {
  border-color: rgba(232, 93, 42, 0.7);
  box-shadow: 0 0 0 4px rgba(232, 93, 42, 0.1);
  background: #fff;
}

.secret-wrap {
  display: flex;
  position: relative;
}

.secret-wrap input {
  padding-right: 70px;
}

.icon-button {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  border: 0;
  padding: 7px 9px;
  color: var(--muted);
  background: transparent;
  border-radius: 7px;
  font-size: 12px;
}

.icon-button:hover {
  color: var(--ink);
  background: rgba(20, 33, 29, 0.06);
}

.privacy-line {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 12px;
}

.shield {
  color: var(--green);
  font-size: 9px;
}

.tests-section {
  margin-top: 54px;
}

.tests-heading {
  align-items: center;
}

.primary-button,
.secondary-button {
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 24px;
  padding: 0 18px 0 22px;
  color: white;
  background: var(--ink);
  box-shadow: 0 12px 28px rgba(20, 33, 29, 0.2);
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-2px);
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.58;
  transform: none;
}

.button-arrow {
  font-size: 20px;
  font-weight: 400;
}

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

.test-card {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 15px 45px rgba(44, 53, 48, 0.07);
  transition: border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.test-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 22px 55px rgba(44, 53, 48, 0.11);
}

.test-card.is-running {
  border-color: rgba(232, 93, 42, 0.5);
}

.test-card.is-passed {
  border-color: rgba(22, 119, 90, 0.35);
}

.test-card.is-failed {
  border-color: rgba(184, 62, 62, 0.35);
}

.card-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.test-number {
  color: #9ba39f;
  font-family: Georgia, serif;
  font-size: 15px;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(20, 33, 29, 0.06);
  font-size: 11px;
  font-weight: 700;
}

.badge.running {
  color: var(--amber);
  background: var(--amber-soft);
}

.badge.passed {
  color: var(--green);
  background: var(--green-soft);
}

.badge.failed {
  color: var(--red);
  background: var(--red-soft);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-top: 28px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-family: Georgia, serif;
  font-size: 24px;
}

.balance-icon {
  color: #84500a;
  background: #f7e6bb;
}

.models-icon {
  color: #185f8c;
  background: #dceef8;
}

.video-icon {
  color: var(--accent-dark);
  background: #fbe2d7;
  font-size: 17px;
}

.test-card h3 {
  margin: 22px 0 10px;
  font-family: Georgia, "Songti SC", serif;
  font-size: 25px;
  font-weight: 500;
}

.test-card > p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.model-field {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.model-field input {
  height: 42px;
}

.model-field select {
  height: 42px;
}

.result {
  min-height: 64px;
  margin-top: 18px;
  padding: 13px;
  border: 1px dashed rgba(20, 33, 29, 0.15);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(244, 241, 233, 0.62);
  font-size: 12px;
  line-height: 1.55;
}

.result strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
  font-size: 15px;
}

.result .model-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.result .model-chip {
  color: #245a49;
  background: #e1f2e9;
  border-radius: 5px;
  padding: 3px 6px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.raw-details {
  margin-top: 13px;
  color: var(--muted);
  font-size: 11px;
}

.raw-details summary {
  cursor: pointer;
  user-select: none;
}

.raw-details pre {
  max-height: 220px;
  margin: 10px 0 0;
  overflow: auto;
  padding: 12px;
  color: #d7e3df;
  background: #17221f;
  border-radius: 10px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.exchange-block + .exchange-block {
  margin-top: 12px;
}

.exchange-block > span {
  display: inline-block;
  margin-top: 12px;
  color: #8e9a96;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.exchange-block pre {
  margin-top: 5px;
}

.secondary-button {
  width: 100%;
  height: 44px;
  margin-top: auto;
  padding: 0 14px;
  color: var(--ink);
  background: #ebe8df;
}

.secondary-button:hover {
  background: #e2ded3;
}

.summary-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  margin-top: 24px;
  padding: 26px 30px;
}

.summary-mark {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--green);
  border-radius: 50%;
  font-size: 22px;
}

.summary-card.failed .summary-mark {
  background: var(--red);
}

.summary-card h2 {
  font-size: 25px;
}

.summary-card p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.summary-time {
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.help-panel {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 46px;
  margin-top: 54px;
  padding: 32px;
  box-shadow: none;
}

.help-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}

.help-copy p {
  margin: 0;
}

.help-copy p + p {
  margin-top: 10px;
}

footer {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 20;
  max-width: min(440px, calc(100% - 32px));
  padding: 12px 16px;
  color: #fff;
  background: #1d2925;
  border-radius: 10px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
  font-size: 13px;
  opacity: 0;
  transform: translate(-50%, 16px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 900px) {
  .config-grid,
  .test-grid,
  .help-panel {
    grid-template-columns: 1fr;
  }

  .field-wide:last-child {
    grid-column: auto;
  }

  .test-card {
    min-height: 0;
  }

  .secondary-button {
    margin-top: 24px;
  }
}

@media (max-width: 620px) {
  .topbar,
  .shell,
  footer {
    width: min(100% - 24px, 1180px);
  }

  .topbar {
    height: 74px;
  }

  .online-pill {
    display: none;
  }

  .shell {
    padding: 46px 0 56px;
  }

  .hero {
    margin-bottom: 36px;
  }

  .hero h1 {
    font-size: clamp(43px, 14vw, 62px);
  }

  .hero-copy {
    margin-top: 20px;
    font-size: 14px;
  }

  .config-panel,
  .help-panel {
    padding: 20px;
    border-radius: 18px;
  }

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

  .tests-heading {
    align-items: stretch;
  }

  .primary-button {
    justify-content: space-between;
  }

  .test-grid {
    gap: 12px;
  }

  .test-card {
    padding: 20px;
  }

  .summary-card {
    grid-template-columns: auto 1fr;
    padding: 20px;
  }

  .summary-time {
    grid-column: 2;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
  }
}

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