:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f8fafc;
  --line: #d9e0e7;
  --line-strong: #c7d0da;
  --text: #17212b;
  --muted: #66727e;
  --subtle: #8b96a1;
  --blue: #2f6fda;
  --blue-dark: #255bb7;
  --green: #1b7f5a;
  --green-soft: #edf8f3;
  --yellow: #9a6700;
  --yellow-soft: #fff8e7;
  --red: #b42318;
  --red-soft: #fff1ef;
  --shadow: 0 10px 28px rgba(23, 33, 43, .07);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 Inter, "Microsoft YaHei", "Segoe UI", sans-serif;
}

.ambient { display: none; }
.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 24px 0 34px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 46px;
}

.brand {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #fff;
  background: var(--blue);
  font-weight: 800;
}
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .1px; }
.brand small { color: var(--muted); font-size: 11px; }

.host-pill,
.badge {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  padding: 4px 10px;
  background: var(--surface);
}
.host-pill { color: var(--subtle); }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr);
  gap: 44px;
  align-items: end;
  margin-bottom: 26px;
}
.eyebrow {
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  margin: 0 0 8px;
}
h1, h2, h3, p { margin-top: 0; }
h1 {
  max-width: 700px;
  font-size: clamp(32px, 4.8vw, 48px);
  line-height: 1.16;
  letter-spacing: -.035em;
  margin-bottom: 16px;
}
.lead {
  max-width: 650px;
  color: var(--muted);
  font-size: 16px;
}
.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.trust-row span {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 12px;
  background: var(--surface);
}

.status-card,
.workspace-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
}
.status-card { padding: 20px; min-height: 150px; }
.status-label { color: var(--muted); font-size: 12px; }
.status-title { font-size: 20px; font-weight: 750; margin-top: 6px; }
.status-detail { color: var(--muted); margin-top: 5px; font-size: 13px; }
.status-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--subtle);
  font-size: 11px;
  margin-top: 22px;
}

.workspace-card { padding: clamp(20px, 3.4vw, 34px); }
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 22px;
}
h2 {
  font-size: clamp(22px, 3vw, 29px);
  letter-spacing: -.025em;
  margin-bottom: 0;
}
.badge { white-space: nowrap; }
.badge-ok {
  color: var(--green);
  border-color: #a9d8c5;
  background: var(--green-soft);
}
.badge-warn {
  color: var(--yellow);
  border-color: #eed49a;
  background: var(--yellow-soft);
}
.badge-error {
  color: var(--red);
  border-color: #efb5ae;
  background: var(--red-soft);
}

.card-mode-panel {
  margin: 0 0 24px;
  padding: 18px;
  border: 1px solid #cfd9e4;
  border-radius: 10px;
  background: var(--surface-muted);
}
.mode-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 14px;
}
.mode-heading h3 { margin: 0 0 4px; font-size: 18px; }
.mode-heading p:not(.eyebrow) { margin: 0; color: var(--muted); font-size: 13px; }
.field-label {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}
.card-input,
.result-json {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  padding: 11px 12px;
  color: var(--text);
  background: var(--surface);
  font: 13px/1.5 ui-monospace, Consolas, monospace;
  outline: none;
}
.card-input { min-height: 82px; }
.card-input:focus,
.result-json:focus {
  border-color: #7ea8e8;
  box-shadow: 0 0 0 3px rgba(47, 111, 218, .12);
}
.consent-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 12px 0 14px;
  color: var(--muted);
  font-size: 12px;
}
.consent-row input { accent-color: var(--blue); }

.stepper {
  list-style: none;
  padding: 0 4px;
  margin: 0 0 24px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  position: relative;
}
.stepper::before {
  content: "";
  height: 2px;
  position: absolute;
  top: 16px;
  left: 5%;
  right: 5%;
  background: var(--line);
}
.step {
  position: relative;
  text-align: center;
  color: var(--subtle);
  min-width: 0;
}
.step-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 33px;
  height: 33px;
  margin: 0 auto 9px;
  border: 2px solid var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--subtle);
  font-size: 12px;
  font-weight: 700;
}
.step strong, .step small { display: block; }
.step strong { font-size: 12px; font-weight: 700; }
.step small {
  margin: 3px auto 0;
  max-width: 112px;
  color: var(--subtle);
  font-size: 10px;
  line-height: 1.35;
}
.step.done,
.step.active { color: var(--text); }
.step.done .step-dot {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.step.active .step-dot {
  border-color: var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(47, 111, 218, .12);
}
.step.error { color: var(--red); }
.step.error .step-dot { border-color: var(--red); background: var(--red); color: #fff; }
.step.done small,
.step.active small { color: var(--muted); }

.notice {
  min-height: 23px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 13px;
}
.notice.error { color: var(--red); }
.notice.success { color: var(--green); }

.action-row,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}
button {
  border: 0;
  font: inherit;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: .5; }
.primary-button,
.secondary-button {
  border-radius: 7px;
  padding: 10px 16px;
  font-weight: 700;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.primary-button {
  color: #fff;
  background: var(--blue);
}
.primary-button:not(:disabled):hover { background: var(--blue-dark); }
.secondary-button {
  color: var(--text);
  border: 1px solid var(--line-strong);
  background: var(--surface);
}
.secondary-button:not(:disabled):hover { border-color: #91a8c2; background: var(--surface-muted); }

.result-panel {
  display: grid;
  grid-template-columns: minmax(210px, .38fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-top: 24px;
  padding: 18px;
  border: 1px solid #b9ddcc;
  border-radius: 10px;
  background: var(--green-soft);
}
.result-panel h3 { margin-bottom: 5px; }
.result-panel p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 0;
}
.result-body { min-width: 0; }
.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 8px;
}
.result-meta code {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--green);
  font-family: ui-monospace, Consolas, monospace;
  font-size: 12px;
}
.result-json {
  min-height: 150px;
  margin-bottom: 10px;
  background: var(--surface);
}
.footer {
  display: flex;
  justify-content: space-between;
  color: var(--subtle);
  font-size: 11px;
  padding: 16px 4px 0;
}

@media (max-width: 800px) {
  .shell { width: min(100% - 28px, 680px); padding-top: 18px; }
  .topbar { margin-bottom: 34px; }
  .hero { grid-template-columns: 1fr; gap: 18px; }
  .stepper { grid-template-columns: 1fr; gap: 12px; }
  .stepper::before {
    width: 2px;
    height: calc(100% - 33px);
    left: 20px;
    top: 17px;
    right: auto;
  }
  .step {
    display: grid;
    grid-template-columns: 34px 1fr;
    text-align: left;
    align-items: center;
    gap: 10px;
  }
  .step-dot { margin: 0; }
  .step small { margin: 2px 0 0; max-width: none; }
  .result-panel { grid-template-columns: 1fr; }
  .mode-heading { flex-direction: column; }
  .footer { gap: 12px; flex-direction: column; }
}

