/* ============================================
   PptRenderer - PPT 渲染器样式
   设计风格: Refined Presentation Mode
   ============================================ */

/* ===== 主容器 ===== */
.wk-file-preview-ppt-renderer {
  width: 100%;
  height: 100%;
  overflow: auto;
  padding: var(--wk-sp-6);
  background: var(--wk-bg-base);
  scroll-behavior: smooth;
}

/* 滚动容器内容 */
.wk-file-preview-ppt-renderer__content {
  display: flex;
  flex-direction: column;
  gap: var(--wk-sp-6);
  max-width: 960px;
  margin: 0 auto;
}

/* ===== 加载/错误/空状态 ===== */
.wk-file-preview-ppt-renderer--loading,
.wk-file-preview-ppt-renderer--error,
.wk-file-preview-ppt-renderer--empty {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wk-sp-3);
}

.wk-file-preview-ppt-renderer__spinner {
  width: 32px;
  height: 32px;
  color: var(--wk-brand-primary);
  animation: wk-ppt-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.wk-file-preview-ppt-renderer__loading-text {
  font: var(--wk-text-caption);
  color: var(--wk-text-tertiary);
}

.wk-file-preview-ppt-renderer__error-text {
  font: var(--wk-text-body);
  color: var(--wk-color-error);
}

.wk-file-preview-ppt-renderer--empty {
  font: var(--wk-text-body);
  color: var(--wk-text-tertiary);
}

/* ===== 页面卡片 ===== */
.wk-file-preview-ppt-page {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--wk-bg-surface);
  border-radius: var(--wk-r-lg);
  border: 1px solid var(--wk-border-subtle);
  box-shadow: var(--wk-shadow-sm);
  overflow: hidden;
  transition:
    box-shadow var(--wk-dur) var(--wk-ease),
    border-color var(--wk-dur) var(--wk-ease),
    transform var(--wk-dur) var(--wk-ease);
}

.wk-file-preview-ppt-page:hover {
  box-shadow: var(--wk-shadow-md);
  border-color: var(--wk-border-default);
}


/* ===== 页面头部 ===== */
.wk-file-preview-ppt-page__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--wk-sp-2) var(--wk-sp-3);
  background: transparent;
}

/* ===== 视图切换（简约风格） ===== */
.wk-file-preview-ppt-page__view-switcher {
  display: flex;
  align-items: center;
  gap: var(--wk-sp-1);
}

.wk-file-preview-ppt-page__view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--wk-sp-1) var(--wk-sp-2);
  border: none;
  background: transparent;
  font: var(--wk-text-caption);
  color: var(--wk-text-tertiary);
  cursor: pointer;
  border-radius: var(--wk-r-xs);
  transition:
    color var(--wk-dur-fast) var(--wk-ease),
    background var(--wk-dur-fast) var(--wk-ease);
  user-select: none;
}

.wk-file-preview-ppt-page__view-btn:hover {
  color: var(--wk-text-secondary);
  background: var(--wk-bg-hover);
}

.wk-file-preview-ppt-page__view-btn--active {
  color: var(--wk-text-primary);
}

.wk-file-preview-ppt-page__view-btn-icon {
  width: 14px;
  height: 14px;
}

/* 分隔符 */
.wk-file-preview-ppt-page__view-separator {
  width: 1px;
  height: 12px;
  background: var(--wk-border-subtle);
}

/* ===== 页码 ===== */
.wk-file-preview-ppt-page__page-info {
  display: flex;
  align-items: center;
}

.wk-file-preview-ppt-page__page-badge {
  font: var(--wk-text-caption);
  color: var(--wk-text-tertiary);
}

.wk-file-preview-ppt-page__page-current {
  color: var(--wk-text-secondary);
}

.wk-file-preview-ppt-page__page-separator {
  margin: 0 2px;
}

.wk-file-preview-ppt-page__page-total {}

/* ===== 内容区域 ===== */
.wk-file-preview-ppt-page__content {
  position: relative;
  flex: 1;
  min-height: 0;
}

/* ===== 预览视图 ===== */
.wk-file-preview-ppt-page__preview {
  width: 100%;
  display: flex;
  justify-content: center;
  background: var(--wk-bg-surface);
}

.wk-file-preview-ppt-page__preview-container {
  width: 100%;
  overflow: hidden;
  background: var(--wk-bg-surface);
}

/* ===== 代码视图 ===== */
.wk-file-preview-ppt-page__code-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
}

.wk-file-preview-ppt-page__code {
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: auto;
  background: var(--wk-code-bg);
  border-radius: 0;
}

.wk-file-preview-ppt-page__code pre {
  margin: 0;
  padding: var(--wk-sp-4) !important;
  font-family: var(--wk-font-mono) !important;
  font-size: var(--wk-text-size-base) !important;
  line-height: var(--wk-leading-loose) !important;
  background: transparent !important;
}

/* 代码视图顶部装饰 */
.wk-file-preview-ppt-page__code-header {
  display: flex;
  align-items: center;
  gap: var(--wk-sp-2);
  padding: var(--wk-sp-2) var(--wk-sp-4);
  background: var(--wk-code-bg);
  border-bottom: 1px solid var(--wk-code-border);
}

.wk-file-preview-ppt-page__code-dot {
  width: 10px;
  height: 10px;
  border-radius: var(--wk-r-circle);
}

.wk-file-preview-ppt-page__code-dot--red {
  background: #FF5F57;
}

.wk-file-preview-ppt-page__code-dot--yellow {
  background: #FEBC2E;
}

.wk-file-preview-ppt-page__code-dot--green {
  background: #28C840;
}

.wk-file-preview-ppt-page__code-label {
  flex: 1;
  text-align: center;
  font: var(--wk-text-mono-sm);
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.02em;
}

/* ===== 加载状态 ===== */
.wk-file-preview-ppt-page__loading {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wk-sp-3);
  background: var(--wk-bg-base);
}

.wk-file-preview-ppt-page__spinner {
  width: 24px;
  height: 24px;
  color: var(--wk-brand-primary);
  animation: wk-ppt-spin 1s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.wk-file-preview-ppt-page__loading-text {
  font: var(--wk-text-caption);
  color: var(--wk-text-tertiary);
}

/* ===== 错误状态 ===== */
.wk-file-preview-ppt-page__error {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--wk-sp-2);
  background: var(--wk-color-error-bg);
}

.wk-file-preview-ppt-page__error-icon {
  width: 32px;
  height: 32px;
  color: var(--wk-color-error);
  opacity: 0.6;
}

.wk-file-preview-ppt-page__error-text {
  font: var(--wk-text-body);
  color: var(--wk-color-error);
}

/* ===== 预览模式（无头部） ===== */
.wk-file-preview-ppt-page--preview-only {
  border-radius: var(--wk-r-md);
}

.wk-file-preview-ppt-page--preview-only .wk-file-preview-ppt-page__header {
  display: none;
}

.wk-file-preview-ppt-page--preview-only::before {
  display: none;
}

/* ===== 动画 ===== */
@keyframes wk-ppt-spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

/* 页面入场动画 */
@keyframes wk-ppt-slide-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.wk-file-preview-ppt-page {
  animation: wk-ppt-slide-up var(--wk-dur-slow) var(--wk-ease) backwards;
}

.wk-file-preview-ppt-page:nth-child(1) { animation-delay: 0ms; }
.wk-file-preview-ppt-page:nth-child(2) { animation-delay: 80ms; }
.wk-file-preview-ppt-page:nth-child(3) { animation-delay: 160ms; }
.wk-file-preview-ppt-page:nth-child(4) { animation-delay: 240ms; }
.wk-file-preview-ppt-page:nth-child(5) { animation-delay: 320ms; }
.wk-file-preview-ppt-page:nth-child(n+6) { animation-delay: 400ms; }

/* ===== 滚动条美化 ===== */
.wk-file-preview-ppt-renderer::-webkit-scrollbar,
.wk-file-preview-ppt-page__code::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

.wk-file-preview-ppt-renderer::-webkit-scrollbar-track,
.wk-file-preview-ppt-page__code::-webkit-scrollbar-track {
  background: transparent;
}

.wk-file-preview-ppt-renderer::-webkit-scrollbar-thumb {
  background: var(--wk-border-default);
  border-radius: var(--wk-r-full);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.wk-file-preview-ppt-page__code::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--wk-r-full);
}

.wk-file-preview-ppt-renderer::-webkit-scrollbar-thumb:hover {
  background: var(--wk-border-strong);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.wk-file-preview-ppt-page__code::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* ===== 暗色主题微调 ===== */
body[theme-mode=dark] .wk-file-preview-ppt-page {
  border-color: var(--wk-border-subtle);
}

body[theme-mode=dark] .wk-file-preview-ppt-page:hover {
  border-color: var(--wk-border-default);
  box-shadow: var(--wk-shadow-md);
}

body[theme-mode=dark] .wk-file-preview-ppt-page__preview {
  background: var(--wk-bg-surface);
}
