/* =============================================
   电商直播话术生成工具 - 主样式
   主题色：橙红 #f97316 / 直播红 #ef4444
   ============================================= */

/* ========== 容器 ========== */
.els-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 620px;
    background: #fef9f5;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.3s ease;
}

.els-container.fullscreen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999;
    border-radius: 0;
    margin: 0;
}

/* ========== 顶部工具栏 ========== */
.els-toolbar {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: white;
    flex-wrap: wrap;
    gap: 8px;
    box-shadow: 0 2px 8px rgba(249, 115, 22, 0.3);
    flex-shrink: 0;
    min-height: 44px;
}

.toolbar-group {
    display: flex;
    gap: 5px;
    align-items: center;
}

.toolbar-group--right {
    margin-left: auto;
}

.els-toolbar-btn {
    padding: 5px 10px;
    background: rgba(255, 255, 255, 0.92);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    color: #c2410c;
    transition: all 0.2s;
    white-space: nowrap;
    line-height: 1.5;
}

.els-toolbar-btn:hover {
    background: #fff;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.els-toolbar-btn:active {
    transform: translateY(0);
    box-shadow: none;
}

/* AI生成按钮 - 绿色强调 */
.els-toolbar-btn--ai {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    font-weight: 600;
    padding: 5px 14px;
    box-shadow: 0 2px 6px rgba(16, 185, 129, 0.4);
}

.els-toolbar-btn--ai:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    color: white;
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.45);
}

/* ========== 主内容区 ========== */
.els-main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    background: #fef9f5;
}

/* ========== 左侧历史面板 ========== */
.els-history-panel {
    width: 200px;
    min-width: 160px;
    background: white;
    border-right: 1px solid #fed7aa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex-shrink: 0;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: linear-gradient(to bottom, #fff7ed, #fef3e2);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.history-clear-btn {
    background: #fff0f0;
    border: none;
    color: #ef4444;
    font-size: 11px;
    cursor: pointer;
    padding: 2px 7px;
    border-radius: 3px;
    transition: all 0.2s;
}

.history-clear-btn:hover {
    background: #fde8e8;
    color: #dc2626;
}

.history-search {
    padding: 8px;
    border-bottom: 1px solid #fef3e2;
    flex-shrink: 0;
}

.history-search input {
    width: 100%;
    padding: 5px 9px;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: all 0.2s;
    box-sizing: border-box;
    color: #334155;
}

.history-search input:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.1);
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 6px;
}

.history-empty {
    text-align: center;
    color: #94a3b8;
    font-size: 12px;
    padding: 28px 12px;
    line-height: 1.6;
}

.history-empty-icon { font-size: 28px; margin-bottom: 8px; }
.history-empty-sub  { font-size: 11px; color: #94a3b8; margin-top: 4px; }

.history-item {
    padding: 9px 10px;
    margin-bottom: 5px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.18s;
    position: relative;
    animation: elsItemFadeIn 0.2s ease;
}

@keyframes elsItemFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.history-item:hover {
    background: #ffedd5;
    border-color: #fb923c;
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.15);
}

.history-item.active {
    background: #fff7ed;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.history-item-title {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.history-item-meta {
    font-size: 11px;
    color: #a16207;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-scene {
    background: #ffedd5;
    color: #c2410c;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

.history-item-delete {
    position: absolute;
    top: 5px;
    right: 5px;
    background: none;
    border: none;
    color: #cbd5e1;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 3px;
    opacity: 0;
    transition: all 0.15s;
    line-height: 1;
}

.history-item:hover .history-item-delete {
    opacity: 1;
    color: #ef4444;
}

/* ========== 中间编辑面板 ========== */
.els-editor-panel {
    flex: 0 0 360px;
    background: white;
    border-right: 1px solid #fed7aa;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.editor-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #fff7ed, #fef3e2);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.editor-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.editor-panel-meta {
    font-size: 11px;
    color: #a16207;
    background: #ffedd5;
    padding: 2px 8px;
    border-radius: 10px;
    transition: all 0.25s;
}

/* ========== 表单样式 ========== */
.els-form {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.els-form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.els-form-row {
    display: flex;
    gap: 10px;
}

.els-form-group--half {
    flex: 1;
    min-width: 0;
}

.els-label {
    font-size: 12px;
    font-weight: 600;
    color: #78350f;
    display: flex;
    align-items: center;
    gap: 4px;
}

.els-label-hint {
    font-size: 11px;
    font-weight: 400;
    color: #a16207;
}

.required-mark {
    color: #ef4444;
    font-weight: 700;
}

.els-input,
.els-select,
.els-textarea {
    padding: 7px 10px;
    border: 1px solid #fed7aa;
    border-radius: 5px;
    font-size: 13px;
    color: #1e293b;
    background: #fffbf7;
    outline: none;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
    font-family: inherit;
}

.els-input:focus,
.els-select:focus,
.els-textarea:focus {
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.12);
    background: #fff;
}

.els-textarea {
    resize: vertical;
    min-height: 70px;
    line-height: 1.6;
}

.els-char-counter {
    text-align: right;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    transition: color 0.2s;
}

.els-char-counter.warn  { color: #f97316; }
.els-char-counter.limit { color: #ef4444; font-weight: 700; }

/* ========== 复选框组 ========== */
.els-checkbox-quick {
    display: flex;
    gap: 6px;
    align-items: center;
    font-size: 11px;
    color: #a16207;
    margin-bottom: 6px;
}

.els-checkbox-quick-btn {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #c2410c;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.els-checkbox-quick-btn:hover {
    background: #ffedd5;
    border-color: #fb923c;
}

.els-checkbox-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}

.els-checkbox-item {
    display: flex;
    align-items: center;
    gap: 7px;
    cursor: pointer;
    font-size: 12px;
    color: #374151;
    padding: 5px 8px;
    border-radius: 5px;
    border: 1px solid #fde8c4;
    background: #fffbf7;
    transition: all 0.15s;
    user-select: none;
}

.els-checkbox-item:hover {
    background: #fff7ed;
    border-color: #fb923c;
    color: #c2410c;
}

.els-checkbox-item input[type="checkbox"] {
    display: none;
}

.els-checkbox-mark {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid #fed7aa;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s;
}

.els-checkbox-item input[type="checkbox"]:checked + .els-checkbox-mark {
    background: #f97316;
    border-color: #f97316;
}

.els-checkbox-item input[type="checkbox"]:checked + .els-checkbox-mark::after {
    content: '';
    width: 9px;
    height: 5px;
    border-left: 2px solid white;
    border-bottom: 2px solid white;
    transform: rotate(-45deg) translateY(-1px);
    display: block;
}

/* ========== 表单操作按钮 ========== */
.els-form-actions {
    display: flex;
    gap: 10px;
    padding-top: 4px;
}

.els-btn {
    padding: 9px 18px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    flex: 1;
    justify-content: center;
}

.els-btn--primary {
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: white;
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.35);
}

.els-btn--primary:hover {
    background: linear-gradient(135deg, #ea6c10 0%, #dc2626 100%);
    box-shadow: 0 4px 14px rgba(249, 115, 22, 0.45);
    transform: translateY(-1px);
}

.els-btn--primary:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.els-btn--primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.els-btn--secondary {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}

.els-btn--secondary:hover {
    background: #e2e8f0;
    color: #475569;
}

/* ========== 右侧预览面板 ========== */
.els-preview-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

.preview-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(to bottom, #fff7ed, #fef3e2);
    border-bottom: 1px solid #fed7aa;
    flex-shrink: 0;
}

.preview-panel-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #92400e;
}

.preview-panel-actions {
    display: flex;
    gap: 8px;
}

.preview-action-btn {
    padding: 4px 10px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 4px;
    font-size: 12px;
    color: #c2410c;
    cursor: pointer;
    transition: all 0.15s;
    font-weight: 500;
}

.preview-action-btn:hover {
    background: #ffedd5;
    border-color: #fb923c;
    box-shadow: 0 2px 5px rgba(249, 115, 22, 0.15);
}

.preview-content {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #94a3b8;
    text-align: center;
    padding: 40px 20px;
}

.preview-empty-icon {
    font-size: 48px;
    margin-bottom: 14px;
    opacity: 0.7;
}

.preview-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
}

.preview-empty-hint {
    font-size: 13px;
    color: #94a3b8;
    line-height: 1.7;
}

/* ========== 话术卡片 ========== */
.script-section {
    background: white;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    overflow: hidden;
    animation: elsSectionIn 0.3s ease;
}

/* 话术段落左侧色条区分 */
.script-section[data-section="opening"]   { border-left: 3px solid #f97316; }
.script-section[data-section="pitch"]     { border-left: 3px solid #ef4444; }
.script-section[data-section="price"]     { border-left: 3px solid #f59e0b; }
.script-section[data-section="urgency"]   { border-left: 3px solid #ec4899; }
.script-section[data-section="interact"]  { border-left: 3px solid #06b6d4; }
.script-section[data-section="orderPush"] { border-left: 3px solid #8b5cf6; }
.script-section[data-section="closing"]   { border-left: 3px solid #10b981; }

@keyframes elsSectionIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.script-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px;
    background: linear-gradient(to right, #fff7ed, #fef3e2);
    border-bottom: 1px solid #fde8c4;
    cursor: pointer;
}

.script-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.script-section-count {
    font-size: 11px;
    color: #a16207;
    background: #ffedd5;
    padding: 1px 7px;
    border-radius: 10px;
}

.script-section-body {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.script-item {
    padding: 10px 12px;
    background: #fffbf7;
    border: 1px solid #fde8c4;
    border-radius: 6px;
    position: relative;
    transition: border-color 0.15s;
}

.script-item:hover {
    border-color: #fb923c;
}

.script-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.script-label {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.script-label--primary {
    background: linear-gradient(135deg, #f97316, #ef4444);
    color: white;
}

.script-label--alt {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

.script-label--scene {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.script-copy-btn {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s;
}

.script-copy-btn:hover {
    background: #fff7ed;
    border-color: #fed7aa;
    color: #c2410c;
}

.script-copy-btn.copied {
    background: #d1fae5;
    border-color: #a7f3d0;
    color: #059669;
}

.script-text {
    font-size: 13px;
    color: #1e293b;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ========== 加载遮罩 ========== */
.preview-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 251, 247, 0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    backdrop-filter: blur(3px);
}

.loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #fed7aa;
    border-top-color: #f97316;
    border-radius: 50%;
    animation: elsSpinnerRotate 0.8s linear infinite;
}

@keyframes elsSpinnerRotate {
    to { transform: rotate(360deg); }
}

.loading-title {
    font-size: 15px;
    font-weight: 600;
    color: #92400e;
}

.loading-hint {
    font-size: 12px;
    color: #a16207;
    text-align: center;
    max-width: 240px;
    line-height: 1.5;
}

.cancel-generate-btn {
    padding: 7px 20px;
    background: #fff;
    border: 1px solid #fca5a5;
    color: #ef4444;
    border-radius: 5px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 6px;
}

.cancel-generate-btn:hover {
    background: #fef2f2;
    border-color: #f87171;
}

/* ========== Toast 通知 ========== */
.els-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 10000;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.els-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.els-toast.toast-success { background: #059669; }
.els-toast.toast-error   { background: #dc2626; }
.els-toast.toast-info    { background: #0369a1; }
.els-toast.toast-warning { background: #d97706; }

/* ========== 弹框 ========== */
.els-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.els-modal.open {
    display: flex;
}

.els-modal-content {
    background: white;
    border-radius: 12px;
    width: 600px;
    max-width: 94vw;
    max-height: 82vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: elsModalIn 0.2s ease;
}

@keyframes elsModalIn {
    from { opacity: 0; transform: scale(0.95); }
    to   { opacity: 1; transform: scale(1); }
}

.els-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f97316 0%, #ef4444 100%);
    color: white;
}

.els-modal-header h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.els-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.els-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
}

.els-modal-body {
    padding: 18px 20px;
    overflow-y: auto;
}

.template-modal-hint {
    font-size: 13px;
    color: #64748b;
    margin: 0 0 14px;
}

.template-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.template-card {
    padding: 13px 14px;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s;
    background: #fffbf7;
}

.template-card:hover {
    background: #fff7ed;
    border-color: #fb923c;
    box-shadow: 0 3px 10px rgba(249, 115, 22, 0.15);
    transform: translateY(-1px);
}

.template-card-icon {
    font-size: 22px;
    margin-bottom: 6px;
}

.template-card-name {
    font-size: 13px;
    font-weight: 700;
    color: #92400e;
    margin-bottom: 3px;
}

.template-card-desc {
    font-size: 12px;
    color: #a16207;
}

/* ========== 暗色主题 ========== */
.els-container.dark {
    background: #1e1b18;
}

.els-container.dark .els-toolbar {
    background: linear-gradient(135deg, #9a3412 0%, #991b1b 100%);
}

.els-container.dark .els-main-content {
    background: #1e1b18;
}

.els-container.dark .els-history-panel,
.els-container.dark .els-editor-panel {
    background: #28211c;
    border-color: #44322a;
}

.els-container.dark .panel-header,
.els-container.dark .editor-panel-header,
.els-container.dark .preview-panel-header {
    background: linear-gradient(to bottom, #33271e, #2a2118);
    border-color: #44322a;
}

.els-container.dark .panel-header h3,
.els-container.dark .editor-panel-title,
.els-container.dark .editor-panel-meta,
.els-container.dark .preview-panel-header h3 {
    color: #fdba74;
}

.els-container.dark .history-search input {
    background: #33271e;
    border-color: #44322a;
    color: #e2e8f0;
}

.els-container.dark .history-item {
    background: #33271e;
    border-color: #44322a;
}

.els-container.dark .history-item:hover,
.els-container.dark .history-item.active {
    background: #3d2d21;
    border-color: #f97316;
}

.els-container.dark .history-item-title {
    color: #fdba74;
}

.els-container.dark .els-label {
    color: #fdba74;
}

.els-container.dark .els-input,
.els-container.dark .els-select,
.els-container.dark .els-textarea {
    background: #33271e;
    border-color: #44322a;
    color: #f1f5f9;
}

.els-container.dark .els-input:focus,
.els-container.dark .els-select:focus,
.els-container.dark .els-textarea:focus {
    border-color: #f97316;
    background: #3d2d21;
}

.els-container.dark .els-checkbox-item {
    background: #33271e;
    border-color: #44322a;
    color: #cbd5e1;
}

.els-container.dark .els-checkbox-item:hover {
    background: #3d2d21;
    border-color: #f97316;
    color: #fdba74;
}

.els-container.dark .els-checkbox-mark {
    background: #28211c;
    border-color: #44322a;
}

.els-container.dark .preview-loading {
    background: rgba(30, 27, 24, 0.92);
}

.els-container.dark .preview-content {
    background: #1e1b18;
}

.els-container.dark .script-section {
    background: #28211c;
    border-color: #44322a;
}

.els-container.dark .script-section-header {
    background: linear-gradient(to right, #33271e, #2a2118);
    border-color: #44322a;
}

.els-container.dark .script-section-title {
    color: #fdba74;
}

.els-container.dark .script-item {
    background: #33271e;
    border-color: #44322a;
}

.els-container.dark .script-item:hover {
    border-color: #fb923c;
}

.els-container.dark .script-text {
    color: #e2e8f0;
}

/* ========== 响应式适配 ========== */
@media (max-width: 900px) {
    .els-history-panel {
        display: none;
    }

    .els-editor-panel {
        flex: 0 0 320px;
    }
}

@media (max-width: 680px) {
    .els-editor-panel {
        flex: 0 0 100%;
    }

    .els-preview-panel {
        display: none;
    }

    .els-form-row {
        flex-direction: column;
    }

    .els-checkbox-group {
        grid-template-columns: 1fr;
    }
}

/* ========== 快捷键提示行 ========== */
.els-shortcut-tip {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    padding: 4px 0 2px;
    letter-spacing: 0.2px;
}

/* ========== 元信息栏无标题警告 ========== */
.editor-panel-meta.unsaved-warn {
    background: #fef3c7;
    color: #b45309;
    border: 1px solid #fde68a;
}

/* ========== 骨架占位符 ========== */
.els-skeleton-block {
    background: linear-gradient(90deg, #fde8c4 25%, #ffedd5 50%, #fde8c4 75%);
    background-size: 200% 100%;
    animation: elsSkeleton 1.4s ease infinite;
    border-radius: 4px;
    height: 14px;
    margin-bottom: 8px;
}

@keyframes elsSkeleton {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.els-skeleton-item {
    padding: 12px;
    border: 1px solid #fde8c4;
    border-radius: 6px;
    margin-bottom: 8px;
    background: white;
}

.els-skeleton-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.els-skeleton-badge   { width: 48px; height: 20px; border-radius: 10px; }
.els-skeleton-line-lg { width: 100%; }
.els-skeleton-line-md { width: 72%; }
.els-skeleton-line-sm { width: 45%; }

/* ========== 自定义滚动条 ========== */
.history-list::-webkit-scrollbar,
.els-form::-webkit-scrollbar,
.preview-content::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track,
.els-form::-webkit-scrollbar-track,
.preview-content::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb,
.els-form::-webkit-scrollbar-thumb,
.preview-content::-webkit-scrollbar-thumb {
    background: #fcd9b0;
    border-radius: 2px;
}

.history-list::-webkit-scrollbar-thumb:hover,
.els-form::-webkit-scrollbar-thumb:hover,
.preview-content::-webkit-scrollbar-thumb:hover {
    background: #fb923c;
}

/* ========== 话术段落标题右侧控件 ========== */
.script-section-header-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.script-section-toggle {
    font-size: 11px;
    color: #a16207;
    margin-left: 2px;
    transition: transform 0.18s ease;
    display: inline-block;
    line-height: 1;
}

.script-section-header.collapsed .script-section-toggle {
    transform: rotate(-90deg);
}

/* ========== 话术条目操作区 ========== */
.script-item-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.script-char-count {
    font-size: 10px;
    color: #94a3b8;
    white-space: nowrap;
}

/* ========== 话术文本点击复制 ========== */
.script-text--clickable {
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.script-text--clickable:hover {
    background: #fff7ed;
}

/* ========== 暗色模式补充 ========== */
.els-container.dark .history-search {
    border-bottom-color: #44322a;
}

.els-container.dark .els-skeleton-item {
    background: #28211c;
    border-color: #44322a;
}

.els-container.dark .els-skeleton-block {
    background: linear-gradient(90deg, #33271e 25%, #3d2d21 50%, #33271e 75%);
    background-size: 200% 100%;
    animation: elsSkeleton 1.4s ease infinite;
}

.els-container.dark .editor-panel-meta.unsaved-warn {
    background: #422006;
    color: #fbbf24;
    border-color: #78350f;
}

.els-container.dark .els-shortcut-tip {
    color: #475569;
}

.els-container.dark .script-text--clickable:hover {
    background: #3d2d21;
}

.els-container.dark .script-char-count {
    color: #64748b;
}

/* ========== 折叠段落边框优化 ========== */
.script-section-header.collapsed {
    border-bottom-color: transparent;
}

/* ========== 暗色模式补充（第二批） ========== */
.els-container.dark .history-item-meta {
    color: #a8805a;
}

.els-container.dark .history-item-scene {
    background: #44322a;
    color: #fdba74;
}

.els-container.dark .editor-panel-meta {
    background: #44322a;
    color: #fdba74;
}

.els-container.dark .script-section-count {
    background: #44322a;
    color: #fdba74;
}

.els-container.dark .script-copy-btn {
    background: #2a2118;
    border-color: #44322a;
    color: #a8805a;
}

.els-container.dark .script-copy-btn:hover {
    background: #33271e;
    border-color: #f97316;
    color: #fdba74;
}

.els-container.dark .script-copy-btn.copied {
    background: #052e16;
    border-color: #166534;
    color: #86efac;
}

.els-container.dark .preview-action-btn {
    background: #33271e;
    border-color: #44322a;
    color: #fdba74;
}

.els-container.dark .preview-action-btn:hover {
    background: #3d2d21;
    border-color: #f97316;
    box-shadow: 0 2px 5px rgba(249, 115, 22, 0.15);
}

.els-container.dark .els-btn--secondary {
    background: #33271e;
    border-color: #44322a;
    color: #a8805a;
}

.els-container.dark .els-btn--secondary:hover {
    background: #3d2d21;
    color: #fdba74;
}

.els-container.dark .script-section-toggle {
    color: #a8805a;
}
