:root {
  --bg: #FBF9FD;
  --surface: #FFFFFF;
  --surface-tint: #F5EEF8;
  --border: #ECE4F1;
  --text: #1F1428;
  --text-muted: #6E6479;
  --primary: #A82490;
  --primary-dark: #7E1B6C;
  --accent: #A82490;
  --accent-light: #F6E4F2;
  --violet: #5A2A9C;
  --danger: #C0392B;
  --danger-light: #FBEAE8;
  --session-accent: #244884;
  --session-accent-light: #E5EBF5;
  --radius: 18px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --grad-brand: linear-gradient(135deg, #B8309F 0%, #A82490 42%, #66299E 100%);
  /* 紫色調陰影：貼邊接觸陰影 + 大範圍柔和擴散 */
  --shadow-sm: 0 1px 2px rgba(60,20,70,.06), 0 6px 16px -6px rgba(60,20,70,.12);
  --shadow-md: 0 2px 4px rgba(60,20,70,.06), 0 22px 44px -14px rgba(96,26,104,.30);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", "Hiragino Sans", "Apple SD Gothic Neo", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  position: relative;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--accent-light); color: var(--primary-dark); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 註冊 --mx/--my 為數值屬性，供動畫補間 */
@property --mx { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --my { syntax: '<number>'; inherits: true; initial-value: 0; }
@property --angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }

/* 背景裝飾層：角落漸層光暈與交叉細對角線格線，光暈以 CSS 動畫緩慢飄移 */
@keyframes bg-drift-x { 0%, 100% { --mx: -1; } 50% { --mx: 1; } }
@keyframes bg-drift-y { 0%, 100% { --my: 1; } 50% { --my: -1; } }
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  --mx: 0;
  --my: 0;
  animation: bg-drift-x 37s ease-in-out infinite, bg-drift-y 29s ease-in-out infinite;
  /* 三個光暈色塊：桃紅／黃／青，低透明度 */
  background-image:
    radial-gradient(circle at calc(12% + var(--mx) * 26%) calc(-8% + var(--my) * 26%), rgba(214,110,170,.16) 0%, transparent 36%),
    radial-gradient(circle at calc(108% - var(--mx) * 26%) calc(12% + var(--my) * 26%), rgba(240,204,120,.15) 0%, transparent 36%),
    radial-gradient(circle at calc(50% + var(--mx) * 18%) calc(115% - var(--my) * 18%), rgba(60,180,180,.13) 0%, transparent 46%),
    repeating-linear-gradient(115deg, rgba(60,20,70,.035) 0px, rgba(60,20,70,.035) 1px, transparent 1px, transparent 88px),
    repeating-linear-gradient(25deg, rgba(60,20,70,.03) 0px, rgba(60,20,70,.03) 1px, transparent 1px, transparent 88px);
}
/* 細微顆粒紋理 */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .05;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .8 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--primary); text-decoration: none; }

/* ---------- 頁首 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--grad-brand);
}
.topbar::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(60% 160% at 88% -50%, rgba(255,255,255,.26), transparent 62%);
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.5), transparent);
}
.topbar-inner {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  transition: padding .35s var(--ease);
}
.topbar.scrolled .topbar-inner { padding-top: 10px; padding-bottom: 10px; }
.brand { font-weight: 700; font-size: 16px; letter-spacing: .02em; color: #fff; display: inline-flex; align-items: center; gap: 10px; }
/* Logo 外包白底圓角方塊 */
.brand-logo { height: 1.4em; width: auto; display: block; background: #fff; border-radius: 8px; padding: 4px 9px; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.lang-label { font-size: 12px; letter-spacing: .06em; color: rgba(255,255,255,.8); }
.lang-switch-select {
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 12px;
  border: 1px solid rgba(255,255,255,.38);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
  color: #fff;
  cursor: pointer;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  transition: background .25s, border-color .25s;
}
.lang-switch-select:hover { background: rgba(255,255,255,.22); border-color: rgba(255,255,255,.7); }
.lang-switch-select:focus { outline: none; border-color: #fff; }
.lang-switch-select option { color: #000; }

.app {
  max-width: 800px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}

/* ---------- 文字層級 ---------- */
h1 {
  font-size: clamp(28px, 7vw, 40px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  margin: 6px 0 24px;
  text-wrap: balance;
}
h2 {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin: 0 0 14px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
}
.eyebrow::before { content: ''; width: 28px; height: 2px; border-radius: 2px; background: var(--grad-brand); }
.eyebrow.center { justify-content: center; }
.eyebrow.center::before { display: none; }
.page-head { margin-bottom: 28px; }
.page-head h1 { margin: 10px 0 0; }

.conference-name-tag {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 6px;
}

/* ---------- 進場動效 ---------- */
@keyframes rise-in {
  from { opacity: 0; transform: translateY(22px); }
  to { opacity: 1; transform: translateY(0); }
}
.reveal {
  animation: rise-in .8s var(--ease) backwards;
  animation-delay: calc(var(--i, 0) * 80ms);
}

/* ---------- 卡片 ---------- */
.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}
.card-list { display: flex; flex-direction: column; gap: 14px; }
.card-list .card { margin-bottom: 0; }
.card-link {
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  cursor: pointer;
  overflow: hidden;
  isolation: isolate;
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .3s ease;
}
.card-link::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s ease;
  background: radial-gradient(380px circle at var(--px, 50%) var(--py, 50%), rgba(168,36,144,.11), transparent 62%);
}
.card-link:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: rgba(168,36,144,.32); }
.card-link:hover::after { opacity: 1; }
.card-link:active { transform: translateY(-1px) scale(.994); }
.card-body { min-width: 0; flex: 1; }
.card-title { font-weight: 700; font-size: 18px; letter-spacing: -.01em; line-height: 1.35; margin-bottom: 8px; }
.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text-muted);
}
.card-meta + .card-meta { margin-top: 4px; }
.card-meta svg { width: 15px; height: 15px; flex-shrink: 0; opacity: .8; }
.card-arrow {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface-tint);
  color: var(--accent);
  transition: background .35s var(--ease), color .35s ease, transform .5s var(--ease);
}
.card-arrow svg { width: 17px; height: 17px; }
.card-link:hover .card-arrow { background: var(--accent); color: #fff; transform: translateX(2px); }

/* 進行中的會議：旋轉的紫色漸層外框 */
.conf-card-live {
  padding: 28px 26px;
  border: 1.5px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    conic-gradient(from var(--angle), #A82490, #D37BC4, #66299E, #A82490) border-box;
  animation: spin-angle 7s linear infinite;
}
.conf-card-live.reveal {
  animation: rise-in .8s var(--ease) backwards, spin-angle 7s linear infinite;
  animation-delay: calc(var(--i, 0) * 80ms), 0s;
}
@keyframes spin-angle { to { --angle: 360deg; } }
.conf-card-live .card-title { font-size: 23px; }
.conf-card-live:hover { border-color: transparent; }

.conf-card-compact { padding: 20px 24px; }
.conf-card-compact .card-title { font-size: 17px; }

/* 選定的會議：紫色漸層橫幅 */
.card.conf-card-selected {
  display: block;
  cursor: default;
  overflow: hidden;
  padding: 30px 28px;
  margin-bottom: 20px;
  border: none;
  background: var(--grad-brand);
  color: #fff;
  box-shadow: 0 30px 60px -26px rgba(102,41,158,.7);
  animation: none;
  transform: none;
}
.card.conf-card-selected::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -80px;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.28), transparent 68%);
  pointer-events: none;
}
.card.conf-card-selected::after { display: none; }
.card.conf-card-selected:hover { transform: none; border-color: transparent; box-shadow: 0 30px 60px -26px rgba(102,41,158,.7); }
.conf-card-selected .card-body { position: relative; }
.conf-card-selected .card-title { font-size: clamp(22px, 5.5vw, 30px); font-weight: 800; letter-spacing: -.02em; color: #fff; margin-bottom: 12px; }
.conf-card-selected .card-meta { color: rgba(255,255,255,.86); }
.conf-card-selected .card-arrow { display: none; }
.conf-card-selected .live-badge { color: #fff; }

/* 場次時間軸 */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(168,36,144,.4), rgba(102,41,158,.08));
}
.tl-item { position: relative; margin-bottom: 14px; }
.tl-dot {
  position: absolute;
  left: -34px;
  top: 30px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid #CDBFD6;
}
.tl-dot.is-ended { background: #CDBFD6; border-color: #CDBFD6; transform: scale(.7); }
.tl-dot.is-live { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-light); animation: dot-pulse 1.8s ease-out infinite; }
@keyframes dot-pulse {
  0% { box-shadow: 0 0 0 0 rgba(168,36,144,.45); }
  100% { box-shadow: 0 0 0 14px rgba(168,36,144,0); }
}

.session-card.card { padding: 22px 24px; }
.session-card.is-live-card {
  border-color: rgba(168,36,144,.5);
  background: linear-gradient(135deg, #fff 55%, var(--accent-light));
}
.session-card.is-live-card .card-title { color: var(--accent); }
.session-card-muted { border-color: transparent; }
.session-card-muted:hover { border-color: rgba(168,36,144,.32); }

/* 選會議時的轉場動畫：其他卡片淡出、選到的卡片放大定住 */
.card-fade-out {
  transition: opacity .28s ease, transform .28s ease;
  opacity: 0;
  transform: scale(0.96);
  pointer-events: none;
}
.card-rise {
  transition: transform .28s ease, border-color .28s ease;
  transform: scale(1.02);
}
.fade-in-area {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s ease, transform .5s var(--ease);
}
.fade-in-area.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 狀態標籤與聲波 ---------- */
.wave { display: inline-flex; align-items: center; gap: 2px; height: 12px; margin-right: 7px; }
.wave b {
  width: 2.5px;
  height: 100%;
  border-radius: 2px;
  background: currentColor;
  transform-origin: center;
  animation: wave 1s ease-in-out infinite;
}
.wave b:nth-child(2) { animation-delay: .18s; }
.wave b:nth-child(3) { animation-delay: .36s; }
.wave b:nth-child(4) { animation-delay: .12s; }
@keyframes wave { 0%, 100% { transform: scaleY(.3); } 50% { transform: scaleY(1); } }

.live-badge {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.live-badge .wave { height: 14px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--text-muted);
  margin-left: 8px;
}
.status-pill.live { background: var(--accent-light); color: var(--accent); }
.status-pill.live .wave { height: 10px; margin-right: 6px; }
.status-pill.ended { background: var(--surface-tint); color: var(--text-muted); }

/* ---------- 子導覽與按鈕 ---------- */
.subnav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 22px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 14px -10px;
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  transition: background .25s, color .25s;
}
.subnav .back-link { margin-bottom: 0; }
.back-link:hover { background: var(--accent-light); color: var(--accent); }

.qr-btn, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  padding: 9px 18px;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), background .25s, color .25s, border-color .25s;
}
.qr-btn svg, .btn-primary svg { width: 16px; height: 16px; }
.qr-btn { border: 1px solid var(--border); background: var(--surface); color: var(--accent); box-shadow: var(--shadow-sm); }
.qr-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateY(-1px); }
.btn-primary { border: none; background: var(--grad-brand); color: #fff; box-shadow: 0 12px 24px -10px rgba(168,36,144,.7); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 28px -10px rgba(168,36,144,.8); }
.qr-btn:active, .btn-primary:active { transform: scale(.97); }

/* ---------- QR Code 視窗 ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(34,12,44,.55);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: opacity .35s ease;
}
.modal-backdrop.open { opacity: 1; }
.modal-sheet {
  position: relative;
  width: min(380px, 100%);
  padding: 34px 28px 28px;
  text-align: center;
  background: var(--surface);
  border-radius: 28px;
  box-shadow: 0 50px 90px -24px rgba(50,8,64,.6);
  transform: translateY(30px) scale(.95);
  transition: transform .6s var(--ease);
}
.modal-backdrop.open .modal-sheet { transform: none; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--text-muted);
  cursor: pointer;
  transition: background .25s, color .25s, transform .4s var(--ease);
}
.modal-close svg { width: 16px; height: 16px; }
.modal-close:hover { background: var(--accent); color: #fff; transform: rotate(90deg); }
.modal-title { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.3; margin: 10px 0 0; text-wrap: balance; }
.qr-tile {
  display: inline-block;
  padding: 16px;
  margin: 22px 0 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow-sm);
  line-height: 0;
}
.qr-tile img, .qr-tile canvas { width: 220px; height: 220px; image-rendering: pixelated; }
.modal-hint { margin: 0 0 14px; font-size: 14px; color: var(--text-muted); }
.modal-link {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface-tint);
  font-size: 11.5px;
  color: var(--text-muted);
  word-break: break-all;
  user-select: all;
}

/* ---------- 分頁 ---------- */
.tabs {
  position: relative;
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
  overflow-x: auto;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: none;
  padding: 13px 18px;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .25s ease;
}
@media (max-width: 480px) {
  .tab-btn { padding: 13px 12px; font-size: 14px; }
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { color: var(--accent); }
.tab-indicator {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  border-radius: 3px 3px 0 0;
  background: var(--grad-brand);
  transition: transform .55s var(--ease), width .55s var(--ease);
}

.tts-toggle-row { margin-bottom: 16px; }
.tts-toggle-btn {
  padding: 9px 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), border-color .25s, color .25s, background .25s;
}
.tts-toggle-btn:hover { transform: translateY(-1px); }
.tts-toggle-btn.on { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* ---------- 即時字幕 ---------- */
.caption-line-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 68vh;
  overflow-y: auto;
  padding: 4px 2px 10px;
}
.caption-line {
  position: relative;
  padding: 18px 22px 18px 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  font-size: 19px;
  line-height: 1.65;
  color: #4B4056;
  box-shadow: var(--shadow-sm);
  transition: opacity .4s ease, transform .5s var(--ease), box-shadow .5s var(--ease);
}
.caption-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, var(--accent), var(--violet));
  opacity: .28;
}
.caption-line:first-child {
  color: var(--text);
  border-color: rgba(168,36,144,.26);
  box-shadow: var(--shadow-md);
}
.caption-line:first-child::before { opacity: 1; }
.caption-line-enter { opacity: 0; transform: translateY(-16px); }
.caption-line-fadeout { opacity: 0; }
.caption-line-warn { color: var(--danger); font-size: 14px; margin: 0 4px; cursor: help; }
.speaker-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-left: 8px;
  vertical-align: middle;
  box-shadow: 0 0 0 2px var(--surface);
}
.caption-line .speaker-dot { margin-left: 0; margin-right: 8px; }

/* ---------- 摘要與逐字稿 ---------- */
.summary-item {
  padding: 14px 18px;
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 4px 14px 14px 4px;
  margin-bottom: 10px;
  font-size: 15px;
  line-height: 1.7;
  white-space: pre-wrap;
  box-shadow: var(--shadow-sm);
}
.summary-time { font-size: 11px; letter-spacing: .08em; color: var(--text-muted); margin-bottom: 4px; font-variant-numeric: tabular-nums; }

.update-note { font-size: 12px; color: var(--text-muted); }

.tab-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.refresh-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: border-color .25s, color .25s, transform .35s var(--ease);
}
.refresh-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.refresh-btn:disabled { opacity: .5; cursor: default; }

.transcript-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.transcript-slider-row input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.transcript-slider-label {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
  min-width: 3.5em;
  font-variant-numeric: tabular-nums;
}
.transcript-slider-label:last-child { text-align: right; }

.transcript-chunks-scroll {
  max-height: 55vh;
  overflow-y: auto;
  padding-right: 6px;
}
.transcript-chunk { margin-bottom: 22px; scroll-margin-top: 12px; }
.transcript-chunk-time {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .1em;
  color: var(--accent);
  margin-bottom: 6px;
  font-variant-numeric: tabular-nums;
}

.final-summary { white-space: pre-wrap; font-size: 15px; line-height: 1.75; }

/* 簡報外觀主題：預設使用網站強調色，其他主題覆寫這些變數（與下載版簡報主題色碼一致） */
.slide-viewer {
  --deck-accent: var(--accent); --deck-accent-rgb: 168,36,144;
  --deck-accent2: var(--session-accent); --deck-accent2-rgb: 36,72,132;
  /* 簡報預覽固定使用深色底 */
  --deck-bg: #0B141A; --deck-text: #EAECF0;
}
.slide-viewer[data-deck-theme="ocean"] {
  --deck-accent: #4FD1C5; --deck-accent-rgb: 79,209,197;
  --deck-accent2: #1B3A4B; --deck-accent2-rgb: 27,58,75;
  --deck-bg: #0A1F2E; --deck-text: #EAF6F5;
}
.slide-viewer[data-deck-theme="violet"] {
  --deck-accent: #C77DFF; --deck-accent-rgb: 199,125,255;
  --deck-accent2: #3D2A5C; --deck-accent2-rgb: 61,42,92;
  --deck-bg: #1A1030; --deck-text: #F0E9FA;
}
.slide-viewer[data-deck-theme="mono"] {
  --deck-accent: #E5E5E5; --deck-accent-rgb: 229,229,229;
  --deck-accent2: #333333; --deck-accent2-rgb: 51,51,51;
  --deck-bg: #141414; --deck-text: #F5F5F5;
}
.slide-viewer {
  position: relative;
  background: var(--deck-bg);
  color: var(--deck-text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 5% 6% 4% 8%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: slide-fade-in .32s ease;
  box-shadow: 0 12px 32px -14px rgba(0,0,0,.5);
}
.slide-logo {
  position: absolute;
  z-index: 2;
  top: 4%;
  right: 5%;
  max-height: 10%;
  max-width: 22%;
  object-fit: contain;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.4));
}
.slide-viewer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 6px;
  height: 100%;
  background: linear-gradient(180deg, var(--deck-accent), var(--deck-accent2));
}
.slide-viewer::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 88% -8%, rgba(var(--deck-accent-rgb),.6) 0%, transparent 38%),
    radial-gradient(circle at -8% 106%, rgba(var(--deck-accent2-rgb),.6) 0%, transparent 42%),
    radial-gradient(circle at 78% 10%, transparent 22%, rgba(255,255,255,.04) 23%, rgba(255,255,255,.04) 23.6%, transparent 24.4%);
  opacity: .35;
}

.slide-kicker {
  position: relative;
  z-index: 1;
  font-size: .68em;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--deck-accent);
  margin-bottom: .8em;
}

.slide-content {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  justify-content: safe center;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.slide-content::-webkit-scrollbar { width: 6px; }
.slide-content::-webkit-scrollbar-track { background: transparent; }
.slide-content::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }

/* min-height:0 讓 overflow-y:auto 在巢狀 flex 容器內生效 */
.slide-media-row { display: flex; flex-direction: column; min-height: 0; }
.slide-text { min-height: 0; }

.slide-title { font-size: 1.5em; font-weight: 700; margin-bottom: .6em; line-height: 1.3; }
.slide-bullets { font-size: 1em; line-height: 1.7; padding-left: 1.1em; margin: 0; }
.slide-bullets li { margin-bottom: 0.55em; }
.slide-bullets li::marker { color: var(--deck-accent); font-weight: 700; }

.slide-image {
  width: 100%;
  max-height: 26%;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 3%;
  flex-shrink: 1;
  min-height: 0;
  box-shadow: 0 6px 18px -6px rgba(0,0,0,.5);
}

.slide-footer {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-top: .8em;
  padding-top: .6em;
  border-top: 1px solid var(--border);
  font-size: .62em;
  color: var(--text-muted);
}
.slide-footer-source { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slide-footer-page { flex-shrink: 0; }

/* 簡報版面變化：封面／金句／關鍵數據 */
.slide-layout-title .slide-content { text-align: center; align-items: center; }
.slide-layout-title .slide-title { font-size: 1.7em; padding-right: 0; }
.slide-layout-title .slide-kicker { align-self: center; }

.slide-layout-quote .slide-content { text-align: center; align-items: center; }
.slide-layout-quote .slide-kicker { align-self: center; }
.slide-layout-quote .slide-title { font-size: 1.35em; font-style: italic; padding-right: 0; }
.slide-layout-quote .slide-title::before { content: '\201C'; color: var(--deck-accent); font-weight: 800; }
.slide-layout-quote .slide-title::after { content: '\201D'; color: var(--deck-accent); font-weight: 800; }

.slide-layout-stat .slide-title {
  font-size: 2.4em;
  font-weight: 800;
  color: var(--deck-accent);
  display: inline-block;
  padding-bottom: .15em;
  border-bottom: 3px solid var(--deck-accent);
}

.slide-layout-compare .slide-content { justify-content: center; }
.slide-compare-row { display: flex; gap: 6%; align-items: flex-start; }
.slide-compare-row .slide-bullets { flex: 1; min-width: 0; }
.slide-compare-divider { align-self: stretch; width: 1px; background: rgba(var(--deck-accent2-rgb),.6); flex-shrink: 0; }

.slide-layout-image-full .slide-content { align-items: center; text-align: center; justify-content: center; }
.slide-layout-image-full .slide-media-row { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; }
.slide-image-full { max-width: 100%; max-height: 82%; width: auto; object-fit: contain; margin-bottom: 0; }
.slide-image-full-caption { font-size: 1.15em; margin-top: .6em; margin-bottom: 0; }

.slide-layout-bullets .slide-media-row:has(.slide-image) {
  flex-direction: row;
  align-items: center;
  gap: 6%;
}
.slide-layout-bullets .slide-media-row:has(.slide-image) .slide-image {
  width: 38%;
  max-height: 100%;
  margin-bottom: 0;
}
.slide-layout-bullets .slide-media-row:has(.slide-image) .slide-text { flex: 1; min-width: 0; }

/* 窄螢幕縮小簡報字級與間距 */
@media (max-width: 480px) {
  .slide-viewer { padding: 4% 5% 3% 7%; }
  .slide-kicker { font-size: .6em; margin-bottom: .5em; }
  .slide-title { font-size: 1.25em; margin-bottom: .4em; }
  .slide-bullets { font-size: .85em; line-height: 1.5; }
  .slide-bullets li { margin-bottom: .35em; }
  .slide-layout-title .slide-title { font-size: 1.4em; }
  .slide-layout-stat .slide-title { font-size: 1.9em; }
  .slide-footer { font-size: .58em; margin-top: .5em; padding-top: .4em; }
  .slide-image { max-height: 20%; }
  .slide-logo { max-height: 8%; }
  .slide-compare-row { gap: 4%; }
}

@keyframes slide-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 頁面淡入 */
.page-fade-in { animation: slide-fade-in .5s var(--ease); }

.slide-dots { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 18px; }
.slide-dot { width: 7px; height: 7px; border-radius: 999px; background: var(--border); transition: width .45s var(--ease), background .3s ease; }
.slide-dot.active { width: 24px; background: var(--grad-brand); }

.slide-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 12px;
}
.slide-nav button {
  padding: 9px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), border-color .25s, color .25s;
}
.slide-nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
.slide-nav button:disabled { opacity: 0.4; cursor: default; }

.slide-download-row {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.slide-download-btn {
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .35s var(--ease), border-color .25s, color .25s;
}
.slide-download-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }

.empty-state { color: var(--text-muted); font-size: 14px; padding: 56px 0; text-align: center; }
.loading { color: var(--text-muted); padding: 56px 0; text-align: center; }
.error-box { color: var(--danger); padding: 16px 18px; background: var(--danger-light); border-radius: 14px; }

.site-footer {
  text-align: center;
  font-size: 10.5px;
  line-height: 1.9;
  letter-spacing: .08em;
  color: var(--text-muted);
  padding: 8px 0 40px;
}
.site-footer::before {
  content: '';
  display: block;
  width: 36px;
  height: 2px;
  margin: 0 auto 18px;
  border-radius: 2px;
  background: var(--grad-brand);
  opacity: .6;
}
.site-footer div:first-child { font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.site-footer div:last-child { opacity: .75; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
