/* =============================================
   分镜设计工具 - storyboard_design.css
   电影胶片暗金主题，三栏布局
   暗黑模式全部以 body.dark 作为 CSS 父级选择器前缀
   ============================================= */

/* ===== 主容器 ===== */
.sb-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 600px;
    background: #f8f7f4;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.10);
    transition: all 0.3s ease;
}

.sb-container.fullscreen {
    position: fixed;
    top: 0; left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
    min-height: unset;
}

/* ===== 顶部工具栏（电影胶片深色主题） ===== */
.sb-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #e2c97e;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 12px rgba(15,52,96,0.5);
    flex-shrink: 0;
    border-bottom: 2px solid #e2c97e;
    position: relative;
}

/* 胶片孔装饰 */
.sb-toolbar::before,
.sb-toolbar::after {
    content: '⬛⬛⬛⬛⬛⬛';
    font-size: 7px;
    color: #e2c97e;
    opacity: 0.3;
    letter-spacing: 2px;
    position: absolute;
    left: 0; right: 0;
}
.sb-toolbar::before { top: 1px; }
.sb-toolbar::after  { bottom: 1px; }

.toolbar-group {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    min-height: 28px;
}

.sb-toolbar .toolbar-title {
    font-size: 13px;
    font-weight: 700;
    color: #e2c97e;
    letter-spacing: 1px;
    margin-right: 6px;
    text-shadow: 0 1px 6px rgba(226,201,126,0.4);
}

.toolbar-btn {
    padding: 5px 11px;
    background: rgba(226,201,126,0.12);
    border: 1px solid rgba(226,201,126,0.3);
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #e2c97e;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar-btn:hover:not(:disabled) {
    background: rgba(226,201,126,0.25);
    border-color: #e2c97e;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(226,201,126,0.2);
}

.toolbar-btn:active:not(:disabled) { transform: translateY(0); }
.toolbar-btn:disabled { opacity: 0.35; cursor: not-allowed; }

.toolbar-btn-add {
    background: linear-gradient(135deg, #e2c97e 0%, #c9a84c 100%);
    border-color: #c9a84c;
    color: #1a1a2e;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(226,201,126,0.35);
}
.toolbar-btn-add:hover:not(:disabled) {
    background: linear-gradient(135deg, #f0d794 0%, #e2c97e 100%);
    color: #1a1a2e;
    box-shadow: 0 4px 12px rgba(226,201,126,0.5);
}

.toolbar-btn-ai {
    background: rgba(139,92,246,0.2);
    border-color: rgba(139,92,246,0.5);
    color: #c4b5fd;
}
.toolbar-btn-ai:hover:not(:disabled) {
    background: rgba(139,92,246,0.35);
    border-color: #a78bfa;
    color: #ede9fe;
}

/* ===== 主内容三栏 ===== */
.sb-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== 左栏：历史记录 ===== */
.sb-history-panel {
    width: 200px;
    flex-shrink: 0;
    background: #fff;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.history-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 11px 14px;
    background: linear-gradient(to bottom, #fafafa, #f5f5f5);
    border-bottom: 1px solid #e2e8f0;
    border-left: 3px solid #e2c97e;
    flex-shrink: 0;
}

.history-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.history-count {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    color: #1a1a2e;
    background: #e2c97e;
    padding: 1px 7px;
    border-radius: 10px;
    margin-left: 5px;
    vertical-align: middle;
    line-height: 1.6;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: background 0.2s;
}
.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 8px;
    font-size: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    outline: none;
    background: #f8fafc;
    color: #334155;
    box-sizing: border-box;
    transition: border-color 0.2s;
}
.history-search input:focus { border-color: #e2c97e; background: #fff; }

.history-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.history-empty {
    padding: 24px 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
}

.history-item {
    padding: 9px 12px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.15s;
    border-left: 3px solid transparent;
    position: relative;
}
.history-item:hover { background: #fef9ec; }
.history-item.active {
    background: #fef9ec;
    border-left-color: #e2c97e;
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #334155;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
    padding-right: 22px;
}

.history-item-meta {
    font-size: 10px;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-panels {
    font-size: 10px;
    color: #c9a84c;
    font-weight: 600;
}

.history-del-btn {
    position: absolute;
    right: 7px;
    top: 50%;
    transform: translateY(-50%);
    display: none;
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
    padding: 1px 5px;
    border-radius: 3px;
    transition: all 0.15s;
}
.history-item:hover .history-del-btn { display: block; }
.history-del-btn:hover { color: #ef4444; background: #fee2e2; }

/* ===== 中栏：编辑区 ===== */
.sb-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fafaf8;
    border-right: 1px solid #e2e8f0;
    min-width: 0;
}

/* 项目信息栏 */
.project-info-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to right, #1a1a2e 0%, #16213e 100%);
    border-bottom: 2px solid #e2c97e;
    flex-shrink: 0;
    gap: 10px;
}

.project-info-fields {
    display: flex;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.project-title-input,
.project-theme-input {
    padding: 5px 10px;
    border: 1px solid rgba(226,201,126,0.3);
    border-radius: 4px;
    font-size: 12px;
    background: rgba(255,255,255,0.07);
    color: #e2c97e;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.project-title-input {
    flex: 2;
    min-width: 0;
    font-weight: 600;
}
.project-theme-input {
    flex: 1;
    min-width: 0;
}
.project-title-input::placeholder,
.project-theme-input::placeholder { color: rgba(226,201,126,0.4); }
.project-title-input:focus,
.project-theme-input:focus {
    border-color: #e2c97e;
    background: rgba(255,255,255,0.12);
}

.project-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-shrink: 0;
}

.panel-count-badge,
.total-duration-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 10px;
}
.panel-count-badge {
    background: rgba(226,201,126,0.18);
    color: #e2c97e;
    border: 1px solid rgba(226,201,126,0.3);
}
.total-duration-badge {
    background: rgba(139,92,246,0.15);
    color: #c4b5fd;
    border: 1px solid rgba(139,92,246,0.3);
}

/* 分镜帧列表区域 */
.sb-panels-list {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 0;
}

.panels-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}
.panels-empty-icon { font-size: 32px; margin-bottom: 8px; }
.panels-empty p { margin: 4px 0; font-size: 13px; }
.panels-empty-tip { font-size: 11px; color: #b0bec5; }

/* 分镜帧行卡片 */
.panel-card {
    background: #fff;
    border: 1px solid #e8e8e4;
    border-radius: 6px;
    padding: 10px 12px;
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: default;
    transition: box-shadow 0.2s, border-color 0.2s;
    position: relative;
}
.panel-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.08); border-color: #e2c97e; }

.panel-card-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #e2c97e;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-card-body {
    flex: 1;
    min-width: 0;
}

.panel-card-tags {
    display: flex;
    gap: 5px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.panel-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 3px;
    background: #f1f5f9;
    color: #475569;
}
.panel-tag.shot-tag { background: #fef9ec; color: #c9a84c; }
.panel-tag.move-tag { background: #f0fdf4; color: #16a34a; }
.panel-tag.dur-tag  { background: #eff6ff; color: #3b82f6; }

.panel-card-desc {
    font-size: 12px;
    color: #334155;
    line-height: 1.5;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-card-dialogue {
    font-size: 11px;
    color: #7c3aed;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.panel-card-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
    align-items: center;
    opacity: 0;
    transition: opacity 0.18s;
}
.panel-card:hover .panel-card-actions,
.panel-card:focus-within .panel-card-actions { opacity: 1; }

.panel-action-btn {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    background: transparent;
    color: #94a3b8;
}
.panel-action-btn:hover { background: #f1f5f9; color: #334155; }
.panel-action-btn.del-btn:hover { background: #fde8e8; color: #ef4444; }

/* 添加/编辑表单 */
.sb-add-form {
    background: #fff;
    border-top: 2px solid #e2c97e;
    flex-shrink: 0;
    max-height: 340px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    display: none;
}
.sb-add-form.visible { display: block; }

.add-form-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    background: linear-gradient(to right, #fef9ec, #fffdf4);
    border-bottom: 1px solid #f0e8c8;
}
.add-form-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}
.form-close-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 13px;
    padding: 2px 6px;
    border-radius: 3px;
    transition: all 0.15s;
}
.form-close-btn:hover { background: #fee2e2; color: #ef4444; }

.add-form-body {
    padding: 12px 14px;
}

.form-row-3 {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.form-row-3 .form-group { flex: 1; min-width: 0; margin-bottom: 0; }

.form-row-2 {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}
.form-row-2 .form-group { flex: 1; min-width: 0; margin-bottom: 0; }

.form-group {
    margin-bottom: 10px;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.label-tip {
    font-size: 10px;
    color: #94a3b8;
    font-weight: 400;
}

.required-mark { color: #ef4444; font-weight: 700; }

.sb-select,
.sb-input {
    width: 100%;
    padding: 6px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #334155;
    background: #f8fafc;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
}
.sb-select:focus,
.sb-input:focus { border-color: #e2c97e; background: #fff; box-shadow: 0 0 0 2px rgba(226,201,126,0.15); }

.sb-select option { background: #fff; color: #334155; }

.sb-textarea {
    width: 100%;
    padding: 7px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    color: #334155;
    background: #f8fafc;
    outline: none;
    resize: vertical;
    transition: border-color 0.2s, background 0.2s;
    box-sizing: border-box;
    max-height: 160px;
    font-family: inherit;
    line-height: 1.5;
}
.sb-textarea:focus { border-color: #e2c97e; background: #fff; box-shadow: 0 0 0 2px rgba(226,201,126,0.15); }
.sb-textarea-sm { max-height: 80px; }

.char-count {
    text-align: right;
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

.add-form-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-top: 4px;
    flex-wrap: wrap;
}

.action-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.action-btn-primary {
    background: linear-gradient(135deg, #e2c97e, #c9a84c);
    color: #1a1a2e;
    box-shadow: 0 2px 6px rgba(226,201,126,0.35);
}
.action-btn-primary:hover {
    background: linear-gradient(135deg, #f0d794, #e2c97e);
    box-shadow: 0 3px 10px rgba(226,201,126,0.5);
}
.action-btn-cancel {
    background: #f1f5f9;
    color: #64748b;
}
.action-btn-cancel:hover { background: #e2e8f0; }

.shortcut-hint {
    font-size: 11px;
    color: #94a3b8;
    margin-left: auto;
}

/* ===== 右栏：分镜视觉预览 ===== */
.sb-preview-panel {
    width: 300px;
    flex-shrink: 0;
    background: #f0ede8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid #e2e8f0;
}

.preview-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #f5f2ed, #eceae4);
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.preview-panel-header h3 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

.preview-ctrl-btn {
    font-size: 11px;
    padding: 3px 9px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    color: #475569;
    transition: all 0.15s;
}
.preview-ctrl-btn:hover { border-color: #e2c97e; color: #92400e; }

.sb-preview-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px;
}

.preview-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
}
.preview-placeholder-icon { font-size: 36px; margin-bottom: 10px; opacity: 0.5; }
.preview-placeholder p { margin: 4px 0; font-size: 12px; }
.preview-placeholder-tip { font-size: 11px; }

/* 预览网格（默认单列卡片模式） */
.preview-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 网格模式：2列 CSS Grid（点击“☰ 列表”后切换） */
.preview-grid.mode-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}
.preview-grid.mode-grid .frame-visual {
    height: 64px;
    font-size: 22px;
}
.preview-grid.mode-grid .frame-header { padding: 4px 7px; }
.preview-grid.mode-grid .frame-num,
.preview-grid.mode-grid .frame-shot { font-size: 9px; }
.preview-grid.mode-grid .frame-info { padding: 4px 7px; }
.preview-grid.mode-grid .frame-desc {
    font-size: 10px;
    -webkit-line-clamp: 2;
}
.preview-grid.mode-grid .frame-dialogue { display: none; }
.preview-grid.mode-grid .frame-footer { padding: 3px 7px 5px; }
.preview-grid.mode-grid .frame-move-badge { font-size: 8px; padding: 1px 3px; }

/* 预览分镜帧卡片（电影帧风格） */
.preview-frame {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 6px rgba(0,0,0,0.10);
    border: 1px solid #e8e4dc;
    transition: transform 0.15s, box-shadow 0.15s;
    cursor: pointer;
}
.preview-frame:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.preview-frame.editing {
    border-color: #e2c97e;
    box-shadow: 0 0 0 3px rgba(226,201,126,0.35), 0 2px 8px rgba(0,0,0,0.12);
    transform: translateY(-1px);
    z-index: 1;
}

/* 胶片帧头部 */
.frame-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    padding: 5px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.frame-num { font-size: 10px; font-weight: 700; color: #e2c97e; }
.frame-shot { font-size: 10px; color: rgba(226,201,126,0.75); }

/* 帧视觉区（模拟取景器） */
.frame-visual {
    position: relative;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 28px;
}

/* 不同镜头类型颜色 */
.frame-visual.ws-shot  { background: linear-gradient(135deg, #1e3a5f, #2d5986); }
.frame-visual.ms-shot  { background: linear-gradient(135deg, #1f3a2e, #2d5e45); }
.frame-visual.mcu-shot { background: linear-gradient(135deg, #3a1f1a, #6b3228); }
.frame-visual.cu-shot  { background: linear-gradient(135deg, #3a2a1a, #7a5020); }
.frame-visual.ecu-shot { background: linear-gradient(135deg, #2a1a3a, #5a2d7a); }
.frame-visual.ots-shot { background: linear-gradient(135deg, #1a3a3a, #1d6060); }
.frame-visual.bird-shot{ background: linear-gradient(135deg, #1a2a3a, #284466); }
.frame-visual.worm-shot{ background: linear-gradient(135deg, #3a1a2a, #6b284f); }
.frame-visual.two-shot { background: linear-gradient(135deg, #2a3a1a, #4f7a20); }
.frame-visual.ins-shot { background: linear-gradient(135deg, #2a2a2a, #555555); }

/* 取景器角落装饰 */
.frame-visual::before {
    content: '';
    position: absolute;
    top: 4px; left: 4px; right: 4px; bottom: 4px;
    border: 1px solid rgba(226,201,126,0.2);
    pointer-events: none;
}
.frame-visual::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: radial-gradient(ellipse at center, transparent 60%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

.frame-move-badge {
    position: absolute;
    bottom: 6px;
    right: 8px;
    font-size: 9px;
    font-weight: 600;
    background: rgba(226,201,126,0.2);
    color: #e2c97e;
    border: 1px solid rgba(226,201,126,0.3);
    padding: 1px 5px;
    border-radius: 2px;
    z-index: 1;
}

/* 帧信息区 */
.frame-info {
    padding: 7px 10px;
}
.frame-desc {
    font-size: 11px;
    color: #475569;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.frame-dialogue {
    font-size: 10px;
    color: #7c3aed;
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.frame-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 10px 6px;
    border-top: 1px solid #f0ede8;
}
.frame-dur {
    font-size: 10px;
    color: #3b82f6;
    font-weight: 600;
}
.frame-notes {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
}

/* ===== AI辅助侧边栏 ===== */
.ai-sidebar {
    position: fixed;
    top: 0; right: -380px;
    width: 360px;
    height: 100vh;
    background: #fff;
    z-index: 10010;
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
}
.ai-sidebar.visible { right: 0; }

.ai-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    color: #e2c97e;
    flex-shrink: 0;
    border-bottom: 2px solid #e2c97e;
}
.ai-sidebar-header h4 { margin: 0; font-size: 14px; }
.ai-close-btn {
    background: rgba(226,201,126,0.15);
    border: 1px solid rgba(226,201,126,0.3);
    color: #e2c97e;
    cursor: pointer;
    padding: 3px 9px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}
.ai-close-btn:hover { background: rgba(226,201,126,0.3); }

.ai-sidebar-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px;
}

.ai-form-group {
    margin-bottom: 12px;
}
.ai-form-group label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 5px;
}
.ai-form-group textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    font-size: 13px;
    color: #334155;
    background: #f8fafc;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
    font-family: inherit;
    max-height: 160px;
}
.ai-form-group textarea:focus { border-color: #e2c97e; background: #fff; }

.ai-form-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}
.ai-form-row .ai-form-group { flex: 1; min-width: 0; margin-bottom: 0; }

.ai-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.ai-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
}
.ai-btn-primary {
    background: linear-gradient(135deg, #e2c97e, #c9a84c);
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(226,201,126,0.35);
}
.ai-btn-primary:hover { background: linear-gradient(135deg, #f0d794, #e2c97e); }
.ai-btn-cancel {
    background: #fee2e2;
    color: #ef4444;
}
.ai-btn-cancel:hover { background: #fecaca; }

.ai-result-area {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 14px;
}
.ai-result-label {
    font-size: 11px;
    font-weight: 600;
    color: #94a3b8;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.ai-result-content {
    font-size: 12px;
    color: #334155;
    line-height: 1.6;
    max-height: 200px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    white-space: pre-wrap;
}
.ai-result-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
}
.ai-apply-btn,
.ai-copy-btn {
    padding: 5px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s;
}
.ai-apply-btn { background: linear-gradient(135deg, #e2c97e, #c9a84c); color: #1a1a2e; }
.ai-apply-btn:hover { background: linear-gradient(135deg, #f0d794, #e2c97e); }
.ai-copy-btn { background: #f1f5f9; color: #475569; }
.ai-copy-btn:hover { background: #e2e8f0; }

.ai-tips {
    background: #fef9ec;
    border-left: 3px solid #e2c97e;
    border-radius: 4px;
    padding: 10px 12px;
    font-size: 11px;
    color: #92400e;
}
.ai-tips p { margin: 0 0 5px; font-weight: 600; }
.ai-tips ul { margin: 0; padding-left: 16px; }
.ai-tips li { margin-bottom: 3px; line-height: 1.5; }

.ai-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.35);
    z-index: 10005;
    display: none;
    backdrop-filter: blur(2px);
}
.ai-overlay.visible { display: block; }

/* ===== 模态框 ===== */
.sb-modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10010;
    backdrop-filter: blur(3px);
}

.sb-modal {
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10020;
    width: 680px;
    max-width: 95vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.sb-modal-content {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    max-height: 80vh;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.sb-modal-content-sm { width: 460px; max-width: 95vw; }

.sb-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #0f3460 100%);
    color: #e2c97e;
    flex-shrink: 0;
    border-bottom: 2px solid #e2c97e;
}
.sb-modal-header h3 { margin: 0; font-size: 15px; }

.sb-modal-close {
    background: rgba(226,201,126,0.15);
    border: 1px solid rgba(226,201,126,0.3);
    color: #e2c97e;
    cursor: pointer;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    transition: all 0.2s;
}
.sb-modal-close:hover { background: rgba(226,201,126,0.3); }

.sb-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* 示例卡片网格 */
#exampleList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.example-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px;
    cursor: pointer;
    transition: all 0.2s;
    background: #fafaf8;
}
.example-card:hover {
    border-color: #e2c97e;
    background: #fef9ec;
    box-shadow: 0 3px 12px rgba(226,201,126,0.2);
    transform: translateY(-2px);
}

.example-card-icon { font-size: 24px; margin-bottom: 7px; }
.example-card-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 3px;
}
.example-card-desc {
    font-size: 11px;
    color: #64748b;
    line-height: 1.5;
}
.example-card-meta {
    margin-top: 7px;
    display: flex;
    gap: 5px;
}
.example-meta-tag {
    font-size: 10px;
    font-weight: 600;
    padding: 1px 7px;
    border-radius: 3px;
    background: #fef9ec;
    color: #c9a84c;
    border: 1px solid rgba(226,201,126,0.3);
}

/* 导出选项 */
.export-options {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.export-opt-btn {
    flex: 1;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #f8fafc;
    color: #334155;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}
.export-opt-btn:hover { border-color: #e2c97e; background: #fef9ec; color: #92400e; }
.export-preview {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    border-radius: 5px;
    padding: 10px;
    font-size: 11px;
    color: #475569;
    max-height: 200px;
    overflow-y: auto;
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    display: none;
}

/* ===== 挥抖验证动画 ===== */
@keyframes sb-shake {
    0%, 100% { transform: translateX(0); }
    10%, 50%, 90% { transform: translateX(-5px); }
    30%, 70% { transform: translateX(5px); }
}
.sb-shake {
    animation: sb-shake 0.5s ease-in-out;
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12) !important;
}

/* ===== Toast 轻提示 ===== */
.sb-toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    padding: 9px 22px;
    border-radius: 22px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: #1a1a2e;
    box-shadow: 0 4px 18px rgba(0,0,0,0.22);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.25s, transform 0.25s;
    pointer-events: none;
    white-space: nowrap;
}
.sb-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.sb-toast-success { background: linear-gradient(135deg, #166534, #15803d); }
.sb-toast-error   { background: linear-gradient(135deg, #991b1b, #dc2626); }
.sb-toast-warn    { background: linear-gradient(135deg, #92400e, #d97706); }
.sb-toast-info    { background: linear-gradient(135deg, #1e3a5f, #2563eb); }

/* ===== AI 加载指示器 ===== */
.ai-loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}
.ai-loading-dots {
    display: flex;
    gap: 5px;
}
.ai-loading-dots span {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: #e2c97e;
    animation: sb-dot-bounce 1.2s infinite ease-in-out;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes sb-dot-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}
.ai-loading-text {
    font-size: 12px;
    color: #94a3b8;
    animation: sb-blink 1.4s ease-in-out infinite;
}
@keyframes sb-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

/* ===== 预览列表模式（紧凑行） ===== */
.preview-grid.mode-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.preview-grid.mode-list .preview-frame {
    border-radius: 4px;
    overflow: hidden;
}
.preview-grid.mode-list .frame-visual {
    height: 36px;
    font-size: 16px;
}
.preview-grid.mode-list .frame-info {
    padding: 4px 8px;
}
.preview-grid.mode-list .frame-desc {
    font-size: 10px;
    -webkit-line-clamp: 1;
}
.preview-grid.mode-list .frame-dialogue { display: none; }

/* ===== 滚动条自定义（全部可滚动区域） ===== */
.history-list,
.sb-panels-list,
.sb-add-form,
.sb-preview-body,
.ai-sidebar-body,
.ai-result-content,
.sb-modal-body,
.export-preview {
    scrollbar-width: thin;
    scrollbar-color: #c9a84c #f0ede8;
}
.history-list::-webkit-scrollbar,
.sb-panels-list::-webkit-scrollbar,
.sb-add-form::-webkit-scrollbar,
.sb-preview-body::-webkit-scrollbar,
.ai-sidebar-body::-webkit-scrollbar,
.ai-result-content::-webkit-scrollbar,
.sb-modal-body::-webkit-scrollbar,
.export-preview::-webkit-scrollbar {
    width: 5px;
}
.history-list::-webkit-scrollbar-track,
.sb-panels-list::-webkit-scrollbar-track,
.sb-add-form::-webkit-scrollbar-track,
.sb-preview-body::-webkit-scrollbar-track,
.ai-sidebar-body::-webkit-scrollbar-track,
.ai-result-content::-webkit-scrollbar-track,
.sb-modal-body::-webkit-scrollbar-track,
.export-preview::-webkit-scrollbar-track {
    background: #f0ede8;
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb,
.sb-panels-list::-webkit-scrollbar-thumb,
.sb-add-form::-webkit-scrollbar-thumb,
.sb-preview-body::-webkit-scrollbar-thumb,
.ai-sidebar-body::-webkit-scrollbar-thumb,
.ai-result-content::-webkit-scrollbar-thumb,
.sb-modal-body::-webkit-scrollbar-thumb,
.export-preview::-webkit-scrollbar-thumb {
    background: #d4b96a;
    border-radius: 3px;
}
.history-list::-webkit-scrollbar-thumb:hover,
.sb-panels-list::-webkit-scrollbar-thumb:hover,
.sb-add-form::-webkit-scrollbar-thumb:hover,
.sb-preview-body::-webkit-scrollbar-thumb:hover,
.ai-sidebar-body::-webkit-scrollbar-thumb:hover,
.ai-result-content::-webkit-scrollbar-thumb:hover,
.sb-modal-body::-webkit-scrollbar-thumb:hover,
.export-preview::-webkit-scrollbar-thumb:hover {
    background: #c9a84c;
}

/* ===== 滚动条暗黑模式 ===== */
body.dark .history-list { scrollbar-color: #5a4a2a #161627; }
body.dark .sb-panels-list { scrollbar-color: #5a4a2a #13131f; }
body.dark .sb-add-form { scrollbar-color: #5a4a2a #1e1e34; }
body.dark .sb-preview-body { scrollbar-color: #5a4a2a #13131f; }
body.dark .ai-sidebar-body { scrollbar-color: #5a4a2a #1e1e34; }
body.dark .ai-result-content { scrollbar-color: #5a4a2a #252540; }
body.dark .sb-modal-body { scrollbar-color: #5a4a2a #1e1e34; }
body.dark .export-preview { scrollbar-color: #5a4a2a #252540; }
/* 各滚动區域暗黑轨道色需匹配各自容器背景色 */
body.dark .history-list::-webkit-scrollbar-track { background: #161627; }
body.dark .sb-panels-list::-webkit-scrollbar-track { background: #13131f; }
body.dark .sb-add-form::-webkit-scrollbar-track { background: #1e1e34; }
body.dark .sb-preview-body::-webkit-scrollbar-track { background: #13131f; }
body.dark .ai-sidebar-body::-webkit-scrollbar-track { background: #1e1e34; }
body.dark .ai-result-content::-webkit-scrollbar-track { background: #252540; }
body.dark .sb-modal-body::-webkit-scrollbar-track { background: #1e1e34; }
body.dark .export-preview::-webkit-scrollbar-track { background: #252540; }
body.dark .history-list::-webkit-scrollbar-thumb,
body.dark .sb-panels-list::-webkit-scrollbar-thumb,
body.dark .sb-add-form::-webkit-scrollbar-thumb,
body.dark .sb-preview-body::-webkit-scrollbar-thumb,
body.dark .ai-sidebar-body::-webkit-scrollbar-thumb,
body.dark .ai-result-content::-webkit-scrollbar-thumb,
body.dark .sb-modal-body::-webkit-scrollbar-thumb,
body.dark .export-preview::-webkit-scrollbar-thumb {
    background: #5a4a2a;
    border-radius: 3px;
}
body.dark .history-list::-webkit-scrollbar-thumb:hover,
body.dark .sb-panels-list::-webkit-scrollbar-thumb:hover,
body.dark .sb-add-form::-webkit-scrollbar-thumb:hover,
body.dark .sb-preview-body::-webkit-scrollbar-thumb:hover,
body.dark .ai-sidebar-body::-webkit-scrollbar-thumb:hover,
body.dark .ai-result-content::-webkit-scrollbar-thumb:hover,
body.dark .sb-modal-body::-webkit-scrollbar-thumb:hover,
body.dark .export-preview::-webkit-scrollbar-thumb:hover {
    background: #c9a84c;
}

/* 暗黑模式 AI 加载文字颜色 */
body.dark .ai-loading-text { color: #94a3b8; }
body.dark .ai-loading-dots span { background: #c9a84c; }

/* 暗黑 Toast */
body.dark .sb-toast { box-shadow: 0 4px 18px rgba(0,0,0,0.5); }

/* ===== 进度条（加载中） ===== */
.sb-progress {
    height: 3px;
    background: linear-gradient(90deg, #e2c97e, #c9a84c, #e2c97e);
    background-size: 200% 100%;
    animation: sb-progress-move 1.5s linear infinite;
    border-radius: 2px;
    margin-top: 8px;
}
@keyframes sb-progress-move {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.sb-progress.done {
    background: linear-gradient(90deg, #4ade80, #22d3ee);
    animation: sb-progress-pulse 0.5s ease 2;
}
@keyframes sb-progress-pulse {
    0%, 100% { filter: brightness(1); }
    50%       { filter: brightness(1.4); }
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .sb-preview-panel { display: none; }
    .sb-history-panel { width: 160px; }
}

@media (max-width: 600px) {
    .sb-history-panel { display: none; }
    .form-row-3, .form-row-2 { flex-direction: column; }
    #exampleList { grid-template-columns: 1fr; }
    .sb-modal { width: 96vw; }
    .ai-sidebar { width: 96vw; right: -100vw; }
}

/* ============================================================
   暗黑模式 - 全部以 body.dark 作为 CSS 父级选择器前缀
   ============================================================ */

body.dark .sb-container { background: #1a1a2e; box-shadow: 0 2px 16px rgba(0,0,0,0.4); }

/* 工具栏 */
body.dark .sb-toolbar {
    background: linear-gradient(135deg, #0d0d1a 0%, #0a1020 50%, #071833 100%);
    border-bottom-color: #c9a84c;
}
body.dark .toolbar-btn {
    background: rgba(226,201,126,0.08);
    border-color: rgba(226,201,126,0.2);
    color: #c9a84c;
}
body.dark .toolbar-btn:hover:not(:disabled) {
    background: rgba(226,201,126,0.18);
    border-color: #c9a84c;
}
body.dark .toolbar-btn-add {
    background: linear-gradient(135deg, #c9a84c, #a07828);
    color: #0d0d1a;
    border-color: #a07828;
}
body.dark .toolbar-btn-ai {
    background: rgba(139,92,246,0.15);
    border-color: rgba(139,92,246,0.4);
    color: #a78bfa;
}

/* 历史面板 */
body.dark .sb-history-panel { background: #161627; border-right-color: #2a2a3e; }
body.dark .history-panel-header {
    background: linear-gradient(to bottom, #1e1e34, #1a1a2e);
    border-bottom-color: #2a2a3e;
    border-left-color: #c9a84c;
}
body.dark .history-panel-header h3 { color: #a0aec0; }
body.dark .history-search input {
    background: #1e1e34;
    border-color: #2a2a3e;
    color: #cbd5e1;
}
body.dark .history-search input:focus { border-color: #c9a84c; background: #25253d; }
body.dark .history-search input::placeholder { color: #4a5568; }
body.dark .history-item { border-bottom-color: #252540; }
body.dark .history-item:hover { background: #1f1f34; }
body.dark .history-item.active { background: #1f1f34; border-left-color: #c9a84c; }
body.dark .history-item-title { color: #cbd5e1; }
body.dark .history-empty { color: #4a5568; }
body.dark .history-clear-btn { background: rgba(239,68,68,0.1); color: #ef4444; }
body.dark .history-clear-btn:hover { background: rgba(239,68,68,0.2); }
body.dark .history-del-btn:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
body.dark .history-item-meta { color: #4a5568; }

/* 编辑区 */
body.dark .sb-editor-panel { background: #13131f; border-right-color: #2a2a3e; }
body.dark .project-info-bar {
    background: linear-gradient(to right, #0d0d1a, #0a1020);
    border-bottom-color: #c9a84c;
}
body.dark .project-title-input,
body.dark .project-theme-input {
    background: rgba(255,255,255,0.05);
    border-color: rgba(226,201,126,0.2);
    color: #c9a84c;
}
body.dark .project-title-input::placeholder,
body.dark .project-theme-input::placeholder { color: rgba(226,201,126,0.3); }
body.dark .project-title-input:focus,
body.dark .project-theme-input:focus {
    border-color: #c9a84c;
    background: rgba(255,255,255,0.08);
}
body.dark .panel-count-badge { background: rgba(226,201,126,0.1); color: #c9a84c; border-color: rgba(226,201,126,0.2); }
body.dark .total-duration-badge { background: rgba(139,92,246,0.12); color: #a78bfa; border-color: rgba(139,92,246,0.25); }

/* 分镜帧列表 */
body.dark .sb-panels-list { background: #13131f; }
body.dark .panels-empty { color: #4a5568; }
body.dark .panels-empty-tip,
body.dark .preview-placeholder-tip,
body.dark .placeholder-desc { color: #4b5563; }
body.dark .panel-card {
    background: #1e1e34;
    border-color: #2a2a3e;
}
body.dark .panel-card:hover { border-color: #c9a84c; box-shadow: 0 2px 10px rgba(0,0,0,0.4); }
body.dark .panel-card-num { background: linear-gradient(135deg, #0d0d1a, #071833); }
body.dark .panel-card-desc { color: #a0aec0; }
body.dark .panel-tag { background: #252540; color: #718096; }
body.dark .panel-tag.shot-tag { background: #2a2415; color: #c9a84c; }
body.dark .panel-tag.move-tag { background: #0d2018; color: #4ade80; }
body.dark .panel-tag.dur-tag  { background: #0d1a30; color: #60a5fa; }
body.dark .panel-action-btn { color: #4a5568; }
body.dark .panel-action-btn:hover { background: #252540; color: #a0aec0; }
body.dark .panel-action-btn.del-btn:hover { background: rgba(239,68,68,0.15); color: #ef4444; }
body.dark .panel-card-dialogue { color: #a78bfa; }

/* 表单 */
body.dark .sb-add-form { background: #1e1e34; border-top-color: #c9a84c; }
body.dark .add-form-header { background: linear-gradient(to right, #252540, #1e1e34); border-bottom-color: #2a2a3e; }
body.dark .add-form-title { color: #c9a84c; }
body.dark .form-group label { color: #94a3b8; }
body.dark .label-tip { color: #4a5568; }
body.dark .sb-select,
body.dark .sb-input { background: #252540; border-color: #2a2a3e; color: #cbd5e1; }
body.dark .sb-select:focus,
body.dark .sb-input:focus { border-color: #c9a84c; background: #2a2a50; }
body.dark .sb-select option { background: #252540; color: #cbd5e1; }
body.dark .sb-textarea { background: #252540; border-color: #2a2a3e; color: #cbd5e1; }
body.dark .sb-textarea:focus { border-color: #c9a84c; background: #2a2a50; }
body.dark .sb-textarea::placeholder { color: #4a5568; }
body.dark .sb-input::placeholder { color: #4a5568; }
body.dark .char-count { color: #4a5568; }
body.dark .action-btn-cancel { background: #252540; color: #718096; }
body.dark .action-btn-cancel:hover { background: #2a2a50; }
body.dark .shortcut-hint { color: #4a5568; }

/* 预览面板 */
body.dark .sb-preview-panel { background: #13131f; border-left-color: #2a2a3e; }
body.dark .preview-panel-header { background: linear-gradient(to bottom, #1a1a2e, #161627); border-bottom-color: #2a2a3e; }
body.dark .preview-panel-header h3 { color: #94a3b8; }
body.dark .preview-ctrl-btn { background: #1e1e34; border-color: #2a2a3e; color: #718096; }
body.dark .preview-ctrl-btn:hover { border-color: #c9a84c; color: #c9a84c; }
body.dark .preview-placeholder { color: #4a5568; }
body.dark .preview-frame { background: #1e1e34; border-color: #2a2a3e; }
body.dark .preview-frame.editing {
    border-color: #c9a84c;
    box-shadow: 0 0 0 3px rgba(201,168,76,0.25), 0 2px 8px rgba(0,0,0,0.4);
}
body.dark .frame-desc { color: #a0aec0; }
body.dark .frame-notes { color: #4a5568; }
body.dark .frame-footer { border-top-color: #252540; }
body.dark .frame-dialogue { color: #a78bfa; }

/* AI侧边栏 */
body.dark .ai-sidebar { background: #1e1e34; }
body.dark .ai-sidebar-header {
    background: linear-gradient(135deg, #0d0d1a, #071833);
    border-bottom-color: #c9a84c;
}
body.dark .ai-form-group label { color: #94a3b8; }
body.dark .ai-form-group textarea {
    background: #252540;
    border-color: #2a2a3e;
    color: #cbd5e1;
}
body.dark .ai-form-group textarea:focus { border-color: #c9a84c; background: #2a2a50; }
body.dark .ai-form-group textarea::placeholder { color: #4a5568; }
body.dark .ai-result-area { background: #252540; border-color: #2a2a3e; }
body.dark .ai-result-label { color: #4a5568; }
body.dark .ai-result-content { color: #a0aec0; }
body.dark .ai-copy-btn { background: #252540; color: #718096; }
body.dark .ai-copy-btn:hover { background: #2a2a50; }
body.dark .ai-tips { background: rgba(226,201,126,0.06); border-left-color: #c9a84c; color: #a07828; }

/* 模态框 */
body.dark .sb-modal-content { background: #1e1e34; }
body.dark .sb-modal-body { background: #1e1e34; }
body.dark .example-card { background: #252540; border-color: #2a2a3e; }
body.dark .example-card:hover { border-color: #c9a84c; background: #2a2a50; }
body.dark .example-card-title { color: #c9a84c; }
body.dark .example-card-desc { color: #718096; }
body.dark .example-meta-tag { background: rgba(226,201,126,0.08); color: #c9a84c; border-color: rgba(226,201,126,0.2); }
body.dark .export-opt-btn { background: #252540; border-color: #2a2a3e; color: #a0aec0; }
body.dark .export-opt-btn:hover { border-color: #c9a84c; background: #2a2a50; color: #c9a84c; }
body.dark .export-preview { background: #252540; border-color: #2a2a3e; color: #a0aec0; }

/* 错误重试按钮暗黑模式规范 */
body.dark .result-error-retry {
    background: linear-gradient(135deg, #3a1a00, #5a2d00);
    color: #e2c97e;
    border-color: rgba(226,201,126,0.3);
}
body.dark .result-error-retry:hover {
    background: linear-gradient(135deg, #5a2d00, #7a3d00);
}
