/* Presentation Deck Layout & Slide Styles */
html, body {
  height: 100%;
  overflow: hidden;
}

.deck {
  position: relative;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Top Progress Bar */
#progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--line);
  z-index: 60;
}
#progress span {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--grad);
  transition: width 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Top Floating Chrome */
.top-bar {
  position: fixed;
  top: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 50;
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }

.brand-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
}
.brand-pill .divider {
  width: 1px;
  height: 20px;
  background: var(--line-2);
}
.brand-pill .title-group {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-pill .title-group b {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.brand-pill .title-group span {
  font-size: 11px;
  color: var(--muted);
}

.toolbar {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 6px;
  border-radius: 999px;
}
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.16s, color 0.16s, transform 0.16s;
}
.tb-btn:hover {
  background: var(--surface-2);
  color: var(--ink);
}
.tb-btn.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.tb-btn.primary {
  background: var(--ink);
  color: var(--bg);
  padding: 0 14px;
}
.tb-btn.primary:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}
.tb-btn.icon-only {
  width: 32px;
  padding: 0;
  justify-content: center;
}

/* 16:9 Stage Viewport */
#viewport {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 100%;
  padding: 72px 28px 68px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.slide {
  display: none;
  width: min(100%, calc((100vh - 140px) * 16 / 9));
  aspect-ratio: 16 / 9;
  container-type: inline-size;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  padding: 3.1cqi 4cqi 2.8cqi;
  position: relative;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
}

.slide.active {
  display: flex;
  animation: slideIn 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(8px) scale(0.994); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Decorative subtle ring (from yuanbao-search-live-deck) */
.slide::after {
  content: "";
  position: absolute;
  top: -11cqi;
  right: -9cqi;
  width: 30cqi;
  height: 30cqi;
  border-radius: 50%;
  border: 1px solid var(--ink);
  opacity: 0.04;
  pointer-events: none;
}

/* Slide Theme Variants */
.slide.theme-paper {
  background: var(--paper);
}
.slide.theme-mint {
  background: linear-gradient(155deg, color-mix(in srgb, var(--accent-soft) 75%, var(--surface)) 0%, var(--surface) 65%);
}
.slide.theme-coral {
  background: linear-gradient(155deg, color-mix(in srgb, var(--coral-soft) 75%, var(--surface)) 0%, var(--surface) 65%);
}
.slide.theme-dark {
  background: #101c2d;
  color: #f8fafc;
  border-color: rgba(255, 255, 255, 0.12);
}
.slide.theme-dark .muted,
.slide.theme-dark .slide-sub { color: #9fb3c8; }
.slide.theme-dark .card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}
.slide.theme-dark .chapter-tag { color: #fbbf24; }
.slide.theme-dark .chapter-tag::before { background: #fbbf24; }

/* Slide Typography */
.chapter-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.7cqi;
  font-family: var(--font-mono);
  font-size: max(11px, 1.02cqi);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.7cqi;
}
.chapter-tag::before {
  content: "";
  width: 1.4cqi;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}
.chapter-tag.coral { color: var(--coral); }
.chapter-tag.coral::before { background: var(--coral); }

.slide h1 {
  margin: 0;
  font-size: max(30px, 4.3cqi);
  line-height: 1.12;
  letter-spacing: -0.04em;
  font-weight: 800;
}
.slide h2 {
  margin: 0;
  font-size: max(22px, 3.1cqi);
  line-height: 1.18;
  letter-spacing: -0.035em;
  font-weight: 800;
}
.slide h3 {
  margin: 0;
  font-size: max(15px, 1.55cqi);
  line-height: 1.3;
  font-weight: 700;
}
.slide-sub {
  margin: 0.7cqi 0 0;
  font-size: max(13px, 1.38cqi);
  line-height: 1.5;
  color: var(--muted);
}

.slide-header {
  position: relative;
  z-index: 2;
}
.slide-body {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-top: 1.4cqi;
  min-height: 0;
}
.slide-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1cqi;
  border-top: 1px solid var(--line);
  font-size: max(11px, 0.98cqi);
  color: var(--muted);
}

/* Common Layout Helpers */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.6cqi; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4cqi; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2cqi; }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 1cqi; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1.2cqi;
  padding: 1.5cqi 1.6cqi;
  box-shadow: var(--shadow-sm);
}
.card-soft {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 1.2cqi;
  padding: 1.4cqi 1.5cqi;
}

.big-num {
  font-size: max(26px, 3.6cqi);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
  font-family: var(--font-mono);
}

.callout-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2cqi;
  padding: 1cqi 1.4cqi;
  border-radius: 1cqi;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  color: var(--ink);
  font-size: max(12px, 1.18cqi);
  font-weight: 600;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5cqi;
  padding: 0.65cqi 1.3cqi;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: max(12px, 1.08cqi);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s, opacity 0.16s;
}
.action-btn:hover { transform: translateY(-1px); opacity: 0.92; }
.action-btn.outline {
  background: var(--surface);
  color: var(--ink);
}
.action-btn.accent {
  background: var(--grad);
  color: #fff;
  border-color: transparent;
}

/* Cover Slide Specific */
.cover-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 3cqi;
  align-items: center;
  height: 100%;
}
.cobrand-row {
  display: flex;
  align-items: center;
  gap: 0.8cqi;
  margin-bottom: 1.4cqi;
  flex-wrap: wrap;
}
.cobrand-x {
  color: var(--muted);
  font-weight: 700;
  font-size: 1.2cqi;
}
.cover-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6cqi;
  margin-top: 1.6cqi;
}
.cover-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45cqi;
  padding: 0.5cqi 0.95cqi;
  border-radius: 0.7cqi;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--accent);
  font-size: max(11px, 1.05cqi);
  font-weight: 700;
}
.cover-meta {
  display: inline-flex;
  align-items: center;
  gap: 1.1cqi;
  margin-top: 1.8cqi;
  padding: 0.7cqi 1.1cqi;
  border-radius: 1cqi;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: max(11px, 1.02cqi);
}
.cover-stage-3d {
  perspective: 1100px;
  position: relative;
}
.preview-card-3d {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 1.5cqi;
  padding: 1.6cqi;
  box-shadow: var(--shadow-lg);
  transform: rotateY(-7deg) rotateX(3deg);
  transition: transform 0.35s ease;
}
.preview-card-3d:hover {
  transform: rotateY(-2deg) rotateX(1deg);
}
.float-pill {
  position: absolute;
  padding: 0.55cqi 1cqi;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-md);
  font-size: max(10.5px, 0.96cqi);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 0.4cqi;
  animation: bob 3.8s ease-in-out infinite;
  z-index: 4;
}
.float-pill.top-right { top: -1.1cqi; right: -0.8cqi; }
.float-pill.bottom-left { bottom: -1cqi; left: -1.2cqi; animation-delay: 1.4s; }

/* Poll Cards (Slide 4) */
.poll-card {
  cursor: pointer;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1cqi;
  position: relative;
}
.poll-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-line);
}
.poll-card.chosen {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--surface));
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.poll-bar-track {
  height: 0.7cqi;
  border-radius: 999px;
  background: var(--surface-3);
  overflow: hidden;
}
.poll-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: var(--grad);
  transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

/* macOS Prompt Window (Slide 6) */
.mac-window {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 1.2cqi;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.mac-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7cqi 1.2cqi;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: max(11px, 0.96cqi);
  color: var(--muted);
}
.mac-dots { display: flex; gap: 6px; }
.mac-dots i { width: 10px; height: 10px; border-radius: 50%; display: block; }
.mac-dots i:nth-child(1) { background: #ff5f57; }
.mac-dots i:nth-child(2) { background: #febc2e; }
.mac-dots i:nth-child(3) { background: #28c840; }

.prompt-row {
  display: grid;
  grid-template-columns: 9.5cqi 1fr auto;
  gap: 1.2cqi;
  align-items: center;
  padding: 1.1cqi 1.4cqi;
  border-bottom: 1px solid var(--line);
}
.prompt-row:last-child { border-bottom: none; }
.prompt-code {
  font-family: var(--font-mono);
  font-size: max(11.5px, 1.05cqi);
  color: var(--ink);
  background: var(--surface-2);
  padding: 0.65cqi 1cqi;
  border-radius: 0.65cqi;
  border: 1px solid var(--line);
  line-height: 1.45;
}
.copy-btn {
  padding: 0.5cqi 1cqi;
  border-radius: 0.6cqi;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink);
  font-size: max(11px, 0.96cqi);
  font-weight: 700;
  cursor: pointer;
}
.copy-btn:hover { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-line); }

/* Comparison Table (Slide 9 & 13) */
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: max(11px, 0.98cqi);
}
.audit-table th, .audit-table td {
  text-align: left;
  padding: 0.56cqi 0.95cqi;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  line-height: 1.38;
}
.audit-table .badge {
  white-space: nowrap;
  font-size: max(10.5px, 0.88cqi);
  padding: 2px 8px;
}
.audit-table th {
  font-size: max(10px, 0.88cqi);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  background: var(--surface-2);
}
.audit-table tr:last-child td { border-bottom: none; }

/* Self-check diagnostic (Slide 12) */
.diag-btn {
  padding: 0.55cqi 0.9cqi;
  border-radius: 0.65cqi;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--ink-2);
  font-size: max(11px, 1cqi);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s;
}
.diag-btn.selected {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: transparent;
}

/* Bottom Floating Controls */
.bottom-bar {
  position: fixed;
  bottom: 16px;
  left: 20px;
  right: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  pointer-events: none;
}
.controls-pill {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
}
.controls-pill .section-label {
  color: var(--muted);
  padding-right: 10px;
  border-right: 1px solid var(--line-2);
}
.nav-arrow {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}
.nav-arrow:hover { background: var(--surface-2); border-color: var(--line); }
.page-counter {
  font-family: var(--font-mono);
  font-size: 12.5px;
  min-width: 56px;
  text-align: center;
  color: var(--ink);
}
.hotkey-tip {
  position: fixed;
  right: 24px;
  bottom: 22px;
  font-size: 12px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 50;
}

/* Directory Drawer (G) */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 18, 0.45);
  backdrop-filter: blur(4px);
  z-index: 80;
  display: none;
}
.drawer-backdrop.open { display: block; }
.drawer {
  position: fixed;
  top: 16px;
  right: 16px;
  bottom: 16px;
  width: min(390px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 90;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}
.toc-item {
  width: 100%;
  display: grid;
  grid-template-columns: 32px 1fr auto;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  border: none;
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  font-family: var(--font-sans);
}
.toc-item:hover { background: var(--surface-2); }
.toc-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.toc-item .num { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.toc-item .time { font-family: var(--font-mono); font-size: 11px; color: var(--muted); }

/* Speaker Notes Panel (N) */
.notes-panel {
  position: fixed;
  right: 24px;
  bottom: 68px;
  width: min(440px, calc(100vw - 48px));
  max-height: 58vh;
  background: color-mix(in srgb, var(--surface) 95%, transparent);
  backdrop-filter: blur(18px);
  border: 1px solid var(--line-2);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  z-index: 75;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.notes-panel.open { display: flex; animation: fadeUp 0.2s ease; }
.notes-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.notes-body {
  padding: 14px 18px 18px;
  overflow-y: auto;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--ink-2);
}
.notes-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent);
  margin: 12px 0 4px;
  letter-spacing: 0.04em;
}
.notes-label:first-child { margin-top: 0; }

/* Source Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 18, 0.58);
  backdrop-filter: blur(6px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  width: min(860px, 100%);
  max-height: 82vh;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
}
.modal-body {
  padding: 18px 22px 24px;
  overflow-y: auto;
  font-size: 14px;
  line-height: 1.65;
}

.toast {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: var(--ink);
  color: var(--bg);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 120;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 900px) {
  .hotkey-tip, .brand-pill .title-group span { display: none; }
}
@media print {
  .top-bar, .bottom-bar, .hotkey-tip, #progress, .notes-panel, .drawer, .drawer-backdrop { display: none !important; }
  html, body, .deck, #viewport { height: auto; overflow: visible; display: block; padding: 0; }
  .slide { display: flex !important; width: 100%; margin: 0 0 12px; page-break-after: always; box-shadow: none; }
}
