:root {
  --ink: #18201d;
  --muted: #627069;
  --line: #d7ddd7;
  --paper: #f5f3ee;
  --surface: #ffffff;
  --soft: #e9eee8;
  --accent: #007f73;
  --accent-dark: #075c55;
  --amber: #bd7d1b;
  --rose: #b55862;
  --violet: #6b5d9c;
  --shadow: 0 20px 60px rgba(24, 32, 29, 0.12);
  --radius: 8px;
  font-family:
    Inter, "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(24, 32, 29, 0.04) 1px, transparent 1px),
    linear-gradient(180deg, rgba(24, 32, 29, 0.04) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
}

button,
input {
  font: inherit;
}

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(24, 32, 29, 0.12);
  background: rgba(245, 243, 238, 0.86);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--accent) 0 4px, transparent 5px),
    conic-gradient(from 45deg, transparent 0 24%, var(--accent) 25% 32%, transparent 33% 57%, var(--amber) 58% 66%, transparent 67%);
}

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

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

.nav-links {
  display: flex;
  gap: 22px;
  color: var(--muted);
  font-size: 14px;
}

.nav-links a:hover {
  color: var(--accent-dark);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 0.72fr) minmax(520px, 1.5fr);
  gap: 24px;
  min-height: calc(100svh - 68px);
  padding: 28px;
}

.profile-pane,
.control-surface,
.result-panel,
.boundary-locked,
.boundary-open {
  border: 1px solid rgba(24, 32, 29, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.profile-pane {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(24px, 4vw, 44px);
  overflow: hidden;
}

.profile-kicker,
.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 18px;
  font-size: clamp(48px, 7vw, 96px);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(26px, 3vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 10px;
  font-size: 18px;
  line-height: 1.25;
}

.profile-copy {
  max-width: 420px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.profile-facts {
  margin: 36px 0;
  border-top: 1px solid var(--line);
}

.profile-facts div {
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}

.profile-facts dt {
  color: var(--muted);
  font-size: 13px;
}

.profile-facts dd {
  margin: 0;
  font-weight: 700;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.trust-strip span,
.status-lock {
  border: 1px solid rgba(0, 127, 115, 0.24);
  border-radius: 999px;
  background: rgba(0, 127, 115, 0.08);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 700;
}

.trust-strip span {
  padding: 8px 11px;
}

.control-surface {
  padding: clamp(18px, 3vw, 30px);
}

.surface-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 22px;
}

.surface-head h2 {
  max-width: 580px;
}

.status-lock {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-height: 34px;
  padding: 8px 12px;
}

.lock-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(0, 127, 115, 0.12);
}

.input-grid {
  display: grid;
  grid-template-columns: 118px minmax(220px, 1fr) minmax(180px, 0.7fr) 132px;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(24, 32, 29, 0.12);
  border-radius: var(--radius);
  background: rgba(245, 243, 238, 0.74);
}

.input-grid label {
  display: grid;
  gap: 6px;
}

.input-grid label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.input-grid input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(24, 32, 29, 0.16);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 12px;
  outline: none;
}

.input-grid input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 127, 115, 0.12);
}

.run-button {
  align-self: end;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.run-button:hover {
  background: var(--accent-dark);
}

.run-icon {
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 9px solid currentColor;
}

.run-layout {
  display: grid;
  grid-template-columns: minmax(210px, 0.42fr) minmax(360px, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.role-rail {
  display: grid;
  gap: 10px;
  align-content: start;
  margin: 0;
  padding: 0;
  list-style: none;
}

.role-step {
  position: relative;
  min-height: 64px;
  padding: 12px 12px 12px 44px;
  border: 1px solid rgba(24, 32, 29, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.72);
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease;
}

.role-step::before {
  position: absolute;
  left: 13px;
  top: 17px;
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-radius: 50%;
  content: "";
}

.role-step strong,
.role-step span {
  display: block;
}

.role-step strong {
  font-size: 14px;
}

.role-step span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.role-step.is-active {
  border-color: rgba(0, 127, 115, 0.44);
  background: rgba(0, 127, 115, 0.08);
  transform: translateX(4px);
}

.role-step.is-active::before {
  border-color: var(--accent);
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(0, 127, 115, 0.12);
}

.role-step.is-done::before {
  border-color: var(--accent);
  background: var(--accent);
}

.result-panel {
  min-height: 554px;
  overflow: hidden;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 48px;
  border: 0;
  border-right: 1px solid var(--line);
  background: rgba(245, 243, 238, 0.78);
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.tab:last-child {
  border-right: 0;
}

.tab.is-active {
  background: var(--surface);
  color: var(--ink);
}

.panel-body {
  padding: 24px;
  animation: reveal 240ms ease both;
}

.panel-body h3 {
  font-size: 22px;
}

.panel-body p,
.panel-body li {
  color: var(--muted);
  line-height: 1.75;
}

.note-output {
  display: grid;
  gap: 18px;
}

.note-block {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.note-block:last-child {
  border-bottom: 0;
}

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

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tags span {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
}

.section-band {
  display: grid;
  gap: 32px;
  padding: clamp(56px, 8vw, 96px) 28px;
  border-top: 1px solid rgba(24, 32, 29, 0.12);
}

.section-intro,
.rule-copy {
  max-width: 760px;
}

.section-intro p,
.rule-copy p {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.75;
}

.capability-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.capability-grid article {
  min-height: 210px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.84);
}

.capability-grid span {
  display: block;
  margin-bottom: 46px;
  color: var(--amber);
  font-weight: 900;
}

.capability-grid p {
  color: var(--muted);
  line-height: 1.7;
}

.rules {
  grid-template-columns: minmax(260px, 0.72fr) minmax(420px, 1.2fr);
  align-items: start;
}

.rule-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.rule-list div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.rule-list strong {
  color: var(--accent-dark);
}

.rule-list span {
  color: var(--muted);
  line-height: 1.7;
}

.boundary {
  grid-template-columns: minmax(220px, 0.46fr) minmax(420px, 1fr);
}

.boundary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.boundary-locked,
.boundary-open {
  padding: 26px;
}

.boundary-locked h3 {
  color: var(--rose);
}

.boundary-open h3 {
  color: var(--accent-dark);
}

.boundary ul {
  margin: 0;
  padding-left: 18px;
}

.boundary li {
  margin: 12px 0;
  color: var(--muted);
}

.footer {
  padding: 28px;
  border-top: 1px solid rgba(24, 32, 29, 0.12);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.footer p {
  max-width: 860px;
  margin: 0;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1060px) {
  .workspace,
  .rules,
  .boundary {
    grid-template-columns: 1fr;
  }

  .profile-pane {
    min-height: auto;
  }

  .input-grid,
  .run-layout {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
  }

  .nav-links {
    width: 100%;
    justify-content: space-between;
  }

  .workspace,
  .section-band,
  .footer {
    padding-left: 16px;
    padding-right: 16px;
  }

  .surface-head {
    flex-direction: column;
  }

  .capability-grid,
  .boundary-grid {
    grid-template-columns: 1fr;
  }

  .rule-list div {
    grid-template-columns: 1fr;
    gap: 8px;
  }

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

  .tab {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .result-panel {
    min-height: auto;
  }
}

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