:root {
  color-scheme: light;
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-strong: #edf2f7;
  --ink: #172026;
  --muted: #5d6976;
  --line: #d8e0e8;
  --teal: #0f9f8f;
  --blue: #3268f6;
  --coral: #e0523f;
  --amber: #d48913;
  --green: #2c8a51;
  --shadow: 0 22px 70px rgba(23, 32, 38, 0.11);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(90deg, rgba(50, 104, 246, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, rgba(15, 159, 143, 0.07) 1px, transparent 1px),
    var(--bg);
  background-size: 44px 44px;
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "Microsoft YaHei", sans-serif;
  line-height: 1.55;
  letter-spacing: 0;
}

button,
textarea,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 12px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 20px;
  justify-content: space-between;
  margin: 14px 0 28px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 224, 232, 0.8);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 30px rgba(23, 32, 38, 0.08);
  backdrop-filter: blur(16px);
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  background: var(--ink);
  color: white;
  font-weight: 800;
}

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

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

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.nav-links a,
.top-action,
.contact-button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid transparent;
}

.nav-links a {
  color: var(--muted);
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  border-color: var(--line);
}

.top-action,
.contact-button {
  background: var(--ink);
  color: white;
  font-weight: 700;
}

.experience {
  min-height: calc(100vh - 98px);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 26px;
  align-items: center;
  padding: 20px 0 42px;
}

.agent-identity {
  align-self: center;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 820px;
  font-size: clamp(44px, 8vw, 94px);
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

h3 {
  margin: 0 0 10px;
  font-size: 19px;
  line-height: 1.2;
}

.hero-copy {
  max-width: 640px;
  margin: 22px 0 0;
  color: #33414f;
  font-size: clamp(18px, 2vw, 24px);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.trust-row span,
.mode-pill,
.network-state,
.fake-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.78);
  color: #31404e;
  font-size: 13px;
  font-weight: 700;
}

.trust-row span {
  padding: 8px 10px;
}

.agent-console {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 18px;
}

.console-header,
.control-row,
.sample-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.console-header {
  justify-content: space-between;
  margin-bottom: 16px;
}

.console-header > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(44, 138, 81, 0.13);
  border-radius: 50%;
}

.mode-pill,
.network-state {
  padding: 6px 9px;
}

.sample-row {
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.sample-button,
.primary-button,
.ghost-button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.sample-button {
  padding: 8px 11px;
}

.sample-button.is-active {
  border-color: var(--teal);
  background: rgba(15, 159, 143, 0.12);
  color: #006f64;
}

.input-label {
  display: block;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

textarea {
  width: 100%;
  min-height: 112px;
  resize: vertical;
  border: 1px solid var(--line);
  background: #f9fbfd;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(50, 104, 246, 0.13);
}

.control-row {
  flex-wrap: wrap;
  margin: 14px 0;
}

.primary-button,
.ghost-button {
  padding: 9px 14px;
}

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

.primary-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.ghost-button {
  background: var(--surface-strong);
}

.progress-shell {
  height: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #eef3f8;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--blue), var(--coral));
  transition: width 260ms ease;
}

.runtime-log {
  min-height: 238px;
  max-height: 238px;
  overflow: auto;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--line);
  background: #101820;
  color: #d9e7ef;
}

.runtime-log li {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-family:
    "SFMono-Regular", Consolas, "Liberation Mono", "Microsoft YaHei Mono",
    monospace;
  font-size: 13px;
}

.runtime-log li:last-child {
  border-bottom: 0;
}

.runtime-log time {
  color: #89dbc8;
}

.output-band,
.standards-layout,
.boundary-columns,
.contact {
  display: grid;
  gap: 22px;
}

.output-band {
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.8fr);
  align-items: stretch;
  margin: 10px 0 70px;
  padding: 22px;
  border: 1px solid var(--line);
  background: #ffffff;
}

.output-visual {
  min-height: 340px;
  border: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 22%, rgba(224, 82, 63, 0.12), transparent 26%),
    radial-gradient(circle at 82% 80%, rgba(15, 159, 143, 0.18), transparent 28%),
    #f8fbfd;
}

canvas {
  width: 100%;
  height: 100%;
  min-height: 340px;
  display: block;
}

.document-preview {
  min-width: 0;
}

.doc-card {
  margin-top: 18px;
  border: 1px solid var(--line);
  background: #fbfcfe;
}

.doc-card header {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
}

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

.doc-card header span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.doc-card ul {
  margin: 0;
  padding: 16px 18px 16px 34px;
}

.doc-card li {
  margin: 7px 0;
}

.fake-link {
  margin: 0;
  padding: 12px 16px;
  overflow-wrap: anywhere;
}

.capability-grid,
.workflow,
.standards,
.boundaries,
.metrics-strip,
.contact {
  margin: 70px 0;
}

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

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.cards-grid article,
.flow-track > div,
.check-panel,
.boundary-columns article {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.82);
}

.cards-grid article {
  min-height: 190px;
  padding: 18px;
}

.card-index {
  display: inline-flex;
  margin-bottom: 22px;
  color: var(--coral);
  font-size: 13px;
  font-weight: 900;
}

.cards-grid p,
.flow-track p,
.check-panel li,
.boundary-columns p,
.contact p,
.metrics-strip span {
  color: var(--muted);
}

.cards-grid p,
.flow-track p,
.boundary-columns p,
.contact p {
  margin: 0;
}

.flow-track {
  display: grid;
  grid-template-columns: repeat(6, minmax(145px, 1fr));
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.flow-track > div {
  min-height: 190px;
  padding: 16px;
}

.flow-track span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  margin-bottom: 20px;
  background: var(--amber);
  color: white;
  font-weight: 900;
}

.flow-track strong {
  display: block;
  margin-bottom: 8px;
}

.standards-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.check-panel {
  padding: 22px;
}

.check-panel h3 {
  color: var(--green);
}

.check-panel.warning h3 {
  color: var(--coral);
}

.check-panel ul {
  margin: 12px 0 0;
  padding-left: 22px;
}

.check-panel li {
  margin: 8px 0;
}

.boundary-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.boundary-columns article {
  padding: 20px;
}

.metrics-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metrics-strip div {
  padding: 18px;
  border-top: 4px solid var(--teal);
  background: var(--ink);
  color: white;
}

.metrics-strip div:nth-child(2) {
  border-color: var(--blue);
}

.metrics-strip div:nth-child(3) {
  border-color: var(--coral);
}

.metrics-strip div:nth-child(4) {
  border-color: var(--amber);
}

.metrics-strip strong,
.metrics-strip span {
  display: block;
}

.metrics-strip strong {
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1;
}

.metrics-strip span {
  margin-top: 10px;
  color: #d6dee5;
}

.contact {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  margin-bottom: 36px;
  padding: 26px;
  background: #ffffff;
  border: 1px solid var(--line);
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(50, 104, 246, 0.4);
  outline-offset: 3px;
}

@media (max-width: 980px) {
  .experience,
  .output-band,
  .standards-layout,
  .boundary-columns,
  .contact {
    grid-template-columns: 1fr;
  }

  .cards-grid,
  .metrics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .experience {
    min-height: auto;
    padding-top: 28px;
  }
}

@media (max-width: 700px) {
  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .agent-console,
  .output-band,
  .contact {
    padding: 14px;
  }

  .cards-grid,
  .metrics-strip {
    grid-template-columns: 1fr;
  }

  .runtime-log li {
    grid-template-columns: 1fr;
  }

  .network-state {
    width: 100%;
  }
}
