/* ========================================
   AI制作PPT - 样式文件
   参考 SVG Editor 风格，紫色渐变主题
   ======================================== */

/* ========== 主容器 ========== */
.ppt-editor-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8fafc;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    /* 仅过渡阴影，避免 position/size 变化触发抖动动画 */
    transition: box-shadow 0.3s ease;
}

/* 全屏模式 */
.ppt-editor-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.ppt-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* 工具栏功能组之间半透明竖线分隔 */
.toolbar-group + .toolbar-group {
    border-left: 1px solid rgba(255, 255, 255, 0.22);
    padding-left: 10px;
    margin-left: 2px;
}

.toolbar-btn {
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #667eea;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.4;
}

.toolbar-btn:hover:not(:disabled) {
    background: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.toolbar-btn:active:not(:disabled) {
    transform: translateY(0);
}

.toolbar-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.primary-toolbar-btn {
    background: #ffffff;
    font-weight: 700;
    color: #5b21b6;
}

.cancel-toolbar-btn {
    background: #fecaca;
    color: #b91c1c;
}

.cancel-toolbar-btn:hover {
    background: #fca5a5 !important;
}

.toolbar-btn kbd {
    display: inline-block;
    padding: 1px 4px;
    font-size: 10px;
    border: 1px solid rgba(100, 100, 100, 0.4);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.8);
    color: #555;
    margin-left: 2px;
    line-height: 1.4;
    font-family: inherit;
}

/* ========== 主内容三栏布局 ========== */
.ppt-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #f8fafc;
}

/* ========== 左侧历史面板 ========== */
.ppt-history-panel {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.2s;
    line-height: 1.5;
}

.history-clear-btn:hover {
    background: #fde8e8;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 10px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #1e293b;
}

.history-search input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px;
}

.history-item {
    padding: 9px 12px;
    margin-bottom: 5px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeInItem 0.2s ease;
}

@keyframes fadeInItem {
    from { opacity: 0; transform: translateX(-4px); }
    to   { opacity: 1; transform: translateX(0); }
}

.history-item:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    transform: translateX(2px);
}

.history-item.active {
    background: #ede9fe;
    border-color: #7c3aed;
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 4px;
    padding-right: 18px;
}

.history-item-meta {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.history-item-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 18px;
    height: 18px;
    background: #fde8e8;
    color: #ef4444;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s;
    border: none;
    cursor: pointer;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: #ffffff;
}

/* 历史记录数量徽章 */
.history-count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #22c55e;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    border-radius: 9px;
    line-height: 1;
    margin-left: 5px;
    flex-shrink: 0;
    transition: background 0.2s;
}

.history-empty-tip {
    padding: 20px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

/* ========== 中间输入配置面板 ========== */
.input-panel {
    width: 310px;
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.input-panel-header {
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.input-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.input-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px;
}

/* ========== 表单元素 ========== */
.form-group {
    margin-bottom: 14px;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}

.form-group .required {
    color: #ef4444;
    margin-left: 2px;
}

.form-group input[type="text"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    color: #1e293b;
    background: #fafafa;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
    background: #ffffff;
}

.form-group textarea {
    resize: vertical;
    min-height: 88px;
    line-height: 1.55;
}

.char-count {
    font-size: 11px;
    color: #94a3b8;
    text-align: right;
    margin-top: 3px;
}

.char-count.warn {
    color: #f59e0b;
}

.char-count.danger {
    color: #ef4444;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-group.half {
    flex: 1;
    min-width: 0;
}

.slide-count-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
}

.slide-count-wrapper input[type="number"] {
    text-align: center;
    width: 54px !important;
    padding: 8px 4px !important;
    flex-shrink: 0;
}

/* 隐藏数字输入框的增减箭头 */
.slide-count-wrapper input[type="number"]::-webkit-inner-spin-button,
.slide-count-wrapper input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.count-btn {
    width: 28px;
    height: 34px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 18px;
    font-weight: 400;
    color: #667eea;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
    user-select: none;
}

.count-btn:hover {
    background: #667eea;
    color: #ffffff;
    border-color: #667eea;
}

.count-btn:active {
    transform: scale(0.92);
}

/* ========== 生成按钮 ========== */
.form-actions {
    margin-top: 6px;
    margin-bottom: 2px;
}

.generate-main-btn {
    width: 100%;
    padding: 12px 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35);
    letter-spacing: 0.3px;
}

.generate-main-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(102, 126, 234, 0.45);
}

.generate-main-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.generate-main-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 生成中状态：渐变调暨动画 */
@keyframes generatingPulse {
    0%, 100% { box-shadow: 0 4px 12px rgba(102, 126, 234, 0.35); }
    50%       { box-shadow: 0 4px 22px rgba(102, 126, 234, 0.6); }
}

.generate-main-btn.generating {
    background: linear-gradient(135deg, #7c8fe8 0%, #8f6bba 100%);
    animation: generatingPulse 2s ease-in-out infinite;
    cursor: not-allowed;
}

.generate-main-btn .btn-shortcut {
    margin-left: auto;
    opacity: 0.75;
    font-weight: 400;
    font-size: 11px;
    display: flex;
    align-items: center;
    gap: 2px;
}

.generate-main-btn kbd {
    display: inline-block;
    padding: 1px 5px;
    font-size: 11px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.18);
    color: rgba(255, 255, 255, 0.9);
    line-height: 1.4;
    font-family: inherit;
}

/* ========== AI状态区 ========== */
.ai-status {
    margin-top: 12px;
    padding: 11px 14px;
    background: #f0f4ff;
    border: 1px solid #c7d2fe;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.ai-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #4338ca;
    flex: 1;
    min-width: 0;
}

#aiStatusText {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.loading-dots {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #667eea;
    animation: dotPulse 1.4s ease-in-out infinite;
}

.loading-dots span:nth-child(2) { animation-delay: 0.25s; }
.loading-dots span:nth-child(3) { animation-delay: 0.5s; }

@keyframes dotPulse {
    0%, 100% { opacity: 0.25; transform: scale(0.75); }
    50%       { opacity: 1;    transform: scale(1.2); }
}

.cancel-mini-btn {
    padding: 4px 10px;
    background: #ef4444;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}

.cancel-mini-btn:hover { background: #dc2626; }

/* ========== 右侧大纲预览面板 ========== */
.preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f4f6fb;
    overflow: hidden;
    min-width: 280px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #fafafa 0%, #f5f5f5 100%);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.preview-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}

.preview-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.slide-total {
    font-size: 12px;
    color: #64748b;
    background: #e2e8f0;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: 500;
}

.slide-total strong {
    color: #667eea;
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

/* 空状态 */
.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    color: #94a3b8;
    text-align: center;
    gap: 8px;
}

.preview-empty-icon {
    font-size: 52px;
    margin-bottom: 8px;
    opacity: 0.45;
    animation: emptyFloat 3s ease-in-out infinite;
}

@keyframes emptyFloat {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}

.preview-empty p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
    color: #64748b;
}

.preview-empty-sub {
    font-size: 12px !important;
    color: #94a3b8 !important;
}

/* ========== PPT大纲卡片 ========== */
.ppt-outline {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 幻灯片卡片入场动画 */
@keyframes slideCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ppt-outline .slide-card { animation: slideCardIn 0.28s ease both; }
.ppt-outline .slide-card:nth-child(2)  { animation-delay: 0.00s; }
.ppt-outline .slide-card:nth-child(3)  { animation-delay: 0.05s; }
.ppt-outline .slide-card:nth-child(4)  { animation-delay: 0.10s; }
.ppt-outline .slide-card:nth-child(5)  { animation-delay: 0.15s; }
.ppt-outline .slide-card:nth-child(6)  { animation-delay: 0.20s; }
.ppt-outline .slide-card:nth-child(7)  { animation-delay: 0.24s; }
.ppt-outline .slide-card:nth-child(8)  { animation-delay: 0.28s; }
.ppt-outline .slide-card:nth-child(9)  { animation-delay: 0.32s; }
.ppt-outline .slide-card:nth-child(n+10){ animation-delay: 0.36s; }

/* 顶部标题条 */
.ppt-title-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 14px 20px;
    border-radius: 10px;
    margin-bottom: 4px;
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.32);
    position: relative;
    overflow: hidden;
}

.ppt-title-bar::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}

.ppt-title-bar h2 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
    line-height: 1.4;
}

.ppt-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    opacity: 0.85;
}

/* 幻灯片卡片 */
.slide-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.slide-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
    border-color: #c4b5fd;
}

/* 卡片头部 */
.slide-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.slide-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: #ffffff;
    flex-shrink: 0;
}

/* 布局色 */
.slide-number.layout-cover  { background: linear-gradient(135deg, #667eea, #764ba2); }
.slide-number.layout-toc    { background: linear-gradient(135deg, #2196F3, #0d47a1); }
.slide-number.layout-content{ background: linear-gradient(135deg, #43a047, #1b5e20); }
.slide-number.layout-section{ background: linear-gradient(135deg, #ff9800, #e65100); }
.slide-number.layout-end    { background: linear-gradient(135deg, #607d8b, #263238); }

.slide-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

.slide-layout-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.slide-layout-badge.layout-cover  { background: #ede9fe; color: #7c3aed; }
.slide-layout-badge.layout-toc    { background: #dbeafe; color: #1d4ed8; }
.slide-layout-badge.layout-content{ background: #dcfce7; color: #15803d; }
.slide-layout-badge.layout-section{ background: #ffedd5; color: #c2410c; }
.slide-layout-badge.layout-end    { background: #f1f5f9; color: #475569; }

/* 卡片正文 */
.slide-card-body {
    padding: 10px 14px 12px;
}

.slide-bullets {
    list-style: none;
    margin: 0;
    padding: 0;
}

.slide-bullets li {
    padding: 3px 0;
    font-size: 12px;
    color: #475569;
    display: flex;
    align-items: flex-start;
    gap: 7px;
    line-height: 1.55;
}

.slide-bullets li::before {
    content: '▶';
    font-size: 7px;
    color: #7c3aed;
    margin-top: 4px;
    flex-shrink: 0;
}

/* 幻灯片卡片每页复制按钮 */
.slide-copy-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12px;
    color: #94a3b8;
    padding: 3px 6px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.18s, color 0.18s, background 0.18s;
    flex-shrink: 0;
    line-height: 1;
}

.slide-card:hover .slide-copy-btn {
    opacity: 1;
}

.slide-copy-btn:hover {
    color: #667eea;
    background: #f0f4ff;
}

/* 局部复制后卡片边框闪烁反馈 */
.slide-card.just-copied {
    border-color: #22c55e !important;
    box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2) !important;
    transition: border-color 0.1s, box-shadow 0.1s;
}

.slide-notes {
    margin-top: 9px;
    padding: 7px 10px;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    border-radius: 0 5px 5px 0;
    font-size: 11px;
    color: #78716c;
    line-height: 1.55;
}

.slide-notes::before {
    content: '\1F4AC  演讲备注：';
    font-weight: 600;
    color: #92400e;
    display: block;
    margin-bottom: 3px;
    font-size: 11px;
}

/* 复制按钮点击成功闪烁 */
.toolbar-btn.copy-success-flash {
    background: #22c55e !important;
    color: #ffffff !important;
    transform: none !important;
    transition: background 0.1s, color 0.1s;
}

/* ========== 话题模板弹窗 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.42);
    z-index: 100000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(3px);
}

.modal.show {
    display: flex;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-18px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-content {
    background: #ffffff;
    border-radius: 10px;
    max-width: 680px;
    width: 100%;
    max-height: 82vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    animation: modalSlideIn 0.22s ease-out;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}

.modal-header h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #1e293b;
}

.modal-close {
    background: #f1f5f9;
    border: none;
    color: #64748b;
    width: 28px;
    height: 28px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 12px;
}

.template-item {
    padding: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.template-item:hover {
    border-color: #667eea;
    background: #f5f3ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(102, 126, 234, 0.16);
}

.template-icon {
    font-size: 26px;
    line-height: 1;
}

.template-name {
    font-size: 13px;
    font-weight: 700;
    color: #1e293b;
}

.template-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* ========== Toast 通知 ========== */
.ppt-toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    padding: 11px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    z-index: 999999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    max-width: 320px;
    word-break: break-word;
    animation: toastSlideIn 0.28s ease-out;
    pointer-events: none;
}

.ppt-toast.success { background: linear-gradient(135deg, #22c55e, #16a34a); color: #ffffff; }
.ppt-toast.error   { background: linear-gradient(135deg, #ef4444, #dc2626); color: #ffffff; }
.ppt-toast.info    { background: linear-gradient(135deg, #3b82f6, #1d4ed8); color: #ffffff; }

@keyframes toastSlideIn {
    from { opacity: 0; transform: translateX(16px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ========== 骨架屏加载状态 ========== */
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.preview-skeleton {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.skel-bar,
.skel-head,
.skel-line {
    background: linear-gradient(90deg, #e8edf5 25%, #f4f6fc 50%, #e8edf5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.7s infinite ease-in-out;
    border-radius: 6px;
}

.skel-bar {
    height: 72px;
    border-radius: 10px;
}

.skel-card {
    border: 1px solid #e9eef5;
    border-radius: 8px;
    overflow: hidden;
}

.skel-head {
    height: 42px;
    border-radius: 0;
    border-bottom: 1px solid #f1f5f9;
}

.skel-body {
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 9px;
    background: #fafbfe;
}

.skel-line {
    height: 9px;
}

/* ========== 自定义滚动条 ========== */
.preview-content::-webkit-scrollbar,
.history-list::-webkit-scrollbar,
.input-panel-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar {
    width: 4px;
}

.preview-content::-webkit-scrollbar-track,
.history-list::-webkit-scrollbar-track,
.input-panel-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.preview-content::-webkit-scrollbar-thumb,
.history-list::-webkit-scrollbar-thumb,
.input-panel-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.28);
    border-radius: 2px;
}

.preview-content::-webkit-scrollbar-thumb:hover,
.history-list::-webkit-scrollbar-thumb:hover,
.input-panel-body::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.55);
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .ppt-history-panel { width: 170px; }
    .input-panel { width: 275px; }
}

@media (max-width: 768px) {
    .ppt-history-panel { width: 150px; }
    .input-panel { width: 250px; }
}

@media (max-width: 640px) {
    .ppt-main-content { flex-direction: column; }
    .ppt-history-panel { display: none; }
    .input-panel {
        width: 100% !important;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        max-height: 55vh;
        overflow: hidden;
        flex-shrink: 0;
    }
    body.theme-dark .input-panel {
        border-bottom-color: rgba(148, 163, 184, 0.18);
    }
    .preview-panel { min-height: 280px; }
    .ppt-toolbar { gap: 4px; }
    .toolbar-btn { padding: 5px 7px; font-size: 11px; }
    .toolbar-group + .toolbar-group { padding-left: 6px; }
}

/* ========== 暗黑模式 ========== */
body.theme-dark .ppt-editor-container {
    background: #1e293b;
}

body.theme-dark .ppt-main-content {
    background: #1e293b;
}

body.theme-dark .ppt-history-panel,
body.theme-dark .input-panel {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .history-header,
body.theme-dark .input-panel-header,
body.theme-dark .preview-header {
    background: linear-gradient(to bottom, #1e293b 0%, #1a2332 100%);
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .history-header h3,
body.theme-dark .input-panel-header h3,
body.theme-dark .preview-header h3 {
    color: #cbd5e1;
}

body.theme-dark .history-search input {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .history-search input::placeholder { color: #64748b; }

body.theme-dark .history-item {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .history-item:hover {
    background: rgba(148, 163, 184, 0.1);
    border-color: rgba(148, 163, 184, 0.3);
}

body.theme-dark .history-item.active {
    background: rgba(124, 58, 237, 0.2);
    border-color: #7c3aed;
}

body.theme-dark .history-item-title { color: #e2e8f0; }
body.theme-dark .history-item-meta  { color: #64748b; }

body.theme-dark .form-group label   { color: #cbd5e1; }

body.theme-dark .form-group input[type="text"],
body.theme-dark .form-group textarea,
body.theme-dark .form-group select {
    background: #1e293b;
    border-color: #334155;
    color: #e2e8f0;
}

body.theme-dark .form-group input[type="text"]::placeholder,
body.theme-dark .form-group textarea::placeholder {
    color: #64748b;
}

body.theme-dark .form-group input[type="text"]:focus,
body.theme-dark .form-group textarea:focus,
body.theme-dark .form-group select:focus {
    border-color: #667eea;
    background: #0f172a;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

body.theme-dark .count-btn {
    background: #1e293b;
    border-color: #334155;
    color: #a5b4fc;
}

body.theme-dark .count-btn:hover {
    background: #667eea;
    border-color: #667eea;
    color: #ffffff;
}

body.theme-dark .ai-status {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
}

body.theme-dark .ai-loading { color: #a5b4fc; }

body.theme-dark .preview-panel {
    background: #0f172a;
}

body.theme-dark .preview-content {
    background: #0f172a;
}

body.theme-dark .slide-card {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .slide-card:hover {
    border-color: #7c3aed;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

body.theme-dark .slide-card-header {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .slide-card-title  { color: #e2e8f0; }
body.theme-dark .slide-bullets li  { color: #94a3b8; }

body.theme-dark .slide-notes {
    background: rgba(245, 158, 11, 0.08);
    border-left-color: #d97706;
    color: #c4913a;
}

body.theme-dark .slide-notes::before { color: #fbbf24; }

body.theme-dark .modal-content {
    background: #1e293b;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

body.theme-dark .modal-header {
    background: #0f172a;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .modal-header h3 { color: #e2e8f0; }
body.theme-dark .modal-close { background: #334155; color: #94a3b8; }
body.theme-dark .modal-close:hover { background: #475569; color: #e2e8f0; }

body.theme-dark .template-item {
    background: #1e293b;
    border-color: rgba(148, 163, 184, 0.18);
}

body.theme-dark .template-item:hover {
    background: rgba(102, 126, 234, 0.12);
    border-color: #667eea;
}

body.theme-dark .template-name { color: #e2e8f0; }
body.theme-dark .template-desc { color: #94a3b8; }

body.theme-dark .skel-bar,
body.theme-dark .skel-head,
body.theme-dark .skel-line {
    background: linear-gradient(90deg, #1e293b 25%, #263548 50%, #1e293b 75%);
    background-size: 200% 100%;
}

body.theme-dark .skel-card {
    border-color: rgba(148, 163, 184, 0.12);
}

body.theme-dark .skel-body {
    background: #0f172a;
}

body.theme-dark .preview-content::-webkit-scrollbar-thumb,
body.theme-dark .history-list::-webkit-scrollbar-thumb,
body.theme-dark .input-panel-body::-webkit-scrollbar-thumb {
    background: rgba(165, 180, 252, 0.28);
}

body.theme-dark .slide-copy-btn:hover {
    background: rgba(102, 126, 234, 0.15);
    color: #a5b4fc;
}

body.theme-dark .slide-total { background: #1e293b; color: #94a3b8; }
body.theme-dark .slide-total strong { color: #a5b4fc; }
