:root {
  --bg: #f6f3ed;
  --surface: #fffdfa;
  --ink: #202124;
  --muted: #67615a;
  --line: #ddd5ca;
  --teal: #007c78;
  --teal-soft: #d9efec;
  --amber: #b96f1d;
  --amber-soft: #f4e3cd;
  --red: #b33a2f;
  --red-soft: #f3d9d5;
  --green: #4c7b36;
  --green-soft: #dcebd3;
  --violet: #5b548a;
  --violet-soft: #e2dfef;
  --shadow: 0 18px 50px rgba(58, 47, 34, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
}

.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  background: rgba(246, 243, 237, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.brand-mark,
.tool-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
  font-size: 0.8rem;
}

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

.nav-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.nav-button:hover,
.nav-button:focus-visible {
  border-color: var(--teal);
  outline: 2px solid var(--teal-soft);
}

.page-indicator {
  min-width: 58px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.deck {
  min-height: 100vh;
}

.slide {
  display: none;
  min-height: 100vh;
  padding: 96px 28px 48px;
}

.slide.is-active {
  display: block;
}

.slide-inner {
  width: min(1180px, 100%);
  min-height: calc(100vh - 144px);
  margin: 0 auto;
  padding: 48px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.cover .slide-inner {
  background:
    linear-gradient(90deg, rgba(0, 124, 120, 0.08), transparent 42%),
    var(--surface);
}

.cover-layout {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--teal);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 16px;
  font-size: 4rem;
  line-height: 1.05;
}

h2 {
  max-width: 900px;
  margin-bottom: 28px;
  font-size: 2.35rem;
  line-height: 1.15;
}

h3 {
  margin-bottom: 10px;
  font-size: 1.15rem;
}

.subtitle {
  color: var(--amber);
  font-size: 1.35rem;
  font-weight: 700;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 1.1rem;
}

.agent-map {
  position: relative;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(32, 33, 36, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(32, 33, 36, 0.04) 1px, transparent 1px),
    #fbf8f3;
  background-size: 34px 34px;
}

.agent-node,
.map-core {
  position: absolute;
  display: grid;
  place-items: center;
  width: 150px;
  height: 150px;
  padding: 16px;
  border: 2px solid;
  border-radius: 8px;
  text-align: center;
}

.agent-node::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 2px;
  background: currentColor;
  opacity: 0.55;
}

.codex-node {
  top: 56px;
  left: 58px;
  color: var(--teal);
  background: var(--teal-soft);
}

.codex-node::after {
  right: -112px;
  top: 88px;
  transform: rotate(22deg);
}

.claude-node {
  right: 44px;
  top: 160px;
  color: var(--amber);
  background: var(--amber-soft);
}

.claude-node::after {
  left: -110px;
  top: 74px;
  transform: rotate(-10deg);
}

.gravity-node {
  left: 110px;
  bottom: 58px;
  color: var(--violet);
  background: var(--violet-soft);
}

.gravity-node::after {
  right: -102px;
  top: 34px;
  transform: rotate(-34deg);
}

.map-core {
  left: 50%;
  top: 50%;
  width: 132px;
  height: 132px;
  transform: translate(-50%, -50%);
  border-color: var(--ink);
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
}

.node-label {
  font-weight: 800;
}

.node-note {
  color: currentColor;
  font-size: 0.9rem;
}

.summary-grid,
.risk-layout,
.strategy-grid,
.source-grid,
.deploy-grid {
  display: grid;
  gap: 20px;
}

.summary-grid {
  grid-template-columns: 1.5fr 0.9fr;
}

.decision-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.decision-table div {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.decision-table div:last-child {
  border-bottom: 0;
}

.decision-table strong {
  color: var(--muted);
}

.callout,
.risk-column,
.strategy-lane,
.tool-card,
.source-group,
.deploy-step,
.timeline-step,
.kpi-grid div,
.metric-strip div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f3;
}

.callout {
  padding: 28px;
  border-color: rgba(0, 124, 120, 0.35);
  background: var(--teal-soft);
}

.shift-visual {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: stretch;
  gap: 20px;
}

.shift-panel {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f3;
}

.shift-panel.active {
  border-color: rgba(0, 124, 120, 0.45);
  background: var(--teal-soft);
}

.stage-label,
.lane-tag {
  display: inline-flex;
  margin-bottom: 18px;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 0.78rem;
  font-weight: 800;
}

.shift-arrow {
  display: grid;
  place-items: center;
  color: var(--amber);
  font-size: 2.8rem;
  font-weight: 800;
}

ul {
  margin: 14px 0 0;
  padding-left: 20px;
}

li {
  margin: 8px 0;
}

.speaker-note {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 4px solid var(--amber);
  background: var(--amber-soft);
  color: #4d3923;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.tool-card {
  padding: 24px;
}

.tool-card.codex {
  border-top: 6px solid var(--teal);
}

.tool-card.claude {
  border-top: 6px solid var(--amber);
}

.tool-card.gravity {
  border-top: 6px solid var(--violet);
}

.tool-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.tool-head p {
  margin-bottom: 0;
  color: var(--muted);
}

dl {
  margin: 0;
}

dt {
  margin-top: 18px;
  color: var(--muted);
  font-weight: 800;
}

dd {
  margin: 4px 0 0;
}

.comparison-table {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.table-row {
  display: grid;
  grid-template-columns: 150px 1.35fr 1fr;
}

.table-row span {
  padding: 16px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.table-row span:last-child {
  border-right: 0;
}

.table-row:last-child span {
  border-bottom: 0;
}

.table-head span {
  background: var(--ink);
  color: var(--surface);
  font-weight: 800;
}

.metric-strip,
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

.metric-strip div,
.kpi-grid div {
  padding: 18px;
}

.metric-strip strong,
.kpi-grid strong {
  display: block;
  font-size: 1.35rem;
}

.metric-strip span,
.kpi-grid span {
  color: var(--muted);
}

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

.risk-column {
  padding: 24px;
}

.positive {
  border-top: 6px solid var(--green);
  background: var(--green-soft);
}

.caution {
  border-top: 6px solid var(--amber);
  background: var(--amber-soft);
}

.alerts {
  border-top: 6px solid var(--red);
  background: var(--red-soft);
}

.check-list {
  padding-left: 18px;
}

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

.strategy-lane {
  padding: 24px;
}

.guardrail-band {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-top: 22px;
  padding: 18px 20px;
  border: 1px solid rgba(179, 58, 47, 0.35);
  border-radius: 8px;
  background: var(--red-soft);
}

.guardrail-band strong {
  flex: 0 0 auto;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.timeline-step {
  position: relative;
  padding: 24px;
}

.timeline-step span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  border-radius: 8px;
  background: var(--teal);
  color: var(--surface);
  font-weight: 800;
}

.decision-steps {
  display: grid;
  gap: 14px;
}

.decision-steps div {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbf8f3;
}

.decision-steps span {
  color: var(--teal);
  font-size: 1.4rem;
  font-weight: 800;
}

.decision-steps p {
  margin: 0;
}

.closing-statement {
  margin-top: 24px;
  padding: 22px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 1.2rem;
  font-weight: 700;
}

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

.source-group {
  padding: 22px;
}

.source-group a,
.source-file-button {
  display: block;
  margin: 10px 0;
  color: var(--teal);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.source-file-button {
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.source-group a:hover,
.source-group a:focus-visible,
.source-file-button:hover,
.source-file-button:focus-visible {
  text-decoration: underline;
}

.source-file-button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

.deploy-grid {
  grid-template-columns: repeat(4, 1fr);
}

.deploy-step {
  padding: 22px;
}

.deploy-step span {
  display: block;
  margin-bottom: 12px;
  color: var(--teal);
  font-weight: 800;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(32, 33, 36, 0.08);
  font-family: Consolas, "Courier New", monospace;
}

.progress-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 5px;
  background: rgba(32, 33, 36, 0.1);
  z-index: 30;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--teal);
  transition: width 160ms ease;
}

.source-dialog {
  width: min(1040px, calc(100vw - 40px));
  max-height: min(840px, calc(100vh - 40px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
}

.source-dialog::backdrop {
  background: rgba(20, 18, 16, 0.56);
  backdrop-filter: blur(4px);
}

.dialog-panel {
  max-height: min(840px, calc(100vh - 40px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 26px 30px 18px;
  border-bottom: 1px solid var(--line);
  background: #fbf8f3;
}

.dialog-header h2 {
  margin-bottom: 0;
  font-size: 1.75rem;
}

.dialog-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.dialog-close:hover,
.dialog-close:focus-visible {
  border-color: var(--teal);
  outline: 2px solid var(--teal-soft);
}

.dialog-body {
  max-height: calc(min(840px, 100vh - 40px) - 112px);
  overflow: auto;
  padding: 28px 30px 34px;
}

.markdown-body {
  font-size: 0.98rem;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  max-width: none;
  margin: 28px 0 12px;
  line-height: 1.25;
}

.markdown-body h1 {
  margin-top: 0;
  font-size: 2rem;
}

.markdown-body h2 {
  font-size: 1.45rem;
}

.markdown-body h3 {
  font-size: 1.15rem;
}

.markdown-body p {
  margin-bottom: 14px;
}

.markdown-body table {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.markdown-body th,
.markdown-body td {
  padding: 11px 12px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.markdown-body th {
  background: var(--ink);
  color: var(--surface);
  text-align: left;
}

.markdown-body a {
  color: var(--teal);
  overflow-wrap: anywhere;
}

.markdown-body code {
  font-size: 0.92em;
}

.markdown-error {
  padding: 18px;
  border: 1px solid rgba(179, 58, 47, 0.35);
  border-radius: 8px;
  background: var(--red-soft);
}

.markdown-fallback-frame {
  width: 100%;
  min-height: 560px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

@media (max-width: 980px) {
  .slide-inner {
    padding: 32px;
  }

  .cover-layout,
  .summary-grid,
  .shift-visual,
  .tool-grid,
  .risk-layout,
  .strategy-grid,
  .timeline,
  .source-grid,
  .deploy-grid {
    grid-template-columns: 1fr;
  }

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

  .agent-map {
    min-height: 420px;
  }

  .agent-node::after {
    display: none;
  }

  .codex-node {
    left: 24px;
  }

  .claude-node {
    right: 24px;
  }

  .gravity-node {
    left: 24px;
  }

  .table-row {
    grid-template-columns: 1fr;
  }

  .table-row span {
    border-right: 0;
  }

  .metric-strip,
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .topbar {
    padding: 10px 14px;
  }

  .brand span:last-child {
    display: none;
  }

  .slide {
    padding: 82px 12px 34px;
  }

  .slide-inner {
    min-height: calc(100vh - 116px);
    padding: 24px;
  }

  h1 {
    font-size: 2.4rem;
  }

  h2 {
    font-size: 1.75rem;
  }

  .decision-table div,
  .decision-steps div {
    grid-template-columns: 1fr;
  }

  .guardrail-band {
    align-items: flex-start;
    flex-direction: column;
  }

  .agent-node {
    width: 130px;
    height: 118px;
  }

  .map-core {
    width: 112px;
    height: 112px;
  }

  .source-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
  }

  .dialog-header,
  .dialog-body {
    padding-left: 20px;
    padding-right: 20px;
  }
}

@media print {
  .topbar,
  .progress-wrap {
    display: none;
  }

  body {
    background: #fff;
  }

  .slide {
    display: block;
    min-height: auto;
    page-break-after: always;
    padding: 0;
  }

  .slide-inner {
    min-height: auto;
    box-shadow: none;
    border: 0;
  }
}
