/* ============ PPT 工作台样式 ============ */
/* 复用 style.css 中的 CSS 变量：--brand-1/--brand-2/--brand-3/--brand-grad
   --ink-900/--ink-700/--ink-500/--ink-300/--line/--bg/--card/--danger/--success
   --radius/--shadow-sm/--shadow-md */

.ppt-page { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 顶部栏 ---------- */
.ppt-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 28px;
  height: 60px;
  background: var(--brand-grad);
  color: #fff;
  box-shadow: 0 4px 18px rgba(37, 99, 235, .25);
  position: sticky;
  top: 0;
  z-index: 50;
  flex-wrap: wrap;
}
.ppt-brand { display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 800; letter-spacing: .5px; }
.ppt-brand-logo {
  width: 34px; height: 34px; border-radius: 10px;
  background: rgba(255, 255, 255, .2);
  display: grid; place-items: center;
  font-size: 18px;
}
.ppt-topbar-right { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ppt-user-email { font-size: 13px; opacity: .9; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppt-quota-pill {
  font-size: 12.5px; font-weight: 600;
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .3);
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.ppt-quota-pill b { font-size: 14px; margin: 0 3px; }
.ppt-quota-pill.zero b { color: #fecaca; }
.ppt-link-btn {
  font-size: 13px; color: #fff; opacity: .85;
  padding: 6px 12px; border-radius: 8px;
  transition: opacity .15s, background .15s;
}
.ppt-link-btn:hover { opacity: 1; background: rgba(255, 255, 255, .12); }
.ppt-link-btn.danger:hover { background: rgba(225, 29, 72, .25); }

/* ---------- 主区域 ---------- */
.ppt-main { flex: 1; width: min(1600px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 60px; }

.ppt-view { display: none; }
.ppt-view.active { display: block; }

/* ---------- 列表视图 ---------- */
.ppt-list-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.ppt-list-head h1 { font-size: 22px; font-weight: 800; color: var(--ink-900); }
.ppt-btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 700; color: #fff;
  background: var(--brand-grad);
  padding: 10px 20px; border-radius: 11px;
  box-shadow: 0 6px 18px rgba(37, 99, 235, .3);
  transition: transform .15s, box-shadow .15s;
}
.ppt-btn-primary:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(37, 99, 235, .38); }
.ppt-btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }

.ppt-deck-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.ppt-deck-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
  display: flex; flex-direction: column; gap: 8px;
  box-shadow: var(--shadow-sm); transition: box-shadow .18s, border-color .18s;
}
.ppt-deck-card:hover { box-shadow: var(--shadow-md); border-color: #c7c2f5; }
.ppt-deck-title { font-size: 16px; font-weight: 700; color: var(--ink-900); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.ppt-deck-title:hover { color: var(--brand-1); }
.ppt-deck-meta { font-size: 12.5px; color: var(--ink-500); display: flex; gap: 10px; flex-wrap: wrap; }
.ppt-deck-meta .tag { background: #f4f3fb; border: 1px solid #ece9f8; border-radius: 999px; padding: 2px 9px; }
.ppt-deck-status { font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px; display: inline-block; }
.ppt-deck-status.draft { background: #f1f5f9; color: #64748b; }
.ppt-deck-status.done { background: #dcfce7; color: #15803d; }
.ppt-deck-status.published { background: #dbeafe; color: #1d4ed8; }
.ppt-deck-time { font-size: 11.5px; color: var(--ink-300); }
.ppt-deck-actions { display: flex; gap: 8px; margin-top: 6px; }
.ppt-deck-actions .ppt-btn-sm { flex: 1; text-align: center; }

.ppt-btn-sm {
  font-size: 13px; font-weight: 600; color: var(--ink-700);
  border: 1px solid var(--line); background: #fff;
  padding: 7px 14px; border-radius: 9px; transition: all .15s;
}
.ppt-btn-sm:hover { border-color: #c7c2f5; color: var(--brand-1); }
.ppt-btn-sm.danger { color: var(--danger); border-color: #fecaca; }
.ppt-btn-sm.danger:hover { background: #fef2f2; border-color: var(--danger); }

.ppt-empty { text-align: center; padding: 80px 20px; color: var(--ink-300); }
.ppt-empty .illu { font-size: 48px; margin-bottom: 14px; }
.ppt-empty p { font-size: 15px; }

.ppt-pagination { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 28px; flex-wrap: wrap; }
.ppt-pagination button { min-width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-700); font-size: 13px; font-weight: 600; transition: all .15s; }
.ppt-pagination button:hover:not(:disabled) { border-color: var(--brand-1); color: var(--brand-1); }
.ppt-pagination button.active { background: var(--brand-1); color: #fff; border-color: var(--brand-1); }
.ppt-pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- 创建视图 ---------- */
.ppt-form-wrap { max-width: 800px; margin: 0 auto; }
.ppt-form-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 28px; box-shadow: var(--shadow-sm); margin-bottom: 20px; }
.ppt-form-card h2 { font-size: 17px; font-weight: 800; margin-bottom: 18px; color: var(--ink-900); }
.ppt-field { margin-bottom: 18px; }
.ppt-field label { display: block; font-size: 13.5px; font-weight: 700; color: var(--ink-700); margin-bottom: 7px; }
.ppt-field .ppt-hint { font-size: 12px; color: var(--ink-300); margin-top: 5px; }
.ppt-field textarea, .ppt-field input[type="text"], .ppt-field input[type="number"], .ppt-field select {
  width: 100%; font-family: inherit; font-size: 14px; color: var(--ink-900);
  border: 1.5px solid var(--line); background: #fbfaff;
  border-radius: 11px; padding: 11px 13px;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.ppt-field textarea { min-height: 120px; resize: vertical; line-height: 1.7; }
.ppt-field textarea:focus, .ppt-field input:focus, .ppt-field select:focus {
  outline: none; border-color: var(--brand-1); background: #fff;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, .12);
}
.ppt-field select { appearance: none; padding-right: 28px; background: #fbfaff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7590' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; }
.ppt-field input[type="file"] { border: none; background: none; padding: 0; }
.ppt-upload-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ppt-upload-row .ppt-btn-sm { flex: 0 0 auto; }
.ppt-file-preview { font-size: 12.5px; color: var(--ink-500); margin-top: 8px; background: #f4f3fb; border-radius: 8px; padding: 8px 12px; }
.ppt-file-preview .truncate { display: inline-block; max-width: 560px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.ppt-char-count { text-align: right; font-size: 12px; color: var(--ink-300); margin-top: 4px; }

.ppt-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ---------- 大纲编辑器 ---------- */
.ppt-outline-title-row { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.ppt-outline-title-row label { font-size: 13.5px; font-weight: 700; color: var(--ink-700); flex: 0 0 auto; }
.ppt-outline-title-row input { flex: 1; }

.ppt-outline-page {
  border: 1px solid var(--line); border-radius: 11px; padding: 12px 14px;
  margin-bottom: 10px; background: #fbfaff; transition: border-color .15s;
}
.ppt-outline-page:hover { border-color: #c7c2f5; }
.ppt-outline-page-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.ppt-outline-page-num { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; background: var(--brand-grad); color: #fff; font-size: 12.5px; font-weight: 700; display: grid; place-items: center; }
.ppt-outline-page-layout { font-size: 12px; font-weight: 600; color: var(--brand-1); background: rgba(37, 99, 235, .08); border: 1px solid rgba(37, 99, 235, .15); padding: 3px 9px; border-radius: 999px; }
.ppt-outline-page-title { flex: 1; font-size: 14px; font-weight: 600; color: var(--ink-900); border: none; background: transparent; outline: none; border-bottom: 1px dashed transparent; }
.ppt-outline-page-title:focus { border-bottom-color: var(--brand-1); }
.ppt-outline-page-points { font-size: 12.5px; color: var(--ink-500); line-height: 1.7; padding-left: 36px; }
.ppt-outline-page-actions { display: flex; gap: 6px; margin-left: auto; }
.ppt-icon-btn { font-size: 12px; color: var(--ink-300); padding: 4px 7px; border-radius: 6px; transition: all .15s; }
.ppt-icon-btn:hover { color: var(--danger); background: rgba(225, 29, 72, .07); }
.ppt-icon-btn.move { cursor: grab; }
.ppt-icon-btn.move:active { cursor: grabbing; }

.ppt-outline-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

/* ---------- 编辑器视图 ---------- */
.ppt-editor-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.ppt-editor-title { flex: 1; min-width: 200px; font-size: 18px; font-weight: 800; color: var(--ink-900); border: none; border-bottom: 2px solid transparent; background: transparent; outline: none; padding: 4px 0; }
.ppt-editor-title:focus { border-bottom-color: var(--brand-1); }

.ppt-editor-layout { display: grid; grid-template-columns: 170px minmax(0, 1fr) 210px; gap: 14px; align-items: stretch; }

.ppt-sidebar { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.ppt-sidebar-head { padding: 12px 14px; border-bottom: 1px solid var(--line); background: #fcfbfe; font-size: 13px; font-weight: 700; color: var(--ink-700); display: flex; align-items: center; justify-content: space-between; }
.ppt-slide-list { max-height: calc(100vh - 240px); overflow-y: auto; padding: 6px; }
.ppt-slide-thumb {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px;
  border-radius: 9px; cursor: pointer; transition: background .15s, border-color .15s;
  border: 1.5px solid transparent; margin-bottom: 4px;
}
.ppt-slide-thumb:hover { background: #faf9ff; }
.ppt-slide-thumb.active { background: rgba(37, 99, 235, .06); border-color: var(--brand-1); }
.ppt-slide-thumb-num { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 6px; background: #f4f3fb; color: var(--ink-500); font-size: 11.5px; font-weight: 700; display: grid; place-items: center; }
.ppt-slide-thumb.active .ppt-slide-thumb-num { background: var(--brand-grad); color: #fff; }
.ppt-slide-thumb-title { flex: 1; min-width: 0; font-size: 12.5px; color: var(--ink-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ppt-slide-thumb-del { flex: 0 0 auto; font-size: 14px; color: var(--ink-300); opacity: 0; transition: opacity .15s, color .15s; }
.ppt-slide-thumb:hover .ppt-slide-thumb-del { opacity: 1; }
.ppt-slide-thumb-del:hover { color: var(--danger); }
.ppt-slide-thumb .drag-handle { flex: 0 0 auto; color: var(--ink-300); font-size: 13px; cursor: grab; }
.ppt-slide-thumb .drag-handle:active { cursor: grabbing; }
.ppt-add-slide { display: block; width: 100%; text-align: center; padding: 9px; border: 1.5px dashed var(--line); border-radius: 9px; color: var(--ink-500); font-size: 13px; font-weight: 600; transition: all .15s; }
.ppt-add-slide:hover { border-color: var(--brand-1); color: var(--brand-1); background: rgba(37, 99, 235, .04); }
.ppt-sidebar-foot { padding: 6px; }

.ppt-center { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; display: flex; flex-direction: column; min-height: calc(100vh - 220px); }
.ppt-center-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--line); background: #fcfbfe; flex-wrap: wrap; }
.ppt-center-toolbar .ppt-toolbar-left { font-size: 13px; font-weight: 600; color: var(--ink-700); display: flex; align-items: center; gap: 8px; }
.ppt-center-toolbar .ppt-toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; }
.ppt-slide-preview-wrap { flex: 1; background: #f0eff7; padding: 14px; overflow: auto; display: flex; flex-direction: column; align-items: center; }
.ppt-slide-preview {
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 40px rgba(30, 27, 46, .14);
}

.ppt-meta { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 16px 18px; }
.ppt-meta h3 { font-size: 14px; font-weight: 800; margin-bottom: 14px; color: var(--ink-900); }
.ppt-meta-field { margin-bottom: 14px; }
.ppt-meta-field label { display: block; font-size: 12px; font-weight: 600; color: var(--ink-500); margin-bottom: 5px; }
.ppt-meta-field input, .ppt-meta-field textarea, .ppt-meta-field select {
  width: 100%; font-family: inherit; font-size: 13px; color: var(--ink-900);
  border: 1.5px solid var(--line); background: #fbfaff; border-radius: 9px; padding: 8px 10px;
}
.ppt-meta-field input:focus, .ppt-meta-field textarea:focus, .ppt-meta-field select:focus { outline: none; border-color: var(--brand-1); background: #fff; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.ppt-meta-field textarea { min-height: 70px; resize: vertical; line-height: 1.6; }

.ppt-editor-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ---------- 进度指示器 ---------- */
.ppt-progress { margin: 18px 0; }
.ppt-progress-bar { width: 100%; height: 8px; background: #ece9f8; border-radius: 999px; overflow: hidden; }
.ppt-progress-fill { height: 100%; background: var(--brand-grad); border-radius: 999px; transition: width .3s ease; width: 0; }
.ppt-progress-text { font-size: 13px; color: var(--ink-500); margin-top: 8px; text-align: center; }
.ppt-progress-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; }
.ppt-progress-page { border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; font-size: 12px; color: var(--ink-500); display: flex; align-items: center; gap: 6px; }
.ppt-progress-page .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-300); flex: 0 0 auto; }
.ppt-progress-page.done .dot { background: var(--success); }
.ppt-progress-page.error .dot { background: var(--danger); }
.ppt-progress-page.loading .dot { background: var(--brand-2); animation: pptPulse 1s ease-in-out infinite; }
@keyframes pptPulse { 0%, 100% { opacity: .4; } 50% { opacity: 1; } }

/* ---------- 模态弹窗 ---------- */
.ppt-modal-mask {
  position: fixed; inset: 0; background: rgba(30, 27, 46, .45);
  backdrop-filter: blur(3px); display: flex; align-items: center; justify-content: center;
  padding: 20px; z-index: 200; animation: pptMaskIn .18s ease;
}
@keyframes pptMaskIn { from { opacity: 0; } to { opacity: 1; } }
.ppt-modal {
  width: 560px; max-width: 100%; max-height: calc(100vh - 48px); overflow-y: auto;
  background: #fff; border-radius: 18px; box-shadow: 0 30px 80px rgba(30, 27, 46, .35);
  animation: pptModalIn .22s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes pptModalIn { from { opacity: 0; transform: translateY(16px) scale(.97); } to { opacity: 1; transform: none; } }
.ppt-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 14px; }
.ppt-modal-head h3 { font-size: 17px; font-weight: 800; }
.ppt-modal-close { width: 30px; height: 30px; border-radius: 9px; font-size: 20px; line-height: 1; color: var(--ink-500); transition: all .15s; }
.ppt-modal-close:hover { background: #f1effa; color: var(--ink-900); }
.ppt-modal-body { padding: 0 22px 6px; }
.ppt-modal-body textarea { width: 100%; min-height: 320px; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.7; border: 1.5px solid var(--line); border-radius: 11px; padding: 13px 14px; resize: vertical; background: #fbfaff; color: var(--ink-900); }
.ppt-modal-body textarea:focus { outline: none; border-color: var(--brand-1); background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.ppt-modal-body input { width: 100%; font-family: inherit; font-size: 14px; border: 1.5px solid var(--line); background: #fbfaff; border-radius: 11px; padding: 11px 13px; }
.ppt-modal-body input:focus { outline: none; border-color: var(--brand-1); background: #fff; box-shadow: 0 0 0 4px rgba(99, 102, 241, .12); }
.ppt-modal-tip { font-size: 12px; color: var(--ink-500); line-height: 1.6; margin-top: 8px; }
.ppt-modal-error { font-size: 12.5px; color: var(--danger); background: rgba(225, 29, 72, .07); border: 1px solid rgba(225, 29, 72, .2); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }
.ppt-modal-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; padding: 14px 22px 20px; }
.ppt-btn-cancel { font-size: 13.5px; font-weight: 600; color: var(--ink-700); background: #f4f3fa; padding: 10px 20px; border-radius: 9px; transition: background .15s; }
.ppt-btn-cancel:hover { background: #eae8f5; }
.ppt-btn-confirm { font-size: 13.5px; font-weight: 700; color: #fff; background: var(--brand-grad); padding: 10px 22px; border-radius: 9px; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); transition: transform .15s; }
.ppt-btn-confirm:hover { transform: translateY(-1px); }
.ppt-btn-confirm:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* 发布成功 */
.ppt-publish-success { text-align: center; padding: 14px 0 6px; }
.ppt-publish-success .illu { font-size: 44px; }
.ppt-publish-success h4 { font-size: 18px; margin: 8px 0; color: var(--ink-900); }
.ppt-publish-success p { font-size: 13.5px; color: var(--ink-500); margin: 0 0 14px; }
.ppt-publish-url { display: flex; gap: 8px; margin-bottom: 12px; }
.ppt-publish-url input { flex: 1; font-size: 13px; }
.ppt-publish-url a { display: inline-flex; align-items: center; padding: 0 14px; background: var(--brand-1); color: #fff; border-radius: 9px; font-size: 13px; font-weight: 600; text-decoration: none; }

/* ---------- 品牌限制提示 ---------- */
.ppt-blocked { text-align: center; padding: 100px 20px; }
.ppt-blocked .illu { font-size: 56px; margin-bottom: 18px; }
.ppt-blocked h2 { font-size: 20px; font-weight: 800; margin-bottom: 10px; color: var(--ink-900); }
.ppt-blocked p { font-size: 14px; color: var(--ink-500); line-height: 1.8; max-width: 420px; margin: 0 auto; }
.ppt-blocked .ppt-back-home { margin-top: 22px; }

/* ---------- Toast ---------- */
.ppt-toast {
  position: fixed; left: 50%; bottom: 34px;
  transform: translateX(-50%) translateY(20px);
  background: #26233a; color: #fff; font-size: 13.5px;
  padding: 11px 22px; border-radius: 999px;
  box-shadow: 0 12px 30px rgba(30, 27, 46, .3);
  opacity: 0; transition: opacity .25s, transform .25s;
  z-index: 300; pointer-events: none;
}
.ppt-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 加载态 ---------- */
.ppt-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 60px 20px; }
.ppt-loading-orb { display: flex; gap: 10px; margin-bottom: 18px; }
.ppt-loading-orb span { width: 16px; height: 16px; border-radius: 50%; background: var(--brand-grad); animation: pptBounce 1.15s ease-in-out infinite; }
.ppt-loading-orb span:nth-child(2) { animation-delay: .16s; }
.ppt-loading-orb span:nth-child(3) { animation-delay: .32s; }
@keyframes pptBounce { 0%, 70%, 100% { transform: translateY(0) scale(.85); opacity: .55; } 35% { transform: translateY(-14px) scale(1); opacity: 1; } }
.ppt-loading p { font-size: 14px; color: var(--ink-500); }

/* ---------- 响应式 ---------- */
@media (max-width: 1020px) {
  .ppt-editor-layout { grid-template-columns: 180px minmax(0, 1fr); }
  .ppt-meta { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .ppt-topbar { padding: 0 16px; height: auto; flex-direction: column; align-items: flex-start; padding: 10px 16px; gap: 8px; }
  .ppt-topbar-right { width: 100%; justify-content: space-between; }
  .ppt-user-email { max-width: 120px; }
  .ppt-editor-layout { grid-template-columns: 1fr; }
  .ppt-slide-list { max-height: 240px; }
  .ppt-grid-2 { grid-template-columns: 1fr; }
  .ppt-deck-grid { grid-template-columns: 1fr; }
  .ppt-form-card { padding: 18px 16px; }
  .ppt-main { width: calc(100% - 24px); padding: 16px 0 40px; }
}
