:root {
  --paper: #fbfaf7;
  --paper-2: #f4f1ea;
  --ink: #24211d;
  --muted: #6d675f;
  --line: #ded8cc;
  --line-strong: #c7beb0;
  --card: rgba(255, 255, 255, 0.84);
  --shadow: 0 18px 55px rgba(36, 33, 29, 0.12);
  --shadow-soft: 0 8px 24px rgba(36, 33, 29, 0.08);
  --coral: #ff8b73;
  --mint: #8fd7bf;
  --yellow: #ffd66b;
  --sky: #8cc6ec;
  --lavender: #c7b6ff;
  --green: #b8d9a5;
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Menlo", "Consolas", monospace;
  --radius: 8px;
  --slide-w: min(96vw, 1440px);
  --slide-h: min(54vw, calc(100vh - 74px));
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--paper-2);
  color: var(--ink);
  font-family: var(--font);
  overflow-x: hidden;
}

body {
  background:
    linear-gradient(90deg, rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(36, 33, 29, 0.035) 1px, transparent 1px),
    var(--paper-2);
  background-size: 34px 34px;
}

button {
  font: inherit;
}

.deck-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 22px 18px 58px;
}

.slide {
  width: var(--slide-w);
  height: var(--slide-h);
  min-height: 620px;
  max-height: 900px;
  aspect-ratio: 16 / 9;
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-gutter: stable;
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr;
}

.slide::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 16% 18%, rgba(255, 214, 107, 0.18), transparent 18%),
    radial-gradient(circle at 82% 22%, rgba(143, 215, 191, 0.16), transparent 20%),
    radial-gradient(circle at 78% 86%, rgba(140, 198, 236, 0.13), transparent 22%);
  opacity: 0.85;
}

.slide-header,
.slide-body,
.deck-controls {
  position: relative;
  z-index: 1;
}

.slide-header {
  padding: 54px 64px 22px;
  display: grid;
  gap: 12px;
}

.eyebrow {
  color: var(--muted);
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  max-width: 1050px;
  font-size: clamp(42px, 4.5vw, 76px);
  line-height: 1.04;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.subtitle {
  max-width: 900px;
  color: var(--muted);
  font-size: clamp(20px, 1.7vw, 30px);
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.slide-body {
  padding: 8px 64px 56px;
  display: grid;
  gap: 24px;
  align-content: center;
}

.layout-hero .slide-body,
.layout-split .slide-body {
  grid-template-columns: 1fr 0.92fr;
  align-items: center;
}

.layout-wide .slide-body {
  align-content: start;
}

.layout-centered .slide-body {
  text-align: center;
  justify-items: center;
}

.content-stack {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.lead {
  font-size: clamp(24px, 2.1vw, 36px);
  line-height: 1.32;
  font-weight: 720;
}

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

.note {
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.bullets {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bullets li {
  position: relative;
  padding-left: 30px;
  font-size: clamp(21px, 1.55vw, 28px);
  line-height: 1.42;
}

.bullets li::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--accent, var(--coral));
  border: 1px solid rgba(36, 33, 29, 0.35);
  position: absolute;
  left: 0;
  top: 0.62em;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  gap: 16px;
  min-width: 0;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
  min-height: 96px;
  display: grid;
  gap: 10px;
  align-content: start;
}

.card strong {
  font-size: 22px;
  line-height: 1.25;
}

.card span,
.card p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.38;
  margin: 0;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 17px;
  font-weight: 650;
}

.quote {
  border-left: 8px solid var(--accent, var(--coral));
  background: rgba(255, 255, 255, 0.76);
  padding: 24px 28px;
  font-size: clamp(26px, 2.25vw, 40px);
  line-height: 1.35;
  font-weight: 760;
  box-shadow: var(--shadow-soft);
}

.code {
  font-family: var(--mono);
  background: #26231f;
  color: #fff8e8;
  border-radius: var(--radius);
  padding: 20px 24px;
  white-space: pre-wrap;
  font-size: clamp(18px, 1.35vw, 24px);
  line-height: 1.48;
  box-shadow: var(--shadow-soft);
  max-width: 100%;
  overflow-x: auto;
}

.table {
  width: 100%;
  max-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--shadow-soft);
}

.table th,
.table td {
  text-align: left;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  font-size: 18px;
  line-height: 1.35;
}

.table th {
  color: var(--muted);
  font-size: 16px;
  text-transform: uppercase;
}

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

.stage-path,
.pipeline,
.cycle {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.stage,
.pipe-node,
.cycle-node {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.8);
  padding: 14px 16px;
  min-width: 118px;
  text-align: center;
  font-weight: 760;
  box-shadow: var(--shadow-soft);
}

.stage.active,
.pipe-node.active,
.cycle-node.active {
  background: var(--accent, var(--yellow));
  border-color: rgba(36, 33, 29, 0.38);
}

.arrow {
  color: var(--muted);
  font-size: 28px;
}

.folder-tree {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 26px;
  box-shadow: var(--shadow-soft);
  font-size: clamp(18px, 1.32vw, 24px);
  line-height: 1.6;
  white-space: pre;
  max-width: 100%;
  overflow-x: auto;
}

.image-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-soft);
  align-self: stretch;
  min-height: 360px;
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.image-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.mini-diagram {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-soft);
  min-width: 0;
  max-width: 100%;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.prompt-list {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.prompt-card {
  font-family: var(--font);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-left: 8px solid var(--accent, var(--sky));
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-soft);
  font-size: 20px;
  line-height: 1.42;
}

.deck-controls {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: 42px minmax(160px, 280px) auto 42px;
  align-items: center;
  gap: 12px;
  background: rgba(251, 250, 247, 0.86);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}

.control-btn {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--ink);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.control-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.control-btn:focus-visible {
  outline: 3px solid rgba(140, 198, 236, 0.85);
  outline-offset: 3px;
}

.progress-wrap {
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--coral), var(--yellow), var(--mint), var(--sky));
}

.slide-count {
  color: var(--muted);
  font-size: 14px;
  min-width: 58px;
}

@media (max-width: 900px) {
  .deck-shell {
    place-items: start center;
    padding: 10px 8px 68px;
  }

  .slide {
    width: calc(100vw - 16px);
    max-width: calc(100vw - 16px);
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: auto;
    overflow: visible;
  }

  .slide-header {
    padding: 32px 24px 12px;
    max-width: 100%;
  }

  h1 {
    font-size: 31px;
    line-height: 1.08;
    word-break: break-word;
    white-space: normal;
  }

  .subtitle {
    font-size: 20px;
  }

  .lead {
    font-size: 25px;
    overflow-wrap: anywhere;
    word-break: break-all;
    width: 100%;
    max-width: 100%;
  }

  .bullets,
  .card-grid,
  .prompt-list,
  .mini-diagram,
  .table,
  .code,
  .stage-path,
  .pipeline,
  .cycle,
  .folder-tree,
  .image-panel {
    width: 100%;
    max-width: 100%;
  }

  .slide-body {
    padding: 8px 24px 34px;
    max-width: 100%;
    display: block;
  }

  .layout-hero .slide-body,
  .layout-split .slide-body,
  .two-col {
    grid-template-columns: 1fr;
  }

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

  .stage-path,
  .pipeline,
  .cycle {
    display: grid;
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .stage,
  .pipe-node,
  .cycle-node {
    width: 100%;
    min-width: 0;
    padding: 12px 14px;
    overflow-wrap: anywhere;
  }

  .arrow {
    justify-self: center;
    transform: rotate(90deg);
    font-size: 22px;
    line-height: 1;
  }

  .code {
    font-size: 15px;
    line-height: 1.55;
  }

  .image-panel {
    min-height: 260px;
    margin-top: 20px;
  }

  .deck-controls {
    width: calc(100vw - 20px);
    grid-template-columns: 38px 1fr auto 38px;
    gap: 8px;
    padding: 6px 8px;
  }

  .slide-count {
    min-width: 42px;
    font-size: 12px;
  }
}

@media print {
  body {
    background: #fff;
  }

  .deck-shell {
    display: block;
    padding: 0;
  }

  .slide {
    width: 100vw;
    height: 100vh;
    min-height: 0;
    max-height: none;
    box-shadow: none;
    border: 0;
    page-break-after: always;
  }

  .deck-controls {
    display: none;
  }
}
