/* ========== PPT文案生成 - 容器 ========== */
.ppt-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #eff6ff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(37, 99, 235, 0.08);
    transition: all 0.3s ease;
}

/* 全屏模式 */
.ppt-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: flex-start;
    align-items: center;
    padding: 8px 14px;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #0284c7 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 10px rgba(30, 64, 175, 0.45);
    flex-shrink: 0;
}

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}

/* 全屏按钮右对齐 */
.toolbar-group--right {
    margin-left: auto;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.5px;
    margin-right: 4px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.toolbar-btn {
    padding: 6px 11px;
    background: rgba(255, 255, 255, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    backdrop-filter: blur(4px);
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.3);
    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;
}

.toolbar-btn-primary {
    background: rgba(255, 255, 255, 0.95);
    color: #1e40af;
    border-color: transparent;
    font-weight: 600;
}

.toolbar-btn-primary:hover:not(:disabled) {
    background: #fff;
    color: #1d4ed8;
}

.toolbar-btn-cancel {
    background: rgba(239, 68, 68, 0.85);
    border-color: rgba(239, 68, 68, 0.5);
}

.toolbar-btn-cancel:hover {
    background: rgba(239, 68, 68, 1);
}

/* ========== 主内容区 ========== */
.ppt-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #eff6ff;
}

/* ========== 左栏：历史记录 ========== */
.ppt-history-panel {
    width: 200px;
    background: #ffffff;
    border-right: 1px solid #bfdbfe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    background: linear-gradient(to bottom, #f0f9ff, #dbeafe);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}

.history-count {
    font-size: 11px;
    color: #3b82f6;
    margin-left: 4px;
    font-weight: 400;
}

.history-clear-btn {
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    color: #0284c7;
    font-size: 11px;
    cursor: pointer;
    padding: 3px 7px;
    border-radius: 4px;
    transition: all 0.2s;
    white-space: nowrap;
}

.history-clear-btn:hover {
    background: #e0f2fe;
    border-color: #0ea5e9;
}

.history-search {
    padding: 8px 10px;
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #bfdbfe;
    border-radius: 5px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #f0f9ff;
    color: #374151;
}

.history-search input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.12);
}

.history-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #93c5fd;
    font-size: 12px;
    padding: 24px 12px;
    line-height: 1.8;
}

.history-item {
    padding: 9px 10px;
    margin: 3px 0;
    background: #f0f9ff;
    border: 1px solid #bfdbfe;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.history-item:hover {
    background: #dbeafe;
    border-color: #93c5fd;
    transform: translateX(2px);
}

.history-item.active {
    background: #bfdbfe;
    border-color: #3b82f6;
    box-shadow: 0 1px 4px rgba(59, 130, 246, 0.2);
}

.history-item-delete {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 16px;
    height: 16px;
    background: #fee2e2;
    color: #ef4444;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    opacity: 0;
    transition: all 0.2s;
    cursor: pointer;
}

.history-item:hover .history-item-delete {
    opacity: 1;
}

.history-item-delete:hover {
    background: #ef4444;
    color: white;
}

.history-item-topic {
    font-size: 12px;
    font-weight: 600;
    color: #1e3a8a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 3px;
    padding-right: 18px;
}

.history-item-meta {
    font-size: 11px;
    color: #2563eb;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.history-item-badge {
    background: #dbeafe;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
}

.history-item-time {
    font-size: 10px;
    color: #93c5fd;
    margin-top: 3px;
}

/* ========== 中栏：生成设置 ========== */
.ppt-input-panel {
    width: 360px;
    min-width: 300px;
    background: #ffffff;
    border-right: 1px solid #bfdbfe;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f0f9ff, #dbeafe);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}

.panel-tip {
    font-size: 11px;
    color: #93c5fd;
}

.ppt-input-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
}

/* 表单组 */
.form-group {
    margin-bottom: 16px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: #1e3a8a;
    margin-bottom: 7px;
}

.form-label-icon {
    font-size: 14px;
}

.form-required {
    color: #ef4444;
    font-size: 13px;
}

.form-optional {
    color: #93c5fd;
    font-size: 11px;
    font-weight: 400;
}

.ppt-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #bfdbfe;
    border-radius: 7px;
    font-size: 13px;
    line-height: 1.6;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #f0f9ff;
    color: #374151;
    min-height: 68px;
}

.ppt-textarea:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #fff;
}

.ppt-textarea::placeholder {
    color: #bfdbfe;
    font-size: 12px;
}

/* shake 校验动画 */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.ppt-textarea.shake {
    animation: shake 0.4s ease;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.ppt-input {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #bfdbfe;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    background: #f0f9ff;
    color: #374151;
}

.ppt-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: #fff;
}

.ppt-input::placeholder {
    color: #bfdbfe;
    font-size: 12px;
}

.nm-textarea-hint {
    text-align: right;
    font-size: 11px;
    color: #93c5fd;
    margin-top: 3px;
}

/* 字数分级标识类 */
.count-warning { color: #f59e0b !important; }
.count-danger  { color: #ef4444 !important; }

.ppt-select {
    width: 100%;
    padding: 9px 12px;
    border: 1.5px solid #bfdbfe;
    border-radius: 7px;
    font-size: 13px;
    outline: none;
    background: #f0f9ff;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    appearance: none;
    background-image: 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='%233b82f6' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}

.ppt-select:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
}

/* 提示框 */
.ppt-tips-box {
    background: linear-gradient(135deg, #f0f9ff, #eff6ff);
    border: 1px solid #bfdbfe;
    border-left: 3px solid #93c5fd;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 12px;
    color: #1d4ed8;
    margin-top: 4px;
}

.ppt-tips-box p {
    margin: 0 0 8px;
    font-weight: 600;
    color: #1e3a8a;
}

.ppt-tips-box ul {
    margin: 0;
    padding-left: 16px;
    line-height: 1.9;
}

.ppt-tips-box kbd {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    border-radius: 3px;
    padding: 0 5px;
    font-size: 11px;
    color: #1e40af;
    font-family: inherit;
}

/* ========== 右栏：生成结果 ========== */
.ppt-result-panel {
    flex: 1;
    min-width: 300px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.ppt-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(to bottom, #f0f9ff, #dbeafe);
    border-bottom: 1px solid #bfdbfe;
    flex-shrink: 0;
    flex-wrap: wrap;
    gap: 6px;
}

.result-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ppt-result-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1e40af;
}

.result-meta-info {
    display: flex;
    gap: 6px;
    align-items: center;
}

.result-style-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    background: #dbeafe;
    color: #1e40af;
}

.result-count-badge {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    background: #e0f2fe;
    color: #0284c7;
}

.result-word-count {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    background: #dcfce7;
    color: #16a34a;
}

/* 结果区「换一批」按钮 */
.result-regen-btn {
    padding: 5px 12px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.result-regen-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(30, 64, 175, 0.3);
}

.result-regen-btn:active:not(:disabled) {
    transform: translateY(0);
}

.result-regen-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.ppt-result-body {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* 占位提示 */
.result-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #93c5fd;
    min-height: 200px;
}

.placeholder-icon {
    font-size: 52px;
    margin-bottom: 16px;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-8px); }
}

.placeholder-title {
    font-size: 16px;
    font-weight: 600;
    color: #3b82f6;
    margin: 0 0 8px;
}

.placeholder-desc {
    font-size: 13px;
    color: #93c5fd;
    margin: 3px 0;
}

/* 加载动画（PPT幻灯片构建效果） */
.result-loading {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.ppt-loading-anim {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    margin-bottom: 20px;
}

.loading-slide-bar {
    width: 24px;
    border-radius: 3px 3px 0 0;
    background: linear-gradient(to top, #1e40af, #60a5fa);
    animation: slideGrow 1.4s ease-in-out infinite;
}

.loading-slide-bar:nth-child(1) { height: 20px; animation-delay: 0s; }
.loading-slide-bar:nth-child(2) { height: 32px; animation-delay: 0.18s; }
.loading-slide-bar:nth-child(3) { height: 26px; animation-delay: 0.36s; }
.loading-slide-bar:nth-child(4) { height: 38px; animation-delay: 0.54s; }
.loading-slide-bar:nth-child(5) { height: 22px; animation-delay: 0.72s; }

@keyframes slideGrow {
    0%, 100% { transform: scaleY(0.5); opacity: 0.5; }
    50%       { transform: scaleY(1.1); opacity: 1; }
}

.loading-text {
    font-size: 14px;
    color: #3b82f6;
    font-weight: 500;
    margin: 0;
}

/* 结果内容 */
.result-content {
    flex: 1;
    min-height: 0;
    padding: 16px 20px;
    overflow-y: auto;
    line-height: 1.8;
}

/* 结果区淡入动画（由 JS 通过 .ppt-anim 类触发，确保每次切换都重播） */
.result-content.ppt-anim {
    animation: resultFadeIn 0.35s ease;
}

@keyframes resultFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ====== PPT幻灯片卡片样式（由 AI 返回 HTML） ====== */
.result-content .ppt-deck {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 720px;
    margin: 0 auto;
}

.result-content .ppt-slide {
    border-radius: 10px;
    border: 1.5px solid #bfdbfe;
    background: #ffffff;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.result-content .ppt-slide:hover {
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.13);
}

/* 封面/结尾页 */
.result-content .ppt-slide.slide-cover,
.result-content .ppt-slide.slide-ending {
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 60%, #0ea5e9 100%);
    border-color: #1d4ed8;
}

.result-content .ppt-slide.slide-toc {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border-color: #93c5fd;
}

/* 幻灯片头部 */
.result-content .slide-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px 8px;
    border-bottom: 1px solid rgba(191, 219, 254, 0.5);
}

.result-content .ppt-slide.slide-cover .slide-header,
.result-content .ppt-slide.slide-ending .slide-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.result-content .slide-num {
    font-size: 11px;
    font-weight: 700;
    color: #93c5fd;
    font-variant-numeric: tabular-nums;
    min-width: 22px;
}

.result-content .ppt-slide.slide-cover .slide-num,
.result-content .ppt-slide.slide-ending .slide-num {
    color: rgba(255, 255, 255, 0.65);
}

.result-content .slide-type-badge {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
}

.result-content .badge-cover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

.result-content .badge-toc {
    background: #bfdbfe;
    color: #1e40af;
}

.result-content .badge-content {
    background: #dbeafe;
    color: #1d4ed8;
}

.result-content .badge-ending {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* 封面/结尾内容 */
.result-content .slide-cover-content {
    padding: 20px 20px 8px;
    text-align: center;
}

.result-content .slide-main-title {
    font-size: 22px;
    font-weight: 800;
    color: #fff;
    margin: 0 0 10px;
    letter-spacing: 1px;
    line-height: 1.4;
}

.result-content .slide-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.82);
    margin: 0;
    padding-bottom: 4px;
}

/* 目录列表 */
.result-content .slide-toc-list {
    margin: 0;
    padding: 12px 16px 8px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-content .toc-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #bfdbfe;
    transition: all 0.15s;
}

.result-content .toc-item:hover {
    background: #eff6ff;
    border-color: #93c5fd;
}

.result-content .toc-num {
    font-size: 11px;
    font-weight: 700;
    color: #2563eb;
    background: #dbeafe;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.result-content .toc-text {
    font-size: 13px;
    color: #1e3a8a;
    font-weight: 500;
}

/* 幻灯片标题 */
.result-content .slide-title {
    font-size: 16px;
    font-weight: 700;
    color: #1e3a8a;
    margin: 0;
    padding: 14px 16px 0;
    position: relative;
    padding-left: 26px;
}

.result-content .slide-title::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 18px;
    background: linear-gradient(to bottom, #2563eb, #0ea5e9);
    border-radius: 2px;
    margin-top: 7px;
}

/* 要点列表 */
.result-content .slide-points {
    margin: 10px 0 0;
    padding: 0 16px 12px;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.result-content .slide-point {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #f8faff;
    border: 1px solid #e0eaff;
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.6;
    transition: background 0.15s;
}

.result-content .slide-point:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.result-content .point-bullet {
    color: #3b82f6;
    font-size: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.result-content .point-text {
    flex: 1;
}

/* 演讲者备注 */
.result-content .slide-notes {
    margin: 0 12px 12px;
    padding: 8px 12px;
    background: #fafbff;
    border: 1px solid #e0eaff;
    border-radius: 6px;
    border-left: 3px solid #60a5fa;
}

.result-content .ppt-slide.slide-cover .slide-notes,
.result-content .ppt-slide.slide-ending .slide-notes {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.25);
    border-left-color: rgba(255,255,255,0.5);
}

.result-content .notes-label {
    font-size: 11px;
    font-weight: 600;
    color: #3b82f6;
    display: block;
    margin-bottom: 4px;
}

.result-content .ppt-slide.slide-cover .notes-label,
.result-content .ppt-slide.slide-ending .notes-label {
    color: rgba(255,255,255,0.7);
}

.result-content .slide-notes p {
    margin: 0;
    font-size: 12px;
    color: #4b6aab;
    line-height: 1.7;
}

.result-content .ppt-slide.slide-cover .slide-notes p,
.result-content .ppt-slide.slide-ending .slide-notes p {
    color: rgba(255,255,255,0.75);
}

/* 错误提示 */
.result-error {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    color: #dc2626;
    min-height: 200px;
    font-size: 14px;
    gap: 10px;
}

.result-error::before {
    content: '⚠️';
    font-size: 36px;
}

.result-error-retry {
    margin-top: 6px;
    padding: 8px 22px;
    background: linear-gradient(135deg, #1e40af, #2563eb);
    color: #fff;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.result-error-retry:hover {
    background: linear-gradient(135deg, #1e3a8a, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

/* ========== 示例模态框 ========== */
.ppt-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(30, 58, 138, 0.35);
    z-index: 100001;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s;
    backdrop-filter: blur(2px);
}

.ppt-modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.ppt-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.92);
    background: #fff;
    border-radius: 12px;
    z-index: 100002;
    width: 90%;
    max-width: 700px;
    max-height: 82vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 16px 48px rgba(30, 64, 175, 0.2);
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ppt-modal.show {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

.ppt-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1e3a8a, #2563eb);
    color: #fff;
    flex-shrink: 0;
}

.ppt-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.ppt-modal-close {
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ppt-modal-close:hover {
    background: rgba(255,255,255,0.35);
}

.ppt-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 12px;
}

.example-card {
    padding: 14px 16px;
    background: #f0f9ff;
    border: 1.5px solid #bfdbfe;
    border-radius: 9px;
    cursor: pointer;
    transition: all 0.2s;
}

.example-card:hover {
    border-color: #3b82f6;
    background: #dbeafe;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.example-card-label {
    font-size: 14px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 6px;
}

.example-card-topic {
    font-size: 12px;
    color: #374151;
    margin-bottom: 8px;
    line-height: 1.5;
}

.example-card-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.example-card-tag {
    font-size: 11px;
    padding: 2px 7px;
    border-radius: 8px;
    font-weight: 500;
}

.example-card-tag.style-tag {
    background: #dbeafe;
    color: #1e40af;
}

.example-card-tag.count-tag {
    background: #e0f2fe;
    color: #0284c7;
}

.example-loading {
    text-align: center;
    padding: 32px;
    color: #93c5fd;
    font-size: 13px;
}

/* ========== 自定义滚动条 ========== */
.history-list::-webkit-scrollbar,
.ppt-input-body::-webkit-scrollbar,
.result-content::-webkit-scrollbar,
.ppt-modal-body::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track,
.ppt-input-body::-webkit-scrollbar-track,
.result-content::-webkit-scrollbar-track,
.ppt-modal-body::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb,
.ppt-input-body::-webkit-scrollbar-thumb,
.result-content::-webkit-scrollbar-thumb,
.ppt-modal-body::-webkit-scrollbar-thumb {
    background: #bfdbfe;
    border-radius: 4px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.ppt-input-body::-webkit-scrollbar-thumb:hover,
.result-content::-webkit-scrollbar-thumb:hover,
.ppt-modal-body::-webkit-scrollbar-thumb:hover {
    background: #93c5fd;
}

/* ========== 响应式布局 ========== */
@media (min-width: 640px) and (max-width: 899px) {
    .ppt-history-panel { display: none; }
    .ppt-input-panel { width: 320px; }
}

@media (max-width: 639px) {
    .ppt-main-content { flex-direction: column; }
    .ppt-history-panel { display: none; }
    .ppt-input-panel { width: 100%; min-width: unset; border-right: none; border-bottom: 1px solid #bfdbfe; max-height: 55%; }
    .ppt-result-panel { min-width: unset; }
    .form-row { flex-direction: column; gap: 8px; }
}

/* ========== 暗黑模式 ========== */
body.dark .ppt-container {
    background: #090f1e;
}

body.dark .ppt-toolbar {
    background: linear-gradient(135deg, #0a1628 0%, #0f2b5a 55%, #0c3a5e 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

body.dark .ppt-main-content {
    background: #090f1e;
}

body.dark .ppt-history-panel,
body.dark .ppt-input-panel,
body.dark .ppt-result-panel {
    background: #0c1626;
    border-color: #1a3060;
}

body.dark .history-panel-header,
body.dark .panel-header,
body.dark .ppt-result-header {
    background: linear-gradient(to bottom, #0d1e3a, #091428);
    border-color: #1a3060;
}

body.dark .history-panel-header h3,
body.dark .panel-header h3,
body.dark .ppt-result-header h3 {
    color: #93c5fd;
}

body.dark .panel-tip {
    color: #3b5a9a;
}

body.dark .history-search input {
    background: #090f1e;
    border-color: #1a3060;
    color: #e2e8f0;
}

body.dark .history-search input::placeholder {
    color: #1e3a60;
}

body.dark .history-list {
    background: #0c1626;
}

body.dark .history-empty {
    color: #4a7db8;
}

body.dark .history-item {
    background: #0f2040;
    border-color: #1a3060;
    color: #e2e8f0;
}

body.dark .history-item:hover {
    background: #153360;
    border-color: #2563eb;
}

body.dark .history-item.active {
    background: #1a3d70;
    border-color: #3b82f6;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.3);
}

body.dark .history-item-topic {
    color: #93c5fd;
}

body.dark .history-item-meta {
    color: #4a7db8;
}

body.dark .history-item-badge {
    background: #0f2040;
}

body.dark .history-item-time {
    color: #2a4d80;
}

body.dark .history-clear-btn {
    background: #0f2040;
    border-color: #1a3060;
    color: #60a5fa;
}

body.dark .history-clear-btn:hover {
    background: #153360;
}

body.dark .ppt-input-body {
    background: #0c1626;
}

body.dark .form-label {
    color: #93c5fd;
}

body.dark .ppt-textarea,
body.dark .ppt-input {
    background: #0f2040;
    border-color: #1a3060;
    color: #e2e8f0;
}

body.dark .ppt-textarea:focus,
body.dark .ppt-input:focus {
    border-color: #3b82f6;
    background: #0f2040;
}

body.dark .ppt-textarea::placeholder,
body.dark .ppt-input::placeholder {
    color: #1e3a60;
}

body.dark .ppt-select {
    background-color: #0f2040;
    border-color: #1a3060;
    color: #e2e8f0;
    background-image: 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='%2393c5fd' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
}

body.dark .ppt-select option {
    background: #0f2040;
}

body.dark .ppt-tips-box {
    background: linear-gradient(135deg, #0a1628, #091428);
    border-color: #1a3060;
    border-left-color: #1e3a8a;
    color: #4a7db8;
}

body.dark .ppt-tips-box p {
    color: #93c5fd;
}

body.dark .ppt-tips-box kbd {
    background: #0f2040;
    border-color: #1a3060;
    color: #93c5fd;
}

body.dark .nm-textarea-hint {
    color: #2a4d80;
}

body.dark .result-placeholder {
    color: #1e4080;
}

body.dark .placeholder-title {
    color: #3b82f6;
}

body.dark .placeholder-desc {
    color: #4a7db8;
}

body.dark .loading-text {
    color: #60a5fa;
}

body.dark .result-content {
    background: #0c1626;
}

body.dark .result-content .ppt-slide {
    background: #0f2040;
    border-color: #1a3060;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark .result-content .ppt-slide.slide-cover,
body.dark .result-content .ppt-slide.slide-ending {
    background: linear-gradient(135deg, #051230 0%, #0e286e 55%, #073460 100%);
    border-color: #0f3178;
}

body.dark .result-content .ppt-slide.slide-toc {
    background: linear-gradient(135deg, #0a1628, #0d1e3a);
    border-color: #1a3060;
}

body.dark .result-content .slide-header {
    border-bottom-color: rgba(26, 48, 96, 0.8);
}

body.dark .result-content .slide-num {
    color: #2a4d80;
}

body.dark .result-content .badge-content {
    background: #0f2040;
    color: #93c5fd;
}

body.dark .result-content .badge-toc {
    background: #0f2040;
    color: #60a5fa;
}

body.dark .result-content .slide-title {
    color: #93c5fd;
}

body.dark .result-content .slide-title::before {
    background: linear-gradient(to bottom, #3b82f6, #0ea5e9);
}

body.dark .result-content .slide-points {
    /* inherits dark bg from slide */
}

body.dark .result-content .slide-point {
    background: #0a1628;
    border-color: #1a3060;
    color: #bfdbfe;
}

body.dark .result-content .slide-point:hover {
    background: #0d1e3a;
    border-color: #2563eb;
}

body.dark .result-content .point-bullet {
    color: #60a5fa;
}

body.dark .result-content .slide-notes {
    background: rgba(9, 15, 30, 0.6);
    border-color: #1a3060;
    border-left-color: #2563eb;
}

body.dark .result-content .notes-label {
    color: #60a5fa;
}

body.dark .result-content .slide-notes p {
    color: #4a7db8;
}

body.dark .result-content .toc-item {
    background: #0a1628;
    border-color: #1a3060;
}

body.dark .result-content .toc-item:hover {
    background: #0d1e3a;
    border-color: #2563eb;
}

body.dark .result-content .toc-num {
    background: #0f2040;
    color: #60a5fa;
}

body.dark .result-content .toc-text {
    color: #93c5fd;
}

body.dark .result-error {
    color: #fca5a5;
}

body.dark .result-error-retry {
    background: linear-gradient(135deg, #0f2040, #1d4ed8);
}

body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #153360, #2563eb);
}

body.dark .result-style-badge {
    background: #0f2040;
    color: #93c5fd;
}

body.dark .result-count-badge {
    background: #0a1a30;
    color: #60a5fa;
}

body.dark .result-word-count {
    background: #0a2010;
    color: #6ee7b7;
}

body.dark .result-regen-btn {
    background: linear-gradient(135deg, #0f2040, #1d4ed8);
}

body.dark .result-regen-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #153360, #2563eb);
}

/* 字数分级暗黑模式适配 */
body.dark .count-warning { color: #fbbf24 !important; }
body.dark .count-danger  { color: #fca5a5 !important; }

body.dark .ppt-modal {
    background: #0c1626;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.6);
}

body.dark .ppt-modal-header {
    background: linear-gradient(135deg, #0a1628, #0f2b5a);
}

body.dark .ppt-modal-body {
    background: #0c1626;
}

body.dark .example-card {
    background: #0f2040;
    border-color: #1a3060;
}

body.dark .example-card:hover {
    border-color: #3b82f6;
    background: #153360;
}

body.dark .example-card-label {
    color: #93c5fd;
}

body.dark .example-card-topic {
    color: #9ca3af;
}

body.dark .example-card-tag.style-tag {
    background: #0f2040;
    color: #93c5fd;
}

body.dark .example-card-tag.count-tag {
    background: #0a1a30;
    color: #60a5fa;
}

body.dark .example-loading {
    color: #2a4d80;
}

/* 暗黑模式自定义滚动条 */
body.dark .history-list::-webkit-scrollbar-track,
body.dark .ppt-input-body::-webkit-scrollbar-track,
body.dark .result-content::-webkit-scrollbar-track,
body.dark .ppt-modal-body::-webkit-scrollbar-track {
    background: #090f1e;
}

body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .ppt-input-body::-webkit-scrollbar-thumb,
body.dark .result-content::-webkit-scrollbar-thumb,
body.dark .ppt-modal-body::-webkit-scrollbar-thumb {
    background: #1a3060;
}

body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .ppt-input-body::-webkit-scrollbar-thumb:hover,
body.dark .result-content::-webkit-scrollbar-thumb:hover,
body.dark .ppt-modal-body::-webkit-scrollbar-thumb:hover {
    background: #2563eb;
}
