/* ━━━ AI PPT 面板 ━━━
   全部使用 theme.css 的 CSS 变量，自动跟随暗/亮 + 5 套调色板。
   面板结构与 chat-panel 同源（flex column，min-height:0 防溢出）。 */

#ppt-panel {
  display: none;            /* 由 nav.js showPpt() 切 flex */
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

#ppt-panel .ppt-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px clamp(12px, 4vw, 40px) 40px;
}

.ppt-intro {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 4px 0 16px;
}

/* ── 输入区 ── */
.ppt-compose {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 18px;
}
.ppt-compose textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 92px;
  resize: vertical;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.6;
  font-family: var(--sans);
  outline: none;
  transition: border-color var(--trans);
}
.ppt-compose textarea:focus { border-color: var(--accent2); }

.ppt-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.ppt-controls .ppt-spacer { flex: 1; }

.ppt-slidecount {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
}
.ppt-slidecount select {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  outline: none;
}

.ppt-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg3);
  color: var(--text);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: all var(--trans);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--sans);
}
.ppt-btn:hover { border-color: var(--accent2); }
.ppt-btn:disabled { opacity: .5; cursor: not-allowed; }
.ppt-btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
  border: none;
  font-weight: 600;
}
.ppt-btn-primary:hover { filter: brightness(1.05); border: none; }

/* ── 资料芯片 ── */
.ppt-materials {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.ppt-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 240px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 6px 4px 11px;
  font-size: 12px;
  color: var(--text-soft);
}
.ppt-chip .ppt-chip-name {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ppt-chip .ppt-chip-x {
  cursor: pointer; border: none; background: transparent;
  color: var(--text-muted); font-size: 14px; line-height: 1; padding: 0 2px;
}
.ppt-chip .ppt-chip-x:hover { color: var(--danger); }
.ppt-chip.uploading { opacity: .6; }

/* ── 过程列表（复用 status 事件，弱化色，明确过程而非结果）── */
.ppt-process {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg2);
  padding: 10px 14px;
  margin-bottom: 18px;
  font-size: 13px;
}
.ppt-process:empty { display: none; }
.ppt-proc-row {
  display: flex; align-items: center; gap: 9px;
  padding: 5px 0; color: var(--text-soft);
}
.ppt-proc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--text-muted); flex: none;
}
.ppt-proc-row.running .ppt-proc-dot { background: var(--accent2); animation: pptPulse 1s infinite; }
.ppt-proc-row.done    .ppt-proc-dot { background: var(--accent); }
.ppt-proc-row.error   .ppt-proc-dot { background: var(--danger); }
.ppt-proc-row.error   { color: var(--danger); }
@keyframes pptPulse { 0%,100%{opacity:1} 50%{opacity:.35} }

/* ── 幻灯片预览（与导出 pptx 同款观感：渐变 + 几何装饰 + 圆点）── */
.ppt-viewer { display: none; }
.ppt-viewer.show { display: block; }

.ppt-deck-title {
  font-size: 16px; font-weight: 600; color: var(--text);
  margin: 4px 0 12px;
}

.ppt-stage-wrap {
  position: relative;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

/* 16:9 舞台。配色由 JS 注入的 --pg1/--pg2/--pac/--pbg/--pink/--pmuted/--pon 驱动 */
.ppt-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  --pg1:#6366F1; --pg2:#4338CA; --pac:#F59E0B;
  --pbg:#F7F8FD; --pink:#1E293B; --pmuted:#64748B; --pon:#FFFFFF;
}
.ppt-slide {
  position: absolute; inset: 0;
  padding: 7% 7.5%;
  box-sizing: border-box;
  display: flex; flex-direction: column;
  font-family: var(--sans);
  overflow: hidden;
}

/* 封面 / 章节：满版渐变 */
.ppt-slide.layout-title,
.ppt-slide.layout-section {
  background: linear-gradient(135deg, var(--pg1), var(--pg2));
  justify-content: center;
}
.ppt-slide.layout-title  .s-title,
.ppt-slide.layout-section .s-title { color: var(--pon); }
.ppt-slide.layout-title  .s-sub,
.ppt-slide.layout-section .s-sub { color: var(--pon); opacity: .82; }

/* 装饰圆 */
.s-decor { position: absolute; border-radius: 50%; pointer-events: none; }
.s-decor-1 { width: 46%; padding-bottom: 46%; right: -8%; top: -16%; background: rgba(255,255,255,.08); }
.s-decor-2 { width: 22%; padding-bottom: 22%; left: -6%; bottom: -10%; background: var(--pac); opacity: .22; }
.s-decor-c1 { width: 26%; padding-bottom: 26%; right: -6%; top: -12%; background: var(--pg1); opacity: .07; }

/* 章节大号水印 */
.s-watermark {
  position: absolute; right: 4%; top: 50%; transform: translateY(-50%);
  font-weight: 800; font-size: clamp(80px, 17vw, 190px);
  color: var(--pon); opacity: .12; line-height: 1; letter-spacing: -2px;
}

.s-bar { width: clamp(38px,6vw,72px); height: 5px; border-radius: 3px; background: var(--pac); margin-bottom: 16px; z-index:1; }
.s-title { font-weight: 800; line-height: 1.2; z-index:1; }
.ppt-slide.layout-title  .s-title { font-size: clamp(22px,3.6vw,40px); }
.ppt-slide.layout-section .s-title { font-size: clamp(20px,3.2vw,34px); }
.s-sub { margin-top: 12px; font-size: clamp(12px,1.7vw,19px); z-index:1; }

/* 内容页 */
.ppt-slide.layout-bullets { background: var(--pbg); justify-content: flex-start; }
.s-title-wrap { display: flex; align-items: center; gap: 12px; z-index:1; }
.s-tbar { width: 5px; height: clamp(20px,2.6vw,30px); border-radius: 3px; background: var(--pac); flex: none; }
.ppt-slide.layout-bullets .s-title { color: var(--pink); font-size: clamp(16px,2.6vw,27px); }
.s-uline {
  width: clamp(40px,6vw,90px); height: 4px; border-radius: 2px; margin: 10px 0 4px;
  background: linear-gradient(90deg, var(--pac), var(--pg1));
}
.ppt-slide ul { margin: auto 0; padding: 0; list-style: none; display: flex; flex-direction: column; justify-content: center; flex: 1; gap: clamp(6px,1.4vh,16px); }
.ppt-slide li { display: flex; align-items: center; gap: 12px; color: var(--pink); line-height: 1.35; font-size: clamp(11px,1.7vw,18px); }
.s-dot { width: clamp(7px,1vw,11px); height: clamp(7px,1vw,11px); border-radius: 50%; background: var(--pac); flex: none; }

/* 胶囊页码 */
.s-pageno {
  position: absolute; right: 5%; bottom: 6%;
  background: var(--pg2); color: var(--pon);
  font-size: clamp(9px,1.1vw,12px); font-weight: 600;
  padding: 3px 12px; border-radius: 999px;
}

/* ── 模板选择行 ── */
.ppt-template-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.ppt-template-row label { color: var(--text-muted); font-size: 13px; }
.ppt-template-row select {
  flex: 1; min-width: 160px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; font-size: 13px; outline: none;
}
.ppt-template-row select:focus { border-color: var(--accent2); }
.ppt-template-del {
  border: 1px solid var(--border); background: var(--bg3); color: var(--text-muted);
  border-radius: 8px; padding: 6px 10px; font-size: 13px; cursor: pointer;
}
.ppt-template-del:hover { color: var(--danger); border-color: var(--danger); }
.ppt-template-note {
  display: none; width: 100%; color: var(--text-muted);
  font-size: 12px; line-height: 1.5; margin-top: 2px;
}

/* ── 预览装饰层（pptBuildDecor 生成，与导出风格神似）── */
.pd { position: absolute; z-index: 0; pointer-events: none; }
.pd-circle, .pd-ring, .pd-block, .pd-tri, .pd-chev { aspect-ratio: 1; }
.pd-circle { border-radius: 50%; }
.pd-ring { border-radius: 50%; background: transparent !important; border-style: solid; border-width: clamp(3px,0.8vw,10px); }
.pd-block { border-radius: 14%; }
.pd-tri { clip-path: polygon(0 0, 100% 0, 0 100%); }
.pd-chev { clip-path: polygon(0 0, 55% 0, 100% 50%, 55% 100%, 0 100%, 45% 50%); }
.pd-bar, .pd-bar2 { transform-origin: center; border-radius: 2px; }

/* 导航条 */
.ppt-nav {
  display: flex; align-items: center; justify-content: center;
  gap: 14px; margin-top: 14px;
}
.ppt-nav .ppt-counter { color: var(--text-muted); font-size: 13px; min-width: 64px; text-align: center; }
.ppt-nav-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg3); color: var(--text);
  cursor: pointer; font-size: 16px; transition: all var(--trans);
}
.ppt-nav-btn:hover:not(:disabled) { border-color: var(--accent2); }
.ppt-nav-btn:disabled { opacity: .35; cursor: not-allowed; }

.ppt-export-row {
  display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap;
}
