:root {
  color-scheme: light;
  --ink: #142228;
  --text: #2b3a42;
  --muted: #586a72;
  --line: #c4d0d5;
  --line-soft: #dce4e7;
  --surface: #ffffff;
  --surface-soft: #f4f7f8;
  --canvas: #eaf0f2;
  --primary: #315f6c;
  --primary-dark: #204853;
  --teal: #18735f;
  --blue: #2d5f9e;
  --purple: #74509a;
  --red: #bd4538;
  --amber: #8c681f;
  --shadow: 0 12px 36px rgba(20, 34, 40, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 4%, rgba(49, 95, 108, 0.11), transparent 30rem),
    var(--canvas);
  color: var(--text);
  font-family: Inter, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
}

button, input, select { font: inherit; }
button { color: inherit; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-160%);
  background: var(--ink);
  color: white;
  padding: 8px 14px;
  border-radius: 8px;
}
.skip-link:focus { transform: none; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(196, 208, 213, 0.9);
  background: rgba(250, 252, 252, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner,
.primary-nav,
.page-shell,
footer {
  width: min(1400px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 74px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font: 700 1.1rem/1 Georgia, serif;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18);
}
.brand-title { margin: 1px 0 0; color: var(--ink); font-weight: 700; }
.eyebrow {
  margin: 0 0 5px;
  color: var(--primary);
  font-size: .73rem;
  font-weight: 800;
  letter-spacing: .13em;
}

.runtime-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: .86rem;
}
.state-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(140, 104, 31, .12);
}
.runtime-state.ready .state-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(24,115,95,.12); }
.runtime-state.error .state-dot { background: var(--red); box-shadow: 0 0 0 4px rgba(189,69,56,.12); }

.primary-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: thin;
}
.nav-tab {
  flex: 0 0 auto;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  padding: 11px 15px 10px;
  cursor: pointer;
  font-weight: 650;
}
.nav-tab:hover { color: var(--ink); background: rgba(49, 95, 108, .05); }
.nav-tab.active { color: var(--ink); border-bottom-color: var(--primary); }
.nav-tab:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(45, 95, 158, .35);
  outline-offset: 2px;
}

.page-shell { padding: 32px 0 56px; }
.page-panel { animation: page-in .28s ease-out; }
.page-panel[hidden] { display: none; }
.subtab-panel[hidden] { display: none; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.hero,
.model-hero {
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(221,232,235,.92));
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr);
  align-items: center;
  gap: 52px;
  padding: clamp(30px, 5vw, 68px);
  overflow: hidden;
}

.hero h1,
.model-hero h1 {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Noto Serif SC", serif;
  letter-spacing: -.025em;
}
.hero h1 { font-size: clamp(2.15rem, 5vw, 4.25rem); line-height: 1.12; }
.hero-summary { max-width: 780px; margin: 22px 0 0; font-size: 1.08rem; color: var(--text); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.hero-signal {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  justify-self: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 12%, #eef4f5 12% 29%, transparent 29%);
  box-shadow: inset 0 0 60px rgba(49,95,108,.1), 0 18px 40px rgba(20,34,40,.1);
}
.hero-signal::before,
.hero-signal::after {
  content: "";
  position: absolute;
  inset: 50% 7%;
  height: 1px;
  background: var(--line);
}
.hero-signal::after { transform: rotate(90deg); }
.signal-ring { position: absolute; border: 1px solid rgba(49,95,108,.34); border-radius: 50%; }
.ring-one { inset: 20%; }
.ring-two { inset: 7%; }
.signal-core {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: white;
  font-weight: 800;
  letter-spacing: .08em;
  z-index: 2;
}
.signal-label { position: absolute; color: var(--muted); font-size: .77rem; font-weight: 750; }
.signal-label.north { top: 3%; left: 50%; transform: translateX(-50%); }
.signal-label.east { right: 3%; top: 50%; transform: translateY(-50%); }
.signal-label.south { bottom: 3%; left: 50%; transform: translateX(-50%); }
.signal-label.west { left: 3%; top: 50%; transform: translateY(-50%); }

.button {
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 10px 17px;
  cursor: pointer;
  font-weight: 750;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(20,34,40,.1); }
.button:disabled { cursor: wait; opacity: .64; }
.button.primary { border-color: var(--primary); background: var(--primary); color: white; }
.button.primary:hover:not(:disabled) { background: var(--primary-dark); }
.button.secondary { background: var(--surface); color: var(--ink); }
.button.full { width: 100%; margin-top: 18px; padding-block: 13px; }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin: 18px 0;
}
.metric-card {
  min-height: 130px;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-top: 3px solid var(--primary);
  border-radius: 15px;
  background: rgba(255,255,255,.95);
  padding: 17px 18px;
  box-shadow: 0 4px 16px rgba(20,34,40,.04);
}
.metric-card span { color: var(--muted); font-size: .82rem; }
.metric-card strong { margin: auto 0 4px; color: var(--ink); font-size: clamp(1.2rem, 2vw, 1.65rem); line-height: 1.2; }
.metric-card small { color: var(--muted); }
.overview-metrics { margin-top: 18px; }

.content-card,
.control-card,
.result-card,
.detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.97);
  box-shadow: 0 6px 24px rgba(20,34,40,.05);
}
.content-card { margin-top: 18px; padding: clamp(20px, 3vw, 32px); }
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 20px;
}
.section-heading h2 { margin: 0; color: var(--ink); font: 700 clamp(1.35rem, 2vw, 1.8rem)/1.2 Georgia, "Noto Serif SC", serif; }
.section-heading > p { max-width: 620px; margin: 0; color: var(--muted); text-align: right; }
.section-heading.compact { align-items: center; margin-bottom: 17px; }
.section-heading.compact h2 { font-size: 1.35rem; }

.table-wrap { max-width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { border-bottom: 1px solid var(--line-soft); padding: 12px 13px; text-align: left; vertical-align: top; }
th { background: var(--surface-soft); color: var(--ink); font-size: .78rem; letter-spacing: .025em; white-space: nowrap; }
tbody tr:hover { background: #f7fafa; }

.protocol-grid,
.flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin-top: 18px;
}
.protocol-card,
.flow-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  padding: 22px;
  overflow: hidden;
}
.protocol-card.emphasis { border-color: rgba(24,115,95,.48); background: linear-gradient(150deg, #fff, #eaf5f2); }
.protocol-code { position: absolute; top: 13px; right: 16px; color: rgba(49,95,108,.18); font: 800 2.3rem/1 Georgia, serif; }
.protocol-card h3, .flow-card h3 { margin: 0 0 8px; color: var(--ink); }
.protocol-card p, .flow-card p { margin: 0; color: var(--muted); }
.flow-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flow-list { display: flex; align-items: stretch; gap: 6px; margin: 18px 0; padding: 0; list-style: none; counter-reset: flow; }
.flow-list li { flex: 1; position: relative; display: grid; place-items: center; min-height: 76px; padding: 8px; border: 1px solid var(--line); border-radius: 10px; text-align: center; font-size: .82rem; }
.flow-list li:not(:last-child)::after { content: "›"; position: absolute; right: -8px; top: 24px; z-index: 2; color: var(--primary); font-size: 1.3rem; }

.model-hero {
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: clamp(28px, 4vw, 48px);
}
.model-hero.negative { background: linear-gradient(135deg, #fff, #f1eaf5); }
.model-hero h1 { font-size: clamp(2rem, 4vw, 3.35rem); line-height: 1.12; }
.model-hero p:not(.eyebrow) { max-width: 800px; margin: 14px 0 0; }
.model-badge { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.75); color: var(--primary-dark); padding: 11px 17px; font-weight: 800; }

.secondary-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  margin: 18px 0 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,.86);
  padding: 6px;
  scrollbar-width: thin;
}
.subtab {
  flex: 0 0 auto;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  padding: 9px 15px;
  cursor: pointer;
  font-weight: 700;
}
.subtab:hover { color: var(--ink); background: var(--surface-soft); }
.subtab.active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(20,34,40,.06);
}
.subtab-panel { animation: page-in .2s ease-out; }

.notice {
  border-left: 4px solid var(--teal);
  border-radius: 10px;
  background: #e8f3f0;
  margin: 18px 0;
  padding: 13px 16px;
}
.notice.warning { border-left-color: var(--amber); background: #f7f1e3; }

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(340px, .75fr) minmax(500px, 1.25fr);
  align-items: start;
  gap: 18px;
}
.control-card, .result-card { padding: clamp(19px, 2.5vw, 28px); }
.result-card { min-height: 560px; }
.doa-workspace { grid-template-columns: minmax(360px, .68fr) minmax(560px, 1.32fr); }

label, .field-label { display: grid; gap: 6px; color: var(--ink); font-size: .87rem; font-weight: 700; }
input[type="search"], select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: white;
  color: var(--text);
  padding: 10px 11px;
}
select[size] { min-height: 230px; padding: 6px; }
select[size] option { padding: 8px 9px; border-radius: 6px; }
select[size] option:checked { background: linear-gradient(var(--primary), var(--primary)); color: white; }
.filter-row { display: grid; grid-template-columns: .42fr 1fr; gap: 11px; margin-bottom: 12px; }
.field-label { margin-top: 10px; }
.field-hint { margin: 7px 0 12px; color: var(--muted); font-size: .79rem; }

.sample-description {
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: var(--surface-soft);
  min-height: 92px;
  margin-top: 10px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: .84rem;
}
.sample-description strong { color: var(--ink); }
.meta-line { display: flex; flex-wrap: wrap; gap: 6px 12px; margin: 3px 0; }
.meta-line code { word-break: break-all; }

.audio-module { border: 1px solid var(--line); border-radius: 13px; background: #f8fafb; margin-top: 14px; padding: 14px; }
.audio-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 8px; }
.audio-heading > div { display: grid; }
.mini-label { color: var(--primary); font-size: .65rem; font-weight: 800; letter-spacing: .12em; }
#audio-waveform { width: 100%; max-width: 100%; border-radius: 8px; background: white; }
audio { width: 100%; height: 40px; margin-top: 8px; }

.empty-state { display: grid; place-items: center; min-height: 390px; text-align: center; color: var(--muted); }
.empty-state h3 { margin: 9px 0 0; color: var(--ink); }
.empty-state p { margin: 3px 0; }
.empty-icon { display: grid; place-items: center; width: 64px; height: 64px; border: 1px solid var(--line); border-radius: 50%; color: var(--primary); font: 800 1rem/1 Georgia, serif; }
.loading-state {
  display: grid;
  place-items: center;
  min-height: 390px;
  padding: 34px;
  text-align: center;
}
.loading-state h3 { margin: 18px 0 3px; color: var(--ink); }
.loading-state p { max-width: 480px; margin: 0; color: var(--muted); }
.loading-spinner {
  width: 58px;
  height: 58px;
  border: 4px solid rgba(49,95,108,.14);
  border-top-color: var(--primary);
  border-right-color: var(--teal);
  border-radius: 50%;
  animation: inference-spin .8s linear infinite;
  box-shadow: 0 0 0 10px rgba(49,95,108,.04);
}
@keyframes inference-spin { to { transform: rotate(360deg); } }
.result-status { border-left: 4px solid var(--primary); border-radius: 9px; background: var(--surface-soft); margin-bottom: 18px; padding: 13px 16px; }
.result-status.positive { border-left-color: var(--teal); background: #e8f3f0; }
.result-status.error { border-left-color: var(--red); background: #faeeee; }
.result-status h3 { margin: 0 0 2px; color: var(--ink); }
.result-status p { margin: 3px 0; }

.probability-block { border: 1px solid var(--line-soft); border-radius: 12px; padding: 15px; }
.probability-heading { display: flex; align-items: baseline; justify-content: space-between; }
.probability-heading strong { color: var(--ink); font-size: 1.8rem; }
.gauge { position: relative; height: 13px; border-radius: 999px; background: #dce4e7; margin-top: 12px; overflow: visible; }
.gauge span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--teal)); }
.gauge i { position: absolute; top: -5px; width: 2px; height: 23px; background: var(--red); }
.gauge-labels { display: flex; justify-content: space-between; color: var(--muted); font-size: .7rem; margin-top: 5px; }
.chart-title { margin: 20px 0 8px; color: var(--ink); font-size: .94rem; }

.json-grid, .two-column-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.json-grid { margin-top: 14px; }
details { min-width: 0; }
details summary { cursor: pointer; color: var(--ink); font-weight: 750; }
.json-grid details { border: 1px solid var(--line-soft); border-radius: 10px; padding: 11px; }
pre { max-width: 100%; overflow: auto; white-space: pre-wrap; word-break: break-word; font: .77rem/1.55 ui-monospace, SFMono-Regular, Consolas, monospace; }
.two-column-details { margin-top: 18px; }
.detail-card { margin-top: 18px; padding: 18px 20px; }
.two-column-details .detail-card { margin-top: 0; }
.detail-card[open] summary { margin-bottom: 15px; }
.command-block { border: 1px solid #314149; border-radius: 10px; background: #17262d; color: #dce7ea; padding: 14px; }

.model-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; border: 0; margin: 0 0 14px; padding: 0; }
.model-options legend { margin-bottom: 6px; color: var(--ink); font-size: .87rem; font-weight: 700; }
.model-options label { display: block; cursor: pointer; }
.model-options input { position: absolute; opacity: 0; pointer-events: none; }
.model-options span { display: grid; min-height: 78px; border: 1px solid var(--line); border-radius: 10px; background: white; padding: 11px; }
.model-options small { color: var(--muted); font-weight: 400; }
.model-options input:checked + span { border-color: var(--primary); background: #edf4f5; box-shadow: inset 0 0 0 1px var(--primary); }
.model-options input:focus-visible + span { outline: 3px solid rgba(45,95,158,.35); }

.doa-plot {
  width: 100%;
  min-height: 590px;
  border: 1px solid #d7e2e6;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 58%, rgba(49,95,108,.1), transparent 36%),
    linear-gradient(180deg, #fbfdfd, #eef4f5);
}
.plot-image-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; margin-top: 15px; }
.plot-image-grid figure { margin: 0; border: 1px solid var(--line-soft); border-radius: 12px; overflow: hidden; background: white; }
.plot-image-grid figcaption { padding: 9px 12px; color: var(--ink); font-size: .82rem; font-weight: 700; }
.plot-image-grid img { display: block; width: 100%; height: auto; }
.detection-plots { grid-template-columns: 1fr; }
.protocol-copy { margin-bottom: 22px; }

.result-visual-stack { display: grid; gap: 16px; margin-top: 16px; }
.visual-panel {
  margin: 0;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: white;
  overflow: hidden;
}
.visual-panel-heading,
.visual-panel figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(135deg, #fbfdfd, #f1f6f7);
  padding: 13px 16px;
}
.visual-panel-heading span {
  color: var(--primary);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .12em;
}
.visual-panel-heading h3 { margin: 1px 0 0; color: var(--ink); }
.visual-panel-heading small,
.visual-panel figcaption span { color: var(--muted); font-size: .78rem; }
.visual-panel figcaption strong { color: var(--ink); }
.visual-panel > p { margin: 10px 16px 14px; color: var(--muted); font-size: .8rem; }
.visual-panel img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: white;
}
.polar-panel img { max-height: 620px; }
.spectrum-panel img { min-height: 300px; max-height: 560px; }

.native-diagram-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.native-diagram {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 15px;
  background:
    linear-gradient(rgba(49,95,108,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(49,95,108,.04) 1px, transparent 1px),
    #fbfdfd;
  background-size: 24px 24px;
  overflow: hidden;
}
.native-diagram > figcaption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255,255,255,.92);
  padding: 13px 16px;
}
.native-diagram > figcaption strong { color: var(--ink); }
.native-diagram > figcaption span { color: var(--muted); font-size: .78rem; text-align: right; }
.pipeline-track {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 7px;
  padding: 24px 18px;
}
.diagram-node {
  display: grid;
  place-content: center;
  min-width: 105px;
  min-height: 78px;
  border: 1px solid #b9cbd1;
  border-radius: 12px;
  background: rgba(255,255,255,.96);
  padding: 10px 12px;
  text-align: center;
  box-shadow: 0 5px 14px rgba(20,34,40,.05);
}
.diagram-node strong { color: var(--ink); font-size: .86rem; }
.diagram-node small { color: var(--muted); font-size: .7rem; line-height: 1.4; }
.diagram-node.accent,
.source-node { border-color: rgba(45,95,158,.58); background: #eef4fb; }
.diagram-node.outcome { border-color: rgba(24,115,95,.55); background: #edf7f3; }
.diagram-node.warning-node { border-color: rgba(189,69,56,.58); background: #fff1ef; }
.dnn-node { border-left: 4px solid var(--teal); }
.srp-node { border-left: 4px solid var(--blue); }
.music-node { border-left: 4px solid var(--purple); }
.diagram-arrow {
  align-self: center;
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 900;
}
.diagram-arrow.blocked { color: var(--red); font-size: 1.55rem; }
.detailed-diagram { margin-bottom: 24px; }
.detailed-diagram .pipeline-track { overflow-x: auto; justify-content: flex-start; }

.branch-diagram {
  display: grid;
  grid-template-columns: minmax(130px, .65fr) 58px minmax(260px, 1.8fr);
  align-items: center;
  padding: 24px 20px;
}
.compact-branches { grid-template-columns: minmax(120px, .8fr) 52px minmax(180px, 1.4fr); }
.branch-lines { align-self: stretch; display: grid; grid-template-rows: repeat(3, 1fr); padding: 7px 0; }
.branch-lines i { position: relative; border-top: 2px solid rgba(49,95,108,.42); }
.branch-lines i::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -1px;
  border-width: 4px 0 4px 6px;
  border-style: solid;
  border-color: transparent transparent transparent rgba(49,95,108,.58);
}
.branch-stack { display: grid; gap: 10px; }
.branch-stack > .diagram-node { width: 100%; min-height: 64px; }
.branch-row {
  display: grid;
  grid-template-columns: minmax(170px, 1fr) 24px minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
}
.branch-row > span { color: var(--primary); font-weight: 900; text-align: center; }
.branch-row .diagram-node { width: 100%; min-height: 70px; }

.transfer-track,
.adaptation-track {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 26px 20px 16px;
}
.transfer-track .diagram-node { flex: 1 1 0; max-width: 300px; min-height: 112px; }
.adaptation-track { padding-top: 0; }
.adaptation-track .diagram-node { min-width: 220px; }

.comparison-diagram { height: 100%; }
.architecture-lane {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 12px;
  margin: 20px;
}
.architecture-lane > b { color: var(--primary-dark); }
.lane-track {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #b9cbd1;
  border-radius: 12px;
  background: rgba(255,255,255,.92);
  padding: 12px;
}
.lane-track span { flex: 1 1 0; color: var(--ink); font-size: .76rem; text-align: center; }
.lane-track i { color: var(--primary); font-style: normal; font-weight: 900; }
.architecture-lane.hybrid .lane-track { border-color: rgba(116,80,154,.48); background: #f6f1fa; }

.figure-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.static-figure {
  margin: 18px 0 0;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  background: white;
  overflow: hidden;
}
.static-figure:first-child { margin-top: 0; }
.static-figure img { display: block; width: 100%; height: auto; }
.static-figure figcaption {
  border-top: 1px solid var(--line-soft);
  padding: 10px 14px;
  color: var(--muted);
  font-size: .82rem;
}

.conclusion {
  border-left: 4px solid var(--primary);
  border-radius: 9px;
  background: #e9f0f2;
  margin-bottom: 20px;
  padding: 13px 16px;
}
.conclusion strong { color: var(--ink); }

.tech-stack > h2 {
  margin: 0 0 18px;
  color: var(--ink);
  font: 700 clamp(1.35rem, 2vw, 1.8rem)/1.2 Georgia, "Noto Serif SC", serif;
}
.tech-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.tech-card {
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  background: var(--surface-soft);
  padding: 18px;
}
.tech-card h3 { margin: 0 0 12px; color: var(--ink); }
.tech-card dl { margin: 0; }
.tech-card dt { margin-top: 10px; color: var(--primary-dark); font-weight: 800; }
.tech-card dd { margin: 2px 0 0; color: var(--text); }

.markdown-body { color: var(--text); }
.markdown-body h2, .markdown-body h3 { color: var(--ink); font-family: Georgia, "Noto Serif SC", serif; }
.markdown-body h2 { margin: 0 0 12px; }
.markdown-body h3 { margin: 20px 0 8px; }
.markdown-body ul, .markdown-body ol { padding-left: 1.35rem; }
.markdown-body li { margin: 5px 0; }
.markdown-body code { border-radius: 5px; background: #edf2f3; padding: 1px 5px; font-family: ui-monospace, monospace; }
.markdown-body .important-note, .markdown-body .failure-note { border-left: 4px solid var(--primary); border-radius: 8px; background: #e9f0f2; padding: 11px 14px; }
.failure-card { border-left: 4px solid var(--red); }
.provenance-output { min-height: 180px; border: 1px solid var(--line-soft); border-radius: 10px; background: var(--surface-soft); padding: 15px; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  max-width: min(420px, calc(100% - 40px));
  border: 1px solid #deb9b5;
  border-left: 4px solid var(--red);
  border-radius: 10px;
  background: #fff4f2;
  box-shadow: var(--shadow);
  padding: 13px 16px;
}

footer { display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); padding: 24px 0 34px; color: var(--muted); font-size: .8rem; }

@media (max-width: 1060px) {
  .hero { grid-template-columns: 1fr; }
  .hero-signal { display: none; }
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .protocol-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-grid, .doa-workspace { grid-template-columns: 1fr; }
  .result-card { min-height: 480px; }
  .native-diagram-grid { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
  .header-inner, .primary-nav, .page-shell, footer { width: min(100% - 20px, 1400px); }
  .header-inner { min-height: 64px; }
  .brand-mark { width: 36px; height: 36px; }
  .brand .eyebrow, .runtime-state span:last-child { display: none; }
  .primary-nav { gap: 0; }
  .nav-tab { padding-inline: 11px; font-size: .84rem; }
  .page-shell { padding-top: 18px; }
  .hero { min-height: 0; padding: 30px 22px; }
  .hero h1 { font-size: 2.2rem; }
  .model-hero { min-height: 0; align-items: flex-start; flex-direction: column; padding: 28px 22px; }
  .model-hero h1 { font-size: 2.1rem; }
  .metric-grid, .protocol-grid, .flow-grid, .json-grid, .two-column-details,
  .plot-image-grid, .figure-grid, .tech-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 112px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .section-heading > p { text-align: left; }
  .flow-list { display: grid; grid-template-columns: repeat(2, 1fr); }
  .flow-list li::after { display: none; }
  .filter-row { grid-template-columns: 1fr; }
  .model-options { grid-template-columns: 1fr; }
  .doa-plot { min-height: 440px; }
  .pipeline-track { flex-direction: column; }
  .diagram-node { width: 100%; min-width: 0; }
  .diagram-arrow { transform: rotate(90deg); }
  .branch-diagram, .compact-branches { grid-template-columns: 1fr; gap: 10px; }
  .branch-lines { display: none; }
  .branch-row { grid-template-columns: 1fr; }
  .branch-row > span { transform: rotate(90deg); }
  .transfer-track, .adaptation-track { flex-direction: column; }
  .transfer-track .diagram-node, .adaptation-track .diagram-node { width: 100%; max-width: none; min-width: 0; }
  .architecture-lane { grid-template-columns: 1fr; margin: 16px; }
  .lane-track { flex-direction: column; }
  .lane-track i { transform: rotate(90deg); }
  .visual-panel-heading, .visual-panel figcaption { flex-direction: column; gap: 3px; }
  .secondary-nav { border-radius: 10px; }
  .subtab { padding-inline: 12px; font-size: .84rem; }
  footer { flex-direction: column; gap: 4px; }
}

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