:root {
  --ink: #17201c;
  --muted: #65706a;
  --paper: #f4f5f0;
  --surface: #ffffff;
  --line: #d5dad5;
  --line-strong: #9ca79f;
  --hero: #13231c;
  --hero-soft: #1c3228;
  --lime: #c9f36b;
  --lime-dark: #28450d;
  --blue: #225bc8;
  --blue-soft: #e5edfc;
  --orange: #c8592f;
  --orange-soft: #f8e6dc;
  --green: #2b7458;
  --green-soft: #e0f0e8;
  --focus: #ffbb38;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
a,
summary {
  font: inherit;
}

button,
summary {
  -webkit-tap-highlight-color: transparent;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 50;
  padding: 10px 14px;
  color: #fff;
  background: #000;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.hero {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100vh;
  padding: 22px max(24px, calc((100vw - 1180px) / 2));
  color: #f7faf6;
  background: var(--hero);
}

.topbar,
.hero-copy,
.system-flow,
.hero-actions,
.demo-route,
main,
.site-footer {
  width: min(1180px, 100%);
  margin-inline: auto;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 13px;
}

.topbar strong {
  letter-spacing: -0.01em;
}

.boundary-tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  color: var(--lime-dark);
  background: var(--lime);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.045em;
  white-space: nowrap;
}

.hero-copy {
  padding: 44px 0 30px;
}

.eyebrow,
.step-label,
.control-label,
.plain-label,
.result-kicker,
.metric-label {
  margin: 0;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.eyebrow {
  margin-bottom: 12px;
  color: var(--lime);
}

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

h1 {
  max-width: 1000px;
  margin-bottom: 13px;
  font-size: clamp(42px, 5.4vw, 74px);
  font-weight: 670;
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero-subtitle {
  margin-bottom: 14px;
  color: var(--lime);
  font-size: clamp(23px, 2.5vw, 34px);
  font-weight: 620;
  letter-spacing: -0.025em;
}

.hero-intro {
  max-width: 720px;
  margin-bottom: 0;
  color: #cbd5cf;
  font-size: 16px;
  line-height: 1.65;
}

.system-flow {
  display: grid;
  grid-template-columns: 1fr auto 1.2fr auto 1.2fr auto 1.2fr auto 0.8fr;
  align-items: stretch;
  border-top: 1px solid rgba(255, 255, 255, 0.28);
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
}

.flow-node {
  display: flex;
  min-width: 0;
  min-height: 105px;
  flex-direction: column;
  justify-content: center;
  padding: 15px 13px;
}

.flow-node span,
.flow-node small {
  color: #aebdb5;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.035em;
  line-height: 1.35;
}

.flow-node strong {
  margin: 8px 0 7px;
  font-size: 14px;
  line-height: 1.35;
}

.flow-source strong,
.flow-final strong {
  color: var(--lime);
  font-family: var(--mono);
  font-size: 21px;
}

.flow-accent {
  background: var(--hero-soft);
}

.flow-arrow {
  display: grid;
  place-items: center;
  color: var(--lime);
  font-size: 18px;
}

.hero-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 25px 0 18px;
}

.primary-action,
.run-button,
.secondary-action {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 11px 18px;
  border: 0;
  cursor: pointer;
  font-weight: 700;
  text-decoration: none;
}

.primary-action {
  color: var(--lime-dark);
  background: var(--lime);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #dcff8c;
}

.quick-nav {
  display: flex;
  gap: 24px;
}

.quick-nav a {
  color: #d8e0db;
  font-size: 13px;
  text-underline-offset: 4px;
}

.demo-route {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-top: 16px;
  color: #aebdb5;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
  line-height: 1.45;
}

.demo-route b {
  color: var(--lime);
}

main {
  padding: 0 24px 90px;
}

.load-error {
  margin: 24px 0;
  padding: 16px;
  color: #6b2b1c;
  background: var(--orange-soft);
  border-left: 4px solid var(--orange);
}

.lesson {
  display: grid;
  grid-template-columns: minmax(230px, 0.6fr) minmax(0, 1.55fr);
  gap: 54px;
  padding: 86px 0;
  border-bottom: 1px solid var(--line-strong);
  scroll-margin-top: 18px;
}

.lesson-heading {
  align-self: start;
  position: sticky;
  top: 24px;
}

.step-label {
  margin-bottom: 16px;
  color: var(--blue);
}

h2 {
  max-width: 360px;
  margin-bottom: 18px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 680;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

.lesson-heading > p:last-child {
  max-width: 390px;
  margin-bottom: 0;
  color: #48534d;
  font-size: 17px;
  line-height: 1.75;
}

.demo-surface {
  min-width: 0;
  padding: 28px;
  background: var(--surface);
  border-top: 4px solid var(--ink);
  box-shadow: 0 16px 40px rgba(26, 40, 33, 0.06);
}

.lesson-featured .demo-surface {
  border-top-color: var(--orange);
}

.demo-control-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.control-label,
.plain-label,
.result-kicker,
.metric-label {
  color: var(--muted);
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
}

.segmented button {
  min-height: 44px;
  padding: 9px 14px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
}

.segmented button:hover:not(:disabled) {
  background: #eef1ed;
  border-color: var(--ink);
}

.segmented button[aria-pressed="true"] {
  color: #fff;
  background: var(--ink);
  border-color: var(--ink);
}

.segmented button[aria-pressed="true"]::before {
  content: "✓ ";
}

.segmented button:disabled {
  color: #8c948f;
  background: #f1f2ef;
  border-style: dashed;
  cursor: not-allowed;
}

.segmented.compact button {
  min-width: 64px;
}

.run-button {
  flex: 0 0 auto;
  color: #fff;
  background: var(--blue);
}

.run-button:hover,
.run-button:focus-visible {
  background: #1849a7;
}

.run-state {
  min-height: 34px;
  padding: 11px 0 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.run-state[data-state="complete"] {
  color: var(--green);
}

.run-state[data-state="not-run"] {
  color: var(--orange);
}

.history-block {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(180px, 0.75fr);
  gap: 28px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.token-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.token-list span,
.next-item {
  display: inline-flex;
  padding: 7px 9px;
  color: #344039;
  background: #e9ece8;
  font-family: var(--mono);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.next-item {
  margin-top: 10px;
  color: #17439c;
  background: var(--blue-soft);
}

.result-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding-top: 26px;
}

.result-intro h3,
.ctr-main-result h3 {
  margin: 5px 0 0;
  font-size: 22px;
  letter-spacing: -0.025em;
}

.result-method {
  padding: 6px 8px;
  color: #17439c;
  background: var(--blue-soft);
  font-family: var(--mono);
  font-size: 10px;
}

.recommendation-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 0;
  list-style-position: inside;
  counter-reset: result;
  border-top: 1px solid var(--ink);
}

.recommendation-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  counter-increment: result;
}

.recommendation-list li:nth-child(odd) {
  border-right: 1px solid var(--line);
}

.recommendation-list li::before {
  content: counter(result, decimal-leading-zero);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
}

.recommendation-list strong,
.recommendation-list span {
  overflow-wrap: anywhere;
  font-family: var(--mono);
  font-size: 10px;
}

.recommendation-list span {
  color: var(--muted);
  font-size: 9px;
}

.blocked-trace {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  padding: 16px;
  color: #74321f;
  background: var(--orange-soft);
  border-left: 3px solid var(--orange);
  font-size: 12px;
  line-height: 1.55;
}

.blocked-trace[hidden] {
  display: none;
}

.blocked-trace strong {
  font-family: var(--mono);
  font-size: 11px;
}

.tech-details {
  margin-top: 24px;
  border-top: 1px solid var(--line-strong);
  border-bottom: 1px solid var(--line-strong);
}

.tech-details summary,
.project-boundary summary {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  list-style: none;
}

.tech-details summary::-webkit-details-marker,
.project-boundary summary::-webkit-details-marker {
  display: none;
}

.tech-details summary::after,
.project-boundary summary::after {
  content: "+";
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 20px;
}

.tech-details[open] summary::after,
.project-boundary[open] summary::after {
  content: "−";
}

.tech-details summary span {
  font-weight: 700;
}

.tech-details summary small {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.details-body {
  padding: 22px 0 26px;
  border-top: 1px solid var(--line);
}

.advanced-controls {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  margin-bottom: 22px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}

.metric-grid.five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.metric-cell {
  min-width: 0;
  padding: 14px 12px 16px;
  border-right: 1px solid var(--line);
}

.metric-cell:last-child {
  border-right: 0;
}

.metric-label {
  display: block;
  min-height: 27px;
  line-height: 1.35;
}

.metric-value {
  display: block;
  margin-top: 8px;
  font-family: var(--mono);
  font-size: clamp(20px, 2vw, 27px);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.035em;
  overflow-wrap: anywhere;
}

.metric-std {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.ann-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 12px;
  color: #183674;
  background: var(--blue-soft);
  border-left: 3px solid var(--blue);
}

.ann-strip[hidden] {
  display: none;
}

.ann-strip > div {
  padding: 12px;
  border-right: 1px solid #bdcdef;
}

.ann-strip span,
.ann-strip strong {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
}

.ann-strip strong {
  margin-top: 5px;
  font-size: 14px;
}

.evidence-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 18px 0 0;
  border-top: 1px solid var(--line);
}

.evidence-list > div {
  min-width: 0;
  padding: 11px 10px 0 0;
}

.evidence-list dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.evidence-list dd {
  margin: 5px 0 0;
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.panel-footnote {
  margin: 18px 0 0;
  padding-left: 12px;
  color: var(--muted);
  border-left: 2px solid var(--line-strong);
  font-size: 11px;
  line-height: 1.65;
}

.next-step {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  margin-top: 24px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 2px solid var(--ink);
}

.next-step:hover,
.next-step:focus-visible {
  color: var(--blue);
  border-color: var(--blue);
}

.ctr-main-result {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(240px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding: 26px 0 12px;
}

.ctr-main-result p:not(.result-kicker) {
  max-width: 540px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.probability-panel {
  display: flex;
  min-height: 150px;
  flex-direction: column;
  justify-content: center;
  padding: 22px;
  color: #163472;
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
}

.probability-panel strong {
  font-family: var(--mono);
  font-size: 48px;
  letter-spacing: -0.06em;
}

.probability-panel span {
  margin-top: 7px;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
}

.ctr-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(220px, 0.65fr);
  gap: 24px;
  margin-top: 22px;
}

.results-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
}

.feature-grid > div {
  display: flex;
  min-width: 0;
  gap: 6px;
  padding: 7px 5px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9px;
}

.feature-grid dt {
  color: var(--muted);
}

.feature-grid dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.bias-visual {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 34px;
  align-items: center;
  padding: 8px 0 28px;
}

.phone-list {
  display: grid;
  gap: 7px;
  padding: 14px;
  background: #ecede8;
  border: 1px solid var(--line);
}

.rank-row {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  min-height: 50px;
  padding: 9px 12px;
  background: #fff;
  border-left: 3px solid #bcc3bd;
}

.rank-row b {
  font-family: var(--mono);
  font-size: 13px;
}

.rank-row em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.rank-one {
  border-left-color: var(--orange);
  box-shadow: 0 6px 16px rgba(71, 40, 24, 0.09);
}

.rank-one em {
  color: #8c341d;
  font-weight: 700;
}

.bias-message > span {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.bias-message > strong {
  display: block;
  max-width: 480px;
  margin-top: 10px;
  font-size: clamp(25px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.bias-message p {
  max-width: 460px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.position-controls {
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

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

.primary-metrics .metric-value {
  font-size: clamp(30px, 4vw, 46px);
}

.bias-explainer {
  margin: 20px 0 0;
  padding: 17px;
  color: #703019;
  background: var(--orange-soft);
  border-left: 4px solid var(--orange);
  font-size: 14px;
  line-height: 1.65;
}

.secondary-action {
  width: 100%;
  margin-top: 22px;
  color: var(--ink);
  background: #eef0eb;
  border: 1px solid var(--line-strong);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  background: #e3e6e1;
}

.site-footer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding: 28px 24px 48px;
}

.project-boundary {
  width: min(650px, 100%);
  color: var(--muted);
  border-bottom: 1px solid var(--line-strong);
}

.project-boundary summary {
  min-height: 34px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.project-boundary p {
  margin: 8px 0 14px;
  font-size: 11px;
  line-height: 1.65;
}

@media (max-width: 900px) {
  .hero {
    min-height: auto;
  }

  .system-flow {
    grid-template-columns: 1fr 20px 1fr 20px 1fr;
  }

  .system-flow .flow-arrow:nth-of-type(n + 3),
  .system-flow .flow-node:nth-of-type(n + 4) {
    display: none;
  }

  .lesson {
    grid-template-columns: 1fr;
    gap: 30px;
  }

  .lesson-heading {
    position: static;
  }

  .lesson-heading > p:last-child {
    max-width: 680px;
  }

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

  .ctr-main-result,
  .ctr-workbench {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  html {
    scroll-behavior: auto;
  }

  .hero {
    padding: 16px 14px 26px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .hero-copy {
    padding: 32px 0 22px;
  }

  h1 {
    font-size: clamp(37px, 12vw, 52px);
  }

  .hero-subtitle {
    font-size: 23px;
    line-height: 1.18;
  }

  .hero-intro {
    font-size: 14px;
  }

  .hero-actions {
    order: 3;
    align-items: stretch;
    flex-direction: column;
    padding: 4px 0 18px;
  }

  .system-flow {
    order: 4;
    grid-template-columns: 1fr;
  }

  .flow-arrow {
    min-height: 28px;
    transform: rotate(90deg);
  }

  .system-flow .flow-arrow:nth-of-type(n),
  .system-flow .flow-node:nth-of-type(n) {
    display: grid;
  }

  .flow-node {
    min-height: 84px;
  }

  .demo-route {
    order: 5;
    align-items: flex-start;
    flex-direction: column;
    margin-top: 18px;
  }

  .demo-route b {
    display: none;
  }

  .quick-nav {
    justify-content: space-between;
    gap: 10px;
  }

  main {
    padding: 0 14px 56px;
  }

  .lesson {
    gap: 24px;
    padding: 60px 0;
  }

  h2 {
    font-size: 38px;
  }

  .lesson-heading > p:last-child {
    font-size: 16px;
  }

  .demo-surface {
    padding: 18px;
    box-shadow: none;
  }

  .demo-control-row,
  .result-intro {
    align-items: stretch;
    flex-direction: column;
  }

  .run-button {
    width: 100%;
  }

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

  .segmented button {
    width: 100%;
  }

  .history-block,
  .bias-visual,
  .advanced-controls {
    grid-template-columns: 1fr;
  }

  .next-item-wrap {
    padding-top: 14px;
    border-top: 1px solid var(--line);
  }

  .recommendation-list,
  .ann-strip {
    grid-template-columns: 1fr;
  }

  .recommendation-list li:nth-child(odd),
  .ann-strip > div {
    border-right: 0;
  }

  .tech-details summary {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .tech-details summary small {
    width: calc(100% - 30px);
    margin-left: 0;
  }

  .metric-grid,
  .metric-grid.five,
  .primary-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-cell:nth-child(even) {
    border-right: 0;
  }

  .metric-cell:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .evidence-list {
    grid-template-columns: 1fr;
  }

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

  .bias-visual {
    gap: 24px;
  }

  .rank-row {
    grid-template-columns: 25px 1fr;
  }

  .rank-row em {
    grid-column: 2;
  }

  .site-footer {
    align-items: stretch;
    flex-direction: column;
    padding: 24px 14px 40px;
  }
}

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

/* XIAOYUE LAB × commercial polish: a restrained visual refinement only. */
:root {
  --ink: #101512;
  --muted: #667069;
  --paper: #f1ebdd;
  --paper-cool: #d9ddcf;
  --surface: #fbf8ef;
  --line: rgba(36, 74, 49, 0.14);
  --line-strong: rgba(36, 74, 49, 0.28);
  --hero: #244a31;
  --hero-soft: #31573d;
  --lime: #c9f36a;
  --blue: #315f43;
  --blue-soft: #e5eadf;
  --orange: #e8694f;
  --orange-soft: #f8dfd3;
  --green: #315f43;
  --green-soft: #e4ecdf;
  --focus: #f06f52;
  --sans: "PingFang SC", "Lantinghei SC", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --display: "Lantinghei SC", "PingFang SC", "Noto Sans SC", sans-serif;
}

body {
  font-synthesis: none;
}

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px rgba(240, 111, 82, 0.14);
}

.hero {
  min-height: min(790px, 100svh);
  padding-bottom: 32px;
  color: #f8f3e7;
  background:
    radial-gradient(circle at 92% 7%, rgba(201, 243, 106, 0.08), transparent 29%),
    linear-gradient(145deg, #244a31 0%, #1f402b 100%);
}

.topbar {
  border-bottom-color: rgba(248, 243, 231, 0.17);
}

.topbar strong {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.topbar strong::before {
  content: "实验 01";
  padding: 4px 7px;
  color: #f4b69f;
  border: 1px solid rgba(244, 182, 159, 0.45);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.boundary-tag {
  border-radius: 9px;
}

.eyebrow {
  color: #f4b69f;
}

h1,
h2 {
  font-family: var(--display);
  font-weight: 600;
}

h1 {
  font-size: clamp(42px, 5vw, 66px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-subtitle {
  color: #f4b69f;
  font-size: clamp(24px, 2.5vw, 33px);
  font-weight: 600;
}

.hero-intro,
.quick-nav a {
  color: rgba(248, 243, 231, 0.76);
}

.system-flow {
  gap: 7px;
  padding: 7px;
  background: rgba(10, 25, 16, 0.18);
  border: 1px solid rgba(248, 243, 231, 0.13);
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(5, 18, 10, 0.16);
  backdrop-filter: blur(8px);
}

.flow-node {
  border-radius: 15px;
}

.flow-node span,
.flow-node small {
  color: rgba(248, 243, 231, 0.62);
}

.flow-accent {
  background: rgba(244, 182, 159, 0.12);
  box-shadow: inset 0 0 0 1px rgba(244, 182, 159, 0.13);
}

.primary-action,
.run-button,
.secondary-action {
  border-radius: 13px;
}

.primary-action {
  color: #244a31;
  background: #f4e9d7;
  box-shadow: 0 10px 25px rgba(6, 22, 12, 0.18);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: #fff9ed;
  transform: translateY(-1px);
}

.demo-route {
  color: rgba(248, 243, 231, 0.61);
}

.demo-route b {
  color: #f4b69f;
}

main {
  background:
    radial-gradient(circle at 8% 18%, rgba(118, 144, 111, 0.08), transparent 24%),
    radial-gradient(circle at 88% 77%, rgba(240, 111, 82, 0.05), transparent 22%);
}

.lesson {
  border-bottom-color: var(--line);
}

.step-label {
  color: var(--orange);
}

h2 {
  line-height: 1.06;
}

.demo-surface {
  background: rgba(251, 248, 239, 0.94);
  border: 1px solid rgba(36, 74, 49, 0.12);
  border-radius: 26px;
  box-shadow:
    0 24px 70px rgba(36, 52, 39, 0.09),
    0 2px 0 rgba(255, 255, 255, 0.7) inset;
}

.lesson-featured .demo-surface {
  border-color: rgba(232, 105, 79, 0.27);
  box-shadow:
    0 28px 76px rgba(92, 51, 35, 0.1),
    0 2px 0 rgba(255, 255, 255, 0.72) inset;
}

.demo-control-row {
  border-bottom-style: dashed;
}

.segmented button {
  border-radius: 11px;
}

.segmented button:hover:not(:disabled) {
  background: #e9ede2;
  border-color: rgba(36, 74, 49, 0.52);
}

.segmented button[aria-pressed="true"] {
  color: #fffaf0;
  background: var(--hero);
  border-color: var(--hero);
  box-shadow: 0 7px 18px rgba(36, 74, 49, 0.16);
}

.run-button {
  box-shadow: 0 9px 22px rgba(36, 74, 49, 0.16);
}

.run-button:hover,
.run-button:focus-visible {
  background: #244a31;
  transform: translateY(-1px);
}

.token-list span,
.next-item,
.result-method {
  border-radius: 9px;
}

.token-list span {
  background: #e7eadf;
}

.next-item,
.result-method {
  color: #315f43;
}

.recommendation-list {
  gap: 7px;
  border-top: 0;
}

.recommendation-list li,
.recommendation-list li:nth-child(odd) {
  background: rgba(229, 234, 223, 0.54);
  border: 1px solid rgba(36, 74, 49, 0.09);
  border-radius: 11px;
}

.tech-details {
  padding-inline: 16px;
  background: rgba(217, 221, 207, 0.22);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.details-body {
  border-top-style: dashed;
}

.metric-grid {
  background: rgba(255, 252, 244, 0.62);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.ann-strip {
  color: #244a31;
  border-radius: 12px;
  overflow: hidden;
}

.next-step {
  padding-inline: 4px;
  border-bottom: 1px solid var(--line-strong);
}

.next-step:hover,
.next-step:focus-visible {
  color: var(--orange);
  border-color: var(--orange);
}

.probability-panel {
  color: #244a31;
  border: 1px solid rgba(36, 74, 49, 0.13);
  border-radius: 19px;
  box-shadow: 0 16px 38px rgba(36, 74, 49, 0.09);
}

.bias-visual {
  padding: 24px;
  background: rgba(244, 182, 159, 0.16);
  border: 1px solid rgba(232, 105, 79, 0.14);
  border-radius: 21px;
  overflow: hidden;
}

.phone-list {
  padding: 16px;
  background: #d9ddcf;
  border: 1px solid rgba(36, 74, 49, 0.13);
  border-radius: 24px;
  box-shadow:
    0 20px 42px rgba(54, 54, 37, 0.15),
    0 2px 0 rgba(255, 255, 255, 0.55) inset;
  transform: rotate(-1deg);
}

.rank-row {
  background: #fbf8ef;
  border: 1px solid rgba(36, 74, 49, 0.1);
  border-radius: 12px;
}

.rank-one {
  border-color: rgba(232, 105, 79, 0.44);
  box-shadow: 0 9px 20px rgba(71, 40, 24, 0.12);
  transform: translateX(5px);
}

.bias-message > span {
  display: inline-flex;
  padding: 5px 8px;
  color: #9a3d2b;
  background: rgba(244, 182, 159, 0.34);
  border-radius: 8px;
}

.bias-explainer {
  border: 1px solid rgba(232, 105, 79, 0.18);
  border-radius: 13px;
}

.secondary-action {
  background: #e7eadf;
}

.project-boundary {
  border-bottom-color: var(--line);
}

@media (max-width: 620px) {
  html,
  body {
    overflow-x: clip;
  }

  .hero {
    min-height: auto;
  }

  .topbar strong {
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  h1 {
    font-size: clamp(34px, 10.8vw, 42px);
    line-height: 1.04;
    letter-spacing: -0.035em;
  }

  .hero-subtitle {
    font-size: 21px;
    line-height: 1.28;
  }

  .system-flow {
    gap: 4px;
    padding: 6px;
    border-radius: 18px;
  }

  .flow-node {
    border-radius: 12px;
  }

  .demo-surface {
    border-radius: 20px;
    box-shadow:
      0 10px 28px rgba(36, 52, 39, 0.07),
      0 1px 0 rgba(255, 255, 255, 0.68) inset;
  }

  .bias-visual {
    padding: 17px;
    border-radius: 17px;
  }

  .phone-list {
    border-radius: 19px;
    transform: none;
  }

  .rank-one {
    transform: none;
  }

  .tech-details {
    padding-inline: 12px;
  }
}

/* Top-3 ranking game: light, direct, and intentionally not a dashboard card grid. */
.hero {
  min-height: auto;
  color: var(--ink);
  background: #f3efe4;
  border-bottom: 1px solid var(--line-strong);
}

.topbar {
  border-bottom-color: var(--line-strong);
}

.topbar strong::before {
  color: #8f3929;
  border-color: rgba(143, 57, 41, 0.34);
}

.hero .boundary-tag {
  color: #315f43;
  background: #e1eadc;
}

.hero-copy {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  column-gap: 54px;
  padding: 38px 0 24px;
}

.hero-copy .eyebrow,
.hero-copy h1,
.hero-copy .hero-subtitle {
  grid-column: 1;
}

.hero-copy .eyebrow {
  color: var(--orange);
}

.hero-copy h1 {
  max-width: 780px;
  margin-bottom: 16px;
  font-size: clamp(42px, 5vw, 68px);
}

.hero-copy .hero-subtitle {
  margin-bottom: 0;
  color: #315f43;
  font-size: clamp(21px, 2.4vw, 31px);
}

.hero-copy .hero-intro {
  grid-column: 2;
  grid-row: 1 / span 3;
  align-self: end;
  padding: 0 0 6px 22px;
  color: #536058;
  border-left: 1px solid var(--line-strong);
}

.system-flow {
  gap: 0;
  padding: 0;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
}

.flow-node {
  min-height: 88px;
  border-radius: 0;
}

.flow-node + .flow-arrow,
.flow-arrow + .flow-node {
  border-left: 1px solid var(--line);
}

.flow-node span,
.flow-node small {
  color: #6f7a73;
}

.flow-node strong {
  color: var(--ink);
}

.flow-source strong,
.flow-final strong {
  color: #315f43;
}

.flow-accent {
  background: #e7e8dd;
  box-shadow: none;
}

.flow-arrow {
  color: var(--orange);
}

.hero-actions {
  padding: 20px 0 14px;
}

.hero .primary-action {
  color: #fffaf0;
  background: #315f43;
  box-shadow: none;
}

.hero .primary-action:hover,
.hero .primary-action:focus-visible {
  color: #fffaf0;
  background: #244a31;
}

.quick-nav a {
  color: #425048;
}

.demo-route {
  color: #68736c;
  border-top-color: var(--line);
}

.demo-route b {
  color: var(--orange);
}

.ranking-game {
  padding: 54px 0 82px;
  border-bottom: 1px solid var(--line-strong);
  scroll-margin-top: 12px;
}

.ranking-game__header {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 54px;
  align-items: end;
  margin-bottom: 28px;
}

.ranking-game__header h2 {
  max-width: 720px;
  margin-bottom: 0;
}

.ranking-game__boundary {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  border-left: 2px solid var(--orange);
  font-size: 12px;
  line-height: 1.65;
}

.ranking-arena {
  display: grid;
  grid-template-columns: minmax(240px, 0.65fr) minmax(0, 1.35fr);
  background: rgba(251, 248, 239, 0.8);
  border-top: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
}

.ranking-brief {
  padding: 30px 28px;
  background: #e2e5d8;
  border-right: 1px solid var(--line-strong);
}

.ranking-brief h3,
.ranking-workbench__heading h3 {
  margin: 8px 0 12px;
  font-size: clamp(22px, 2.7vw, 32px);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.ranking-brief > p:not(.plain-label) {
  margin-bottom: 26px;
  color: #46534b;
  font-size: 14px;
  line-height: 1.7;
}

.ranking-brief ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-strong);
}

.ranking-brief li {
  padding: 12px 0;
  border-bottom: 1px solid var(--line-strong);
  font-size: 13px;
  line-height: 1.45;
}

.ranking-workbench {
  min-width: 0;
  padding: 28px 30px 32px;
}

.ranking-workbench__heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.ranking-workbench__heading h3 {
  margin-bottom: 0;
}

#ranking-count {
  color: #315f43;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
}

.ranking-slots {
  margin: 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--ink);
}

.ranking-slot {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-strong);
}

.ranking-slot:has(.ranking-slot__copy) {
  background: linear-gradient(90deg, rgba(225, 234, 220, 0.75), transparent 72%);
}

.ranking-slot__rank {
  color: var(--orange);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 800;
}

.ranking-slot__empty {
  color: #879089;
  font-size: 13px;
}

.ranking-slot__copy {
  display: grid;
  gap: 4px;
}

.ranking-slot__copy strong {
  font-size: 15px;
}

.ranking-slot__copy small {
  color: var(--muted);
  font-size: 11px;
}

.ranking-slot__controls {
  display: flex;
  gap: 5px;
}

.ranking-slot__controls button,
.ranking-reset {
  min-height: 38px;
  padding: 7px 9px;
  color: #46534b;
  background: transparent;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  font-size: 11px;
}

.ranking-slot__controls button:hover:not(:disabled),
.ranking-reset:hover:not(:disabled) {
  color: var(--ink);
  background: #e7eadf;
}

.ranking-slot__controls button:disabled,
.ranking-reset:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.ranking-candidates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  margin-top: 8px;
  border-top: 1px solid var(--line-strong);
}

.ranking-candidates-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 22px 0 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
}

.ranking-candidates-label small {
  font-size: 9px;
  font-weight: 500;
}

.ranking-candidate {
  display: flex;
  min-width: 0;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
}

.ranking-candidate:hover:not(:disabled) {
  color: #315f43;
  padding-inline: 8px;
  background: rgba(225, 234, 220, 0.48);
}

.ranking-candidate[aria-pressed="true"] {
  color: #234d34;
  font-weight: 700;
}

.ranking-candidate[aria-pressed="true"]::before {
  content: "✓";
  flex: 0 0 auto;
  color: #315f43;
  font-family: var(--mono);
}

.ranking-candidate strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.ranking-candidate span {
  flex: 0 0 auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
}

.ranking-candidate:disabled {
  cursor: default;
}

.ranking-hint {
  min-height: 22px;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.ranking-hint[data-state="ready"] {
  color: #315f43;
  font-weight: 700;
}

.ranking-hint[data-state="notice"] {
  color: #9a3d2b;
}

.ranking-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 16px;
}

.ranking-actions .run-button {
  min-width: 210px;
}

.ranking-actions .run-button:disabled {
  color: #828a84;
  background: #dfe2dc;
  box-shadow: none;
  cursor: not-allowed;
}

.ranking-reset {
  min-height: 48px;
  padding-inline: 14px;
}

.ranking-feedback {
  margin-top: 28px;
  padding: 24px;
  background: #e6eddf;
  border-left: 4px solid #315f43;
}

.ranking-feedback[hidden] {
  display: none;
}

.ranking-feedback h3 {
  margin: 6px 0 8px;
  font-size: 28px;
}

#ranking-score {
  color: #315f43;
  font-weight: 700;
}

.ranking-feedback ol {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid rgba(49, 95, 67, 0.3);
}

.ranking-feedback li {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid rgba(49, 95, 67, 0.2);
}

.ranking-feedback li > span:first-child {
  color: #315f43;
  font-family: var(--mono);
  font-size: 11px;
}

.ranking-feedback li > span:last-child {
  display: grid;
  gap: 4px;
}

.ranking-feedback li small {
  color: #56635b;
  font-size: 11px;
  line-height: 1.55;
}

.ranking-feedback li[data-result="miss"] > span:first-child {
  color: var(--orange);
}

.ranking-answer {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(49, 95, 67, 0.3);
}

.ranking-answer span,
.ranking-answer strong {
  display: block;
}

.ranking-answer span {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
}

.ranking-answer strong {
  margin-top: 7px;
  line-height: 1.6;
}

.ranking-answer p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.ranking-feedback .secondary-action {
  width: auto;
  margin-top: 18px;
  background: #f5f1e7;
}

@media (max-width: 900px) {
  .hero-copy,
  .ranking-game__header {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .hero-copy .hero-intro {
    grid-column: 1;
    grid-row: auto;
    max-width: 720px;
  }

  .ranking-arena {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .hero-copy {
    padding: 28px 0 20px;
  }

  .hero-copy .hero-intro {
    padding: 0;
    border-left: 0;
  }

  .system-flow {
    border-radius: 0;
  }

  .flow-node {
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .flow-node + .flow-arrow,
  .flow-arrow + .flow-node {
    border-left: 0;
  }

  .ranking-game {
    padding: 42px 0 58px;
  }

  .ranking-game__boundary {
    padding-left: 12px;
  }

  .ranking-brief,
  .ranking-workbench {
    padding: 22px 18px;
  }

  .ranking-workbench__heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .ranking-slot {
    grid-template-columns: 34px minmax(0, 1fr);
  }

  .ranking-slot__controls {
    grid-column: 2;
    flex-wrap: wrap;
  }

  .ranking-slot__controls button {
    min-height: 44px;
  }

  .ranking-candidates {
    grid-template-columns: 1fr;
  }

  .ranking-candidate {
    min-height: 58px;
  }

  .ranking-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .ranking-actions .run-button,
  .ranking-reset,
  .ranking-feedback .secondary-action {
    width: 100%;
  }

  .ranking-answer strong {
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ranking-candidate,
  .primary-action,
  .run-button {
    transition: none;
    transform: none !important;
  }
}
