/*
 * 数据色是验证出来的，不是挑出来的，而且和站点同一个品牌色相族。
 *
 * 站点的 --vp-c-brand-1 是 #3157c8（浅）/ #91aaff（暗），色相 266°/271°。本页曾用
 * 自己的一套蓝（#175c91 / #3489cf，色相 247°），暗色那一对与站点相差 OKLab ΔE 15.1
 * ——正好过了“全色觉读者能分辨两个颜色”的门槛，于是嵌进课程页的组件看起来像另一个
 * 产品。现在浅色直接用站点那个色，暗色用同色相重新选步。
 *
 * 用 data-viz 六项检查验证，对本页自己的卡片表面（浅 #ffffff，暗 #1b1b1f）：
 *   分类色 --brand / --signal
 *     浅  #3157c8 + #d46b3e   五项全过，CVD ΔE 26.4（protan），常视力 33.7
 *     暗  #6b8ae8 + #d1793f   五项全过，CVD ΔE 24.3（protan），常视力 26.3
 *   暗色的 #6b8ae8 在色相 268°，落在站点 266° 和 271° 之间；站点自己的 #91aaff
 *   亮度 0.75，超出暗色数据带（0.48–0.67），所以它留给链接和 chrome，不做数据标记。
 *
 *   状态色 --allow / --warning / --deny 在两种模式下亮度带、色度下限、常视力下限和
 *   对比度全过。绿红这一对的 CVD ΔE 是 3.6（deutan），只要色相还是绿和红，任何选步
 *   都改不了。所以状态从不靠色相承载：每个判定都带字形和文字标签，而被拒调用根本
 *   没有 body 横条，时间轴用形状区分 allow 和 deny。
 *
 *   更早的一版还失败过三项：--allow #19765b 和 --warning #8d661d 低于色度下限、读起来
 *   发灰，且 --warning 与 --deny 的常视力 ΔE 只有 12.9，低于 15 底线——在一个权限管线
 *   里，全色觉读者会把“警告”和“拒绝”看混。重新选步后这一对是 20.9。
 *
 * 表面色也对齐了站点：浅 #f6f6f7/#ffffff，暗 #161618/#1b1b1f，都取自构建产物里
 * VitePress 的实际取值。新表面上十项文字对比度全部达到 4.5:1 正文标准。
 */


* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 4% 0%, color-mix(in srgb, var(--brand-soft) 75%, transparent), transparent 32rem),
    radial-gradient(circle at 98% 18%, color-mix(in srgb, var(--signal-soft) 58%, transparent), transparent 29rem),
    var(--page);
  font-family: var(--sans);
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: var(--brand);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--signal) 80%, white);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  z-index: 10;
  top: 8px;
  left: 12px;
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--surface-strong);
  background: var(--brand);
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.lab-shell {
  width: min(1540px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.card,
.hero-panel {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.card {
  border-radius: var(--radius-lg);
}

.hero-panel {
  position: relative;
  overflow: hidden;
  padding: clamp(28px, 5vw, 68px);
  border-radius: var(--radius-xl);
}

.hero-panel::before,
.hero-panel::after {
  position: absolute;
  content: "";
  border: 1px solid color-mix(in srgb, var(--brand) 24%, transparent);
  border-radius: 50%;
  pointer-events: none;
}

.hero-panel::before {
  top: -190px;
  right: -100px;
  width: 500px;
  height: 500px;
  box-shadow:
    0 0 0 42px color-mix(in srgb, var(--brand) 6%, transparent),
    0 0 0 96px color-mix(in srgb, var(--brand) 3%, transparent);
}

.hero-panel::after {
  right: 16%;
  bottom: -240px;
  width: 380px;
  height: 380px;
  border-color: color-mix(in srgb, var(--signal) 25%, transparent);
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 900px;
}

.eyebrow,
.section-label,
.warning-index,
.schema-pill,
.summary-label,
.metric-grid span,
.tick-readout,
.keyboard-hint {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  color: var(--muted);
}

.eyebrow::before {
  width: 30px;
  height: 1px;
  background: var(--signal);
  content: "";
}

h1,
h2,
h3,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 940px;
  margin: 26px 0 0;
  font-size: clamp(2.35rem, 6vw, 5.4rem);
  font-weight: 800;
  letter-spacing: -0.06em;
  line-height: 0.98;
}

h2 {
  margin: 0;
  font-size: clamp(1.28rem, 2vw, 1.8rem);
  letter-spacing: -0.035em;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.3;
}

.hero-lead {
  max-width: 800px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.65vw, 1.18rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button,
.icon-button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  text-decoration: none;
  transition: transform var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
}

.button {
  padding: 10px 17px;
}

.button:hover,
.icon-button:hover:not(:disabled) {
  transform: translateY(-2px);
}

.button-primary {
  color: #fff;
  background: var(--brand);
}

.button-primary:hover {
  color: #fff;
  background: var(--brand-bright);
}

.button-secondary {
  border-color: var(--line-strong);
  color: var(--ink);
  background: color-mix(in srgb, var(--surface-strong) 65%, transparent);
}

.model-warning {
  position: absolute;
  z-index: 1;
  top: clamp(28px, 5vw, 68px);
  right: clamp(28px, 5vw, 68px);
  width: min(260px, 27%);
  padding: 17px;
  border: 1px solid color-mix(in srgb, var(--signal) 35%, var(--line));
  border-radius: var(--radius-md);
  color: var(--ink);
  background: color-mix(in srgb, var(--signal-soft) 78%, var(--surface));
}

.warning-index {
  color: var(--signal-ink);
}

.model-warning strong {
  display: block;
  margin-top: 12px;
  font-size: 1.03rem;
  line-height: 1.3;
}

.model-warning p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.pipeline-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin: 60px 0 0;
  padding: 0;
  list-style: none;
}

.pipeline-strip li {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 92px;
  padding: 17px 18px;
  border-top: 2px solid var(--brand);
  border-right: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-strong) 42%, transparent);
}

.pipeline-strip li:first-child {
  border-radius: 12px 0 0 12px;
}

.pipeline-strip li:last-child {
  border-right: 0;
  border-radius: 0 12px 12px 0;
}

.pipeline-strip li::after {
  position: absolute;
  top: 27px;
  right: -7px;
  width: 12px;
  height: 12px;
  border-top: 2px solid var(--signal);
  border-right: 2px solid var(--signal);
  background: var(--surface-strong);
  content: "";
  transform: rotate(45deg);
}

.pipeline-strip li:last-child::after {
  display: none;
}

.pipeline-strip span {
  color: var(--signal-ink);
  font: 700 0.7rem var(--mono);
}

.pipeline-strip strong {
  font: 750 0.89rem var(--mono);
}

.pipeline-strip small {
  color: var(--muted);
  font-size: 0.76rem;
}

.experiment-grid {
  display: grid;
  grid-template-columns: minmax(260px, 0.35fr) minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  margin-top: 20px;
}

.experiment-grid > *,
.evidence-grid > * {
  min-width: 0;
}

.control-card,
.timeline-card,
.oracle-card,
.boundary-card,
.event-card,
.source-card,
.matrix-card,
.concurrency-card {
  padding: clamp(22px, 3vw, 38px);
}

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

.section-label {
  margin: 0 0 8px;
  color: var(--brand);
}

.schema-pill {
  display: inline-flex;
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: 999px;
  color: var(--brand);
  background: var(--brand-soft);
  white-space: nowrap;
}

.schema-oracle {
  color: var(--allow-ink);
  border-color: color-mix(in srgb, var(--allow) 36%, var(--line));
  background: var(--allow-soft);
}

form {
  display: grid;
  gap: 18px;
  margin-top: 28px;
}

form label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-weight: 700;
}

form label > span {
  font-size: 0.9rem;
}

form small {
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 450;
  line-height: 1.45;
}

input[type="number"],
select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--ink);
  background: var(--surface-strong);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--brand);
}

output {
  color: var(--brand);
  font-family: var(--mono);
}

.button-wide {
  width: 100%;
  margin-top: 4px;
}

.feedback {
  min-height: 26px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.83rem;
}

.feedback[data-tone="success"] {
  color: var(--allow-ink);
}

.feedback[data-tone="error"] {
  color: var(--deny-ink);
}

.feedback[data-tone="notice"] {
  color: var(--warning-ink);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.metric-grid > div {
  display: grid;
  gap: 4px;
  min-height: 84px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-soft) 58%, transparent);
}

.metric-grid > div.metric-oracle {
  grid-column: 1 / -1;
  background: var(--allow-soft);
}

.metric-grid span {
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
}

.metric-grid strong {
  align-self: end;
  color: var(--brand);
  font: 800 1.34rem var(--mono);
}

#metric-oracle[data-pass="false"] {
  color: var(--deny-ink);
}

.timeline-heading {
  align-items: end;
}

.motion-status {
  max-width: 260px;
  margin: 0;
  color: var(--muted);
  font: 0.72rem/1.45 var(--mono);
  text-align: right;
}

.section-intro {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.transport {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 24px;
}

.icon-button {
  min-height: 38px;
  padding: 7px 13px;
  border-color: var(--line-strong);
  color: var(--ink);
  background: var(--surface-strong);
}

.icon-button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}

.play-button {
  min-width: 76px;
  color: #fff;
  border-color: var(--brand);
  background: var(--brand);
}

.seek-field {
  display: flex;
  flex: 1 1 220px;
  align-items: center;
  min-width: 180px;
  margin-left: 8px;
}

.seek-field input {
  width: 100%;
}

.tick-readout {
  display: flex;
  gap: 10px;
  color: var(--muted);
  white-space: nowrap;
}

.tick-readout strong {
  color: var(--brand);
}

.keyboard-hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
}

.timeline-scroll,
.table-scroll {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: color-mix(in srgb, var(--surface-soft) 42%, transparent);
}

.timeline-scroll {
  margin-top: 20px;
}

.timeline-plot {
  min-width: 760px;
  padding: 6px 10px 0;
}

.timeline-plot svg {
  display: block;
  width: 100%;
  min-height: 320px;
}

.tick-grid {
  stroke: var(--line);
  stroke-dasharray: 2 7;
  stroke-width: 1;
}

.tick-label,
.lane-label {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
}

.lane-label {
  font-size: 13px;
  font-weight: 700;
}

.lane-line {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.body-interval {
  fill: color-mix(in srgb, var(--brand) 65%, transparent);
  stroke: var(--brand);
  stroke-width: 1;
}

.body-interval.mode-exclusive {
  fill: color-mix(in srgb, var(--signal) 68%, transparent);
  stroke: var(--signal);
}

.event-marker {
  fill: var(--surface-strong);
  stroke: var(--brand);
  stroke-width: 2.5;
  transition: opacity var(--dur-fast) var(--ease), r var(--dur-fast) var(--ease);
}

.event-marker.phase-policy-decision {
  fill: var(--brand);
}

.event-marker.decision-deny {
  fill: var(--deny);
  stroke: var(--deny);
}

.event-marker.is-future {
  opacity: 0.33;
}

.event-marker.is-past {
  opacity: 0.7;
}

.event-marker.is-current {
  opacity: 1;
  stroke: var(--signal);
  stroke-width: 4;
}

.current-guide {
  stroke: var(--signal);
  stroke-dasharray: 5 5;
  stroke-width: 2;
}

.frame-inspector {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid color-mix(in srgb, var(--brand) 24%, var(--line));
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--brand-soft) 55%, transparent);
}

.summary-label {
  display: block;
  color: var(--brand);
}

.frame-summary strong {
  display: block;
  margin-top: 6px;
  font-size: 1.03rem;
}

.inspector-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 20px;
}

.inspector-columns h3 {
  color: var(--brand);
}

ul {
  margin: 11px 0 0;
  padding-left: 19px;
}

li {
  margin: 7px 0;
}

.inspector-columns li,
.oracle-list li,
.boundary-columns li {
  color: var(--muted);
  font-size: 0.84rem;
}

.evidence-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 20px;
  min-width: 0;
  margin-top: 20px;
}

.oracle-list {
  display: grid;
  gap: 7px;
  padding-left: 0;
  list-style: none;
}

.oracle-list li {
  display: grid;
  gap: 3px;
  padding: 11px 13px;
  border-left: 3px solid var(--allow);
  background: color-mix(in srgb, var(--allow-soft) 55%, transparent);
}

.oracle-list li[data-pass="false"] {
  border-left-color: var(--deny);
  background: color-mix(in srgb, var(--deny-soft) 58%, transparent);
}

.oracle-list strong {
  color: var(--ink);
}

.oracle-list span {
  font: 0.72rem/1.45 var(--mono);
}

.boundary-columns,
.source-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.boundary-columns > div {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

.boundary-columns h3 {
  font-family: var(--mono);
}

.boundary-yes {
  border-top: 3px solid var(--allow) !important;
}

.boundary-no {
  border-top: 3px solid var(--deny) !important;
}

.boundary-yes h3 {
  color: var(--allow-ink);
}

.boundary-no h3 {
  color: var(--deny-ink);
}

.event-card,
.source-card {
  margin-top: 20px;
}

.event-heading {
  align-items: end;
}

.event-heading > p {
  max-width: 310px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-align: right;
}

.table-scroll {
  margin-top: 20px;
}

table {
  width: 100%;
  min-width: 800px;
  border-collapse: collapse;
  font-size: 0.79rem;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--brand);
  background: color-mix(in srgb, var(--surface-soft) 72%, transparent);
  font: 700 0.7rem var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

td {
  color: var(--muted);
}

td:first-child,
td:nth-child(2),
td:nth-child(3),
td:nth-child(4),
td:nth-child(5) {
  color: var(--ink);
  font-family: var(--mono);
  white-space: nowrap;
}

tbody tr.is-current {
  background: color-mix(in srgb, var(--signal-soft) 68%, transparent);
}

tbody tr.is-future {
  opacity: 0.5;
}

tbody tr:last-child td {
  border-bottom: 0;
}

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

.source-columns > div {
  padding: 17px;
  border-top: 2px solid var(--brand);
  background: color-mix(in srgb, var(--surface-soft) 48%, transparent);
}

.source-columns p {
  min-height: 92px;
  margin: 11px 0 14px;
  color: var(--muted);
  font-size: 0.85rem;
}

.source-columns a {
  font-size: 0.84rem;
  font-weight: 750;
}

.page-footer {
  display: flex;
  justify-content: space-between;
  gap: 22px;
  margin-top: 24px;
  padding: 4px 10px;
  color: var(--muted);
  font: 0.7rem var(--mono);
}

.page-footer a {
  font-weight: 750;
  text-decoration: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 1120px) {
  .model-warning {
    position: relative;
    top: auto;
    right: auto;
    width: min(100%, 360px);
    margin-top: 28px;
  }

  .pipeline-strip {
    margin-top: 38px;
  }
}

@media (max-width: 900px) {
  .experiment-grid,
  .evidence-grid {
    grid-template-columns: 1fr;
  }

  .control-card {
    order: 0;
  }

  .timeline-card {
    order: 1;
  }
}

@media (max-width: 700px) {
  .lab-shell {
    width: min(100% - 20px, 1540px);
    padding-top: 10px;
  }

  .hero-panel,
  .card {
    border-radius: 18px;
  }

  .hero-panel,
  .control-card,
  .timeline-card,
  .oracle-card,
  .boundary-card,
  .event-card,
  .source-card {
    padding: 22px;
  }

  .pipeline-strip {
    grid-template-columns: 1fr;
  }

  .pipeline-strip li,
  .pipeline-strip li:first-child,
  .pipeline-strip li:last-child {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .pipeline-strip li:first-child {
    border-radius: 12px 12px 0 0;
  }

  .pipeline-strip li:last-child {
    border-bottom: 0;
    border-radius: 0 0 12px 12px;
  }

  .pipeline-strip li::after {
    top: auto;
    right: auto;
    bottom: -7px;
    left: 26px;
    transform: rotate(135deg);
  }

  .timeline-heading,
  .event-heading {
    display: grid;
  }

  .motion-status,
  .event-heading > p {
    max-width: none;
    text-align: left;
  }

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

  .source-columns p {
    min-height: auto;
  }

  .page-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  .card,
  .hero-panel,
  .pipeline-strip li,
  .frame-inspector,
  .timeline-scroll,
  .table-scroll {
    border: 1px solid CanvasText;
  }

  .button,
  .icon-button,
  input,
  select {
    border: 1px solid ButtonText;
  }
}

/* ---------------------------------------------------------------------------
 * Two views derived from the same event stream
 *
 * Both exist to make an oracle invariant checkable by looking instead of by
 * trusting the PASS badge: the matrix shows which phases a call reached, the
 * step chart shows body concurrency against the requested cap. Neither adds a
 * dimension the data does not have, and both keep the event table as the full
 * text alternative.
 * ------------------------------------------------------------------------- */

.derived-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 20px;
  min-width: 0;
  margin-top: 20px;
}

.derived-grid > * {
  min-width: 0;
}

.section-intro {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.chart-note {
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.86rem;
}

/* --- phase coverage matrix ------------------------------------------------ */

.matrix-scroll,
.concurrency-scroll {
  overflow-x: auto;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--surface-strong) 62%, transparent);
}

.matrix-table {
  width: 100%;
  border-collapse: separate;
  /* A 2px gap of surface between filled cells; adjacent fills must not touch. */
  border-spacing: 2px;
  font-size: 0.84rem;
}

.matrix-table caption {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: left;
}

.matrix-table th {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
}

.matrix-table tbody th {
  padding-right: 14px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.86rem;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
}

.matrix-table td {
  width: 1%;
  padding: 9px 11px;
  border-radius: 4px;
  color: var(--ink);
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.matrix-table td[data-state="present"] {
  background: color-mix(in srgb, var(--brand) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 34%, transparent);
}

/* The absent cell is the finding, so it reads as a hole rather than a colour. */
.matrix-table td[data-state="absent"] {
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  background: none;
}

.matrix-table tbody tr[data-decision="deny"] th::after {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--deny-ink);
  background: var(--deny-soft);
  content: "✕ denied";
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 750;
}

.matrix-table tbody tr[data-decision="allow"] th::after {
  margin-left: 8px;
  padding: 1px 7px;
  border-radius: 999px;
  color: var(--allow-ink);
  background: var(--allow-soft);
  content: "✓ allowed";
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 750;
}

.matrix-table td.is-future {
  opacity: 0.42;
}

.matrix-table td.is-current {
  box-shadow:
    inset 0 0 0 2px var(--signal),
    0 0 0 2px color-mix(in srgb, var(--signal) 30%, transparent);
}

/* --- concurrency step chart ---------------------------------------------- */

.concurrency-scroll svg {
  display: block;
  width: 100%;
  min-width: 1100px;
}

.conc-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.conc-axis {
  fill: var(--muted);
  font-family: var(--mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.conc-cap {
  stroke: var(--signal);
  stroke-dasharray: 7 5;
  stroke-width: 2;
}

.conc-cap-label {
  fill: var(--signal);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 750;
}

.conc-step {
  fill: none;
  stroke: var(--brand);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.conc-point {
  fill: var(--surface-strong);
  stroke: var(--brand);
  stroke-width: 2;
  transition: r var(--dur-fast) var(--ease), opacity var(--dur-fast) var(--ease);
}

.conc-point.is-future {
  opacity: 0.38;
}

.conc-point.is-current {
  r: 7;
  fill: var(--brand);
}

.conc-guide {
  stroke: var(--signal);
  stroke-width: 2;
  transition: transform var(--dur-fast) var(--ease);
}

@media (max-width: 1080px) {
  .derived-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Motion here only marks where the reader is; it never encodes a value, so
 * removing it costs no information. */
@media (prefers-reduced-motion: reduce) {
  .conc-point,
  .conc-guide {
    transition: none;
  }
}

@media (forced-colors: active) {
  .matrix-scroll,
  .concurrency-scroll {
    border: 1px solid CanvasText;
  }

  .matrix-table td[data-state="present"] {
    box-shadow: inset 0 0 0 1px CanvasText;
  }

  .matrix-table td[data-state="absent"] {
    border: 1px dashed CanvasText;
  }
}

/*
 * 内联图标。语义由旁边的文字标签承担，图标只加快扫读；去掉全部图标后信息量不变。
 * 用 currentColor 描边，所以颜色跟随所在容器，不引入第二套配色。
 */
.icon {
  flex: none;
  vertical-align: -0.16em;
  margin-right: 0.42em;
}

.has-icon {
  display: inline-flex;
  align-items: baseline;
}

/* 图标不参与减少动态效果的判断，它本身不动。 */
@media (forced-colors: active) {
  .icon { stroke: CanvasText; }
  [data-pass="true"] .icon, [data-pass="true"].icon { stroke: CanvasText; }
}

/* 标题断行平衡：与共享层实验页一致，避免中文词组被拆到两行。 */
h1 { text-wrap: balance; letter-spacing: -0.01em; }
