:root {
  --paper: #f4f5f2;
  --surface: #ffffff;
  --ink: #151719;
  --muted: #686d70;
  --line: #d9ddda;
  --line-strong: #b9bfbb;
  --warm: #f0543d;
  --warm-soft: #fff0ec;
  --teal: #168a7b;
  --teal-soft: #e7f5f1;
  --yellow: #e2a324;
  --rail: #202326;
  --shadow: 0 22px 55px rgba(25, 32, 29, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

button {
  color: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(21, 23, 25, 0.12);
  background: rgba(244, 245, 242, 0.94);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: max-content;
  font-weight: 750;
}

.brand img,
.brand-mark {
  display: block;
  border-radius: 6px;
  flex: 0 0 auto;
}

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

.nav {
  display: flex;
  gap: 28px;
  color: #42474a;
  font-size: 13px;
}

.nav a {
  padding: 21px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover {
  border-color: var(--ink);
}

.top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
}

.language-switch {
  min-width: 58px;
  min-height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
}

.language-switch:hover {
  background: var(--surface);
}

.build-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.build-badge span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--yellow);
  box-shadow: 0 0 0 4px rgba(226, 163, 36, 0.15);
}

.build-badge b {
  font-weight: 650;
}

.hero {
  min-height: calc(100svh - 110px);
  padding: clamp(38px, 6vh, 68px) 32px 46px;
  overflow: hidden;
  background:
    linear-gradient(rgba(21, 23, 25, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(21, 23, 25, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 42px 42px;
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(1180px, 100%);
  margin: 0 auto 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--warm);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(54px, 8vw, 108px);
  font-weight: 780;
  line-height: 0.9;
}

.hero-line {
  max-width: 850px;
  margin: 22px 0 5px;
  font-size: clamp(19px, 2.4vw, 30px);
  font-weight: 650;
  line-height: 1.2;
}

.hero-sub {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.6;
}

.text-link {
  display: inline-flex;
  gap: 8px;
  margin-top: 18px;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 3px;
  font-size: 13px;
  font-weight: 700;
}

.workspace {
  position: relative;
  width: min(1180px, 100%);
  min-height: 430px;
  margin: 0 auto;
  border: 1px solid #aeb4b0;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.workspace-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
}

.project-id {
  display: flex;
  align-items: center;
  gap: 11px;
}

.project-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 5px;
  background: var(--ink);
  color: white;
  font-size: 11px;
  font-weight: 800;
}

.project-id strong,
.project-id small {
  display: block;
}

.project-id strong {
  font-size: 13px;
}

.project-id small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.agent-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.status-light {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 154px minmax(315px, 0.9fr) minmax(410px, 1.1fr);
  min-height: 368px;
}

.tool-rail {
  padding: 14px 9px;
  background: var(--rail);
}

.rail-item {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #bdc2c0;
  text-align: left;
  cursor: pointer;
}

.rail-item:hover,
.rail-item.active {
  background: #303437;
  color: white;
}

.rail-item span:not(.rail-dot) {
  font-size: 12px;
}

.rail-item b {
  font-size: 11px;
}

.rail-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.rail-dot.pending { background: var(--warm); }
.rail-dot.approved { background: var(--yellow); }
.rail-dot.running { background: #69a7ef; }
.rail-dot.done { background: #4fc0a8; }

.revision-list {
  border-right: 1px solid var(--line);
  background: #fafbf9;
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.list-heading span,
.list-heading small {
  display: block;
}

.list-heading span {
  font-size: 12px;
  font-weight: 750;
}

.list-heading small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.concept-label {
  color: var(--muted);
  font-size: 9px !important;
  font-weight: 650 !important;
  text-transform: uppercase;
}

.revision-row {
  display: grid;
  grid-template-columns: 78px 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.revision-row:hover {
  background: white;
}

.revision-row.selected {
  background: var(--warm-soft);
  box-shadow: inset 3px 0 0 var(--warm);
}

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

.revision-copy {
  min-width: 0;
}

.revision-copy strong,
.revision-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.revision-copy strong {
  font-size: 12px;
}

.revision-copy small {
  margin-top: 6px;
  color: var(--muted);
  font-size: 10px;
}

.risk {
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 9px;
  font-weight: 750;
  white-space: nowrap;
}

.risk.low {
  background: var(--teal-soft);
  color: #126f64;
}

.risk.medium {
  background: #fff3d7;
  color: #8a5d00;
}

.revision-detail {
  position: relative;
  padding: 20px;
  background: white;
}

.detail-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.detail-heading p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-heading h2 {
  margin: 0;
  font-size: 17px;
  line-height: 1.25;
}

.detail-state {
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-state[data-state="executing"] {
  border-color: #90b7ea;
  background: #edf5ff;
  color: #2a68aa;
}

.detail-state[data-state="verified"] {
  border-color: #84c8ba;
  background: var(--teal-soft);
  color: #126f64;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 20px;
  margin: 24px 0 0;
}

.detail-grid div {
  min-width: 0;
}

.detail-wide {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.detail-grid dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.detail-grid dd {
  margin: 0;
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.change-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 12px;
  border-left: 3px solid var(--warm);
  background: #f7f8f6;
}

.change-line span:first-child {
  color: #8a4c43;
  text-decoration: line-through;
}

.change-line strong {
  color: var(--teal);
}

.checks {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.checks p {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 5px 0;
  color: var(--muted);
  font-size: 10px;
}

.check-mark {
  color: var(--teal);
  font-weight: 900;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
}

.primary-button,
.secondary-button {
  min-height: 36px;
  border-radius: 5px;
  padding: 0 14px;
  font-size: 11px;
  font-weight: 750;
  cursor: pointer;
}

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

.primary-button:hover {
  background: #303437;
}

.primary-button:disabled {
  border-color: #93a09b;
  background: #93a09b;
  cursor: default;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  background: white;
}

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

.execution-track {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  overflow: hidden;
  background: transparent;
}

.execution-track.running {
  background: #dce8e4;
}

.execution-track span {
  display: block;
  width: 0;
  height: 100%;
  background: var(--teal);
}

.execution-track.running span {
  animation: execute 1.6s ease forwards;
}

@keyframes execute {
  from { width: 0; }
  to { width: 100%; }
}

.workflow-band,
.principles,
.architecture,
.build-status {
  scroll-margin-top: 64px;
}

.workflow-band {
  padding: 92px 32px;
  background: var(--ink);
  color: white;
}

.section-intro {
  width: min(1180px, 100%);
  margin: 0 auto 44px;
}

.section-intro h2 {
  max-width: 780px;
  margin: 0;
  font-size: clamp(30px, 4.5vw, 58px);
  line-height: 1.04;
}

.section-intro > p:last-child {
  max-width: 680px;
  margin: 18px 0 0;
  color: #aeb5b2;
  font-size: 15px;
  line-height: 1.6;
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 0;
  list-style: none;
  border-top: 1px solid #484d4b;
}

.workflow-steps li {
  min-height: 195px;
  padding: 20px 18px 16px 0;
  border-right: 1px solid #484d4b;
}

.workflow-steps li + li {
  padding-left: 18px;
}

.workflow-steps li:last-child {
  border-right: 0;
}

.workflow-steps span {
  display: block;
  margin-bottom: 46px;
  color: var(--warm);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.workflow-steps strong {
  font-size: 16px;
}

.workflow-steps p {
  margin: 10px 0 0;
  color: #aeb5b2;
  font-size: 12px;
  line-height: 1.55;
}

.principles {
  padding: 92px 32px;
  background: var(--surface);
}

.principles .section-intro,
.architecture .section-intro {
  margin-bottom: 54px;
}

.principle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  width: min(1180px, 100%);
  margin: 0 auto;
  border-top: 1px solid var(--line-strong);
  border-left: 1px solid var(--line-strong);
}

.principle-grid article {
  min-height: 215px;
  padding: 24px;
  border-right: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.principle-number {
  color: var(--warm);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 10px;
}

.principle-grid h3 {
  margin: 46px 0 8px;
  font-size: 21px;
}

.principle-grid p {
  max-width: 460px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.architecture {
  padding: 92px 32px 110px;
  border-top: 1px solid var(--line);
  background: #e9ece8;
}

.architecture-map {
  display: grid;
  grid-template-columns: 1fr 50px 1fr 50px 1fr;
  align-items: center;
  width: min(1180px, 100%);
  margin: 0 auto;
}

.architecture-node {
  min-height: 166px;
  padding: 22px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
}

.architecture-node small,
.architecture-node strong,
.architecture-node span {
  display: block;
}

.architecture-node small {
  color: var(--warm);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.architecture-node strong {
  margin-top: 42px;
  font-size: 18px;
}

.architecture-node span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
}

.cloud-node {
  background: var(--ink);
  color: white;
}

.cloud-node span {
  color: #aeb5b2;
}

.local-node {
  border-color: #6baea3;
  box-shadow: inset 0 -4px 0 var(--teal);
}

.architecture-arrow {
  color: var(--muted);
  text-align: center;
}

.build-status {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  padding: 80px max(32px, calc((100% - 1180px) / 2));
  background: var(--warm);
  color: white;
}

.build-status .eyebrow {
  color: #51160f;
}

.build-status h2 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(28px, 4vw, 49px);
  line-height: 1.05;
}

.milestone {
  align-self: end;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.55);
}

.milestone span {
  display: block;
  margin-bottom: 22px;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
}

.milestone strong {
  font-size: 18px;
}

.milestone p {
  max-width: 520px;
  margin: 9px 0 0;
  color: #ffe1d9;
  font-size: 13px;
  line-height: 1.55;
}

footer {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 96px;
  padding: 0 32px;
  background: var(--paper);
}

footer > p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.copyright {
  justify-self: end;
}

@media (max-width: 980px) {
  .nav {
    display: none;
  }

  .topbar {
    grid-template-columns: 1fr auto;
  }

  .workspace-grid {
    grid-template-columns: 126px minmax(280px, 0.85fr) minmax(340px, 1.15fr);
    overflow-x: auto;
  }

  .workspace {
    overflow-x: auto;
  }

  .workflow-steps {
    grid-template-columns: repeat(3, 1fr);
  }

  .workflow-steps li:nth-child(3) {
    border-right: 0;
  }

  .workflow-steps li:nth-child(n + 4) {
    border-top: 1px solid #484d4b;
  }

  .architecture-map {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .architecture-arrow {
    transform: rotate(90deg);
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 58px;
    padding: 0 16px;
  }

  .build-badge {
    display: none;
  }

  .hero {
    min-height: auto;
    padding: 38px 16px 28px;
  }

  .hero-copy {
    margin-bottom: 26px;
  }

  .hero h1 {
    font-size: 54px;
  }

  .workspace {
    min-height: 0;
    overflow: hidden;
  }

  .workspace-bar {
    padding: 0 14px;
  }

  .agent-status span:last-child {
    display: none;
  }

  .workspace-grid {
    display: block;
    min-height: auto;
    overflow: visible;
  }

  .tool-rail {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    padding: 8px;
  }

  .rail-item {
    display: flex;
    justify-content: center;
    min-height: 38px;
    padding: 0 5px;
  }

  .rail-item b,
  .rail-dot {
    display: none;
  }

  .revision-list {
    display: none;
  }

  .revision-detail {
    min-height: 270px;
    padding: 16px;
  }

  .detail-grid {
    margin-top: 18px;
  }

  .checks {
    display: none;
  }

  .detail-actions {
    margin-top: 16px;
  }

  .workflow-band,
  .principles,
  .architecture {
    padding: 70px 16px;
  }

  .workflow-steps {
    grid-template-columns: 1fr;
  }

  .workflow-steps li,
  .workflow-steps li + li {
    min-height: auto;
    padding: 18px 0 24px;
    border-right: 0;
    border-bottom: 1px solid #484d4b;
  }

  .workflow-steps li:nth-child(n + 4) {
    border-top: 0;
  }

  .workflow-steps span {
    margin-bottom: 22px;
  }

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

  .build-status {
    grid-template-columns: 1fr;
    gap: 48px;
    padding: 68px 16px;
  }

  footer {
    grid-template-columns: 1fr auto;
    gap: 18px;
    min-height: 120px;
    padding: 22px 16px;
  }

  footer > p:not(.copyright) {
    grid-column: 1 / -1;
    grid-row: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .execution-track.running span {
    animation-duration: 0.01ms;
  }
}
