/* ============================================================
   音频文稿剪辑工具 - 完整样式
   ============================================================ */
:root {
    --bg: #f8fafc;
    --bg-white: #ffffff;
    --text: #0f172a;
    --text-secondary: #64748b;
    --border: #e2e8f0;
    --primary: #2563eb;
    --primary-hover: #1d4ed8;
    --danger: #dc2626;
    --danger-hover: #b91c1c;
    --success: #16a34a;
    --download-blue: #0ea5e9;
    --download-blue-hover: #0284c7;
    --deleted-bg: #fef2f2;
    --deleted-text: #dc2626;
    --highlight-bg: #dbeafe;
    --correct-bg: #fefce8;
    --correct-border: #facc15;
    --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.06);
    --radius: 8px;
    --radius-sm: 6px;
}
* { margin:0; padding:0; box-sizing:border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg); color: var(--text);
    height: 100vh; display: flex; flex-direction: column; overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ==================== 工具栏 ==================== */
.toolbar { display:flex; align-items:center; justify-content:space-between; padding:0 16px; height:44px; background:var(--bg-white); border-bottom:1px solid var(--border); flex-shrink:0; z-index:10; gap:8px; }
.toolbar-left { display:flex; align-items:center; gap:14px; }
.app-title { font-size:14px; font-weight:700; white-space:nowrap; letter-spacing:-0.01em; display:flex; align-items:center; gap:6px; color:var(--text); }
.app-title svg { color: var(--primary); }
.tab-nav { display:flex; gap:1px; background:#f1f5f9; border-radius:var(--radius-sm); padding:2px; }
.tab-btn { display:inline-flex; align-items:center; gap:5px; padding:4px 11px; border:none; background:none; border-radius:4px; cursor:pointer; font-size:12px; font-weight:500; color:var(--text-secondary); transition:all .15s; }
.tab-btn:hover { color:var(--text); background:rgba(255,255,255,0.7); }
.tab-btn.active { background:#fff; color:var(--text); box-shadow:0 1px 3px rgba(0,0,0,0.1); }
.tab-btn svg { flex-shrink:0; }
.toolbar-center { display:flex; align-items:center; gap:4px; }
.toolbar-right { display:flex; align-items:center; gap:4px; }
.tb-btn { display:inline-flex; align-items:center; gap:4px; padding:4px 10px; border:1px solid var(--border); background:var(--bg-white); border-radius:var(--radius-sm); cursor:pointer; font-size:12px; color:var(--text); transition:all .15s; white-space:nowrap; font-weight:500; }
.tb-btn:hover:not(:disabled) { background:#f8fafc; border-color:#cbd5e1; }
.tb-btn:disabled { opacity:.4; cursor:not-allowed; }
.tb-btn-ai { background:#fefce8; border-color:#facc15; color:#854d0e; }
.tb-btn-ai:hover:not(:disabled) { background:#fef08a; }
.btn-sm { padding:3px 8px; font-size:11px; }
.separator { width:1px; height:18px; background:var(--border); margin:0 4px; }
.stats-text { font-size:12px; color:var(--text-secondary); padding:0 6px; }

/* ==================== Tab内容 ==================== */
.tab-content { display:none !important; }
.tab-content.active { display:flex !important; }
.main-area { flex:1; overflow:hidden; display:flex; flex-direction:row; }

/* ==================== 编辑器 ==================== */
.editor-panel { flex:1; display:flex; flex-direction:row; overflow:hidden; }
.upload-icon { display:flex; align-items:center; justify-content:center; width:72px; height:72px; border-radius:16px; background:#eff6ff; color:var(--primary); margin-bottom:16px; }
.upload-icon svg { width:36px; height:36px; }
.upload-row { margin-bottom:10px; width:100%; max-width:400px; }
.file-label { display:flex; align-items:center; gap:10px; cursor:pointer; }
.file-btn { display:inline-flex; align-items:center; gap:5px; padding:7px 14px; background:var(--bg-white); border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13px; transition:all .15s; white-space:nowrap; font-weight:500; }
.file-btn:hover { background:#f0f0f0; }
.file-name { color:var(--text-secondary); font-size:12px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }

.upload-divider { display:flex; align-items:center; width:100%; max-width:400px; margin:10px 0 6px; gap:12px; }
.upload-divider::before, .upload-divider::after { content:''; flex:1; height:1px; background:var(--border); }
.upload-divider span { font-size:12px; color:var(--text-secondary); white-space:nowrap; }

.btn-primary { display:inline-flex; align-items:center; gap:6px; padding:8px 20px; background:var(--primary); color:#fff; border:none; border-radius:var(--radius); font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; }
.btn-primary:hover:not(:disabled) { background:var(--primary-hover); }
.btn-primary:disabled { opacity:.5; cursor:not-allowed; }
.btn-large { padding:10px 28px; font-size:15px; margin-top:14px; }
.btn-block { width:100%; justify-content:center; margin-bottom:6px; }
.btn-secondary { padding:6px 14px; background:var(--bg-white); border:1px solid var(--border); border-radius:var(--radius-sm); cursor:pointer; font-size:13px; }
.btn-secondary:hover { background:#f0f0f0; }
.btn-danger { padding:6px 14px; background:var(--danger); color:#fff; border:none; border-radius:var(--radius-sm); cursor:pointer; font-size:13px; }
.btn-danger:hover { background:var(--danger-hover); }
.btn-download { display:inline-flex; align-items:center; gap:6px; padding:8px 20px; background:var(--download-blue); color:#fff; border:none; border-radius:var(--radius); font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; }
.btn-download:hover { background:var(--download-blue-hover); }
.btn-stop-cut { align-items:center; gap:6px; padding:8px 20px; background:var(--danger); color:#fff; border:none; border-radius:var(--radius); font-size:14px; font-weight:600; cursor:pointer; transition:all .15s; animation:stopPulse 1.2s infinite; }
.btn-stop-cut:hover { background:var(--danger-hover); animation:none; }

.progress-bar { width:100%; height:5px; background:#e5e5e5; border-radius:3px; overflow:hidden; margin:6px 0; }
.progress-fill { height:100%; background:var(--primary); border-radius:3px; width:0%; transition:width .3s; }
.progress-fill.indeterminate { width:30%; animation:indeterminate 1.5s infinite ease-in-out; }
@keyframes indeterminate { 0%{transform:translateX(-100%)} 100%{transform:translateX(400%)} }
@keyframes stopPulse { 0%,100%{ opacity:1; } 50%{ opacity:.72; } }
.progress-text { font-size:12px; color:var(--text-secondary); margin-top:4px; }

.editor-zone { display:flex; flex-direction:column; flex:1; overflow:hidden; }
.editor-header { display:flex; align-items:center; gap:10px; padding:8px 16px; border-bottom:1px solid var(--border); background:var(--bg-white); flex-shrink:0; }
.doc-title { font-size:14px; font-weight:600; }
.char-count { font-size:11px; color:var(--text-secondary); margin-left:auto; }
.sel-duration { font-size:11px; color:var(--accent); margin-left:8px; font-weight:500; white-space:nowrap; }

.editor-content {
    flex:1; overflow-y:auto; padding:28px 36px; background:var(--bg-white); margin:12px;
    border-radius:var(--radius); box-shadow:var(--shadow); line-height:2; font-size:16px;
    cursor:text; user-select:text; -webkit-user-select:text;
    max-width:800px; margin-left:auto; margin-right:auto; width:calc(100% - 24px); outline:none;
}
.editor-content:focus { box-shadow: var(--shadow), 0 0 0 2px rgba(37,99,235,0.3); }
.editor-content .char-span { position:relative; cursor:text; transition:background .1s; border-radius:1px; }
.editor-content .char-span:hover { background:var(--highlight-bg); }
.editor-content .char-span.selected { background:#bfdbfe; }
.editor-content .char-span.deleted { color:var(--deleted-text); text-decoration:line-through; opacity:.35; background:var(--deleted-bg); }
.editor-content .char-span.corrected { background:var(--correct-bg); border-bottom:2px solid var(--correct-border); }
.editor-content .sentence-break { display:inline; }
.editor-content .para-break { display:block; height:6px; }

/* ==================== 侧边栏 ==================== */
.left-panel { width:300px; flex-shrink:0; background:var(--bg-white); border-right:1px solid var(--border); overflow-y:auto; padding:12px; display:flex; flex-direction:column; }
.left-panel .panel-section { flex:1; display:flex; flex-direction:column; margin-bottom:0; }
.left-panel .correct-result { flex:1; max-height:none; overflow-y:auto; display:flex; flex-direction:column; }
.side-panel { width:280px; flex-shrink:0; background:var(--bg-white); border-left:1px solid var(--border); overflow-y:auto; padding:12px; }
.panel-section { margin-bottom:16px; }
.panel-section h3 { font-size:12px; font-weight:600; margin-bottom:8px; display:flex; align-items:center; gap:5px; color:var(--text-secondary); text-transform:uppercase; letter-spacing:0.05em; }
.panel-section h3 svg { color:var(--text-secondary); }
.badge { display:inline-block; padding:1px 7px; background:var(--danger); color:#fff; border-radius:10px; font-size:11px; font-weight:600; }
.info-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.info-item { display:flex; flex-direction:column; padding:6px; background:#f8f8f8; border-radius:var(--radius-sm); }
.info-label { font-size:10px; color:var(--text-secondary); margin-bottom:1px; }
.info-value { font-size:15px; font-weight:700; }
.text-red { color:var(--danger); }
.cut-result { font-size:12px; color:var(--success); padding:6px; background:#f0fdf4; border-radius:var(--radius-sm); text-align:center; }
.deleted-list { max-height:200px; overflow-y:auto; }
.deleted-item { display:flex; align-items:flex-start; gap:4px; padding:4px 6px; border-bottom:1px solid #f0f0f0; font-size:12px; }
.deleted-item .del-text { flex:1; color:var(--deleted-text); text-decoration:line-through; word-break:break-all; }
.deleted-item .del-time { font-size:10px; color:var(--text-secondary); white-space:nowrap; }
.deleted-item .del-restore { cursor:pointer; color:var(--primary); font-size:11px; white-space:nowrap; }
.deleted-item .del-restore:hover { text-decoration:underline; }
.deleted-item-pause .del-text { color:#d97706; text-decoration:none; }
.deleted-item-pause .del-time::before { content:'⏸ '; }
.empty-hint { color:#aaa; font-size:12px; text-align:center; padding:12px; }

/* 纠错结果 */
.correct-item { padding:6px 8px; border-bottom:1px solid #f0f0f0; font-size:12px; }
.correct-item .cor-original { color:var(--danger); text-decoration:line-through; }
.correct-item .cor-arrow { color:#999; margin:0 4px; }
.correct-item .cor-corrected { color:var(--success); font-weight:600; }
.correct-item .cor-pos { color:var(--text-secondary); font-size:10px; display:block; margin-top:2px; }

/* ==================== ASR 页 ==================== */
.asr-container { display:flex; gap:16px; padding:16px; flex:1; overflow:hidden; }
.asr-left { width:380px; flex-shrink:0; }
.asr-right { flex:1; overflow:hidden; display:flex; flex-direction:column; }
.panel-card { background:var(--bg-white); border-radius:var(--radius); box-shadow:var(--shadow); padding:16px; margin-bottom:12px; }
.panel-card h3 { font-size:13px; font-weight:600; margin-bottom:12px; display:flex; align-items:center; gap:6px; color:var(--text); }
.panel-card-header { display:flex; align-items:center; justify-content:space-between; margin-bottom:10px; }
.panel-card-header h3 { margin-bottom:0; }
.form-group { margin-bottom:12px; }
.form-group label { display:block; font-size:12px; color:var(--text-secondary); margin-bottom:4px; font-weight:500; }
.form-group { position:relative; }
.form-input { width:100%; padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius-sm); font-size:13px; transition:border-color .15s; }
.form-input:focus { outline:none; border-color:var(--primary); box-shadow:0 0 0 2px rgba(37,99,235,0.15); }
.btn-toggle-pwd { position:absolute; right:4px; top:22px; background:none; border:none; cursor:pointer; font-size:14px; padding:4px; }

.asr-result-list { max-height:calc(100vh - 200px); overflow-y:auto; }
.asr-result-item { display:flex; align-items:center; justify-content:space-between; padding:10px 12px; border-bottom:1px solid #f0f0f0; transition:background .1s; }
.asr-result-item:hover { background:#f8f8f8; }
.asr-result-info { flex:1; min-width:0; }
.asr-result-name { font-size:13px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.asr-result-meta { font-size:11px; color:var(--text-secondary); margin-top:2px; }
.asr-result-actions { display:flex; gap:4px; flex-shrink:0; }
.asr-result-actions button { padding:3px 8px; font-size:11px; border-radius:var(--radius-sm); cursor:pointer; border:1px solid var(--border); background:var(--bg-white); transition:all .1s; }
.asr-result-actions button:hover { background:#f0f0f0; }
.asr-result-actions .btn-job { background:var(--primary); color:#fff; border-color:var(--primary); }
.asr-result-actions .btn-job:hover { background:var(--primary-hover); }
.asr-result-actions .btn-del { color:var(--danger); }
.asr-result-actions .btn-del:hover { background:var(--deleted-bg); }

/* ASR 上传本地音频 */
.asr-upload-row { display:flex; align-items:center; gap:8px; margin-top:6px; }
.asr-upload-status { font-size:12px; color:var(--text-secondary); flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.asr-upload-status.success { color:var(--success); }
.asr-upload-status.error { color:var(--danger); }
.asr-upload-status.uploading { color:var(--primary); }

/* ==================== 设置页 ==================== */
.settings-container { padding:20px; max-width:700px; margin:0 auto; overflow-y:auto; flex:1; }
.settings-card { margin-bottom:16px; }
.settings-actions { display:flex; align-items:center; gap:10px; margin-top:8px; }
.save-status { font-size:13px; color:var(--success); }

/* ==================== 弹窗 ==================== */
.modal-overlay { position:fixed; top:0; left:0; right:0; bottom:0; background:rgba(0,0,0,0.4); display:flex; align-items:center; justify-content:center; z-index:100; }
.modal-content { background:var(--bg-white); border-radius:var(--radius); box-shadow:var(--shadow-lg); width:480px; max-width:90vw; max-height:80vh; display:flex; flex-direction:column; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid var(--border); }
.modal-header h3 { font-size:15px; }
.modal-close { border:none; background:none; font-size:22px; cursor:pointer; color:#999; padding:0 4px; }
.modal-close:hover { color:#333; }
/* ==================== 版本记录抽屉面板 ==================== */
.ver-panel-overlay {
    position: fixed; top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(0,0,0,0.25);
    z-index: 200;
    display: none;
    justify-content: flex-end;
}
.ver-panel-overlay.open { display: flex; }

.ver-panel {
    width: 680px; max-width: 92vw;   /* 左右两栏合并宽度 */
    background: var(--bg-white);
    box-shadow: -4px 0 24px rgba(0,0,0,0.15);
    display: flex; flex-direction: column;
    height: 100%;
    animation: slideInRight .2s ease;
}
@keyframes slideInRight {
    from { transform: translateX(40px); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.ver-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ver-panel-title { font-size: 15px; font-weight: 600; }
.ver-panel-close {
    border: none; background: none; font-size: 22px;
    cursor: pointer; color: #999; padding: 0 4px; line-height: 1;
}
.ver-panel-close:hover { color: #333; }

/* 主体：左右两栏 */
.ver-panel-body {
    flex: 1; display: flex; flex-direction: row;
    overflow: hidden; min-height: 0;
}

/* 左栏：时间线列表 */
.ver-panel-left {
    width: 220px; flex-shrink: 0;
    display: flex; flex-direction: column;
    border-right: 1px solid var(--border);
    overflow: hidden;
}
.ver-panel-left .ver-timeline { flex: 1; overflow-y: auto; padding: 4px 12px; }
.ver-panel-left-footer {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.ver-panel-left-footer .btn-danger-outline { width: 100%; }

/* 时间线列表 */
.ver-group-label {
    font-size: 11px; color: var(--text-secondary);
    padding: 10px 0 4px;
    font-weight: 500;
    letter-spacing: .04em;
}

/* ── 按日期分组的新版本列表 ── */
.ver-date-group { margin-bottom: 4px; }

/* 日期标题行 */
.ver-date-header {
    display: flex; align-items: center; gap: 6px;
    padding: 7px 5px 5px;
    cursor: pointer; border-radius: 6px;
    transition: background .12s;
}
.ver-date-header:hover { background: #f5f7ff; }
.ver-date-header.active { background: #eff3ff; }

.ver-date-label {
    font-size: 12px; font-weight: 600;
    color: var(--text-primary); flex-shrink: 0;
}
.ver-date-summary {
    flex: 1; font-size: 11px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 时刻条目（折叠在日期下方） */
.ver-day-timeline {
    padding-left: 14px;
    border-left: 2px solid var(--border);
    margin-left: 8px;
    margin-bottom: 4px;
}
.ver-time-entry {
    display: flex; align-items: center; gap: 6px;
    padding: 5px 6px; border-radius: 5px;
    cursor: pointer; transition: background .12s;
    position: relative;
}
.ver-time-entry:hover  { background: #f5f7ff; }
.ver-time-entry.active { background: #eff3ff; }
.ver-time-entry.active .ver-time-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.2); }

.ver-time-dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: #cbd5e1; flex-shrink: 0;
    transition: all .15s;
}
.ver-time-entry:hover .ver-time-dot { background: var(--primary); }

.ver-time-str {
    font-size: 12px; font-weight: 500; color: var(--text-primary);
    flex-shrink: 0; min-width: 38px;
}
.ver-time-summary {
    font-size: 11px; color: var(--text-secondary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 定位闪烁动画：点击版本后编辑区高亮定位 */
@keyframes verLocateFlash {
    0%   { background: #fde68a; }
    40%  { background: #fde68a; }
    100% { background: transparent; }
}
.char-span.ver-locate-flash {
    animation: verLocateFlash 1.8s ease forwards;
    border-radius: 2px;
}

.ver-item {
    display: flex; align-items: flex-start; gap: 8px;
    padding: 7px 0;
    cursor: pointer;
    border-radius: var(--radius-sm);
    position: relative;
}
.ver-item:hover .ver-item-body { background: #f5f7ff; border-radius: 6px; }
.ver-item.active .ver-item-body { background: #eff3ff; border-radius: 6px; }
.ver-item.active .ver-dot { background: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.2); }

.ver-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: #cbd5e1;
    flex-shrink: 0; margin-top: 5px;
    transition: all .15s;
}
.ver-item:hover .ver-dot { background: var(--primary); }

.ver-item-body { flex: 1; padding: 2px 5px; min-width: 0; }

/* 条目顶行：时间 + 时钟按钮 */
.ver-item-top {
    display: flex; align-items: center; justify-content: space-between;
    gap: 4px;
}
.ver-item-time { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.ver-item-sub  { font-size: 11px; color: var(--text-secondary); margin-top: 1px; }

/* 摘要行 */
.ver-item-summary {
    font-size: 11px; color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* 时钟图标按钮 */
.ver-item-clock-btn {
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    width: 20px; height: 20px;
    border: none; background: none; cursor: pointer;
    color: #94a3b8; border-radius: 4px;
    padding: 0; transition: color .15s, background .15s;
}
.ver-item-clock-btn:hover,
.ver-item-clock-btn.active { color: var(--primary); background: #eff3ff; }

/* 改动详情展开区（左栏内折叠） */
.ver-item-detail {
    margin-top: 6px;
    border-left: 2px solid var(--border);
    padding-left: 8px;
    font-size: 12px;
    display: flex; flex-direction: column; gap: 3px;
}
.ver-detail-empty { color: var(--text-secondary); font-size: 11px; }
.ver-detail-item {
    display: flex; align-items: flex-start; gap: 4px;
    line-height: 1.5; word-break: break-all;
}
.ver-detail-icon {
    flex-shrink: 0; font-size: 13px; font-weight: 700;
    width: 14px; text-align: center;
}
.ver-detail-delete .ver-detail-icon { color: #f87171; }
.ver-detail-delete .ver-detail-text { color: #7f1d1d; text-decoration: line-through; opacity: .75; }
.ver-detail-restore .ver-detail-icon { color: #34d399; }
.ver-detail-restore .ver-detail-text { color: #064e3b; }

/* 右栏：预览区（始终显示） */
.ver-preview {
    flex: 1; display: flex; flex-direction: column;
    overflow: hidden; min-width: 0;
}
.ver-preview-empty {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 10px; color: #94a3b8; font-size: 13px;
    text-align: center; line-height: 1.6;
}
.ver-preview-main {
    display: flex; flex-direction: column;
    height: 100%; overflow: hidden;
}
.ver-preview-header {
    padding: 12px 16px 6px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ver-preview-time  { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ver-preview-count { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
.ver-preview-content {
    flex: 1; overflow-y: auto;
    padding: 10px 16px;
    font-size: 13px; line-height: 2;
    color: var(--text-primary);
    word-break: break-all;
}
.ver-preview-del { text-decoration: line-through; color: #f87171; opacity: .6; }
.ver-preview-actions {
    display: flex; gap: 8px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.ver-preview-actions .btn-primary  { flex: 1; }
.ver-preview-actions .btn-secondary { flex: 0 0 auto; }


/* 版本恢复进度条 */
.ver-restore-progress {
    padding: 8px 16px 4px;
    flex-shrink: 0;
}
.ver-restore-bar {
    height: 4px; border-radius: 2px;
    background: #e2e8f0; overflow: hidden;
}
.ver-restore-fill {
    height: 100%; border-radius: 2px;
    background: var(--primary);
    width: 0%;
    transition: width .05s linear;
}
.ver-restore-label {
    font-size: 11px; color: var(--text-secondary);
    margin-top: 4px; text-align: center;
}
.btn-danger-outline {
    background: none; border: 1px solid var(--danger);
    color: var(--danger); border-radius: var(--radius-sm);
    padding: 5px 12px; font-size: 12px; cursor: pointer; width: 100%;
}
.btn-danger-outline:hover { background: var(--deleted-bg); }
.modal-footer { display:flex; justify-content:flex-end; gap:6px; padding:10px 16px; border-top:1px solid var(--border); }

/* ==================== 状态栏 ==================== */
.status-bar { display:flex; align-items:center; justify-content:space-between; padding:3px 16px; background:#1e293b; color:#94a3b8; font-size:11px; flex-shrink:0; }
.connection-ok { color:#4ade80; }
.connection-err { color:#f87171; }

/* ==================== 响应式 ==================== */
@media (max-width:768px) {
    .main-area { flex-direction:column; }
    .side-panel { width:100%; border-left:none; border-top:1px solid var(--border); max-height:35vh; }
    .left-panel { width:100%; border-right:none; border-bottom:1px solid var(--border); max-height:35vh; }
    .editor-content { margin:6px; padding:14px; }
    .toolbar-center { display:none; }
    .asr-container { flex-direction:column; }
    .asr-left { width:100%; }
}

/* ==================== AI 修订审批面板 ==================== */

/* 运行态按钮 */
.tb-btn-ai-stop {
    background: #fff3cd !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
}
.tb-btn-ai-stop:hover { background: #fde68a !important; }
.cor-stop-hint { font-size: 10px; color: #92400e; margin-left: 4px; opacity: .7; }

/* 思考/加载行 */
.cor-review-thinking {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px 6px;
    font-size: 12px; color: var(--primary);
}
.agent-dot-anim { display: inline-flex; gap: 3px; }
.agent-dot-anim span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
    animation: agentDot 1.2s infinite ease-in-out; display: inline-block;
}
.agent-dot-anim span:nth-child(2) { animation-delay: .2s; }
.agent-dot-anim span:nth-child(3) { animation-delay: .4s; }
@keyframes agentDot {
    0%, 80%, 100% { opacity: .25; transform: scale(.8); }
    40%           { opacity: 1;   transform: scale(1.1); }
}

/* 页签栏 */
.cor-review-header {
    flex-shrink: 0; border-bottom: 1px solid var(--border);
}
.cor-tab-bar {
    display: flex; padding: 0 8px;
}
.cor-tab {
    flex: 1; padding: 7px 4px; font-size: 12px; font-weight: 500;
    border: none; background: none; cursor: pointer;
    color: var(--text-secondary); border-bottom: 2px solid transparent;
    transition: color .15s, border-color .15s; white-space: nowrap;
    display: flex; align-items: center; justify-content: center; gap: 3px;
}
.cor-tab:hover { color: var(--primary); }
.cor-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* 页签计数徽章 */
.cor-tab-badge {
    display: inline-block; min-width: 16px; height: 16px; line-height: 16px;
    padding: 0 4px; border-radius: 8px; font-size: 10px; font-weight: 700;
    background: #e2e8f0; color: var(--text-secondary); text-align: center;
}
.cor-tab-badge-accepted { background: #dcfce7; color: #15803d; }
.cor-tab-badge-rejected { background: #f1f5f9; color: #94a3b8; }

/* 批量操作栏 */
.cor-batch-bar {
    display: flex; gap: 6px; padding: 6px 10px;
    border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.cor-batch-btn {
    flex: 1; padding: 4px 0; font-size: 12px; border-radius: var(--radius-sm);
    cursor: pointer; border: 1px solid; transition: all .15s; font-weight: 500;
}
.cor-batch-accept-all {
    background: #f0fdf4; color: var(--success); border-color: var(--success);
}
.cor-batch-accept-all:hover { background: #dcfce7; }
.cor-batch-reject-all {
    background: #fafafa; color: var(--text-secondary); border-color: var(--border);
}
.cor-batch-reject-all:hover { background: #f1f5f9; color: var(--text); }

/* 审批列表 */
.cor-review-list {
    flex: 1; overflow-y: auto; padding: 6px 10px 10px;
    display: flex; flex-direction: column; gap: 5px;
}

/* 审批卡片 */
.cor-card {
    display: flex; align-items: flex-start; gap: 6px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    padding: 7px 8px; background: var(--bg-white);
    transition: border-color .15s, background .15s;
    cursor: pointer;
}
.cor-card:hover { border-color: #94a3b8; }
.cor-card[data-state="accepted"] {
    background: #f0fdf4; border-left: 3px solid var(--success);
    border-color: #bbf7d0;
}
/* 已接受标签页内：取消绿色背景，只保留左侧绿线，hover 恢复正常反馈 */
.cor-tab-accepted-view .cor-card[data-state="accepted"] {
    background: var(--bg-white);
    border-color: var(--border);
    border-left-color: var(--success);
}
.cor-tab-accepted-view .cor-card[data-state="accepted"]:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}
.cor-card[data-state="rejected"] {
    background: #fafafa; opacity: .65;
    border-left: 3px solid #e2e8f0;
}
.cor-card-anim { animation: corCardIn .25s ease-out; }
@keyframes corCardIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cor-card-seq {
    flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
    background: #e2e8f0; color: var(--text-secondary);
    font-size: 10px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}

.cor-card-body {
    flex: 1; min-width: 0; cursor: pointer;
}
.cor-card-diff {
    display: flex; align-items: center; gap: 4px; flex-wrap: wrap;
    font-size: 12px; line-height: 1.6;
}
.cor-card-orig {
    color: var(--danger); text-decoration: line-through; word-break: break-all;
}
.cor-card-arrow { color: #94a3b8; font-size: 11px; flex-shrink: 0; }
.cor-card-sugg {
    color: #15803d; font-weight: 600; word-break: break-all;
}
.cor-card-ctx {
    font-size: 11px; color: var(--text-secondary); margin-top: 3px;
    line-height: 1.5; word-break: break-all;
}

/* 卡片操作区 */
.cor-card-actions {
    flex-shrink: 0; display: flex; align-items: center; gap: 4px;
    margin-top: 1px; flex-wrap: wrap;
}
.cor-btn-accept, .cor-btn-reject, .cor-btn-undo-reject, .cor-btn-undo-accept {
    padding: 2px 7px; font-size: 11px; border-radius: var(--radius-sm);
    cursor: pointer; border: 1px solid; transition: all .15s; white-space: nowrap;
    line-height: 1.6;
}
.cor-btn-accept {
    color: var(--success); border-color: var(--success); background: #f0fdf4;
}
.cor-btn-accept:hover { background: #dcfce7; }
.cor-btn-reject {
    color: var(--text-secondary); border-color: var(--border); background: var(--bg-white);
}
.cor-btn-reject:hover { background: #f1f5f9; color: var(--text); }
.cor-btn-undo-reject {
    color: var(--primary); border-color: var(--primary); background: #eff6ff;
    font-weight: 600;
}
.cor-btn-undo-reject:hover { background: #dbeafe; box-shadow: 0 0 0 2px #bfdbfe; }
.cor-btn-undo-accept {
    color: #b45309; border-color: #f59e0b; background: #fffbeb;
    font-weight: 600;
}
.cor-btn-undo-accept:hover { background: #fef3c7; box-shadow: 0 0 0 2px #fde68a; }

/* 状态标签 */
.cor-state-tag {
    font-size: 11px; font-weight: 600; padding: 1px 6px;
    border-radius: 10px; white-space: nowrap;
}
.cor-state-accepted { color: var(--success); background: #dcfce7; }
.cor-state-rejected { color: #94a3b8; background: #f1f5f9; }

/* 纠错高亮标记 */
.char-span.corrected {
    background: #fde68a;
    border-bottom: 2px solid #d97706;
    border-radius: 2px;
    color: #92400e;
}

/* 下载进度百分比文本 */
.progress-percent {
    display: inline-block;
    margin-left: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* 编辑器插入点光标（竖线 caret） */
.editor-content { caret-color: var(--primary); }
.editor-content .char-span.corrected { caret-color: #b45309; }

/* ==================== 居中确认弹窗 ==================== */
.cor-confirm-mask {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,.35);
    display: flex; align-items: center; justify-content: center;
    animation: corMaskIn .15s ease-out;
}
@keyframes corMaskIn { from { opacity: 0; } to { opacity: 1; } }

.cor-confirm-card {
    background: var(--bg-white); border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0,0,0,.2);
    padding: 24px 24px 20px;
    min-width: 280px; max-width: 360px; width: calc(100vw - 48px);
    animation: corCardPop .2s cubic-bezier(.34,1.56,.64,1);
}
@keyframes corCardPop {
    from { opacity: 0; transform: scale(.88); }
    to   { opacity: 1; transform: scale(1); }
}

.cor-confirm-title {
    font-size: 15px; font-weight: 700; color: var(--text);
    margin-bottom: 8px; line-height: 1.4;
}
.cor-confirm-body {
    font-size: 13px; color: var(--text-secondary); line-height: 1.6;
    margin-bottom: 4px;
}
.cor-confirm-actions {
    display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px;
}
.cor-confirm-cancel {
    padding: 7px 16px; font-size: 13px; border-radius: var(--radius-sm);
    border: 1px solid var(--border); background: var(--bg-white);
    color: var(--text-secondary); cursor: pointer; transition: all .15s;
}
.cor-confirm-cancel:hover { background: var(--bg); }

.cor-confirm-ok {
    padding: 7px 18px; font-size: 13px; font-weight: 600;
    border-radius: var(--radius-sm); border: none;
    cursor: pointer; transition: all .15s; color: #fff;
    background: var(--primary);
}
.cor-confirm-ok:hover { filter: brightness(1.1); }
.cor-confirm-ok-success { background: var(--success); }
.cor-confirm-ok-danger  { background: var(--danger);  }
.cor-confirm-ok-warning { background: #f59e0b; color: #fff; }

/* 表单小提示 */
.form-hint { font-size: 11px; color: var(--text-secondary); font-weight: 400; margin-left: 4px; }

/* 批量撤销按钮 */
.cor-batch-undo-all {
    flex: 1; background: #fffbeb; color: #92400e;
    border-color: #fbbf24;
}
.cor-batch-undo-all:hover { background: #fef3c7; }



/* 按钮点击后反馈：已完成状态 */
.cor-batch-actions .btn-sm.btn-done {
    background: #e5e7eb !important; color: #9ca3af !important;
    border-color: #d1d5db !important; cursor: default; pointer-events: none;
    transform: scale(0.97);
}
/* 点击瞬间动画 */
.cor-batch-actions .btn-sm.btn-clicking {
    transform: scale(0.93);
    opacity: 0.7;
}
.cor-sel-all { font-size:11px; white-space:nowrap; display:flex; align-items:center; gap:3px; cursor:pointer; }
.correct-item { display:flex; align-items:flex-start; flex-wrap:wrap; }
.correct-item .cor-main { flex:1; min-width:0; }

/* SRT 导出按钮 */
.btn-srt { margin-top:6px; padding:8px; border:1px solid var(--border); border-radius:var(--radius-sm); background:var(--bg-white); cursor:pointer; font-size:13px; text-align:center; transition:all .15s; }
.btn-srt:hover { background:#f0f7ff; border-color:var(--primary); color:var(--primary); }

/* 关联音频按钮 */
.btn-link-audio { display:flex; align-items:center; justify-content:center; gap:6px; padding:8px; border:2px dashed var(--border); border-radius:var(--radius-sm); background:var(--bg-white); cursor:pointer; font-size:13px; text-align:center; transition:all .15s; margin-bottom:6px; color:var(--text-secondary); }
.btn-link-audio:hover { border-color:var(--primary); color:var(--primary); background:#f0f7ff; }
.btn-link-audio.linked { border-color:#22c55e; color:#22c55e; border-style:solid; background:#f0fdf4; cursor:default; }
.link-audio-hint { font-size:11px; color:var(--text-muted); margin:0 0 8px 0; text-align:center; }
.link-audio-hint.linked { color:#22c55e; }

/* ==================== 纠错定位高亮 ==================== */
.char-span.cor-locate {
    background: #fef9c3 !important;
    box-shadow: 0 1px 0 #fbbf24;
    border-radius: 2px;
    animation: corLocatePulse 1.6s ease-in-out 2;
}
.char-span {
    transition: background .6s, box-shadow .6s;
}
@keyframes corLocatePulse {
    0%   { background: #fef9c3 !important; }
    50%  { background: #fde68a !important; }
    100% { background: #fef9c3 !important; }
}
.correct-item.cor-active {
    background: #fffbeb;
    box-shadow: inset 3px 0 0 #f59e0b;
}

/* ==================== 左侧面板折叠 ==================== */
.left-panel { position:relative; transition: width .22s ease, min-width .22s ease, padding .22s ease, opacity .18s ease; }
.left-panel.collapsed {
    width: 0 !important; min-width: 0 !important; padding: 0 !important;
    overflow: hidden; opacity: 0; border-right: none;
}

/* 面板顶部标题栏 */
.left-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 8px 10px 8px 12px;
    background: #f0f6ff; border-bottom: 1px solid #dbeafe;
    border-radius: 6px 6px 0 0; cursor: default;
    user-select: none; flex-shrink: 0;
}
.left-panel-header-title {
    font-size: 13px; font-weight: 600; color: var(--primary);
    display: flex; align-items: center; gap: 5px;
}
.left-panel-header-actions {
    display: flex; align-items: center; gap: 4px;
}
/* 清除图标按钮 */
.left-panel-icon-btn {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 4px; border: 1px solid transparent;
    background: none; color: #94a3b8; cursor: pointer; transition: all .15s;
    padding: 0; flex-shrink: 0;
}
.left-panel-icon-btn:hover {
    background: #fee2e2; border-color: #fca5a5; color: var(--danger);
}
/* 收起按钮：文字+箭头 */
.left-panel-fold-btn {
    display: flex; align-items: center; gap: 3px;
    padding: 3px 8px; border-radius: 4px; border: 1px solid #bfdbfe;
    background: white; color: var(--primary); cursor: pointer;
    font-size: 11px; font-weight: 500; white-space: nowrap;
    transition: all .15s;
}
.left-panel-fold-btn:hover { background: #dbeafe; border-color: var(--primary); }
.left-panel-fold-btn svg { flex-shrink: 0; }
.left-panel-body { flex: 1; overflow-y: auto; }

/* 收起状态：左侧竖排标签条 */
.left-panel-tab-collapsed {
    position: fixed; left: 0; top: 50%; transform: translateY(-50%); z-index: 30;
    width: 22px; padding: 14px 0;
    border-radius: 0 8px 8px 0; border: 1.5px solid var(--primary); border-left: none;
    background: #eff6ff; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    box-shadow: 2px 0 10px rgba(37,99,235,.18); transition: all .15s; color: var(--primary);
}
.left-panel-tab-collapsed:hover { background: #dbeafe; width: 26px; box-shadow: 3px 0 14px rgba(37,99,235,.28); }
.left-panel-tab-collapsed svg { flex-shrink: 0; }
.left-panel-tab-collapsed span {
    writing-mode: vertical-lr; font-size: 11px; font-weight: 600;
    letter-spacing: 1px; color: var(--primary);
}

/* 旧按钮样式保留兼容 */
.left-panel-toggle { display: none; }
.left-panel-toggle-collapsed { display: none; }

/* ==================== 拖动调整宽度 ==================== */
.panel-resize-handle {
    width: 5px; cursor: col-resize; background: transparent; flex-shrink: 0;
    position: relative; z-index: 15; transition: background .15s;
}
.panel-resize-handle:hover, .panel-resize-handle.dragging { background: var(--primary); opacity: 0.4; }
body.resizing { cursor: col-resize !important; user-select: none !important; }

/* ==================== 浮动菜单（微信风格） ==================== */
.float-menu {
    position: fixed; z-index: 200; display: flex; gap: 0;
    background: #1a1a1a; border-radius: 8px; padding: 4px 0;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25); animation: floatMenuIn .15s ease-out;
    white-space: nowrap;
}
.float-menu::after {
    content: ''; position: absolute; bottom: -6px; left: 50%; transform: translateX(-50%);
    width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent;
    border-top: 6px solid #1a1a1a;
}
.float-menu-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 6px 14px; color: #fff; font-size: 13px; cursor: pointer;
    border: none; background: none; transition: background .1s;
    border-right: 1px solid #333;
}
.float-menu-btn:last-child { border-right: none; }
.float-menu-btn:hover { background: #333; }
.float-menu-btn:first-child { border-radius: 8px 0 0 8px; }
.float-menu-btn:last-child { border-radius: 0 8px 8px 0; }
/* 删除按钮特别高亮（剪映风格红色） */
#fmDelete { color: #ff5a5a; font-weight: 600; }
#fmDelete:hover { background: #3a1a1a; }
/* 恢复按钮绿色 */
#fmRestore { color: #4cdb7a; font-weight: 600; }
#fmRestore:hover { background: #1a3a22; }
@keyframes floatMenuIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 编辑弹窗 */
.edit-modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.3); z-index: 210;
    display: flex; align-items: center; justify-content: center;
    animation: fadeIn .15s;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.edit-modal {
    background: var(--bg-white); border-radius: var(--radius); padding: 16px;
    box-shadow: var(--shadow-lg); width: 400px; max-width: 90vw;
}
.edit-modal h4 { font-size: 14px; margin-bottom: 8px; }
.edit-modal .edit-original { font-size: 12px; color: var(--text-secondary); margin-bottom: 8px; word-break: break-all; }
.edit-modal textarea {
    width: 100%; height: 80px; padding: 8px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; resize: vertical;
    font-family: inherit; line-height: 1.6;
}
.edit-modal textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 2px rgba(37,99,235,0.15); }
.edit-modal-actions { display: flex; gap: 8px; margin-top: 10px; justify-content: flex-end; }
.edit-modal-actions button { padding: 6px 16px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; }

/* ==================== 富文本格式类 ==================== */
.char-span.fmt-bold      { font-weight: bold; }
.char-span.fmt-italic    { font-style: italic; }
.char-span.fmt-underline { text-decoration: underline; }
.char-span.fmt-bold.fmt-underline      { font-weight: bold; text-decoration: underline; }
.char-span.fmt-italic.fmt-underline    { font-style: italic; text-decoration: underline; }
.char-span.fmt-bold.fmt-italic.fmt-underline { font-weight: bold; font-style: italic; text-decoration: underline; }

/* 格式化工具栏按钮 */
.tb-btn.tb-btn-fmt { min-width: 28px; font-size: 13px; padding: 3px 7px; }

/* ==================== 导出格式选择弹窗 ==================== */
.export-modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,.45);
    display: flex; align-items: center; justify-content: center; z-index: 9000;
}
.export-modal {
    background: var(--bg-white); border-radius: var(--radius); padding: 22px 24px 18px;
    min-width: 300px; max-width: 380px; width: 90%; box-shadow: 0 8px 32px rgba(0,0,0,.22);
}
.export-modal h4 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.export-fmt-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.export-fmt-item {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px;
    border: 1.5px solid var(--border); border-radius: var(--radius-sm);
    cursor: pointer; transition: border-color .15s, background .15s;
}
.export-fmt-item:hover { border-color: var(--primary); background: #eff6ff; }
.export-fmt-item input[type="radio"] { accent-color: var(--primary); width: 15px; height: 15px; flex-shrink: 0; }
.export-fmt-item:has(input:checked) { border-color: var(--primary); background: #eff6ff; }
.export-fmt-name { font-size: 13px; font-weight: 500; flex: 1; }
/* 格式徽章 */
.export-fmt-badge {
    font-size: 10px; font-weight: 700; letter-spacing: .5px;
    padding: 2px 6px; border-radius: 4px; flex-shrink: 0;
    font-family: monospace;
}
.export-fmt-badge--srt  { background: #dbeafe; color: #1d4ed8; }
.export-fmt-badge--txt  { background: #f3f4f6; color: #374151; }
.export-fmt-badge--md   { background: #fef9c3; color: #854d0e; }
.export-fmt-badge--word { background: #dbeafe; color: #1e40af; }
/* 不含标点 */
.export-no-punct-row {
    display: flex; align-items: center; gap: 7px;
    font-size: 13px; color: var(--text-secondary); margin-bottom: 16px; cursor: pointer;
}
.export-no-punct-row input[type="checkbox"] { accent-color: var(--primary); width: 14px; height: 14px; }
.export-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.export-modal-actions button { padding: 6px 18px; border-radius: var(--radius-sm); cursor: pointer; font-size: 13px; border: 1px solid transparent; }


/* ==================== 历史作业常驻侧栏 ==================== */

/* editor-main：历史侧栏之外的主内容包装 */
.editor-main {
    flex: 1; display: flex; flex-direction: row; overflow: hidden;
}

/* uploadZone：仅是上传表单容器 */
.upload-zone {
    flex: 1; display: flex; align-items: center; justify-content: center;
    overflow-y: auto;
}

/* 常驻历史作业侧栏 */
.job-history-zone {
    width: 280px; flex-shrink: 0;
    border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    background: var(--bg-white); padding: 14px 12px;
    overflow: hidden;
    transition: width .2s ease, padding .2s ease;
}
.job-history-header {
    margin-bottom: 10px; flex-shrink: 0;
}
.job-history-title-row {
    display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px;
}
.job-history-title-row h3 { font-size: 13px; font-weight: 600; margin: 0; }
.job-history-header h3 { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
/* 收起/展开图标按钮 */
.job-history-toggle-btn {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; border-radius: 6px;
    border: 1px solid var(--border); background: var(--bg-white);
    cursor: pointer; color: var(--text-secondary); flex-shrink: 0;
    transition: all .15s;
}
.job-history-toggle-btn:hover { border-color: var(--primary); color: var(--primary); background: #f0f7ff; }
/* 收起状态：侧栏收窄，只显示标题行 */
.job-history-zone.collapsed {
    width: 36px; padding: 10px 6px; overflow: hidden;
}
.job-history-zone.collapsed .job-history-title-row h3,
.job-history-zone.collapsed .job-search-bar,
.job-history-zone.collapsed .job-history-list {
    display: none !important;
}
.job-history-zone.collapsed .job-history-toggle-btn svg {
    transform: rotate(180deg);
}
.job-history-zone.collapsed .job-history-title-row {
    flex-direction: column; justify-content: flex-start;
}
/* ── 历史作业搜索栏 ── */
.job-search-bar {
    display: flex; flex-direction: column; gap: 5px; margin-bottom: 8px;
}
.job-search-input {
    width: 100%; box-sizing: border-box;
    padding: 5px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 12px; background: var(--bg-white); color: var(--text); outline: none;
    transition: border-color .15s;
}
.job-search-input:focus { border-color: var(--primary); }
.job-date-range {
    display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--text-secondary);
}
.job-date-input {
    flex: 1; min-width: 0;
    padding: 3px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 11px; background: var(--bg-white); color: var(--text); cursor: pointer;
    outline: none;
}
.job-date-input:focus { border-color: var(--primary); }
.job-clear-btn {
    flex-shrink: 0; padding: 2px 6px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-white); cursor: pointer; font-size: 11px; color: var(--text-secondary);
    line-height: 1.4; transition: all .15s;
}
.job-clear-btn:hover { border-color: var(--danger, #e53e3e); color: var(--danger, #e53e3e); }
/* 分组标签 */
.job-group-label {
    font-size: 10px; font-weight: 700; color: var(--text-secondary);
    letter-spacing: .05em; text-transform: uppercase;
    padding: 4px 2px 2px; margin-top: 4px; border-bottom: 1px solid var(--border);
}
.job-history-list {
    flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 4px;
}
/* 作业列表项 —— 简洁无图标 */
.job-item {
    display: flex; align-items: flex-start; gap: 8px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: var(--radius-sm);
    background: var(--bg-white); cursor: pointer; transition: all .15s; flex-shrink: 0;
}
.job-item:hover { border-color: var(--primary); background: #f0f7ff; }
.job-item.active { border-color: var(--primary); background: #dbeafe; }
/* 序号徽章 */
.job-item-seq {
    flex-shrink: 0; width: 20px; height: 20px; border-radius: 50%;
    background: #e2e8f0; color: var(--text-secondary);
    font-size: 10px; font-weight: 700; display: flex; align-items: center; justify-content: center;
    margin-top: 1px;
}
.job-item-info { flex: 1; min-width: 0; }
.job-item-name {
    font-size: 12px; font-weight: 600; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4;
}
.job-item-time { font-size: 11px; color: var(--text-secondary); margin-top: 2px; }

/* 上传表单（upload-form 内部居中排版） */
.upload-form {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 32px 40px; text-align: center; width: 100%;
}
.upload-form .upload-icon { font-size: 48px; margin-bottom: 10px; }
.upload-form h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 6px; }
.upload-form p { color: var(--text-secondary); margin-bottom: 16px; font-size: 13px; }

@media (max-width: 768px) {
    #tabEditor { flex-direction: column; }
    .job-history-zone { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
    .editor-main { flex-direction: column; }
}

/* ==================== 音频播放器控制栏 ==================== */
.audio-player-bar {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 16px; background: #f8fafc; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.ap-btn {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 4px 10px; border: 1px solid var(--border); background: var(--bg-white);
    border-radius: var(--radius-sm); cursor: pointer; font-size: 12px; color: var(--text);
    transition: all .15s; white-space: nowrap;
}
.ap-btn:hover:not(:disabled) { background: #e0f2fe; border-color: var(--primary); color: var(--primary); }
.ap-btn:disabled { opacity: .4; cursor: not-allowed; }
.ap-btn.playing { background: #dbeafe; border-color: var(--primary); color: var(--primary); }
.ap-time {
    font-size: 11px; color: var(--text-secondary); font-variant-numeric: tabular-nums;
    min-width: 90px; text-align: center; white-space: nowrap;
}
.ap-seek {
    flex: 1; height: 4px; min-width: 80px; cursor: pointer;
    accent-color: var(--primary);
}
.ap-speed { display: flex; align-items: center; gap: 3px; font-size: 11px; color: var(--text-secondary); }
.ap-speed-select {
    padding: 2px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-size: 11px; background: var(--bg-white); cursor: pointer;
}

/* 当前播放高亮 */
.char-span.audio-playing {
    background: #bfdbfe !important;
    border-radius: 2px;
    transition: background .08s;
}

/* ==================== 管理员验证 & 设置保护 ==================== */
.admin-lock-card { text-align: center; }
.admin-hint { font-size: 13px; color: var(--text-secondary); margin-bottom: 12px; }
.admin-pwd-row { display: flex; gap: 8px; max-width: 320px; margin: 0 auto; align-items: center; }
.admin-pwd-row .form-input { flex: 1; }
.admin-verify-status { font-size: 12px; margin-top: 8px; min-height: 18px; }
.admin-verify-status.success { color: var(--success); }
.admin-verify-status.error { color: var(--danger); }

.settings-locked { opacity: 0.5; pointer-events: none; user-select: none; }
.settings-unlocked { opacity: 1; pointer-events: auto; user-select: auto; }

.apikey-display { display: flex; align-items: center; gap: 6px; }
.apikey-masked {
    font-size: 13px; color: var(--text-secondary); padding: 7px 10px;
    background: #f5f5f5; border: 1px solid var(--border); border-radius: var(--radius-sm);
    font-family: monospace; flex: 1;
}
.apikey-input { flex: 1; }

/* ==================== 停顿检测（剪映风格） ==================== */
.pause-box {
    border: 1.5px solid #e0e7ef; border-radius: var(--radius); margin-bottom: 8px;
    overflow: hidden; background: #f8fafd;
}
.pause-box-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 9px 12px;
}
.pause-box-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.pause-box-body { padding: 0 12px 12px; }

/* 搜索栏 */
.pause-search-row {
    display: flex; align-items: center; gap: 6px;
    margin: 8px 0 6px;
    background: #fff; border: 1.5px solid #d1d9e6; border-radius: var(--radius-sm);
    padding: 4px 8px;
}
.pause-search-input {
    flex: 1; border: none; outline: none; font-size: 12px;
    background: transparent; color: var(--text-primary); min-width: 0;
}
.pause-search-input::placeholder { color: #b0bac8; }
.pause-search-nav { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.pause-search-btn {
    border: none; background: none; cursor: pointer; color: #888;
    font-size: 16px; padding: 0 3px; line-height: 1; border-radius: 3px;
    transition: background .1s;
}
.pause-search-btn:hover { background: #e8edf5; color: var(--primary); }
.pause-search-count { font-size: 11px; color: var(--text-secondary); min-width: 32px; text-align: center; }

/* 统计 */
.pause-stats { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pause-stats-count { font-size: 12px; color: var(--text-secondary); }
.pause-stats-count strong { color: var(--primary); font-size: 14px; }

/* 阈值行 */
.pause-threshold-row {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 10px; gap: 8px;
}
.pause-threshold-label { font-size: 12px; color: var(--text-secondary); white-space: nowrap; }
.pause-threshold-input-wrap { display: flex; align-items: center; gap: 4px; }
.pause-threshold-input {
    width: 60px; padding: 4px 6px; font-size: 13px; font-weight: 500;
    border: 1.5px solid #d1d9e6; border-radius: var(--radius-sm);
    text-align: center; outline: none; background: #fff;
    appearance: textfield; -moz-appearance: textfield;
}
.pause-threshold-input::-webkit-inner-spin-button,
.pause-threshold-input::-webkit-outer-spin-button { opacity: 1; cursor: pointer; }
.pause-threshold-input:focus { border-color: var(--primary); }
.pause-threshold-unit { font-size: 12px; color: var(--text-secondary); }
.form-input-sm { font-size: 12px; padding: 4px 6px; height: 28px; }

/* 批量删除按钮 */
.pause-delete-all-btn {
    width: 100%; padding: 7px; font-size: 12px; font-weight: 500;
    background: #fff1f2; color: #dc2626; border: 1.5px solid #fca5a5;
    border-radius: var(--radius-sm); cursor: pointer; transition: all .15s;
}
.pause-delete-all-btn:hover:not(:disabled) { background: #fee2e2; }
.pause-delete-all-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Toggle开关（复用） */
.silence-trim-toggle { position: relative; display: inline-block; width: 36px; height: 20px; flex-shrink: 0; }
.silence-trim-toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: #ccd5e0; border-radius: 20px; transition: .2s;
}
.toggle-slider:before {
    content: ''; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px;
    background: white; border-radius: 50%; transition: .2s;
}
.silence-trim-toggle input:checked + .toggle-slider { background: var(--primary); }
.silence-trim-toggle input:checked + .toggle-slider:before { transform: translateX(16px); }

/* 编辑区停顿标签（剪映风格胶囊） */
.pause-tag {
    display: inline-flex; align-items: center; gap: 2px;
    vertical-align: middle;
    background: #fffbeb; border: 1.5px solid #f59e0b;
    border-radius: 4px; padding: 1px 5px;
    font-size: 11px; line-height: 1.6;
    cursor: pointer; user-select: none;
    transition: background .12s, border-color .12s;
    margin: 0 1px;
}
.pause-tag:hover { background: #fde68a; border-color: #d97706; }
.pause-tag-label {
    background: #f59e0b; color: #fff;
    border-radius: 3px; padding: 0 4px; font-size: 10px; font-weight: 600;
}
.pause-tag-dur { color: #92400e; font-weight: 500; }

/* 搜索高亮 */
.char-span.search-highlight { background: #fef08a; border-radius: 2px; }
.char-span.search-current   { background: #fb923c; color: #fff; border-radius: 2px; }

/* ==================== Agent 纠错流式样式 ==================== */
/* 按钮内转圈动画 */
.btn-spinner {
    display: inline-block;
    width: 13px; height: 13px;
    border: 2px solid rgba(133,77,14,0.35);
    border-top-color: #854d0e;
    border-radius: 50%;
    animation: btn-spin .6s linear infinite;
    vertical-align: middle;
}
@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

.agent-thinking {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; margin-bottom: 8px;
    background: #f0f7ff; border-radius: var(--radius-sm);
    font-size: 12px; color: var(--text-secondary);
    transition: all .3s;
}
.agent-thinking.active { background: #dbeafe; color: var(--primary); }
.agent-dot-anim { display: flex; gap: 3px; }
.agent-dot-anim span {
    width: 6px; height: 6px; border-radius: 50%; background: var(--primary);
    animation: agentDot 1.2s infinite ease-in-out;
}
.agent-dot-anim span:nth-child(2) { animation-delay: .2s; }
.agent-dot-anim span:nth-child(3) { animation-delay: .4s; }
@keyframes agentDot {
    0%, 80%, 100% { opacity: .25; transform: scale(.8); }
    40%           { opacity: 1;   transform: scale(1.1); }
}
.agent-msg { flex: 1; }

.correct-item-anim {
    animation: slideInItem .3s ease-out;
}
@keyframes slideInItem {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* AI 修订激活态 */
.tb-btn-ai-active {
    background: #dcfce7 !important; border-color: #16a34a !important;
    color: #15803d !important;
}
.tb-btn-ai-active:hover:not(:disabled) { background: #bbf7d0 !important; }

/* ==================== Toast 提示 ==================== */
.toast {
    position: fixed; bottom: 32px; left: 50%; transform: translateX(-50%) translateY(20px);
    padding: 10px 22px; border-radius: 20px; font-size: 13px; font-weight: 500;
    color: #fff; box-shadow: 0 4px 16px rgba(0,0,0,0.18);
    opacity: 0; transition: opacity .25s, transform .25s;
    z-index: 9999; pointer-events: none; white-space: nowrap;
}
.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #16a34a; }
.toast-error   { background: #dc2626; }
.toast-info    { background: #2563eb; }
.toast-warning { background: #d97706; }

/* ==================== Activity Bar（VS Code 风格左侧导航栏） ==================== */
.activity-bar {
    flex-shrink: 0;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .22s cubic-bezier(.4,0,.2,1);
    width: 48px;   /* 默认：图标模式 */
    z-index: 5;
}
/* 悬停临时展开 或 固定展开 */
.activity-bar.hover-expanded,
.activity-bar.pinned {
    width: 164px;
}

/* ── 底部伸缩按钮区域 ── */
.activity-bar-footer {
    padding: 4px 0 6px;
    display: flex;
    justify-content: flex-start;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    align-items: center;
}
/* 用伪元素撑满边框宽度，按钮本身固定在左侧 48px 范围内居中 */
.activity-toggle-btn {
    flex-shrink: 0;
    margin-left: 7px;   /* (48px - 34px) / 2，始终贴左侧图标列中点 */
    margin-right: auto; /* 右侧剩余空间全部吸收，按钮不跟随宽度移动 */
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: none;
    border-radius: 7px;
    background: none;
    cursor: pointer;
    color: #3C444D;
    transition: background .15s, color .15s, box-shadow .15s;
    position: relative;
}
.activity-toggle-btn:hover {
    background: #eef1f5;
    color: #1a2330;
}
/* 固定展开时：按钮高亮提示已锁定 */
.activity-bar.pinned .activity-toggle-btn {
    background: #dbeafe;
    color: var(--primary);
    box-shadow: inset 0 0 0 1.5px rgba(37,99,235,.25);
}
.activity-bar.pinned .activity-toggle-btn:hover {
    background: #bfdbfe;
}
.activity-toggle-icon {
    transition: stroke .15s;
}

/* ── 导航项列表 ── */
.activity-items {
    display: flex;
    flex-direction: column;
    padding: 6px 0;
    flex: 1;
}

/* 单个导航项 */
.activity-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0;
    justify-content: center;   /* 默认图标居中 */
    border: none;
    background: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    text-align: left;
    white-space: nowrap;
    transition: background .12s, color .12s, padding .22s cubic-bezier(.4,0,.2,1);
    position: relative;
    border-left: 2px solid transparent;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.activity-item:hover {
    background: #f1f5f9;
    color: var(--text);
}
.activity-item.active {
    background: #dbeafe;
    color: var(--primary);
    border-left-color: var(--primary);
    font-weight: 600;
}
.activity-item.active .activity-icon {
    stroke: var(--primary);
}
.activity-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

/* 默认隐藏文字标签 */
.activity-label {
    flex: 1;
    opacity: 0;
    max-width: 0;
    overflow: hidden;
    transition: opacity .18s ease, max-width .22s cubic-bezier(.4,0,.2,1);
    pointer-events: none;
}
/* 展开时：显示标签，item改为左对齐 */
.activity-bar.hover-expanded .activity-label,
.activity-bar.pinned .activity-label {
    opacity: 1;
    max-width: 120px;
    pointer-events: auto;
}
.activity-bar.hover-expanded .activity-item,
.activity-bar.pinned .activity-item {
    justify-content: flex-start;
    padding: 10px 14px;
}

/* ==================== Activity Content（内容面板） ==================== */
.activity-content {
    flex-shrink: 0;
    width: 260px;
    background: var(--bg-white);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: width .2s ease, min-width .2s ease;
}
.activity-content.hidden {
    width: 0 !important;
    min-width: 0 !important;
    overflow: hidden;
    border-right: none;
}

/* 内容面板（每个导航项对应的面板） */
.activity-pane {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
    height: 100%;
}
.activity-pane.active {
    display: flex;
}

/* 面板顶部标题行 */
.activity-pane-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8fafc;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    gap: 6px;
}
.activity-pane-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: .04em;
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

/* 面板操作按钮组 */
.activity-pane-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}

/* 面板内容区 */
.activity-pane-body {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.activity-pane-body .correct-result {
    flex: 1;
    overflow-y: auto;
}

/* 历史作业面板内搜索栏适配 */
#jobHistoryPane .job-search-bar {
    padding: 8px 10px 4px;
    flex-shrink: 0;
}
#jobHistoryPane .job-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0 8px 8px;
}

/* AI修订 开始修订按钮 */
.activity-correct-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border: 1px solid var(--primary);
    border-radius: var(--radius-sm);
    background: #eff6ff;
    color: var(--primary);
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all .15s;
}
.activity-correct-btn:hover:not(:disabled) {
    background: #dbeafe;
}
.activity-correct-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}
.activity-correct-btn.tb-btn-ai-stop {
    border-color: var(--danger);
    background: #fef2f2;
    color: var(--danger);
}
.activity-correct-btn.tb-btn-ai-stop:hover:not(:disabled) {
    background: #fee2e2;
}

/* 面板内图标按钮 */
.activity-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 1px solid transparent;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    transition: all .15s;
    padding: 0;
    flex-shrink: 0;
}
.activity-icon-btn:hover {
    background: #fee2e2;
    border-color: #fca5a5;
    color: var(--danger);
}

@media (max-width: 768px) {
    .activity-bar { display: none; }
    .activity-content { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 220px; }
}

