/* PPT制作工具样式 - 参考WPS设计 */
* { margin: 0; padding: 0; box-sizing: border-box; }

.ppt-app {
    min-height: calc(100vh - 60px);
    background: #f5f5f5;
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
}

/* 顶部菜单栏 */
.ppt-menu-bar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 30px;
    height: 50px;
}

.ppt-logo {
    font-size: 18px;
    font-weight: 600;
    color: #e60012;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ppt-menu {
    display: flex;
    gap: 25px;
}

.ppt-menu-item {
    color: #333;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s;
    position: relative;
}

.ppt-menu-item:hover, .ppt-menu-item.active {
    background: #f0f0f0;
    color: #e60012;
}

.ppt-menu-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.ppt-btn {
    padding: 6px 16px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ppt-btn-primary {
    background: #e60012;
    color: #fff;
}

.ppt-btn-primary:hover {
    background: #c90010;
}

.ppt-btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.ppt-btn-secondary:hover {
    background: #e0e0e0;
}

/* 快捷键提示 */
.shortcut-hint {
    position: fixed;
    bottom: 60px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    color: #fff;
    padding: 15px 20px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 1000;
    max-width: 300px;
}

.shortcut-hint h6 {
    margin: 0 0 10px 0;
    font-size: 13px;
    color: #e60012;
}

.shortcut-hint kbd {
    background: rgba(255,255,255,0.2);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

/* 功能区选项卡 */
.ppt-tabs {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 0 20px;
    display: flex;
    gap: 5px;
}

.ppt-tab {
    padding: 10px 20px;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.ppt-tab:hover {
    color: #e60012;
}

.ppt-tab.active {
    color: #e60012;
    border-bottom-color: #e60012;
}

/* 工具栏 */
.ppt-toolbar {
    background: #fff;
    border-bottom: 1px solid #ddd;
    padding: 10px 20px;
    display: flex;
    gap: 15px;
    align-items: center;
    min-height: 60px;
}

.toolbar-section {
    display: flex;
    gap: 5px;
    padding-right: 15px;
    border-right: 1px solid #eee;
}

.toolbar-section:last-child {
    border-right: none;
}

.toolbar-btn {
    padding: 8px 12px;
    border: 1px solid transparent;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    font-size: 12px;
    color: #333;
    transition: all 0.2s;
    min-width: 50px;
    position: relative;
}

.toolbar-btn:hover {
    background: #f5f5f5;
    border-color: #ddd;
}

.toolbar-btn.active {
    background: #fff0f0;
    border-color: #e60012;
    color: #e60012;
}

.toolbar-btn i {
    font-size: 16px;
}

.toolbar-btn .shortcut {
    position: absolute;
    bottom: -2px;
    right: 2px;
    font-size: 9px;
    color: #999;
    opacity: 0.7;
}

.toolbar-divider {
    width: 1px;
    height: 40px;
    background: #ddd;
}

/* 主编辑区 */
.ppt-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

/* 左侧幻灯片缩略图 */
.ppt-slides-panel {
    width: 200px;
    background: #f8f8f8;
    border-right: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.ppt-slides-header {
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ppt-slides-header .shortcut {
    font-size: 11px;
    color: #999;
}

.ppt-slides-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.slide-thumb {
    aspect-ratio: 16/9;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.2s;
}

.slide-thumb:hover {
    border-color: #999;
}

.slide-thumb.active {
    border-color: #e60012;
    box-shadow: 0 0 0 2px rgba(230, 0, 18, 0.2);
}

.slide-thumb-number {
    position: absolute;
    top: 4px;
    left: 6px;
    font-size: 11px;
    color: #999;
}

.slide-thumb-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 10px;
    font-size: 8px;
    text-align: center;
}

.add-slide-btn {
    padding: 12px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    transition: all 0.2s;
}

.add-slide-btn:hover {
    border-color: #e60012;
    color: #e60012;
    background: #fff0f0;
}

/* 中间画布区 */
.ppt-canvas-area {
    flex: 1;
    background: #e8e8e8;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    position: relative;
    overflow: auto;
}

.ppt-canvas-wrapper {
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    transition: transform 0.2s;
}

.ppt-canvas {
    width: 960px;
    height: 540px;
    position: relative;
    overflow: hidden;
}

.ppt-canvas.editing {
    cursor: text;
}

.ppt-canvas.drawing {
    cursor: crosshair;
}

.ppt-canvas.moving {
    cursor: move;
}

/* 幻灯片内容 */
.slide-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

.slide-element {
    position: absolute;
    cursor: move;
    user-select: none;
    transition: box-shadow 0.2s;
}

.slide-element:hover {
    box-shadow: 0 0 0 1px rgba(230, 0, 18, 0.3);
}

.slide-element.selected {
    outline: 2px solid #e60012;
    outline-offset: -2px;
}

.slide-element.selected:hover {
    box-shadow: none;
}

.slide-element .resize-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #fff;
    border: 2px solid #e60012;
    border-radius: 50%;
    display: none;
    z-index: 10;
}

.slide-element.selected .resize-handle {
    display: block;
}

.slide-element .resize-handle.nw { top: -5px; left: -5px; cursor: nw-resize; }
.slide-element .resize-handle.ne { top: -5px; right: -5px; cursor: ne-resize; }
.slide-element .resize-handle.sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.slide-element .resize-handle.se { bottom: -5px; right: -5px; cursor: se-resize; }

.slide-element .rotate-handle {
    position: absolute;
    top: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 14px;
    background: #e60012;
    border-radius: 50%;
    display: none;
    cursor: grab;
    z-index: 10;
}

.slide-element.selected .rotate-handle {
    display: block;
}

.slide-element .rotate-handle:active {
    cursor: grabbing;
}

.element-text {
    min-width: 50px;
    min-height: 20px;
    padding: 5px;
    outline: none;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.element-text:focus {
    outline: none;
}

.element-text.selected {
    cursor: text;
}

/* 多选框 */
.selection-box {
    position: absolute;
    border: 1px dashed #e60012;
    background: rgba(230, 0, 18, 0.1);
    pointer-events: none;
    z-index: 100;
}

/* 右键菜单 */
.context-menu {
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
    min-width: 150px;
    display: none;
}

.context-menu.show {
    display: block;
}

.context-menu-item {
    padding: 10px 15px;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.context-menu-item:hover {
    background: #f5f5f5;
}

.context-menu-item .shortcut {
    font-size: 11px;
    color: #999;
}

.context-menu-divider {
    height: 1px;
    background: #eee;
    margin: 5px 0;
}

/* 右侧属性面板 */
.ppt-properties-panel {
    width: 280px;
    background: #fff;
    border-left: 1px solid #ddd;
    display: flex;
    flex-direction: column;
}

.ppt-properties-header {
    padding: 12px 15px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
}

.ppt-properties-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.property-group {
    margin-bottom: 20px;
}

.property-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
    display: block;
}

.property-input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.2s;
}

.property-input:focus {
    outline: none;
    border-color: #e60012;
}

.property-textarea {
    min-height: 80px;
    resize: vertical;
}

.property-row {
    display: flex;
    gap: 10px;
}

.property-row .property-input {
    flex: 1;
}

/* 颜色选择器 */
.color-picker {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.color-option {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.color-option:hover, .color-option.active {
    border-color: #333;
    transform: scale(1.1);
}

/* 字体选择 */
.font-picker {
    display: flex;
    gap: 8px;
}

.font-select {
    flex: 1;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

/* 模板选择弹窗 */
.template-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.template-modal.show {
    display: flex;
}

.template-modal-content {
    background: #fff;
    width: 900px;
    max-height: 80vh;
    border-radius: 8px;
    overflow: hidden;
}

.template-modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.template-modal-body {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.template-item {
    aspect-ratio: 4/3;
    border-radius: 6px;
    cursor: pointer;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all 0.2s;
}

.template-item:hover {
    border-color: #e60012;
    transform: translateY(-2px);
}

.template-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    padding: 15px;
}

.template-preview h4 {
    font-size: 16px;
    margin-bottom: 5px;
}

.template-preview p {
    font-size: 11px;
    opacity: 0.8;
}

/* 专业模板样式 */
.template-business { background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%); }
.template-tech { background: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%); }
.template-creative { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.template-nature { background: linear-gradient(135deg, #56ab2f 0%, #a8e063 100%); }
.template-elegant { background: linear-gradient(135deg, #2c3e50 0%, #4a6741 100%); }
.template-minimal { background: #fff; color: #333; }
.template-minimal h4, .template-minimal p { color: #333; }
.template-dark { background: linear-gradient(135deg, #232526 0%, #414345 100%); }
.template-colorful { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }

/* 图表样式 */
.chart-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chart-bar {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    height: 150px;
    padding: 20px;
}

.chart-bar-item {
    flex: 1;
    background: #e60012;
    border-radius: 4px 4px 0 0;
    min-height: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 5px;
    color: #fff;
    font-size: 11px;
}

/* 底部状态栏 */
.ppt-status-bar {
    background: #f8f8f8;
    border-top: 1px solid #ddd;
    padding: 8px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #666;
}

.ppt-zoom-control {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ppt-zoom-btn {
    width: 24px;
    height: 24px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppt-zoom-btn:hover {
    background: #f0f0f0;
}

/* 动画效果 */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideInLeft { from { transform: translateX(-100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
@keyframes zoomIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.animate-fadeIn { animation: fadeIn 0.5s ease; }
.animate-slideInLeft { animation: slideInLeft 0.5s ease; }
.animate-slideInRight { animation: slideInRight 0.5s ease; }
.animate-slideInUp { animation: slideInUp 0.5s ease; }
.animate-zoomIn { animation: zoomIn 0.5s ease; }

/* 拖拽时的样式 */
.dragging {
    opacity: 0.8;
    z-index: 1000 !important;
}

/* 复制时的样式 */
.copying {
    opacity: 0.5;
}

/* 画布 */
.draw-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* 形状元素样式 */
.ppt-shape {
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    display: block;
}

/* 图片元素样式 */
.ppt-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* 形状容器 */
.shape-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
