:root {
  --primary-color: #881337; /* 太魯閣高雅深紅 */
  --primary-dark: #4c0519;
  --primary-light: #9f1239;
  --primary-bg: #fff1f2;
  --accent-color: #d97706; /* 溫暖陶土琥珀金 */
  --text-main: #1f2937;
  --text-muted: #4b5563;
  --bg-color: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --success-color: #059669;
  --error-color: #dc2626;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.5;
  padding-bottom: 70px;
}

/* 頂部 Header: 自然排版，不強行 sticky 以免遮擋導航 */
.app-header {
  background: linear-gradient(135deg, var(--primary-color), #4c0519);
  color: white;
  padding: 14px 18px;
  position: relative;
  box-shadow: var(--shadow-md);
}

.header-top-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.app-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.btn-qr-share {
  background: linear-gradient(135deg, #d97706, #b45309);
  color: white;
  border: none;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 4px;
}

.app-title {
  font-size: 19px;
  font-weight: 800;
  margin-bottom: 2px;
  line-height: 1.3;
}

.app-subtitle {
  font-size: 13px;
  opacity: 0.9;
}

/* 獨立分頁導航列: 永遠吸頂於螢幕最頂部 (top: 0)，手機觸控滑動順暢，絕不遮擋 */
.site-nav, .tabs-container {
  display: flex;
  background: white;
  border-bottom: 2px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 999;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 4px;
  padding: 0 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.site-nav::-webkit-scrollbar, .tabs-container::-webkit-scrollbar {
  display: none;
}

.nav-item, .tab-btn {
  flex-shrink: 0;
  min-width: max-content;
  padding: 12px 14px;
  text-align: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--text-muted);
  border: none;
  background: none;
  cursor: pointer;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.nav-item.active, .tab-btn.active {
  color: var(--primary-color);
  border-bottom-color: var(--primary-color);
  background-color: var(--primary-bg);
}

/* 內容主容器 */
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 14px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* ===================================
   📽️ 53 頁全功能演講簡報播放器樣式
   =================================== */
.slides-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.slide-counter {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-color);
  background: white;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

.slides-viewport {
  width: 100%;
  aspect-ratio: 16 / 9;
  min-height: 280px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--border-color);
  position: relative;
  transition: all 0.3s ease;
  user-select: none;
  touch-action: pan-y;
}

/* 全螢幕模式 */
.slides-viewport.fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  aspect-ratio: auto;
  z-index: 9999;
  border-radius: 0;
  border: none;
}

/* 投影片內部版面 */
.slide-frame {
  width: 100%;
  height: 100%;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  overflow-y: auto;
}

.slide-frame.theme-cover,
.slide-frame.theme-chapter {
  background: linear-gradient(135deg, #4c0519, #881337);
  color: white;
}

.slide-frame.theme-quote {
  background: linear-gradient(135deg, #881337, #b45309);
  color: white;
}

.slide-frame.theme-content {
  background: #f8fafc;
  color: var(--text-main);
}

.slide-header-badge {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 4px;
}

.theme-cover .slide-header-badge,
.theme-chapter .slide-header-badge {
  color: #fbbf24;
}

.slide-main-title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.3;
  margin-bottom: 6px;
}

@media (min-width: 600px) {
  .slide-frame {
    padding: 36px 44px;
  }
  .slide-main-title {
    font-size: 28px;
  }
}

.theme-content .slide-main-title {
  color: var(--primary-color);
}

.slide-sub-title {
  font-size: 14px;
  opacity: 0.9;
  margin-bottom: 12px;
  line-height: 1.4;
}

@media (min-width: 600px) {
  .slide-sub-title {
    font-size: 17px;
  }
}

.theme-content .slide-sub-title {
  color: var(--text-muted);
}

.slide-card-content {
  background: white;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  border: 1px solid #e2e8f0;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.slide-bullet-item {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #1f2937;
}

@media (min-width: 600px) {
  .slide-bullet-item {
    font-size: 18px;
    margin-bottom: 8px;
  }
}

.slide-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  opacity: 0.75;
  padding-top: 8px;
}

/* 講稿抽屜 (Speaker Notes) */
.slides-notes-drawer {
  display: none;
  background: #1e293b;
  color: #f8fafc;
  border-radius: 14px;
  padding: 16px 18px;
  margin-top: 12px;
  border: 1px solid #334155;
  box-shadow: var(--shadow-md);
}

.slides-notes-drawer.active {
  display: block;
}

.notes-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  color: #38bdf8;
}

.btn-close-notes {
  background: none;
  border: none;
  color: #94a3b8;
  font-size: 16px;
  cursor: pointer;
}

.notes-body {
  font-size: 14px;
  line-height: 1.6;
  color: #cbd5e1;
}

/* 工具按鈕 */
.btn-ctrl {
  flex: 1;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--primary-color);
  background: white;
  color: var(--primary-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.btn-ctrl.active, .btn-ctrl:active {
  background: var(--primary-color);
  color: white;
}

/* 句子卡片樣式 */
.sentence-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 14px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sentence-card:active {
  transform: scale(0.98);
}

.sentence-card.playing {
  border-color: var(--primary-color);
  background-color: #fff1f2;
  box-shadow: 0 0 0 2px rgba(136, 19, 55, 0.2);
}

.sentence-content {
  flex: 1;
}

.sentence-indigenous {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 4px;
  line-height: 1.4;
}

.sentence-zh {
  font-size: 15px;
  color: #374151;
  font-weight: 500;
}

.audio-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 50%;
  background: var(--primary-color);
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 8px rgba(136, 19, 55, 0.3);
  transition: all 0.2s ease;
}

.audio-btn:active {
  transform: scale(0.9);
}

.audio-btn svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

/* 控制欄 */
.controls-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

/* 翻牌配對遊戲 */
.game-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  background: white;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  font-weight: 700;
  font-size: 15px;
}

.memory-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  perspective: 1000px;
}

.memory-card {
  height: 90px;
  background: white;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px;
  font-size: 17px;
  font-weight: 800;
  border: 2px solid #e2e8f0;
  cursor: pointer;
  user-select: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
}

.memory-card.unflipped {
  background: linear-gradient(135deg, #be123c, #881337);
  color: white;
  border-color: #9f1239;
}

.memory-card.unflipped::after {
  content: "✦";
  font-size: 24px;
  opacity: 0.6;
}

.memory-card.flipped {
  background: #fef2f2;
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.memory-card.matched {
  background: #ecfdf5;
  border-color: var(--success-color);
  color: var(--success-color);
  opacity: 0.6;
  pointer-events: none;
  transform: scale(0.96);
}

/* 測驗模式 */
.quiz-box {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  margin-bottom: 14px;
}

.quiz-header {
  font-size: 14px;
  color: var(--primary-color);
  font-weight: 800;
  margin-bottom: 8px;
}

.quiz-question {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 14px;
  line-height: 1.4;
}

.quiz-audio-trigger {
  margin: 10px 0 16px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-quiz-audio {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 9999px;
  background: var(--primary-color);
  color: white;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(136, 19, 55, 0.3);
}

.quiz-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.quiz-opt-btn {
  padding: 14px 16px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  background: white;
  text-align: left;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
}

.quiz-opt-btn:active {
  background: #f1f5f9;
}

.quiz-opt-btn.correct {
  background: #d1fae5;
  border-color: var(--success-color);
  color: #065f46;
}

.quiz-opt-btn.wrong {
  background: #fee2e2;
  border-color: var(--error-color);
  color: #991b1b;
}

.quiz-feedback {
  margin-top: 16px;
  padding: 12px;
  border-radius: 10px;
  font-size: 14px;
  display: none;
  font-weight: 600;
}

.quiz-feedback.show {
  display: block;
}

/* 讚美彈窗與 QR 放大 */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: white;
  border-radius: 20px;
  padding: 24px 20px;
  text-align: center;
  max-width: 360px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0% { transform: scale(0.85); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 10px;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary-color);
  margin-bottom: 6px;
}

.modal-desc {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.modal-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.qr-url-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 6px 12px;
  border-radius: 9999px;
  font-size: 12px;
  color: #334155;
  font-weight: 600;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-copy {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

/* 手機版簡報播放體驗極致優化 */
@media (max-width: 600px) {
  .slides-viewport {
    aspect-ratio: auto;
    min-height: 380px;
    max-height: 75vh;
  }
  .slides-toolbar {
    justify-content: space-between;
    gap: 4px;
  }
  .slides-toolbar .btn-ctrl {
    padding: 8px 10px;
    font-size: 13px;
  }
  .slide-counter {
    padding: 6px 8px;
    font-size: 13px;
  }
  .slide-frame {
    padding: 18px 16px;
  }
  .slide-main-title {
    font-size: 20px;
  }
  .slide-sub-title {
    font-size: 13px;
    margin-bottom: 8px;
  }
  .slide-card-content {
    padding: 12px 14px;
    gap: 8px;
  }
  .slide-bullet-item {
    font-size: 14px;
    line-height: 1.45;
  }
}



/* ===================================
   ✨ AI 備課百寶箱樣式 (NotebookLM & Gemini)
   =================================== */
.ai-hero-card {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: white;
  padding: 22px 20px;
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-md);
  border: 1px solid #334155;
}
.ai-hero-badge {
  display: inline-block;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}
.ai-hero-title {
  font-size: 21px;
  font-weight: 900;
  margin-bottom: 6px;
  line-height: 1.3;
}
.ai-hero-desc {
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.5;
}

.tool-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 18px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.tool-card-header {
  margin-bottom: 14px;
}
.tool-badge {
  display: inline-block;
  background: var(--primary-bg);
  color: var(--primary-color);
  padding: 2px 10px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 4px;
}
.tool-card h3 {
  font-size: 18px;
  font-weight: 800;
  color: #1e293b;
}

/* NotebookLM 流程視覺卡 */
.notebooklm-flow {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 16px 0;
}
@media (min-width: 600px) {
  .notebooklm-flow {
    grid-template-columns: 1fr auto 1fr auto 1fr;
    align-items: center;
  }
}
.flow-step {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  position: relative;
}
.flow-step .step-num {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-color);
  background: #ffe4e6;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 9999px;
  margin-bottom: 8px;
}
.flow-step .step-icon {
  font-size: 28px;
  margin-bottom: 6px;
}
.flow-step .step-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}
.flow-step .step-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}
.flow-arrow {
  display: none;
  font-size: 20px;
  color: #94a3b8;
  font-weight: bold;
}
@media (min-width: 600px) {
  .flow-arrow {
    display: block;
  }
}
.tool-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ai-output-box {
  margin-top: 14px;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  font-size: 13px;
  line-height: 1.6;
  white-space: pre-wrap;
  max-height: 280px;
  overflow-y: auto;
  border: 1px solid #334155;
}

/* Gemini 魔法盒按鈕 */
.gemini-btn-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}
@media (min-width: 600px) {
  .gemini-btn-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.gemini-act-btn {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.gemini-act-btn:hover, .gemini-act-btn.active {
  border-color: var(--primary-color);
  background: var(--primary-bg);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.gemini-act-btn .btn-icon {
  font-size: 24px;
  margin-bottom: 4px;
}
.gemini-act-btn .btn-label {
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 2px;
}
.gemini-act-btn .btn-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.gemini-result-panel {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  padding: 16px;
}
.gemini-result-panel .result-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
  font-size: 14px;
  color: var(--primary-color);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e2e8f0;
}
.gemini-result-panel .result-content {
  font-size: 14px;
  line-height: 1.6;
  color: #1e293b;
  min-height: 80px;
}

/* ===================================
   🌟 生詞圖解百科卡 (Flashcards) 樣式
   =================================== */
.flashcards-section {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 2px dashed #e2e8f0;
}
.section-title {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-color);
  margin-bottom: 14px;
}
.flashcards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
@media (min-width: 600px) {
  .flashcards-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.flashcard-item {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all 0.25s ease;
  position: relative;
  cursor: pointer;
}
.flashcard-item:hover {
  transform: translateY(-3px);
  border-color: var(--primary-color);
  box-shadow: var(--shadow-md);
}
.flashcard-icon {
  font-size: 32px;
  margin-bottom: 6px;
}
.flashcard-indigenous {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary-color);
  line-height: 1.2;
  margin-bottom: 2px;
}
.flashcard-zh {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.flashcard-note {
  font-size: 11px;
  color: #64748b;
  line-height: 1.3;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #f1f5f9;
}
.flashcard-play-btn {
  background: var(--primary-bg);
  border: 1px solid var(--primary-light);
  color: var(--primary-color);
  border-radius: 9999px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  margin-top: 6px;
  cursor: pointer;
}

/* ===================================
   📊 課堂即時調查樣式 (Live Poll)
   =================================== */
.poll-card {
  background: white;
  border-radius: 16px;
  padding: 24px 20px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}
.poll-badge {
  display: inline-block;
  background: #fef3c7;
  color: #b45309;
  font-size: 12px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 9999px;
  margin-bottom: 8px;
}
.poll-title {
  font-size: 19px;
  font-weight: 900;
  color: #1e293b;
  margin-bottom: 6px;
  line-height: 1.3;
}
.poll-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
}
.poll-options-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}
.poll-btn {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}
.poll-btn:hover, .poll-btn.voted {
  border-color: var(--primary-color);
  background: var(--primary-bg);
}
.poll-btn .opt-icon {
  font-size: 20px;
  margin-right: 8px;
  flex-shrink: 0;
}
.poll-btn .opt-text {
  font-size: 14px;
  font-weight: 700;
  color: #1f2937;
  flex: 1;
}
.poll-btn .opt-pct {
  font-size: 14px;
  font-weight: 800;
  color: var(--primary-color);
  margin-left: 10px;
}
.poll-bar-bg {
  width: 100%;
  height: 8px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin-top: -6px;
}
.poll-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--primary-color));
  border-radius: 9999px;
  transition: width 0.6s ease;
}
.poll-footer {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
}
#poll-total-votes {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.poll-analysis {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: #166534;
}

/* ===================================
   📽️ 簡報視覺圖表化排版樣式 (Infographics)
   =================================== */
/* 1. 時間軸 (Timeline) */
.slide-timeline-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
}
@media (min-width: 600px) {
  .slide-timeline-container {
    flex-direction: row;
  }
}
.timeline-card {
  flex: 1;
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
  position: relative;
}
.timeline-era {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary-color);
  background: var(--primary-bg);
  padding: 2px 8px;
  border-radius: 9999px;
  display: inline-block;
  margin-bottom: 6px;
}
.timeline-icon {
  font-size: 26px;
  margin-bottom: 4px;
}
.timeline-title {
  font-size: 15px;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
}
.timeline-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* 2. 對照雙欄 (Comparison) */
.slide-compare-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
}
@media (min-width: 600px) {
  .slide-compare-grid {
    grid-template-columns: 1fr 1fr;
  }
}
.compare-col {
  border-radius: 12px;
  padding: 14px;
  display: flex;
  flex-direction: column;
}
.compare-col.left {
  background: #fef2f2;
  border: 1px solid #fecaca;
}
.compare-col.right {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}
.compare-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 8px;
}
.compare-col.left .compare-header {
  color: #991b1b;
}
.compare-col.right .compare-header {
  color: #166534;
}
.compare-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.compare-list li {
  font-size: 12px;
  line-height: 1.4;
  position: relative;
  padding-left: 14px;
}
.compare-col.left .compare-list li::before {
  content: "✕";
  color: #dc2626;
  position: absolute;
  left: 0;
  font-weight: bold;
}
.compare-col.right .compare-list li::before {
  content: "✓";
  color: #16a34a;
  position: absolute;
  left: 0;
  font-weight: bold;
}

/* 3. 數據指標卡 (Stats Grid) */
.slide-stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  width: 100%;
}
.stat-box {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-box .stat-icon {
  font-size: 24px;
  margin-bottom: 2px;
}
.stat-box .stat-num {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary-color);
  line-height: 1.2;
}
.stat-box .stat-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  margin-top: 2px;
}

/* 4. 金字塔階層 (Pyramid) */
.slide-pyramid-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}
.pyramid-tier {
  border-radius: 10px;
  padding: 10px 14px;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}
.pyramid-tier .tier-icon {
  font-size: 22px;
}
.pyramid-tier .tier-level {
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.pyramid-tier .tier-desc {
  font-size: 12px;
  opacity: 0.95;
  line-height: 1.3;
}

/* 5. 航程地圖 (Agenda Grid) */
.slide-agenda-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  width: 100%;
}
@media (min-width: 600px) {
  .slide-agenda-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
.agenda-card {
  background: white;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.agenda-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  font-weight: 800;
}
.agenda-card-title {
  font-size: 13px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.3;
}

/* 6. 翻牌遊戲卡片圖文優化 */
.memory-card.flipped, .memory-card.matched {
  background: white !important;
  color: var(--text-main) !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  border: 2px solid var(--accent-color) !important;
}
.memory-card.matched {
  border-color: #16a34a !important;
  background: #f0fdf4 !important;
}
.mem-card-icon {
  font-size: 26px;
  margin-bottom: 2px;
}
.mem-card-text {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
}
.mem-card-tag {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* ===================================
   📈 圖表生成實測實驗室與投影片切換樣式
   =================================== */
.chart-theme-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.btn-chart-theme {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.btn-chart-theme.active {
  background: var(--primary-bg);
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.chart-mode-bar {
  display: flex;
  background: #e2e8f0;
  border-radius: 9999px;
  padding: 3px;
  margin-bottom: 14px;
  gap: 4px;
}
.btn-mode-pill {
  flex: 1;
  border: none;
  background: none;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 800;
  color: #475569;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.btn-mode-pill.active {
  background: white;
  color: var(--primary-color);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.chart-lab-viewport {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 16px;
  min-height: 360px;
}
.lab-view-box {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lab-img {
  max-width: 100%;
  max-height: 380px;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  object-fit: contain;
  background: white;
}
.lab-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2e8f0;
  font-size: 12px;
  color: #64748b;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-download-chart {
  background: var(--primary-color);
  color: white;
  padding: 4px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
}
.json-schema-box {
  margin-top: 10px;
  background: #0f172a;
  color: #38bdf8;
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
  font-family: Consolas, monospace;
  max-height: 200px;
  overflow-y: auto;
  width: 100%;
  white-space: pre-wrap;
  text-align: left;
}

/* 投影片內部圖表切換樣式 */
.slide-chart-mode-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 8px;
}
.btn-sm-mode {
  border: 1px solid #cbd5e1;
  background: white;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  cursor: pointer;
}
.btn-sm-mode.active {
  border-color: var(--primary-color);
  background: var(--primary-bg);
  color: var(--primary-color);
}

/* --- Prompt Library Styles --- */
.prompt-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}
.prompt-tab-btn {
  padding: 10px 20px;
  border-radius: 24px;
  border: 2px solid #e5e7eb;
  background: white;
  color: #4b5563;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.prompt-tab-btn:hover {
  background: #f3f4f6;
  border-color: #d1d5db;
}
.prompt-tab-btn.active {
  background: #047857;
  color: white;
  border-color: #047857;
  box-shadow: 0 4px 10px rgba(4,120,87,0.3);
}

.prompt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.prompt-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.02);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
}
.prompt-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
  border-color: #10b981;
}

.prompt-card-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 16px;
}
.prompt-icon {
  font-size: 28px;
  margin-right: 14px;
  background: #ecfdf5;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  flex-shrink: 0;
}
.prompt-title-wrap {
  flex: 1;
}
.prompt-id {
  font-size: 13px;
  color: #10b981;
  font-weight: 900;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}
.prompt-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  margin: 0;
  line-height: 1.3;
}

.prompt-tags {
  margin-bottom: 12px;
}
.prompt-tag {
  display: inline-block;
  background: #f3f4f6;
  color: #374151;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  margin-right: 6px;
  font-weight: 600;
}

.prompt-desc {
  font-size: 14px;
  color: #4b5563;
  margin-bottom: 16px;
  flex: 1;
  line-height: 1.6;
}

.prompt-target {
  font-size: 13px;
  color: #374151;
  background: #f9fafb;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 20px;
  border-left: 4px solid #10b981;
  line-height: 1.5;
}

.btn-copy-prompt {
  background: #047857;
  color: white;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-weight: 800;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.2s;
  width: 100%;
}
.btn-copy-prompt:hover {
  background: #065f46;
  box-shadow: 0 4px 12px rgba(4,120,87,0.3);
}
.btn-copy-prompt.copied {
  background: #111827;
  pointer-events: none;
}
