* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #1a1a2e;
  --bg-card: #16213e;
  --bg-code: #0f0f23;
  --text: #e8e8e8;
  --text-dim: #8892a4;
  --accent: #ff6b35;
  --accent2: #f7c948;
  --green: #4ecdc4;
  --red: #ff6b6b;
}

html, body {
  width: 100%; height: 100vh; height: 100dvh;
  overflow: hidden;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 120%;
  background: var(--bg);
  color: var(--text);
}

.deck {
  width: 100vw; height: 100vh; height: 100dvh;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 6vh 8vw 15vh;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.5s ease;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.slide.active {
  opacity: 1;
  pointer-events: auto;
}

.page-num {
  position: absolute;
  bottom: 3vh;
  right: 4vw;
  font-size: 1.4vh;
  color: var(--text-dim);
}

/* Progress bar */
.progress {
  position: fixed;
  bottom: 0; left: 0;
  height: 4px;
  background: var(--accent);
  transition: width 0.4s ease;
  z-index: 100;
}

/* Typography */
h1 { font-size: clamp(2rem, 5vw, 4.5rem); font-weight: 700; line-height: 1.2; }
h2 { font-size: clamp(1.6rem, 3.5vw, 3rem); font-weight: 600; margin-bottom: 4vh; }
h3 { font-size: clamp(1.2rem, 2.2vw, 2rem); font-weight: 600; }
p, li { font-size: clamp(1rem, 1.8vw, 1.5rem); line-height: 1.8; }
.subtitle { font-size: clamp(1rem, 2vw, 1.6rem); color: var(--text-dim); margin-top: 2vh; }
.small { font-size: clamp(0.7rem, 1.2vw, 1rem); color: var(--text-dim); }
.accent { color: var(--accent); }
.green { color: var(--green); }
.red { color: var(--red); }

ul { list-style: none; text-align: left; max-width: 70vw; }
ul li { padding: 0.8vh 0; }
ul li::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--accent); border-radius: 50%; margin-right: 1.2vw; vertical-align: middle; }

/* Cards */
.cards { display: flex; gap: 3vw; margin-top: 4vh; flex-wrap: wrap; justify-content: center; }
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 4vh 3vw;
  width: clamp(200px, 22vw, 320px);
  text-align: center;
  transition: transform 0.3s;
}
.card:hover { transform: translateY(-4px); }
.card .icon { font-size: clamp(2.5rem, 4vw, 4rem); margin-bottom: 2vh; }
.card h3 { margin-bottom: 1.5vh; color: var(--accent); }
.card p { font-size: clamp(0.85rem, 1.4vw, 1.15rem); color: var(--text-dim); line-height: 1.6; }

/* Code block */
.code-block {
  background: var(--bg-code);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 3vh 3vw;
  font-family: "SF Mono", "Fira Code", "Consolas", monospace;
  font-size: clamp(0.8rem, 1.4vw, 1.15rem);
  line-height: 1.9;
  text-align: left;
  max-width: 65vw;
  margin-top: 3vh;
  color: var(--green);
  white-space: pre;
  overflow-x: auto;
}

/* Flow chart */
.flow { display: flex; flex-direction: column; align-items: center; gap: 1.2vh; margin-top: 3vh; }
.flow-step {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 2vh 4vw;
  font-size: clamp(0.95rem, 1.6vw, 1.3rem);
  min-width: 40vw;
  text-align: center;
}
.flow-arrow { font-size: 1.8rem; color: var(--accent); }

/* Big numbers */
.stats { display: flex; gap: 4vw; flex-wrap: wrap; justify-content: center; margin-top: 4vh; }
.stat { text-align: center; }
.stat .num { font-size: clamp(2.5rem, 5vw, 5rem); font-weight: 800; color: var(--accent); }
.stat .label { font-size: clamp(0.85rem, 1.4vw, 1.15rem); color: var(--text-dim); margin-top: 1vh; }

/* Case intro line */
.case-intro {
  color: var(--text-dim);
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
  text-align: left;
  max-width: 70vw;
  margin-bottom: 2vh;
  line-height: 1.6;
}

/* Diagram */
.diagram {
  display: flex;
  align-items: center;
  gap: 2vw;
  margin-top: 4vh;
  flex-wrap: wrap;
  justify-content: center;
}
.diagram-box {
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 12px;
  padding: 2.5vh 2.5vw;
  text-align: center;
  font-size: clamp(0.9rem, 1.5vw, 1.2rem);
}
.diagram-arrow { font-size: 2rem; color: var(--accent); }
.diagram-group {
  display: flex;
  flex-direction: column;
  gap: 1vh;
}
.diagram-group .diagram-box {
  font-size: clamp(0.8rem, 1.2vw, 1rem);
  padding: 1.5vh 2vw;
}

/* Numbered list */
ol.best { list-style: none; counter-reset: bp; text-align: left; max-width: 70vw; }
ol.best li { counter-increment: bp; padding: 1vh 0; font-size: clamp(0.95rem, 1.6vw, 1.3rem); line-height: 1.7; }
ol.best li::before {
  content: counter(bp);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2em; height: 2em;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  font-weight: 700;
  font-size: 0.85em;
  margin-right: 1.2vw;
  vertical-align: middle;
}

/* Pitfalls (踩坑) */
.pitfall {
  margin-bottom: 4vh;
  padding: 2.5vh 3vw;
  background: var(--bg-card);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}
.pitfall .bad {
  font-size: clamp(0.95rem, 1.6vw, 1.3rem);
  color: var(--red);
  margin-bottom: 1.5vh;
  line-height: 1.7;
}
.pitfall .good {
  font-size: clamp(0.95rem, 1.6vw, 1.3rem);
  color: var(--green);
  line-height: 1.7;
}
.pitfall.compact {
  margin-bottom: 2vh;
  padding: 1.8vh 3vw;
}
.pitfall.compact .bad, .pitfall.compact .good {
  font-size: clamp(0.85rem, 1.4vw, 1.1rem);
  margin-bottom: 0.8vh;
}

.big-quote {
  font-size: clamp(1.4rem, 3vw, 2.8rem);
  font-weight: 600;
  line-height: 1.5;
  max-width: 70vw;
  text-align: center;
  color: var(--accent);
  border-left: 4px solid var(--accent);
  padding-left: 3vw;
}

/* Separator line */
.sep { width: 60px; height: 4px; background: var(--accent); border-radius: 2px; margin: 3vh 0; }

/* Mobile */
@media (max-width: 768px) {
  .slide { padding: 4vh 6vw 12vh; }
  .cards { gap: 2vw; margin-top: 2vh; }
  .card { width: 85vw; padding: 2vh 4vw; flex-direction: row; display: flex; align-items: center; gap: 3vw; border-radius: 12px; }
  .card .icon { font-size: 2rem; margin-bottom: 0; flex-shrink: 0; }
  .card h3 { font-size: 1rem; margin-bottom: 0.3vh; }
  .card p { font-size: 0.85rem; text-align: left; }
  .stats { gap: 6vw; }
  .stat .num { font-size: 2.2rem; }
  .flow-step { min-width: 70vw; padding: 1.5vh 4vw; font-size: 0.95rem; }
  .flow-arrow { font-size: 1.2rem; }
  .code-block { max-width: 85vw; font-size: 0.8rem; padding: 2vh 3vw; }
  .case-intro { max-width: 88vw; font-size: 0.88rem; }
  ul { max-width: 88vw; }
  ul li { font-size: 0.9rem; padding: 0.5vh 0; }
  ol.best { max-width: 85vw; }
  ol.best li { font-size: 1rem; }
  h2 { font-size: 1.5rem; margin-bottom: 2vh; }
  .big-quote { font-size: 1.3rem; }
  .diagram { gap: 3vw; }
  .diagram-box { padding: 1.5vh 2vw; font-size: 0.9rem; }
}

/* PDF Export Button */
.pdf-btn {
  position: fixed; top: 12px; right: 12px; z-index: 9998;
  width: 36px; height: 36px; border-radius: 8px;
  background: rgba(30,30,50,0.7); border: 1px solid rgba(255,255,255,0.1);
  color: var(--text-dim); font-size: 16px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; backdrop-filter: blur(8px);
}
.pdf-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Print Styles */
@media print {
  html, body { overflow: visible !important; height: auto !important; font-size: 100% !important; }
  .deck { height: auto !important; position: static !important; }
  .slide {
    position: static !important; opacity: 1 !important;
    display: flex !important; page-break-after: always;
    height: 100vh; width: 100vw;
    break-after: page; break-inside: avoid;
    background: var(--bg) !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }
  .slide:last-child { page-break-after: auto; }
  .progress, .pdf-btn, .page-num, #pptkit-ctrl, #pptkit-banner { display: none !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; color-adjust: exact !important; }
  @page { size: landscape; margin: 0; }
}
