/* Ve365 PowerPoint 扩展样式 */

.theme-ppt .transition-chip,
.theme-ppt .anim-chip { padding: 4px 8px; font-size: 10px; }
.theme-ppt .theme-chip { height: 28px; font-size: 9px; }
.ppt-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-height: 0; }
.ppt-workspace { flex: 1; display: flex; overflow: hidden; min-height: 0; }

/* 左侧缩略图 */
.ppt-sidebar {
  width: 200px; min-width: 200px;
  background: #202124;
  display: flex; flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}
.ppt-sidebar-header {
  padding: 10px 12px 6px; font-size: 11px;
  color: #bdc1c6; text-transform: uppercase; letter-spacing: 0.5px;
}
.ppt-sidebar-list {
  flex: 1; overflow-y: auto; padding: 4px 8px;
  display: flex; flex-direction: column; gap: 6px;
}
.thumb-item {
  position: relative; background: #3c4043; border-radius: 4px;
  padding: 4px; cursor: pointer; border: 2px solid transparent; transition: all 0.2s;
}
.thumb-item:hover { background: #45494a; }
.thumb-item.active { border-color: var(--accent); background: #45494a; }
.thumb-item.drag-over { border-top-color: var(--accent); }
.thumb-num { position: absolute; bottom: 6px; left: 8px; font-size: 10px; color: #bdc1c6; z-index: 1; }
.thumb-preview { width: 100%; aspect-ratio: 16/9; background: #fff; border-radius: 2px; overflow: hidden; position: relative; }
.thumb-content { width: 100%; height: 100%; transform-origin: top left; pointer-events: none; }

.ppt-sidebar-actions {
  padding: 8px; display: flex; gap: 6px;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.ppt-sidebar-actions button {
  flex: 1; height: 34px; border: none; border-radius: 4px;
  cursor: pointer; font-size: 12px; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn-add-slide { background: var(--accent); color: #fff; }
.btn-add-slide:hover { background: var(--accent-hover); }
.btn-del-slide { background: #3c4043; color: #bdc1c6; }
.btn-del-slide:hover { background: #c62828; color: #fff; }

/* 画布区 */
.ppt-editor {
  flex: 1; display: flex; flex-direction: column; overflow: hidden; background: #e8eaed;
}
.ppt-canvas-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  overflow: auto; padding: 24px; position: relative;
}
.ppt-canvas-wrap.show-grid {
  background-image: linear-gradient(#dadce0 1px, transparent 1px), linear-gradient(90deg, #dadce0 1px, transparent 1px);
  background-size: 20px 20px;
}
.ppt-canvas-container {
  position: relative; width: 960px; height: 540px;
  background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
  border-radius: 2px; flex-shrink: 0; transform-origin: center center;
}

/* 元素 */
.slide-element {
  position: absolute; cursor: move; min-width: 20px; min-height: 20px;
}
.slide-element.selected { outline: 2px solid var(--accent); outline-offset: 1px; }
.slide-element .resize-handle {
  display: none; position: absolute; width: 8px; height: 8px;
  background: #fff; border: 2px solid var(--accent); border-radius: 50%; z-index: 10;
}
.slide-element.selected .resize-handle { display: block; }
.resize-handle.nw { top: -4px; left: -4px; cursor: nw-resize; }
.resize-handle.ne { top: -4px; right: -4px; cursor: ne-resize; }
.resize-handle.sw { bottom: -4px; left: -4px; cursor: sw-resize; }
.resize-handle.se { bottom: -4px; right: -4px; cursor: se-resize; }

.element-text {
  padding: 4px 8px; min-width: 60px; min-height: 24px;
  outline: none; word-wrap: break-word; white-space: pre-wrap; overflow: hidden; width: 100%; height: 100%;
}
.element-shape { width: 100%; height: 100%; }
.element-image { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.element-table { width: 100%; height: 100%; border-collapse: collapse; font-size: 12px; }
.element-table td { border: 1px solid #605e5c; padding: 4px; min-width: 30px; }

/* 右侧属性面板 */
.ppt-props {
  width: 240px; min-width: 240px; background: #f8f9fa;
  border-left: 1px solid #dadce0; overflow-y: auto; flex-shrink: 0;
}
.panel-section { padding: 12px 14px; border-bottom: 1px solid #dadce0; }
.panel-section-title { font-size: 11px; font-weight: 600; color: #80868b; text-transform: uppercase; margin-bottom: 10px; }
.panel-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.panel-label { font-size: 12px; color: #80868b; min-width: 40px; }
.panel-input {
  flex: 1; height: 28px; padding: 0 6px; border: 1px solid #dadce0;
  border-radius: 4px; font-size: 12px; outline: none;
}
.panel-input:focus { border-color: var(--accent); }
.panel-color { width: 28px; height: 28px; border: 1px solid #dadce0; border-radius: 4px; cursor: pointer; padding: 1px; }
.no-selection-msg { padding: 24px 14px; text-align: center; color: #80868b; font-size: 13px; line-height: 1.6; }

.theme-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.theme-chip {
  height: 36px; border-radius: 4px; cursor: pointer; border: 2px solid transparent;
  display: flex; align-items: center; justify-content: center; font-size: 10px; color: #fff;
}
.theme-chip:hover { border-color: var(--accent); }

.layout-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.layout-chip {
  padding: 8px; border: 1px solid #dadce0; border-radius: 4px; cursor: pointer;
  font-size: 11px; text-align: center; background: #fff;
}
.layout-chip:hover { border-color: var(--accent); background: var(--accent-light); }

.transition-chip, .anim-chip {
  padding: 6px 10px; border: 1px solid #dadce0; border-radius: 4px;
  cursor: pointer; font-size: 11px; margin: 2px; display: inline-block; background: #fff;
}
.transition-chip.active, .anim-chip.active { border-color: var(--accent); background: var(--accent-light); color: var(--accent); }

/* 底部栏 */
.ppt-bottom {
  height: 40px; background: #fff; border-top: 1px solid #dadce0;
  display: flex; align-items: center; padding: 0 16px; gap: 12px; flex-shrink: 0;
}
.slide-counter { font-size: 12px; color: #80868b; }
.notes-toggle { font-size: 12px; color: #80868b; cursor: pointer; }
.notes-toggle:hover { color: var(--accent); }
.notes-area {
  flex: 1; height: 26px; border: 1px solid #dadce0; border-radius: 4px;
  padding: 0 8px; font-size: 12px; resize: none; outline: none;
}
.notes-area.expanded { height: 80px; }

/* 演示模式 */
.presentation-overlay {
  position: fixed; inset: 0; background: #000; z-index: 10000;
  display: none; align-items: center; justify-content: center;
}
.presentation-overlay.active { display: flex; }
.presentation-slide {
  position: relative; background: #fff;
  box-shadow: 0 0 80px rgba(0,0,0,0.5); transform-origin: center center;
}
.presentation-slide .slide-element { cursor: default; }
.presentation-slide .resize-handle { display: none !important; }
.presentation-slide .slide-element.selected { outline: none; }

.pres-anim-fade { animation: presFade 0.6s ease; }
.pres-anim-fly { animation: presFly 0.6s ease; }
.pres-anim-zoom { animation: presZoom 0.5s ease; }
@keyframes presFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes presFly { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }
@keyframes presZoom { from { opacity: 0; transform: scale(0.5); } to { opacity: 1; transform: scale(1); } }

.pres-transition-fade { animation: presFade 0.5s ease; }
.pres-transition-push { animation: presPush 0.5s ease; }
.pres-transition-zoom { animation: presZoom 0.4s ease; }
@keyframes presPush { from { transform: translateX(100%); } to { transform: translateX(0); } }

.presentation-nav {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 12px; z-index: 10001;
}
.presentation-nav button {
  width: 40px; height: 40px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3); background: rgba(0,0,0,0.5);
  color: #fff; font-size: 18px; cursor: pointer;
}
.presentation-nav button:hover { background: var(--accent); border-color: var(--accent); }
.presentation-hint {
  position: fixed; top: 16px; right: 16px; color: rgba(255,255,255,0.4); font-size: 12px; z-index: 10001;
}
.presentation-progress {
  position: fixed; bottom: 0; left: 0; height: 3px; background: var(--accent); z-index: 10001; transition: width 0.3s;
}

/* 上下文菜单 */
.ppt-context {
  position: fixed; background: #fff; border: 1px solid #dadce0;
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  z-index: 9999; min-width: 160px; padding: 4px 0; display: none;
}
.ppt-context.show { display: block; }
.ppt-context-item {
  padding: 8px 16px; font-size: 13px; cursor: pointer;
}
.ppt-context-item:hover { background: var(--accent-light); color: var(--accent); }
.ppt-context-sep { height: 1px; background: #dadce0; margin: 4px 0; }

.shape-palette {
  display: none; position: fixed; background: #fff; border: 1px solid #dadce0;
  border-radius: 6px; box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  padding: 8px; z-index: 8000; gap: 4px; flex-wrap: wrap; width: 200px;
}
.shape-palette.show { display: flex; }
.shape-palette-item {
  width: 40px; height: 40px; border: 1px solid #dadce0; border-radius: 4px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.shape-palette-item:hover { border-color: var(--accent); background: var(--accent-light); }

/* 幻灯片浏览视图 */
.sorter-overlay {
  display: none; position: fixed; inset: 0; background: #f3f2f1;
  z-index: 5000; overflow-y: auto; padding: 24px;
}
.sorter-overlay.show { display: block; }
.sorter-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; max-width: 1200px; margin: 0 auto; }
.sorter-card {
  background: #fff; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 8px; cursor: pointer; border: 2px solid transparent;
}
.sorter-card:hover { border-color: var(--accent); }
.sorter-card-num { font-size: 11px; color: #80868b; margin-bottom: 4px; }

@media print {
  .office-titlebar, .qat-bar, .office-ribbon, .ppt-sidebar, .ppt-props,
  .ppt-bottom, .office-statusbar, .file-backdrop, .file-panel { display: none !important; }
  .ppt-canvas-wrap { padding: 0; overflow: visible; }
  .ppt-canvas-container { box-shadow: none; page-break-after: always; }
}
