  :root {
    /* 黑白蓝配色 + 全站黑体 */
    --bg-primary: #f4f6fa;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f8fafc;
    --bg-hover: #eef3fc;
    --border-color: #dde4ef;
    --border-light: #c6d2e4;
    --text-primary: #10151d;
    --text-secondary: #46536a;
    --text-muted: #8794a8;
    --accent: #1f5fd0;
    --accent-hover: #1749a6;
    --accent-dim: rgba(31, 95, 208, 0.10);
    --danger: #cf2f2f;
    --success: #1f5fd0;
    --mono: 'JetBrains Mono', 'Cascadia Code', Consolas, 'SF Mono', 'Noto Sans Mono CJK SC', 'WenQuanYi Micro Hei Mono', ui-monospace, monospace;
    --sans: 'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Segoe UI', Arial, sans-serif;
    /* 正文（caption 文本）用无衬线黑体族：思源黑体 / 苹方 / 微软雅黑 依次回退 */
    --text-font: 'Noto Sans CJK SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', 'WenQuanYi Micro Hei', 'Segoe UI', Arial, sans-serif;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }

  html, body {
    height: 100%;
    overflow: hidden;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--sans);
    font-size: 14px;
    line-height: 1.5;
  }

  /* ===== 顶部工具栏 ===== */
  .toolbar {
    height: 38px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 6px;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
  }

  .toolbar-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    margin-right: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .toolbar-title .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
  }

  .toolbar-divider {
    width: 1px;
    height: 20px;
    background: var(--border-color);
    margin: 0 4px;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-family: var(--sans);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    user-select: none;
  }

  .btn:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
  }

  .btn:active { transform: translateY(1px); }

  .btn-exit {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    padding: 5px 12px;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(31, 95, 208, 0.24);
    position: sticky;
    right: 0;
    flex-shrink: 0;
    margin-left: 4px;
  }
  .btn-exit:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }

  .btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #141414;
    font-weight: 600;
  }

  .btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
  }

  /* 保存：本机缓存定稿，做成克制的浅色实底，和「A−/A+」这类工具按钮区分开 */
  .btn-save {
    background: #f2f5fd;
    border-color: #c9d8f6;
    color: #1f4ed8;
    font-weight: 600;
  }
  .btn-save:hover { background: #e6edfc; border-color: #a9c1f2; color: #163db0; }

  .btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .toolbar-spacer { flex: 1; }

  .file-info {
    font-size: 11px;
    color: var(--text-secondary);
    font-family: var(--mono);
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* ===== 主体布局 ===== */
  .main {
    display: flex;
    height: calc(100vh - 38px);
    overflow: hidden;
  }

  /* ===== 左侧视频区 ===== */
  .video-panel {
    flex: 1.3;
    display: flex;
    flex-direction: column;
    background: var(--bg-primary);
    min-width: 0;
    transition: flex 0.25s ease;
  }

  .video-panel.collapsed {
    flex: 0;
    min-width: 0;
    border-right: none;
    overflow: hidden;
  }

  .video-panel.collapsed > * {
    display: none;
  }

  .video-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    position: relative;
    overflow: hidden;
    min-height: 0;
  }

  .video-container video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    cursor: pointer;
  }

  /* 全屏播放：视频贴紧屏幕比例，填满整个屏幕 */
  .video-container:fullscreen {
    width: 100vw;
    height: 100vh;
    background: #000;
  }

  .video-container:fullscreen video {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
  }

  /* Firefox 兼容 */
  .video-container:-moz-full-screen {
    width: 100vw;
    height: 100vh;
    background: #000;
  }

  .video-container:-moz-full-screen video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .video-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: #6b7280;
    text-align: center;
    padding: 40px;
  }

  .video-placeholder svg {
    width: 64px;
    height: 64px;
    opacity: 0.25;
  }

  .video-placeholder p {
    font-size: 14px;
    color: #9ca3af;
  }

  .video-placeholder .hint {
    font-size: 12px;
    color: #6b7280;
  }

  /* ===== 快捷键与说明面板（视频下方） ===== */
  .help-panel {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
    max-height: 148px;
    overflow-y: auto;
    padding: 7px 12px 9px;
  }

  .help-panel-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 5px;
  }

  .help-panel-title {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: .2px;
  }

  .help-panel-title svg { width: 13px; height: 13px; }

  .help-hint {
    margin-left: auto;
    font-size: 10.5px;
    color: var(--text-muted);
    white-space: nowrap;
  }

  .help-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(226px, 1fr));
    gap: 2px 16px;
  }

  .help-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11.5px;
    line-height: 1.7;
    color: var(--text-secondary);
    min-width: 0;
  }

  .help-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .help-item kbd {
    font-family: var(--mono);
    font-size: 10.5px;
    line-height: 1.4;
    padding: 0 5px;
    border: 1px solid #dcdfe6;
    border-bottom-width: 2px;
    border-radius: 4px;
    background: #fff;
    color: var(--text-primary);
    flex-shrink: 0;
  }

  .help-note {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px dashed var(--border-color);
    font-size: 10.5px;
    line-height: 1.7;
    color: var(--text-muted);
  }

  /* ===== 只读切镜结果面板（已停用，样式保留） ===== */
  .cut-panel {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    height: 130px;
  }

  .cut-panel-header {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
    flex-shrink: 0;
    min-height: 26px;
  }

  .cut-panel-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
  }

  .cut-panel-title svg {
    width: 12px;
    height: 12px;
  }

  .cut-panel-spacer { flex: 1; }

  .cut-add-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    color: var(--accent);
    background: var(--accent-dim);
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-right: 8px;
  }

  .cut-add-btn:hover {
    background: var(--accent);
    color: #fff;
  }

  .cut-add-btn svg {
    width: 12px;
    height: 12px;
  }

  .cut-panel-stats {
    font-size: 11px;
    font-family: var(--mono);
    color: var(--text-muted);
  }

  .cut-panel-stats .hard { color: var(--accent); }
  .cut-panel-stats .soft { color: #3b82f6; }

  .cut-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px;
    min-height: 0;
  }

  .cut-list {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .cut-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.1s;
    user-select: none;
  }

  /* 时间戳靠右排列：拖拽手柄在左，镜头编号/删除按钮在中，时间戳在最右 */
  .cut-item .cut-time {
    margin-left: auto;
    font-weight: 500;
  }

  .cut-item .cut-label {
    color: var(--text-muted);
    margin-left: 4px;
  }

  .cut-item:hover {
    background: var(--bg-hover);
  }

  .cut-item .cut-time {
    font-family: var(--mono);
    font-weight: 600;
    min-width: 90px;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
  }

  .cut-item.hard .cut-time { color: var(--accent); }
  .cut-item.soft .cut-time { color: #3b82f6; }
  .cut-item.manual .cut-time { color: #64748b; }

  .cut-item .cut-tag {
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 3px;
    font-weight: 600;
    min-width: 36px;
    text-align: center;
  }

  .cut-item.hard .cut-tag {
    background: var(--accent-dim);
    color: var(--accent);
  }

  .cut-item.soft .cut-tag {
    background: rgba(59, 130, 246, 0.12);
    color: #3b82f6;
  }

  .cut-item.manual .cut-tag {
    background: rgba(100, 116, 139, 0.14);
    color: #64748b;
  }

  .cut-item .cut-label {
    color: var(--text-secondary);
    flex: 1;
  }

  .cut-item .cut-range {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--text-muted);
  }

  .cut-edit-input {
    width: 48px;
    padding: 1px 4px;
    border: 1px solid var(--accent);
    border-radius: 3px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: var(--mono);
    font-size: 11px;
    text-align: center;
    outline: none;
    /* 隐藏数字输入框的上下箭头滑块 */
    -moz-appearance: textfield;
    appearance: textfield;
  }

  .cut-edit-input::-webkit-outer-spin-button,
  .cut-edit-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
  }

  .cut-edit-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-dim);
  }

  .cut-actions {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .cut-item:hover .cut-actions {
    opacity: 1;
  }

  .cut-action-btn {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
  }

  .cut-action-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
  }

  .cut-action-btn.move-up:hover,
  .cut-action-btn.move-down:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
  }

  .cut-action-btn.delete:hover {
    color: var(--danger);
    border-color: rgba(207, 47, 47, 0.25);
    background: rgba(207, 47, 47, 0.08);
  }

  .cut-action-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
  }

  .drag-handle {
    cursor: grab;
    color: var(--text-muted);
    font-size: 10px;
    letter-spacing: -2px;
    user-select: none;
    opacity: 0.5;
    transition: opacity 0.15s ease;
  }

  .cut-item:hover .drag-handle {
    opacity: 1;
  }

  .cut-item.dragging {
    opacity: 0.3;
  }

  .drag-ghost {
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    background: var(--bg-secondary);
    border: 1px solid var(--accent);
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    opacity: 0.95;
  }

  .drag-indicator {
    height: 2px;
    background: var(--accent);
    border-radius: 1px;
    margin: 2px 0;
    box-shadow: 0 0 6px var(--accent);
  }

  .cut-empty {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    padding: 20px 0;
  }

  /* ===== 视频控制条 ===== */
  .controls {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 6px 12px;
    flex-shrink: 0;
  }

  .progress-wrapper {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 22px 18px 14px;
    cursor: pointer;
    background: linear-gradient(to top, rgba(0,0,0,0.72) 0%, rgba(0,0,0,0.35) 55%, transparent 100%);
    z-index: 5;
    opacity: 0;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .progress-wrapper .progress-track {
    flex: 1;
  }

  .fs-btn-in-bar {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .fs-btn-in-bar:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
  }

  .fs-btn-in-bar svg {
    width: 16px;
    height: 16px;
  }

  .video-container:hover .progress-wrapper,
  .progress-wrapper.dragging {
    opacity: 1;
  }

  /* —— 进度条美化：圆角胶囊轨道 + 渐变填充 + 播放拖动点 —— */
  .progress-track {
    position: relative;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.45), 0 1px 0 rgba(255,255,255,0.06);
    overflow: visible;
    transition: height 0.18s ease, background 0.18s ease;
  }

  .progress-wrapper:hover .progress-track,
  .progress-wrapper.dragging .progress-track {
    height: 10px;
    background: rgba(255, 255, 255, 0.22);
  }

  .progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.3);
    width: 0%;
  }

  .progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, #7fa8f0 100%);
    box-shadow: 0 0 10px rgba(31, 95, 208, 0.38);
    width: 0%;
    transition: width 0.05s linear;
  }

  /* 播放中的拖动点（圆形手柄，可直接按住拖动） */
  .progress-thumb {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 15px;
    height: 15px;
    margin-top: -7.5px;
    margin-left: -7.5px;
    border-radius: 50%;
    background: radial-gradient(circle at 34% 30%, #ffffff 0%, var(--accent) 62%);
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45), 0 0 0 3px rgba(31, 95, 208, 0.16);
    opacity: 0;
    transform: scale(0.7);
    pointer-events: none;
    z-index: 3;
    transition: opacity 0.18s ease, transform 0.12s ease, box-shadow 0.12s ease;
  }

  .video-container:hover .progress-thumb,
  .progress-wrapper:hover .progress-thumb,
  .progress-wrapper.dragging .progress-thumb {
    opacity: 1;
    transform: scale(1);
  }

  .progress-wrapper.dragging .progress-thumb {
    transform: scale(1.3);
    box-shadow: 0 0 0 7px rgba(31, 95, 208, 0.22), 0 3px 12px rgba(0, 0, 0, 0.5);
  }

  .progress-tooltip {
    position: absolute;
    bottom: 22px;
    transform: translateX(-50%);
    background: rgba(20, 20, 20, 0.92);
    border: 1px solid rgba(31, 95, 208, 0.35);
    border-radius: 6px;
    padding: 3px 9px;
    font-family: var(--mono);
    font-size: 11px;
    color: #cfe0ff;
    pointer-events: none;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .progress-wrapper:hover .progress-tooltip { opacity: 1; }

  .controls-row {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .ctrl-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
  }

  .ctrl-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
  }

  .ctrl-btn:active { transform: scale(0.95); }

  .ctrl-btn svg {
    width: 18px;
    height: 18px;
  }

  .ctrl-btn.play-btn {
    width: 34px;
    height: 34px;
    background: var(--accent);
    color: #141414;
  }

  .ctrl-btn.play-btn:hover {
    background: var(--accent-hover);
    color: #141414;
  }

  .ctrl-btn.play-btn svg {
    width: 20px;
    height: 20px;
  }

  .time-display {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--text-primary);
    padding: 0 8px;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .time-display .current {
    color: var(--accent);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
  }

  .time-display .separator { color: var(--text-muted); }

  .time-display .duration {
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
  }

  .controls-spacer { flex: 1; }

  .nudge-group {
    display: flex;
    align-items: center;
    gap: 2px;
    background: var(--bg-tertiary);
    border-radius: 6px;
    padding: 2px;
  }

  .nudge-btn {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2px 6px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--mono);
    font-size: 10px;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1.1;
    min-width: 36px;
  }

  .nudge-btn:hover {
    background: var(--bg-hover);
    color: var(--accent);
  }

  .nudge-btn .val { font-size: 12px; font-weight: 600; }
  .nudge-btn .unit { font-size: 9px; opacity: 0.7; }

  .speed-select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-family: var(--mono);
    font-size: 12px;
    padding: 4px 6px;
    cursor: pointer;
    outline: none;
  }

  .speed-select:hover { border-color: var(--border-light); }

  /* 帧位计数器 */
  .frame-counter {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--text-muted);
    padding: 3px 7px;
    border-radius: 4px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    user-select: none;
    cursor: default;
  }

  .frame-counter .fr-cur {
    color: var(--accent);
    font-weight: 600;
  }

  .progress-wrapper.dragging .progress-tooltip { opacity: 1; }

  .progress-tooltip .tt-frame {
    color: rgba(255, 255, 255, 0.6);
    margin-left: 6px;
  }

  .progress-tooltip.fine-mode { border-color: var(--accent); }

  .volume-group {
    display: flex;
    align-items: center;
    gap: 6px;
  }

  .volume-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 70px;
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    outline: none;
    cursor: pointer;
  }

  .volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: var(--text-secondary);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.15s;
  }

  .volume-slider::-webkit-slider-thumb:hover { background: var(--accent); }

  /* ===== 视频区与文本区之间的可拖动分隔线 ===== */
  .pane-resizer {
    flex: 0 0 7px;
    width: 7px;
    position: relative;
    z-index: 5;
    cursor: col-resize;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .pane-resizer::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 3px;
    width: 1px;
    background: var(--border-color);
    transition: background 0.15s;
  }

  .pane-resizer:hover::before,
  .pane-resizer.dragging::before {
    background: var(--accent);
  }

  .pane-resizer-grip {
    width: 3px;
    height: 46px;
    border-radius: 2px;
    background: #c9ced8;
    opacity: 0.55;
    transition: opacity 0.15s, background 0.15s;
  }

  .pane-resizer:hover .pane-resizer-grip,
  .pane-resizer.dragging .pane-resizer-grip {
    opacity: 1;
    background: var(--accent);
  }

  .pane-resizer:hover::before,
  .pane-resizer.dragging::before { background: var(--accent); }

  /* ===== 右侧文本区 ===== */
  .text-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--bg-secondary);
    min-width: 0;
  }

  .text-panel-header { display: none; }

  .text-editor-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-height: 0;
  }

  .text-editor {
    flex: 1;
    width: 100%;
    min-height: 0;
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: none;
    outline: none;
    resize: none;
    padding: 14px 16px;
    font-family: var(--text-font);
    font-size: 15px;
    line-height: 1.85;
    letter-spacing: 0.2px;
    overflow-y: auto;
  }

  .text-editor::placeholder { color: var(--text-muted); }

  /* 右侧文本区滚动导条：平时隐藏，滚动时出现，停下自动隐去 */
  .text-editor::-webkit-scrollbar { width: 0; height: 0; }
  .text-editor { scrollbar-width: none; }

  .scroll-rail {
    position: absolute;
    top: 6px;
    right: 3px;
    bottom: 6px;
    width: 7px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease, background 0.15s;
    z-index: 4;
    cursor: pointer;
  }

  .scroll-rail.is-active { opacity: 1; pointer-events: auto; }

  .scroll-thumb {
    position: absolute;
    left: 0;
    width: 100%;
    min-height: 26px;
    border-radius: 4px;
    background: rgba(31, 35, 41, 0.30);
    transition: background 0.15s;
  }

  .scroll-rail.is-dragging .scroll-thumb,
  .scroll-rail:hover .scroll-thumb { background: rgba(31, 35, 41, 0.5); }

  /* ===== 拖拽覆盖层 ===== */
  .drop-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(232, 131, 12, 0.08);
    border: 3px dashed var(--accent);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    pointer-events: none;
  }

  .drop-overlay.active {
    display: flex;
  }

  .drop-overlay-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 32px 48px;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  }

  .drop-overlay-content svg {
    width: 48px;
    height: 48px;
    color: var(--accent);
    margin-bottom: 12px;
  }

  .drop-overlay-content .drop-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
  }

  .drop-overlay-content .drop-hint {
    font-size: 13px;
    color: var(--text-secondary);
  }

  /* ===== 隐藏文件输入 ===== */
  .hidden-input { display: none; }

  /* ===== Toast ===== */
  .toast-container {
    position: fixed;
    top: 50px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .toast {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-light);
    border-left: 3px solid var(--accent);
    border-radius: 6px;
    padding: 10px 16px;
    font-size: 13px;
    color: var(--text-primary);
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    animation: toastIn 0.25s ease, toastOut 0.3s ease 2.7s forwards;
    max-width: 320px;
  }

  .toast.success { border-left-color: var(--success); }
  .toast.error { border-left-color: var(--danger); }

  @keyframes toastIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
  }

  @keyframes toastOut {
    from { opacity: 1; }
    to { opacity: 0; transform: translateX(20px); }
  }
