/* ============ Web IDE 全局布局 ============ */
:root {
    --ide-bg: #1e1e1e;
    --ide-sidebar: #252526;
    --ide-activitybar: #333333;
    --ide-tabbar: #2d2d2d;
    --ide-tab-active: #1e1e1e;
    --ide-tab-inactive: #2d2d2d;
    --ide-border: #1a1a1a;
    --ide-text: #cccccc;
    --ide-text-dim: #858585;
    --ide-text-bright: #ffffff;
    --ide-accent: #007acc;
    --ide-statusbar: #007acc;
    --ide-git-added: #89d185;
    --ide-git-modified: #e2c08d;
    --ide-git-deleted: #f48771;
    --ide-git-untracked: #7f7f7f;
    --ide-danger: #e51400;
    --ide-warning: #f0ad4e;
}

* { box-sizing: border-box; }
[v-cloak] { display: none !important; }
html, body { margin: 0; padding: 0; height: 100%; overflow: hidden; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif; font-size: 13px; color: var(--ide-text); background: var(--ide-bg); }
#ide-app { display: flex; flex-direction: column; height: 100vh; }
.ide-hidden { display: none !important; }
.ide-flex { display: flex; align-items: center; }
.ide-fill { flex: 1; min-width: 0; min-height: 0; }

/* ============ 顶部菜单栏 ============ */
.ide-menubar {
    display: flex; align-items: center; height: 30px; background: var(--ide-bg);
    padding: 0 8px; user-select: none; flex-shrink: 0; border-bottom: 1px solid var(--ide-border);
}
.ide-menu-item { padding: 4px 8px; cursor: pointer; color: var(--ide-text); border-radius: 3px; white-space: nowrap; }
.ide-menu-item:hover { background: #37373d; }
.ide-menubar-title { font-weight: 600; margin-right: 10px; display: flex; align-items: center; gap: 6px; }
.ide-menubar-title i { color: var(--ide-accent); }
.ide-menu-spacer { flex: 1; }
.ide-menu-right { display: flex; align-items: center; gap: 4px; }
.ide-menu-right i { font-size: 15px; cursor: pointer; padding: 4px 6px; border-radius: 3px; }
.ide-menu-right i:hover { background: #37373d; }

/* ============ 多选操作条 ============ */
.ide-multi-bar {
    display: flex; align-items: center; gap: 4px; height: 32px; padding: 0 10px;
    background: #2d4d6b; flex-shrink: 0; font-size: 12px; color: #fff;
}
.ide-multi-bar .mb-count { display: flex; align-items: center; gap: 5px; margin-right: 8px; font-weight: 600; }
.ide-multi-bar .mb-op {
    padding: 3px 10px; border-radius: 3px; cursor: pointer; color: #e8e8e8;
    border: 1px solid rgba(255,255,255,0.25);
}
.ide-multi-bar .mb-op:hover { background: rgba(255,255,255,0.2); color: #fff; }
.ide-multi-bar .mb-op.danger { color: #ffb3ab; border-color: rgba(229,20,0,0.5); }
.ide-multi-bar .mb-op.danger:hover { background: var(--ide-danger); color: #fff; }
.ide-multi-bar .mb-spacer { flex: 1; }

/* ============ 主体（活动栏 + 侧边栏 + 编辑区） ============ */
/* IDE 工作区外壳：占满全屏，内部纵向布局，子级 ide-body 才能正确撑满剩余高度 */
.ide-shell {
    display: flex; flex-direction: column; flex: 1; min-height: 0;
}
.ide-body { display: flex; flex: 1; min-height: 0; }

/* 活动栏 */
.ide-activitybar {
    width: 48px; background: var(--ide-activitybar); display: flex; flex-direction: column;
    align-items: center; padding: 4px 0; flex-shrink: 0; z-index: 10;
}
.ide-activitybar .ab-item {
    width: 48px; height: 42px; display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: #858585; font-size: 22px; position: relative; border-left: 2px solid transparent;
}
.ide-activitybar .ab-item:hover { color: #fff; }
.ide-activitybar .ab-item.active { color: #fff; border-left-color: #fff; }
.ide-activitybar .ab-item.active::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; background: #fff;
}
.ide-activitybar .ab-bottom { margin-top: auto; }
.ide-activitybar .ab-badge {
    position: absolute; top: 6px; right: 6px; background: var(--ide-danger); color: #fff;
    font-size: 9px; min-width: 14px; height: 14px; line-height: 14px; text-align: center; border-radius: 7px; padding: 0 3px;
}

/* 侧边栏 */
.ide-sidebar {
    width: 260px; background: var(--ide-sidebar); display: flex; flex-direction: column;
    flex-shrink: 0; min-height: 0; border-right: 1px solid var(--ide-border); position: relative;
}
.sidebar-resizer { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 50; }
.sidebar-resizer:hover { background: rgba(0,122,204,0.3); }
.ide-sidebar.resizing { cursor: col-resize; }
.ide-sidebar-header {
    height: 34px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 12px; text-transform: uppercase; font-size: 11px; letter-spacing: 0.8px; color: var(--ide-text-dim); flex-shrink: 0;
}
.ide-sidebar-header .ssh-actions { display: flex; gap: 4px; }
.ide-sidebar-header .ssh-actions i { font-size: 13px; cursor: pointer; color: var(--ide-text-dim); padding: 3px; border-radius: 3px; }
.ide-sidebar-header .ssh-actions i:hover { color: #fff; background: #37373d; }
.ide-sidebar-body { flex: 1; overflow: auto; min-height: 0; }
.ide-sidebar-footer { flex-shrink: 0; }

/* 文件树 */
.ide-tree { padding: 4px 0; font-size: 13px; }
.ide-tree-row {
    display: flex; align-items: center; height: 24px; padding: 0 8px; cursor: pointer; white-space: nowrap;
    color: var(--ide-text); outline: none;
}
.ide-tree-row:hover { background: #2a2d2e; }
.ide-tree-row.selected { background: #37373d; }
.ide-tree-row .tree-icon { width: 18px; text-align: center; margin-right: 4px; color: #c5c5c5; flex-shrink: 0; }
.ide-tree-row .tree-arrow { width: 16px; text-align: center; color: #858585; flex-shrink: 0; transition: transform 0.15s; }
.ide-tree-row .tree-arrow.expanded { transform: rotate(90deg); }
.ide-tree-row .tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ide-tree-row .tree-git-badge {
    font-size: 10px; margin-left: 6px; font-weight: 700; flex-shrink: 0;
}
.ide-tree-row .st-new { color: var(--ide-git-added); font-weight: 700; }
.ide-tree-row .st-mod { color: var(--ide-git-modified); font-weight: 700; }
.ide-tree-row .st-del { color: var(--ide-git-deleted); font-weight: 700; }
.ide-tree-row .st-unt { color: var(--ide-git-untracked); }
.ide-tree-empty { padding: 16px; color: var(--ide-text-dim); text-align: center; font-size: 12px; }
.ide-tree-row .tree-op { display: none; color: var(--ide-text-dim); font-size: 12px; margin-left: 4px; }
.ide-tree-row:hover .tree-op { display: inline; }

/* ============ 编辑区 ============ */
.ide-editor-area { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--ide-bg); }

/* 标签栏 */
.ide-tabs-bar {
    display: flex; height: 35px; background: var(--ide-tabbar); overflow-x: auto; flex-shrink: 0;
    border-bottom: 1px solid var(--ide-border); scrollbar-width: thin;
}
.ide-tabs-bar::-webkit-scrollbar { height: 3px; }
.ide-tab {
    display: flex; align-items: center; padding: 0 10px; border-right: 1px solid var(--ide-border);
    color: var(--ide-text-dim); cursor: pointer; font-size: 13px; white-space: nowrap; max-width: 200px;
    position: relative; flex-shrink: 0;
}
.ide-tab:hover { background: #2a2d2e; color: var(--ide-text); }
.ide-tab.active { background: var(--ide-tab-active); color: var(--ide-text-bright); }
.ide-tab.active::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 1px; background: var(--ide-accent); }
.ide-tab .tab-name { overflow: hidden; text-overflow: ellipsis; margin: 0 4px; }
.ide-tab .tab-dirty { width: 8px; height: 8px; border-radius: 50%; background: #fff; flex-shrink: 0; }
.ide-tab .tab-close { width: 16px; height: 16px; display: flex; align-items: center; justify-content: center; border-radius: 3px; color: var(--ide-text-dim); }
.ide-tab .tab-close:hover { background: #4d4d4d; color: #fff; }
.ide-tab .tab-git-state { font-size: 10px; font-weight: 700; }

/* 面包屑 */
.ide-breadcrumbs {
    height: 24px; display: flex; align-items: center; padding: 0 14px; font-size: 12px; color: var(--ide-text-dim);
    background: var(--ide-bg); flex-shrink: 0; overflow: hidden; white-space: nowrap;
}
.ide-breadcrumbs .bc-seg { cursor: pointer; padding: 1px 4px; border-radius: 3px; }
.ide-breadcrumbs .bc-seg:hover { background: #37373d; color: #fff; }
.ide-breadcrumbs .bc-sep { margin: 0 2px; }

/* Monaco 容器 */
.ide-editor-host { flex: 1; min-height: 0; position: relative; }
.ide-editor-host .ide-welcome {
    position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--ide-text-dim); font-size: 14px; z-index: 1;
}
.ide-welcome h2 { color: var(--ide-text); margin: 0 0 8px; font-weight: 400; }
.ide-welcome .welcome-actions { display: flex; gap: 12px; margin-top: 16px; }
.ide-welcome .welcome-actions span { cursor: pointer; color: var(--ide-accent); padding: 4px 12px; border: 1px solid #3c3c3c; border-radius: 3px; }
.ide-welcome .welcome-actions span:hover { background: #37373d; color: #fff; }

/* ============ 状态栏 ============ */
.ide-statusbar {
    height: 22px; background: var(--ide-statusbar); color: #fff; display: flex; align-items: center;
    font-size: 12px; padding: 0 10px; flex-shrink: 0; user-select: none;
}
.ide-statusbar .sb-item { display: flex; align-items: center; gap: 5px; padding: 0 8px; cursor: pointer; height: 100%; }
.ide-statusbar .sb-item:hover { background: rgba(255,255,255,0.15); }
.ide-statusbar .sb-right { margin-left: auto; display: flex; align-items: center; }

/* ============ 底部面板（终端/输出） ============ */
.ide-panel-resizer {
    height: 4px; flex-shrink: 0; cursor: row-resize; position: relative; z-index: 20;
    background: var(--ide-border); transition: background 0.15s;
}
.ide-panel-resizer::after {
    content: ''; position: absolute; left: 50%; top: 1px; transform: translateX(-50%);
    width: 36px; height: 2px; border-radius: 1px; background: transparent; transition: background 0.15s;
}
.ide-panel-resizer:hover { background: var(--ide-accent); }
.ide-panel-resizer:hover::after { background: #fff; }
.ide-panel {
    height: 140px; background: var(--ide-sidebar); border-top: 1px solid var(--ide-border);
    display: flex; flex-direction: column; flex-shrink: 0; transition: height 0.15s ease;
}
.ide-panel.resizing { transition: none; }
.ide-panel-tabs { display: flex; height: 32px; align-items: center; border-bottom: 1px solid var(--ide-border); flex-shrink: 0; }
.ide-panel-tab {
    padding: 0 14px; height: 100%; display: flex; align-items: center; cursor: pointer; font-size: 12px;
    color: var(--ide-text-dim); border-bottom: 1px solid transparent; text-transform: uppercase; letter-spacing: 0.5px;
}
.ide-panel-tab:hover { color: var(--ide-text); }
.ide-panel-tab.active { color: var(--ide-text-bright); border-bottom-color: var(--ide-accent); }
.ide-panel-body { flex: 1; overflow: auto; font-family: Consolas, 'Courier New', monospace; font-size: 12px; padding: 6px 10px; min-height: 0; }

/* ============ 终端 ============ */
.ide-terminal-wrap { display: flex; flex-direction: column; height: 100%; }
.ide-terminal-input-row { display: flex; gap: 6px; padding: 4px 8px; border-top: 1px solid var(--ide-border); flex-shrink: 0; }
.ide-terminal-input-row input { flex: 1; background: #1e1e1e; border: 1px solid #3c3c3c; color: #ccc; padding: 4px 8px; border-radius: 3px; outline: none; }
.ide-terminal-input-row input:focus { border-color: var(--ide-accent); }
.ide-terminal-output { flex: 1; overflow: auto; padding: 6px 10px; font-family: Consolas, 'Courier New', monospace; font-size: 12px; min-height: 0; }
.ide-term-line { white-space: pre-wrap; word-break: break-all; margin: 1px 0; }
.ide-term-line .term-prompt { color: #6a9955; }
.ide-term-line .term-cmd { color: #dcdcaa; }
.ide-term-line.term-err { color: #f48771; }
.ide-term-line.term-ok { color: #89d185; }

/* ============ 通用对话框美化 ============ */
.ide-modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999;
}
.ide-modal-box {
    background: #252526; border: 1px solid #3c3c3c; border-radius: 6px; width: 480px; max-width: 90vw; max-height: 80vh;
    display: flex; flex-direction: column; box-shadow: 0 8px 30px rgba(0,0,0,0.5);
}
.ide-modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid #3c3c3c; }
.ide-modal-head h3 { margin: 0; font-size: 14px; font-weight: 600; color: #fff; }
.ide-modal-head .close { cursor: pointer; color: var(--ide-text-dim); }
.ide-modal-head .close:hover { color: #fff; }
.ide-modal-body { padding: 16px; overflow: auto; }
.ide-modal-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 16px; border-top: 1px solid #3c3c3c; }
.ide-modal-foot .btn { padding: 5px 16px; border-radius: 3px; cursor: pointer; font-size: 13px; border: 1px solid #3c3c3c; background: #3c3c3c; color: #ccc; }
.ide-modal-foot .btn:hover { background: #4d4d4d; color: #fff; }
.ide-modal-foot .btn.primary { background: var(--ide-accent); border-color: var(--ide-accent); color: #fff; }
.ide-modal-foot .btn.primary:hover { background: #1b8fe3; }
.ide-modal-foot .btn.danger { background: var(--ide-danger); border-color: var(--ide-danger); color: #fff; }
.ide-modal-body .field { margin-bottom: 12px; }
.ide-modal-body label { display: block; font-size: 12px; color: var(--ide-text-dim); margin-bottom: 4px; }
.ide-modal-body input, .ide-modal-body select, .ide-modal-body textarea {
    width: 100%; background: #1e1e1e; border: 1px solid #3c3c3c; color: #ccc; padding: 6px 8px; border-radius: 3px; outline: none; font-size: 13px;
}
.ide-modal-body input:focus, .ide-modal-body select:focus, .ide-modal-body textarea:focus { border-color: var(--ide-accent); }
.ide-modal-body textarea { resize: vertical; min-height: 60px; font-family: Consolas, monospace; }

/* ============ 克隆弹窗 - 类型切换 ============ */
.clone-mode-tabs { display: flex; border-bottom: 1px solid #3c3c3c; background: #1e1e1e; flex-shrink: 0; }
.clone-mode-tabs .cm-tab {
    padding: 8px 16px; font-size: 13px; color: var(--ide-text-dim); cursor: pointer;
    display: flex; align-items: center; gap: 6px; border-bottom: 2px solid transparent; user-select: none;
}
.clone-mode-tabs .cm-tab:hover { color: var(--ide-text); }
.clone-mode-tabs .cm-tab.active { color: var(--ide-text-bright); border-bottom-color: var(--ide-accent); }

/* ============ 克隆弹窗 - Gitee 快捷选择 ============ */
.clone-gitee {
    border: 1px solid #3c3c3c; border-radius: 6px; padding: 10px 12px; margin-bottom: 12px; background: #1e1e1e;
}
.cg-title { font-size: 12px; color: var(--ide-text); display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-weight: 600; }
.cg-title i { color: var(--ide-accent); }
.cg-row { display: flex; gap: 8px; }
.cg-row select { flex: 1; }
.cg-row .btn {
    padding: 6px 14px; border-radius: 3px; background: var(--ide-accent); border: none; color: #fff;
    cursor: pointer; font-size: 13px; flex-shrink: 0;
}
.cg-row .btn:hover { background: #1b8fe3; }
.cg-row .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cg-row .btn.ghost { background: #3c3c3c; border: 1px solid #3c3c3c; padding: 5px 10px; }
.cg-row .btn.ghost:hover { background: #4d4d4d; }
.cg-row .btn.ghost.danger:hover { background: var(--ide-danger); border-color: var(--ide-danger); }
.cg-tip { margin-top: 8px; font-size: 12px; color: var(--ide-text-dim); }
.cg-repos { margin-top: 8px; border-top: 1px solid #3c3c3c; padding-top: 8px; max-height: 180px; overflow: auto; }
.cg-repos input {
    width: 100%; background: #252526; border: 1px solid #3c3c3c; color: #ccc; padding: 5px 8px;
    border-radius: 3px; outline: none; font-size: 12px; margin-bottom: 6px;
}
.cg-repos input:focus { border-color: var(--ide-accent); }
.cg-repo-item { display: flex; align-items: center; gap: 6px; padding: 5px 8px; border-radius: 3px; cursor: pointer; font-size: 13px; }
.cg-repo-item:hover { background: #2a2d2e; }
.cg-repo-item .cg-repo-icon { color: #e8a33d; flex-shrink: 0; }
.cg-repo-item .cg-repo-icon.el-icon-lock { color: var(--ide-warning); }
.cg-repo-item .cg-repo-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ide-text); }
.cg-repo-item .cg-repo-lang { font-size: 11px; color: var(--ide-text-dim); flex-shrink: 0; }
.cg-empty { padding: 10px; color: var(--ide-text-dim); text-align: center; font-size: 12px; }
.cg-picked { margin-top: 8px; font-size: 12px; color: var(--ide-git-added); display: flex; align-items: center; gap: 4px; }

/* ============ 冲突解决 / 文件历史 ============ */
.cf-item {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 8px 10px; border: 1px solid #3c3c3c; border-radius: 6px; margin-bottom: 8px; background: #1e1e1e;
}
.cf-item .cf-name { flex: 1; font-family: Consolas, monospace; font-size: 12px; color: #f48771; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cf-item .cf-ops { display: flex; gap: 6px; }
.cf-item .cf-ops .btn { padding: 3px 10px; border-radius: 3px; cursor: pointer; font-size: 12px; border: 1px solid #3c3c3c; background: #3c3c3c; color: #ccc; }
.cf-item .cf-ops .btn:hover { background: #4d4d4d; color: #fff; }
.cf-item .cf-ops .btn.primary { background: var(--ide-accent); border-color: var(--ide-accent); color: #fff; }
.fh-item {
    display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: 1px solid #333;
    border-radius: 6px; margin-bottom: 6px; cursor: pointer;
}
.fh-item:hover { border-color: var(--ide-accent); background: #2a2d2e; }
.fh-item .fh-sha { color: #e8a33d; font-family: Consolas, monospace; font-size: 12px; flex-shrink: 0; }
.fh-item .fh-msg { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; font-size: 13px; }
.fh-item .fh-meta { color: #858585; font-size: 11px; flex-shrink: 0; }

/* ============ 命令面板 ============ */
.ide-command-palette {
    position: fixed; top: 80px; left: 50%; transform: translateX(-50%); width: 560px; max-width: 90vw; z-index: 10000;
    background: #252526; border: 1px solid #3c3c3c; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); overflow: hidden;
}
.ide-command-palette input {
    width: 100%; background: transparent; border: none; outline: none; color: #fff; font-size: 14px;
    padding: 12px 16px; border-bottom: 1px solid #3c3c3c;
}
.ide-cmd-list { max-height: 320px; overflow: auto; padding: 4px 0; }
.ide-cmd-item { padding: 8px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ide-cmd-item:hover, .ide-cmd-item.active { background: #37373d; }
.ide-cmd-item .kbd { margin-left: auto; color: var(--ide-text-dim); font-size: 11px; }
.ide-cmd-empty { padding: 16px; color: var(--ide-text-dim); text-align: center; }

/* ============ 快速打开 (Ctrl+P) ============ */
.ide-quick-open { position: fixed; top: 120px; left: 50%; transform: translateX(-50%); width: 520px; max-width: 90vw; z-index: 10000; background: #252526; border: 1px solid #3c3c3c; border-radius: 6px; box-shadow: 0 10px 40px rgba(0,0,0,0.6); overflow: hidden; }
.ide-quick-open input { width: 100%; background: transparent; border: none; outline: none; color: #fff; font-size: 14px; padding: 12px 16px; border-bottom: 1px solid #3c3c3c; }
.ide-qo-list { max-height: 360px; overflow: auto; padding: 4px 0; }
.ide-qo-item { padding: 7px 16px; cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; }
.ide-qo-item:hover, .ide-qo-item.active { background: #37373d; }
.ide-qo-item .qo-name { overflow: hidden; text-overflow: ellipsis; }
.ide-qo-item .qo-path { margin-left: auto; color: var(--ide-text-dim); font-size: 11px; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }

/* ============ 右键菜单 ============ */
.ide-context-menu {
    position: fixed; background: #252526; border: 1px solid #3c3c3c; border-radius: 4px; z-index: 10050;
    min-width: 180px; padding: 4px 0; box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.ide-context-menu .ctx-item { padding: 6px 16px; cursor: pointer; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.ide-context-menu .ctx-item:hover { background: var(--ide-accent); color: #fff; }
.ide-context-menu .ctx-item.disabled { color: var(--ide-text-dim); cursor: not-allowed; }
.ide-context-menu .ctx-item.disabled:hover { background: none; color: var(--ide-text-dim); }
.ide-context-menu .ctx-item .kbd { margin-left: auto; font-size: 11px; opacity: 0.7; }
.ide-context-menu .ctx-sep { height: 1px; background: #3c3c3c; margin: 4px 0; }
.ide-context-menu .ctx-title { padding: 4px 16px; font-size: 11px; color: var(--ide-text-dim); text-transform: uppercase; letter-spacing: 0.5px; }
.ide-context-menu .ctx-sub { position: relative; }
.ide-context-menu .ctx-sub-arrow { margin-left: auto; font-size: 11px; }
.ide-context-menu .ctx-submenu {
    position: absolute; left: 100%; top: -4px; background: #252526; border: 1px solid #3c3c3c; border-radius: 4px;
    min-width: 170px; padding: 4px 0; box-shadow: 0 4px 20px rgba(0,0,0,0.5); display: none;
}
.ide-context-menu .ctx-sub:hover .ctx-submenu { display: block; }

/* ============ Git 面板 ============ */
.ide-git-panel { height: 100%; display: flex; flex-direction: column; }
/* Git 面板（侧边栏只显示文件列表） */
.git-commit-body { flex: 1; overflow: hidden; min-height: 0; }
.git-commit-files { height: 100%; overflow-y: auto; }
.git-commit-files::-webkit-scrollbar { width: 6px; }
.git-commit-files::-webkit-scrollbar-thumb { background: #4a4a4a; border-radius: 3px; }

/* Git Diff 面板（主编辑区域显示） */
.git-diff-panel { position: absolute; top: 0; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--ide-bg); z-index: 100; }
.git-diff-panel-header { display: flex; align-items: center; gap: 8px; padding: 6px 12px; border-bottom: 1px solid var(--ide-border); background: var(--ide-tabbar); flex-shrink: 0; position: relative; z-index: 101; min-height: 34px; }
.git-diff-panel-body { flex: 1; overflow: hidden; min-height: 0; position: relative; }
.git-diff-panel-body #git-diff-host { height: 100%; width: 100%; }
.git-diff-close-btn { width: 24px; height: 22px; display: flex; align-items: center; justify-content: center; color: #ccc; background: #3c3c3c; border: 1px solid #454545; border-radius: 3px; cursor: pointer; font-size: 12px; transition: all 0.15s; }
.git-diff-close-btn:hover { background: #e51400; border-color: #ff4444; color: #fff; }
.git-diff-toolbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--ide-border); background: #2d2d2d; flex-shrink: 0; }
.git-diff-filename { font-size: 12px; color: #ccc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.git-diff-nav-btn { width: 24px; height: 22px; display: flex; align-items: center; justify-content: center; color: #ccc; background: #3c3c3c; border: 1px solid #454545; border-radius: 3px; cursor: pointer; font-size: 11px; transition: all 0.15s; }
.git-diff-nav-btn:hover { background: #0e639c; border-color: #1177bb; color: #fff; }
.git-diff-nav-btn.disabled { opacity: 0.3; cursor: not-allowed; }
.git-diff-nav-btn.disabled:hover { background: #3c3c3c; border-color: #454545; color: #ccc; }
.git-diff-revert-btn { display: flex; align-items: center; gap: 4px; padding: 3px 10px; font-size: 11px; color: #f48771; background: rgba(244,135,113,0.1); border: 1px solid rgba(244,135,113,0.4); border-radius: 3px; cursor: pointer; transition: all 0.15s; }
.git-diff-revert-btn:hover { background: rgba(244,135,113,0.25); color: #ff6b52; }
.git-diff-host { flex: 1; overflow: hidden; min-height: 0; }
.ide-git-item.active { background: #094771; }
.ide-git-item.active .gi-name { color: #fff; }
.ide-git-toolbar { display: flex; align-items: center; padding: 4px 8px; gap: 4px; border-bottom: 1px solid var(--ide-border); flex-shrink: 0; }
.ide-git-toolbar i { cursor: pointer; padding: 4px; border-radius: 3px; color: var(--ide-text-dim); }
.ide-git-toolbar i:hover { background: #37373d; color: #fff; }
.ide-git-toolbar .gt-info { font-size: 12px; color: var(--ide-text-dim); margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ide-git-body { flex: 1; overflow: auto; min-height: 0; }
.ide-git-group-title {
    display: flex; align-items: center; padding: 6px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--ide-text-dim); cursor: pointer; user-select: none;
}
.ide-git-group-title .gt-count { margin-left: auto; font-size: 11px; }
.ide-git-group-title:hover { color: #fff; }
.ide-git-group-body { padding-bottom: 4px; }
.ide-git-item {
    display: flex; align-items: center; padding: 3px 10px; cursor: pointer; font-size: 13px;
}
.ide-git-item:hover { background: #2a2d2e; }
.ide-git-item .gi-status { width: 16px; text-align: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.ide-git-item .gi-status i { font-style: normal; font-size: 14px; }
.ide-git-item .gi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ide-git-item .gi-ops { display: none; gap: 4px; }
.ide-git-item:hover .gi-ops { display: flex; }
.ide-git-item .gi-ops i { font-size: 12px; color: var(--ide-text-dim); padding: 2px; border-radius: 3px; cursor: pointer; }
.ide-git-item .gi-ops i:hover { color: #fff; background: #37373d; }
.ide-git-empty { padding: 20px 10px; color: var(--ide-text-dim); text-align: center; font-size: 12px; }
.staged .gi-status { color: var(--ide-git-added); }
.unstaged .gi-status { color: var(--ide-git-modified); }
.untracked .gi-status { color: var(--ide-git-untracked); }
.conflict .gi-status { color: var(--ide-danger); }
.ide-git-commit-bar { padding: 12px 14px; border-top: 1px solid var(--ide-border); display: flex; flex-direction: column; gap: 10px; flex-shrink: 0; }
.ide-git-commit-bar textarea {
    width: 100%; background: #1e1e1e; border: 1px solid #3c3c3c; color: #ccc; padding: 8px 10px; border-radius: 4px;
    outline: none; font-size: 13px; resize: vertical; min-height: 64px; font-family: inherit; line-height: 1.5;
}
.ide-git-commit-bar textarea:focus { border-color: var(--ide-accent); }
.ide-git-commit-bar textarea::placeholder { color: #6f6f6f; }
.ide-git-commit-ops { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.ide-git-commit-check { display: flex; align-items: center; cursor: pointer; font-size: 12px; color: #bbb; padding-left: 2px; }
.ide-git-commit-check .el-checkbox__label { font-size: 12px; color: #bbb; }
.ide-git-commit-ops .btn { padding: 5px 16px; border-radius: 4px; cursor: pointer; font-size: 12px; border: 1px solid #3c3c3c; background: #3c3c3c; color: #ccc; line-height: 1.4; }
.ide-git-commit-ops .btn:hover { background: #4d4d4d; }
.ide-git-commit-ops .btn.primary { background: var(--ide-accent); border-color: var(--ide-accent); color: #fff; }
.ide-git-commit-ops .btn.primary:hover { background: #1b8fe3; }
.ide-git-commit-ops .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ide-git-branch-row {
    display: flex; align-items: center; padding: 3px 10px; cursor: pointer; font-size: 13px;
}
.ide-git-branch-row:hover { background: #2a2d2e; }
.ide-git-branch-row.current { color: #fff; }
.ide-git-branch-row .gb-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ide-git-branch-row .gb-check { color: var(--ide-git-added); }

/* Git 变更文件树 */
.git-tree-row { display: flex; align-items: center; height: 24px; cursor: pointer; font-size: 13px; gap: 4px; }
.git-tree-row:hover { background: #2a2d2e; }
.git-tree-row.active { background: #094771; }
.git-tree-arrow { width: 16px; text-align: center; flex-shrink: 0; color: #888; font-size: 10px; }
.git-tree-arrow i { cursor: pointer; }
.git-tree-check { width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; accent-color: #007acc; }
.git-tree-icon { width: 16px; text-align: center; flex-shrink: 0; font-size: 13px; }
.git-tree-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #ccc; }
.git-tree-ops { display: none; gap: 6px; margin-right: 6px; flex-shrink: 0; }
.git-tree-row:hover .git-tree-ops { display: flex; }
.git-tree-ops i { font-size: 13px; cursor: pointer; color: #888; padding: 2px; border-radius: 3px; }
.git-tree-ops i:hover { color: #fff; background: #37373d; }

/* Git 批量操作栏 */
.git-batch-bar { display: flex; align-items: center; gap: 10px; padding: 4px 10px; background: #0e639c; border-bottom: 1px solid #3c3c3c; flex-shrink: 0; }
.git-batch-bar .gb-count { font-size: 12px; color: #fff; }
.git-batch-bar i { font-size: 14px; cursor: pointer; color: #fff; padding: 3px; border-radius: 3px; }
.git-batch-bar i:hover { background: rgba(255,255,255,0.2); }
.git-tree-children { }

/* ============ 搜索面板 ============ */
.ide-search-panel { height: 100%; display: flex; flex-direction: column; }
.ide-search-input { display: flex; gap: 4px; padding: 8px; flex-shrink: 0; }
.ide-search-input input { flex: 1; background: #1e1e1e; border: 1px solid #3c3c3c; color: #ccc; padding: 5px 8px; border-radius: 3px; outline: none; font-size: 13px; }
.ide-search-input input:focus { border-color: var(--ide-accent); }
.ide-search-opts { display: flex; gap: 10px; padding: 0 8px 6px; font-size: 11px; color: var(--ide-text-dim); flex-shrink: 0; }
.ide-search-opts label { display: flex; align-items: center; gap: 3px; cursor: pointer; }
.ide-search-results { flex: 1; overflow: auto; min-height: 0; }
.ide-search-file { padding: 4px 8px; cursor: pointer; }
.ide-search-file .sf-name { font-weight: 600; color: var(--ide-text); }
.ide-search-file:hover { background: #2a2d2e; }
.ide-search-line { padding: 1px 8px 1px 24px; cursor: pointer; font-family: Consolas, monospace; font-size: 12px; color: var(--ide-text-dim); }
.ide-search-line:hover { background: #2a2d2e; color: #fff; }
.ide-search-line em { color: var(--ide-warning); font-style: normal; }
.ide-search-empty { padding: 20px; color: var(--ide-text-dim); text-align: center; font-size: 12px; }

/* ============ FTP 面板 ============ */
.ide-ftp-panel { height: 100%; display: flex; flex-direction: column; }
.ide-ftp-list { flex: 1; overflow: auto; min-height: 0; }
.ide-ftp-item {
    display: flex; align-items: center; padding: 6px 10px; cursor: pointer; font-size: 13px;
}
.ide-ftp-item:hover { background: #2a2d2e; }
.ide-ftp-item .fi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.ide-ftp-item .fi-info { color: var(--ide-text-dim); font-size: 11px; margin-right: 8px; }
.ide-ftp-item .fi-ops { display: none; gap: 6px; }
.ide-ftp-item:hover .fi-ops { display: flex; }
.ide-ftp-item .fi-ops i { font-size: 13px; color: var(--ide-text-dim); cursor: pointer; }
.ide-ftp-item .fi-ops i:hover { color: #fff; }
.ide-ftp-add { padding: 8px; border-top: 1px solid var(--ide-border); display: flex; }
.ide-ftp-add .btn { flex: 1; padding: 5px; border-radius: 3px; background: var(--ide-accent); color: #fff; border: none; cursor: pointer; font-size: 13px; }
.ide-ftp-empty { padding: 20px 10px; color: var(--ide-text-dim); text-align: center; font-size: 12px; }
/* FTP 远程目录浏览 */
.ftp-browse-btn { flex-shrink: 0; padding: 4px 12px; border-radius: 3px; cursor: pointer; font-size: 12px; border: 1px solid #3c3c3c; background: #3c3c3c; color: #ccc; }
.ftp-browse-btn:hover { background: #4d4d4d; color: #fff; }
.ftp-browse-path { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid #3c3c3c; border-radius: 4px; background: #1e1e1e; color: #ccc; font-size: 13px; }
.ftp-browse-dir { display: flex; align-items: center; padding: 7px 10px; cursor: pointer; font-size: 13px; color: #ccc; }
.ftp-browse-dir:hover { background: #2a2d2e; }
.ftp-browse-empty { padding: 18px 10px; text-align: center; color: var(--ide-text-dim); font-size: 12px; }
/* 右下角 FTP 同步进度条 */
.ide-ftp-sync {
    position: fixed; right: 16px; bottom: 16px; z-index: 200001;
    display: flex; align-items: center; gap: 10px; min-width: 230px;
    background: #252526; border: 1px solid #3c3c3c; border-radius: 6px;
    padding: 10px 14px; box-shadow: 0 4px 16px rgba(0, 0, 0, .4);
}
.ide-ftp-sync .ifs-icon { color: var(--ide-accent); font-size: 16px; animation: ifs-spin 1s linear infinite; }
.ide-ftp-sync .ifs-body { flex: 1; min-width: 0; }
.ide-ftp-sync .ifs-text { font-size: 12px; color: #ccc; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ide-ftp-sync .ifs-bar { height: 4px; background: #3c3c3c; border-radius: 2px; overflow: hidden; }
.ide-ftp-sync .ifs-fill { height: 100%; width: 40%; border-radius: 2px; background: var(--ide-accent); animation: ifs-slide 1.1s ease-in-out infinite; }
@keyframes ifs-slide { 0% { margin-left: -40%; } 100% { margin-left: 100%; } }
@keyframes ifs-spin { from { transform: rotate(0); } to { transform: rotate(360deg); } }

/* ============ 设置面板 ============ */
.ide-settings { height: 100%; overflow: auto; padding: 16px; }
.ide-settings .set-group { margin-bottom: 20px; }
.ide-settings .set-group h4 { margin: 0 0 10px; color: var(--ide-text-bright); font-size: 13px; border-bottom: 1px solid #3c3c3c; padding-bottom: 6px; }
.ide-settings .field { margin-bottom: 10px; display: flex; align-items: center; gap: 10px; }
.ide-settings .field label { width: 130px; color: var(--ide-text-dim); font-size: 12px; flex-shrink: 0; }
.ide-settings .field input, .ide-settings .field select {
    flex: 1; background: #1e1e1e; border: 1px solid #3c3c3c; color: #ccc; padding: 4px 8px; border-radius: 3px; outline: none; font-size: 13px;
}
.ide-settings .field input:focus, .ide-settings .field select:focus { border-color: var(--ide-accent); }
.ide-settings .save-row { text-align: right; }

/* ============ 输出面板 ============ */
.ide-output-line { font-family: Consolas, monospace; font-size: 12px; margin: 1px 0; white-space: pre-wrap; word-break: break-all; }
.ide-output-line .ol-time { color: var(--ide-text-dim); margin-right: 8px; }
.ide-output-line.info { color: var(--ide-text); }
.ide-output-line.warn { color: var(--ide-warning); }
.ide-output-line.error { color: var(--ide-danger); }

/* ============ 工作区首页 ============ */
.ide-home { display: flex; flex-direction: column; height: 100vh; background: #1e1e1e; }
.ide-home-top { height: 48px; display: flex; align-items: center; padding: 0 20px; border-bottom: 1px solid #333; background: #252526; flex-shrink: 0; }
.ide-home-top .logo { font-size: 16px; font-weight: 600; color: #fff; display: flex; align-items: center; gap: 8px; }
.ide-home-top .logo i { color: var(--ide-accent); font-size: 20px; }
.ide-home-top .user-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.ide-home-top .user-box .uname { color: #ccc; font-size: 13px; }
.ide-home-body { flex: 1; overflow: auto; padding: 24px; min-height: 0; }
.ide-home-hero { text-align: center; margin: 20px 0 30px; }
.ide-home-hero h1 { color: #fff; font-size: 24px; margin: 0 0 6px; }
.ide-home-hero p { color: #858585; margin: 0; font-size: 13px; }
.ide-home-actions { display: flex; justify-content: center; gap: 14px; margin-top: 18px; }
.ide-home-actions .ha-btn {
    display: flex; align-items: center; gap: 8px; padding: 8px 18px; background: #2d2d2d; border: 1px solid #3c3c3c;
    border-radius: 6px; color: #ccc; cursor: pointer; font-size: 13px;
}
.ide-home-actions .ha-btn:hover { border-color: var(--ide-accent); color: #fff; background: #37373d; }
.ide-home-actions .ha-btn.primary { background: var(--ide-accent); border-color: var(--ide-accent); color: #fff; }
.ide-home-actions .ha-btn.primary:hover { background: #1b8fe3; }
.ide-home-section-title { display: flex; align-items: center; gap: 8px; color: var(--ide-text-bright); font-size: 14px; margin: 24px 0 12px; }
.ide-home-section-title .bar { width: 3px; height: 16px; background: var(--ide-accent); border-radius: 2px; }
.ide-home-storage { max-width: 640px; margin: 0 auto 10px; }
.ide-storage-bar { height: 6px; background: #333; border-radius: 3px; overflow: hidden; margin-top: 6px; }
.ide-storage-bar .fill { height: 100%; background: var(--ide-accent); border-radius: 3px; transition: width 0.3s; }
.ide-storage-bar .fill.warn { background: var(--ide-warning); }
.ide-storage-bar .fill.danger { background: var(--ide-danger); }
.ide-storage-text { color: var(--ide-text-dim); font-size: 12px; display: flex; justify-content: space-between; }
.ide-project-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.ide-project-card {
    background: #252526; border: 1px solid #333; border-radius: 8px; padding: 16px; cursor: pointer; transition: border-color 0.2s, transform 0.15s;
}
.ide-project-card:hover { border-color: var(--ide-accent); transform: translateY(-2px); }
.ide-project-card .pc-name { color: #fff; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ide-project-card .pc-name i { color: #e8a33d; }
.ide-project-card .pc-meta { color: #858585; font-size: 12px; margin-top: 8px; display: flex; gap: 12px; flex-wrap: wrap; }
.ide-project-card .pc-meta span { display: flex; align-items: center; gap: 4px; }
.ide-project-card .pc-ops { display: flex; gap: 8px; margin-top: 12px; opacity: 0; transition: opacity 0.2s; }
.ide-project-card:hover .pc-ops { opacity: 1; }
.ide-project-card .pc-ops a { color: var(--ide-accent); font-size: 12px; cursor: pointer; }
.ide-project-card .pc-ops a.danger { color: var(--ide-danger); }
.ide-home-empty { text-align: center; color: #858585; padding: 40px 0; font-size: 13px; }
.ide-home-empty i { font-size: 40px; display: block; margin-bottom: 10px; color: #4d4d4d; }

/* ============ 通知 toast ============ */
.ide-toast {
    position: fixed; bottom: 40px; right: 20px; z-index: 200000; display: flex; flex-direction: column; gap: 8px;
}
.ide-toast-item {
    background: #333; border-left: 3px solid var(--ide-accent); color: #fff; padding: 10px 16px; border-radius: 4px;
    font-size: 13px; box-shadow: 0 4px 16px rgba(0,0,0,0.4); min-width: 240px; max-width: 420px; cursor: pointer; animation: ideToastIn 0.2s ease;
}
.ide-toast-item.success { border-left-color: var(--ide-git-added); }
.ide-toast-item.error { border-left-color: var(--ide-danger); }
.ide-toast-item.warn { border-left-color: var(--ide-warning); }
@keyframes ideToastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }

/* ============ Diff 弹窗 ============ */
.ide-diff-overlay {
    position: fixed; inset: 0; background: #1e1e1e; z-index: 9000; display: flex; flex-direction: column;
}
.ide-diff-head { display: flex; align-items: center; padding: 8px 16px; background: #252526; border-bottom: 1px solid #333; gap: 10px; }
.ide-diff-head .df-title { color: #fff; font-size: 13px; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ide-diff-head .df-btn { padding: 4px 12px; background: #3c3c3c; border: 1px solid #555; color: #ccc; border-radius: 3px; cursor: pointer; font-size: 12px; }
.ide-diff-head .df-btn:hover { background: #4d4d4d; color: #fff; }
.ide-diff-host { flex: 1; min-height: 0; }

/* ============ 拖拽 ============ */
.ide-drop-zone { outline: 2px dashed var(--ide-accent); outline-offset: -2px; background: rgba(0,122,204,0.08); }
.ide-dragging { opacity: 0.4; }

/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #424242; border-radius: 5px; }
::-webkit-scrollbar-thumb:hover { background: #4f4f4f; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }

/* el-loading 遮罩兼容深色 */
.el-loading-mask { background: rgba(0,0,0,0.5) !important; }

/* ============ layer 弹窗暗黑适配 ============ */
.layui-layer {
    background: #252526 !important;
    border: 1px solid #3c3c3c !important;
    border-radius: 8px !important;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6) !important;
}
.layui-layer-title {
    background: #1e1e1e !important;
    color: #fff !important;
    border-bottom: 1px solid #3c3c3c !important;
    font-size: 14px !important;
    padding: 0 16px !important;
}
.layui-layer-setwin { top: 14px !important; right: 14px !important; }
.layui-layer-setwin .layui-layer-close1 {
    background: #3c3c3c !important;
    width: 20px !important;
    height: 20px !important;
    border-radius: 4px;
    position: relative;
}
.layui-layer-setwin .layui-layer-close1:hover { background: #4d4d4d !important; }
.layui-layer-setwin .layui-layer-close1::after {
    content: '✕';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #ccc;
    font-size: 12px;
    line-height: 1;
}
.layui-layer-btn {
    background: #252526 !important;
    border-top: 1px solid #3c3c3c !important;
    padding: 10px 16px !important;
}
.layui-layer-btn .layui-layer-btn0 {
    background: var(--ide-accent) !important;
    border-color: var(--ide-accent) !important;
    color: #fff !important;
}
.layui-layer-btn .layui-layer-btn0:hover { background: #1b8fe3 !important; }
.layui-layer-btn .layui-layer-btn1 {
    background: #3c3c3c !important;
    border-color: #3c3c3c !important;
    color: #ccc !important;
}
.layui-layer-btn .layui-layer-btn1:hover { background: #4d4d4d !important; color: #fff !important; }
.layui-layer-shade { background: rgba(0,0,0,0.6) !important; }
.layui-layer-content { color: #ccc !important; }
.layui-layer-loading .layui-layer-loading0 { color: #fff !important; }

/* ============ 克隆进度遮罩 ============ */
.ide-clone-mask {
    position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 300000;
    display: flex; align-items: center; justify-content: center;
}
.icm-box {
    background: #252526; border: 1px solid #3c3c3c; border-radius: 8px; padding: 26px 34px;
    width: 360px; text-align: center; box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.icm-spinner {
    width: 36px; height: 36px; border: 3px solid #3c3c3c; border-top-color: var(--ide-accent);
    border-radius: 50%; margin: 0 auto 14px; animation: icmSpin 0.8s linear infinite;
}
@keyframes icmSpin { to { transform: rotate(360deg); } }
.icm-title { color: #fff; font-size: 14px; margin-bottom: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.icm-bar { height: 6px; background: #333; border-radius: 3px; overflow: hidden; }
.icm-fill { height: 100%; background: var(--ide-accent); border-radius: 3px; transition: width 0.3s ease; }
.icm-text {
    color: #858585; font-size: 12px; margin-top: 10px; font-family: Consolas, monospace;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* ============ AI 助手面板 ============ */
.ide-ai-panel {
    position: relative; display: flex; flex-direction: column; flex-shrink: 0;
    background: var(--ide-sidebar); border-left: 1px solid var(--ide-border);
    height: 100%; min-width: 300px; overflow: hidden; z-index: 40;
}
.ai-resizer { position: absolute; left: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; }
.ai-resizer:hover { background: rgba(0,122,204,0.3); }
.ai-header {
    display: flex; align-items: center; justify-content: space-between; padding: 0 8px;
    height: 36px; background: var(--ide-tabbar); border-bottom: 1px solid var(--ide-border); flex-shrink: 0;
}
.ai-header-model { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ai-logo { color: var(--ide-accent); font-size: 16px; }
.ai-title { font-weight: 600; color: var(--ide-text-bright); font-size: 13px; white-space: nowrap; }
.ai-model-select {
    background: #3c3c3c; color: var(--ide-text); border: 1px solid var(--ide-border);
    border-radius: 3px; font-size: 11px; padding: 2px 4px; max-width: 170px; outline: none;
}
.ai-header-actions { display: flex; align-items: center; gap: 2px; }
.ai-header-actions i { font-size: 15px; cursor: pointer; padding: 4px; border-radius: 3px; color: var(--ide-text); }
.ai-header-actions i:hover { background: #37373d; color: var(--ide-text-bright); }
.ai-body { flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; }
.ai-chat { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.ai-messages { flex: 1; overflow-y: auto; padding: 12px 10px; }
.ai-messages::-webkit-scrollbar { width: 8px; }
.ai-messages::-webkit-scrollbar-thumb { background: #4a4a4a; border-radius: 4px; }

/* 空状态 */
.ai-empty { text-align: center; padding: 40px 16px; color: var(--ide-text-dim); }
.ai-empty-icon { font-size: 40px; margin-bottom: 10px; }
.ai-empty-title { font-size: 15px; color: var(--ide-text-bright); margin: 0 0 6px; }
.ai-empty-sub { font-size: 12px; margin: 0 0 20px; }
.ai-suggests { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.ai-suggests span {
    padding: 6px 12px; background: #333; border: 1px solid #454545; border-radius: 4px;
    font-size: 12px; cursor: pointer; color: var(--ide-text);
}
.ai-suggests span:hover { border-color: var(--ide-accent); color: var(--ide-text-bright); }

/* 消息 */
.ai-msg { display: flex; margin-bottom: 14px; gap: 8px; }
.ai-avatar {
    width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0; display: flex; align-items: center;
    justify-content: center; font-size: 11px; color: #fff; margin-top: 2px;
}
.av-user { background: #4a6fa5; }
.av-assistant { background: #007acc; }
.ai-bubble { flex: 1; min-width: 0; }
.ai-msg-text { font-size: 13px; line-height: 1.6; color: #d4d4d4; word-break: break-word; }
.ai-user-text { white-space: pre-wrap; word-break: break-word; }
.ai-msg-actions { display: flex; gap: 12px; margin-top: 4px; font-size: 11px; color: var(--ide-text-dim); }
.ai-msg-actions span { cursor: pointer; }
.ai-msg-actions span:hover { color: var(--ide-accent); }

/* 打字动画 */
.ai-typing { display: flex; gap: 4px; padding: 8px 2px; }
.ai-typing span { width: 6px; height: 6px; background: #888; border-radius: 50%; animation: ai-blink 1.2s infinite; }
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes ai-blink { 0%,80%,100% { opacity: 0.2; } 40% { opacity: 1; } }

/* Markdown 元素 */
.ai-md-p { margin: 4px 0; }
.ai-md-h1, .ai-md-h2, .ai-md-h3, .ai-md-h4, .ai-md-h5, .ai-md-h6 { margin: 10px 0 6px; color: var(--ide-text-bright); font-weight: 600; }
.ai-md-h1 { font-size: 17px; } .ai-md-h2 { font-size: 16px; } .ai-md-h3 { font-size: 15px; }
.ai-md-h4 { font-size: 14px; } .ai-md-h5 { font-size: 13px; } .ai-md-h6 { font-size: 13px; }
.ai-md-hr { border: none; border-top: 1px solid #3c3c3c; margin: 10px 0; }
.ai-md-quote { border-left: 3px solid var(--ide-accent); padding: 4px 10px; margin: 6px 0; background: #2a2d2e; color: #a8a8a8; }
.ai-md-list { margin: 4px 0; }
.ai-md-li { display: flex; gap: 6px; padding: 2px 0; }
.ai-md-bullet { color: var(--ide-accent); flex-shrink: 0; }
.ai-md-table { border-collapse: collapse; margin: 8px 0; font-size: 12px; width: 100%; }
.ai-md-table th, .ai-md-table td { border: 1px solid #3c3c3c; padding: 4px 8px; text-align: left; }
.ai-md-table th { background: #2d2d2d; color: var(--ide-text-bright); }
.ai-inline-code { background: #3c3c3c; color: #dcdcaa; padding: 1px 5px; border-radius: 3px; font-family: Consolas, monospace; font-size: 12px; }
.ai-msg-text a { color: #4daafc; text-decoration: none; }
.ai-msg-text strong { color: var(--ide-text-bright); }

/* 用户消息附件 */
.ai-user-attachments { margin-bottom: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.ai-att-image { display: inline-block; max-width: 200px; max-height: 200px; border-radius: 6px; overflow: hidden; border: 1px solid #3c3c3c; background: #1e1e1e; }
.ai-att-image img { display: block; max-width: 100%; max-height: 200px; object-fit: contain; }
.ai-att-file { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; background: #2d2d2d; border: 1px solid #3c3c3c; border-radius: 4px; font-size: 12px; color: #ccc; font-family: Consolas, monospace; }
.ai-att-file i { color: var(--ide-accent); }

/* 知识库选择面板 */
.ai-kb-picker { position: absolute; bottom: 100%; left: 10px; right: 10px; z-index: 20; background: #252526; border: 1px solid #3c3c3c; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.4); margin-bottom: 4px; overflow: hidden; }
.ai-kb-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border-bottom: 1px solid #333; background: #2d2d2d; }
.ai-kb-title { display: flex; align-items: center; gap: 6px; font-size: 13px; color: #fff; font-weight: 600; }
.ai-kb-close { cursor: pointer; color: #858585; font-size: 14px; padding: 2px 4px; border-radius: 3px; }
.ai-kb-close:hover { color: #fff; background: #3c3c3c; }
.ai-kb-actions { display: flex; align-items: center; gap: 6px; }
.ai-kb-manage { cursor: pointer; color: #858585; font-size: 12px; padding: 2px 8px; border-radius: 3px; border: 1px solid #454545; display: flex; align-items: center; gap: 3px; }
.ai-kb-manage:hover { color: #fff; background: #3c3c3c; border-color: #555; }
.ai-kb-link { color: #4daafc; cursor: pointer; text-decoration: underline; }
.ai-kb-link:hover { color: #6dbcfc; }
.ai-kb-list { max-height: 240px; overflow-y: auto; }
.ai-kb-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; cursor: pointer; font-size: 12px; border-bottom: 1px solid #2a2a2a; }
.ai-kb-item:hover { background: #2a2d2e; }
.ai-kb-name { flex: 1; color: #ccc; font-family: Consolas, monospace; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-kb-count { font-size: 11px; color: #858585; flex-shrink: 0; }
.ai-kb-add { font-size: 11px; color: #89d185; flex-shrink: 0; padding: 1px 6px; border: 1px solid rgba(137,209,133,0.4); border-radius: 3px; }
.ai-kb-item:hover .ai-kb-add { background: rgba(137,209,133,0.15); }
.ai-kb-add.active { color: #f48771; border-color: rgba(244,135,113,0.4); }
.ai-kb-item:hover .ai-kb-add.active { background: rgba(244,135,113,0.15); }
.ai-kb-item.selected { background: #2a2d2e; }
.ai-kb-empty { padding: 20px; text-align: center; color: #858585; font-size: 12px; }

/* 代码块 */
.ai-codeblock { margin: 8px 0; border: 1px solid #2d2d2d; border-radius: 4px; overflow: hidden; background: #1e1e1e; }
.ai-codeblock-head { display: flex; align-items: center; justify-content: space-between; background: #2d2d2d; padding: 4px 10px; font-size: 11px; color: var(--ide-text-dim); }
.ai-cb-lang { display: flex; align-items: center; gap: 4px; }
.ai-cb-actions { display: flex; gap: 8px; }
.ai-cb-btn { cursor: pointer; display: flex; align-items: center; gap: 3px; }
.ai-cb-btn:hover { color: var(--ide-text-bright); }
.ai-cb-btn.apply { color: #89d185; }
.ai-codeblock pre { margin: 0; padding: 8px 10px; overflow-x: auto; background: #1e1e1e !important; }
.ai-codeblock code { font-family: Consolas, "Courier New", monospace; font-size: 12px; line-height: 1.5; background: #1e1e1e !important; color: #d4d4d4 !important; }
.ai-codeblock pre::-webkit-scrollbar { height: 6px; }
.ai-codeblock pre::-webkit-scrollbar-thumb { background: #4a4a4a; }

/* 会话历史 */
.ai-history { flex: 1; overflow-y: auto; padding: 10px; }
.ai-history-title { font-size: 12px; color: var(--ide-text-dim); padding: 6px 4px; }
.ai-history-empty { text-align: center; color: var(--ide-text-dim); padding: 30px 0; font-size: 12px; }
.ai-history-item {
    padding: 8px 10px; border-radius: 4px; cursor: pointer; border: 1px solid transparent; margin-bottom: 4px;
}
.ai-history-item:hover { background: #2d2d2d; }
.ai-history-item.active { background: #37373d; border-color: var(--ide-accent); }
.ai-hi-title { font-size: 13px; color: var(--ide-text-bright); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-hi-meta { font-size: 11px; color: var(--ide-text-dim); margin-top: 2px; }
.ai-hi-ops { display: none; gap: 8px; margin-top: 4px; font-size: 13px; }
.ai-hi-ops i { cursor: pointer; color: var(--ide-text-dim); }
.ai-hi-ops i:hover { color: var(--ide-accent); }
.ai-history-item:hover .ai-hi-ops { display: flex; }

/* Diff 审核区 */
.ai-diff { border-top: 1px solid var(--ide-border); max-height: 40%; overflow-y: auto; background: #222; flex-shrink: 0; }
.ai-diff::-webkit-scrollbar { width: 8px; }
.ai-diff::-webkit-scrollbar-thumb { background: #4a4a4a; }
.ai-diff-head { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: #2a4d3c; color: #b8e0c5; font-size: 12px; position: sticky; top: 0; z-index: 2; }
.ai-diff-title { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.ai-diff-count { font-size: 11px; }
.ai-diff-btn { padding: 2px 8px; border-radius: 3px; cursor: pointer; font-size: 11px; border: 1px solid #454545; color: var(--ide-text); white-space: nowrap; }
.ai-diff-btn:hover { background: #3c3c3c; }
.ai-diff-btn.ok { color: #89d185; border-color: rgba(137,209,133,0.4); }
.ai-diff-btn.ok:hover { background: rgba(137,209,133,0.12); }
.ai-diff-btn.warn { color: #e2c08d; border-color: rgba(226,192,141,0.4); }
.ai-diff-btn.x { border: none; color: var(--ide-text-dim); }
.ai-diff-file { border-bottom: 1px solid #2d2d2d; }
.ai-diff-file-head { display: flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer; }
.ai-diff-file-head:hover { background: #2b2b2b; }
.ai-diff-tag { font-size: 10px; padding: 1px 5px; border-radius: 3px; }
.ai-diff-tag.t-create { background: rgba(137,209,133,0.15); color: #89d185; }
.ai-diff-tag.t-write { background: rgba(226,192,141,0.15); color: #e2c08d; }
.ai-diff-tag.t-delete { background: rgba(244,135,113,0.15); color: #f48771; }
.ai-diff-file-path { flex: 1; font-size: 12px; font-family: Consolas, monospace; color: var(--ide-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-diff-file-stat { font-size: 11px; color: var(--ide-text-dim); }
.ai-diff-arrow { transition: transform 0.15s; font-size: 12px; color: var(--ide-text-dim); }
.ai-diff-arrow.open { transform: rotate(90deg); }
.ai-diff-file-body { padding: 4px 10px 8px; }
.ai-diff-hunk { margin-bottom: 8px; border: 1px solid #2d2d2d; border-radius: 4px; overflow: hidden; }
.ai-diff-hunk.hunk-accepted { border-color: rgba(137,209,133,0.5); }
.ai-diff-hunk.hunk-accepted .ai-diff-hunk-ops { background: rgba(137,209,133,0.1); }
.ai-diff-hunk.hunk-rejected { border-color: rgba(244,135,113,0.4); opacity: 0.55; }
.ai-diff-hunk.hunk-rejected .ai-diff-hunk-ops { background: rgba(244,135,113,0.08); }
.ai-diff-hunk.hunk-pending { border-color: #3a3a3a; }
.ai-diff-btn.active { background: rgba(137,209,133,0.2) !important; color: #89d185 !important; border-color: #89d185 !important; }
.ai-diff-btn.ok.active { background: rgba(137,209,133,0.2) !important; }
.ai-diff-btn:not(.ok).active { background: rgba(244,135,113,0.2) !important; color: #f48771 !important; border-color: #f48771 !important; }
.ai-diff-hunk-ops { display: flex; align-items: center; gap: 6px; padding: 4px 8px; background: #2d2d2d; }
.ai-diff-hunk-info { margin-left: auto; font-size: 11px; color: var(--ide-text-dim); }
.ai-diff-lines { font-family: Consolas, monospace; font-size: 12px; line-height: 1.5; }
.ai-dl { display: flex; white-space: pre; }
.ai-dl-num { width: 34px; text-align: right; padding-right: 8px; color: #6a6a6a; user-select: none; flex-shrink: 0; }
.ai-dl-text { flex: 1; overflow-x: hidden; text-overflow: ellipsis; padding-left: 4px; }
.ai-dl.dl-add { background: rgba(137,209,133,0.14); }
.ai-dl.dl-add .ai-dl-text { color: #c8e6c9; }
.ai-dl.dl-del { background: rgba(244,135,113,0.14); }
.ai-dl.dl-del .ai-dl-text { color: #ffcdd2; }
.ai-dl.dl-ctx .ai-dl-text { color: #b0b0b0; }
.ai-diff-hunk-edit { padding: 6px; background: #252525; }
.ai-diff-edit-ta { width: 100%; min-height: 80px; background: #1e1e1e; color: #d4d4d4; border: 1px solid #3c3c3c; border-radius: 3px; font-family: Consolas, monospace; font-size: 12px; padding: 6px; resize: vertical; outline: none; }
.ai-diff-hunk-edit-ops { display: flex; justify-content: flex-end; gap: 6px; margin-top: 6px; }
.ai-diff-file-foot { display: flex; gap: 6px; padding: 4px 0; }

/* 输入区 */
.ai-input { position: relative; border-top: 1px solid var(--ide-border); background: var(--ide-tabbar); flex-shrink: 0; padding: 8px 10px 10px; }
.ai-ctx-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.ai-ctx-tag { display: flex; align-items: center; gap: 3px; background: #3a3d41; color: #c8c8c8; font-size: 11px; padding: 2px 6px; border-radius: 3px; }
.ai-ctx-tag i:first-child { color: var(--ide-accent); font-size: 12px; }
.ai-ctx-del { cursor: pointer; font-size: 11px; color: var(--ide-text-dim); margin-left: 2px; }
.ai-ctx-del:hover { color: #f48771; }
.ai-ctx-clear { font-size: 11px; color: var(--ide-text-dim); cursor: pointer; align-self: center; }
.ai-ctx-clear:hover { color: var(--ide-accent); }
.ai-textarea {
    width: 100%; min-height: 60px; max-height: 140px; resize: vertical; background: #1e1e1e;
    color: var(--ide-text); border: 1px solid #3c3c3c; border-radius: 4px; padding: 8px;
    font-family: inherit; font-size: 13px; outline: none; line-height: 1.5;
}
.ai-textarea:focus { border-color: var(--ide-accent); }
.ai-input-bottom { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.ai-input-tools { display: flex; gap: 4px; }
.ai-tool { width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; background: #333; border: 1px solid #454545; border-radius: 4px; cursor: pointer; font-size: 14px; color: var(--ide-text); }
.ai-tool:hover { color: var(--ide-text-bright); }
.ai-tool.active { border-color: var(--ide-accent); color: var(--ide-accent); }
.ai-token-hint { font-size: 11px; color: var(--ide-text-dim); }
.ai-send-btn { padding: 5px 16px; border-radius: 4px; border: none; cursor: pointer; font-size: 13px; background: var(--ide-accent); color: #fff; }
.ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ai-send-btn:hover:not(:disabled) { filter: brightness(1.1); }
.ai-send-btn.stop { background: #e51400; }

/* 指令 / @文件选择器 */
.ai-picker { position: absolute; bottom: 100%; left: 10px; right: 10px; z-index: 20; background: #252526; border: 1px solid #3c3c3c; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.4); margin-bottom: 4px; overflow: hidden; }
.ai-picker-search { padding: 6px; border-bottom: 1px solid #333; }
.ai-picker-search input { width: 100%; background: #1e1e1e; color: var(--ide-text); border: 1px solid #3c3c3c; border-radius: 3px; padding: 5px 8px; font-size: 12px; outline: none; }
.ai-picker-list { max-height: 200px; overflow-y: auto; }
.ai-picker-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; cursor: pointer; font-size: 12px; }
.ai-picker-item.active { background: #094771; }
.ai-picker-item.disabled { opacity: 0.45; cursor: not-allowed; }
.ai-picker-item:hover:not(.disabled) { background: #333; }
.ai-pi-icon { color: #e8a33d; width: 16px; }
.ai-pi-name { color: var(--ide-text-bright); font-family: Consolas, monospace; }
.ai-pi-desc { color: var(--ide-text-dim); margin-left: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-pi-path { color: var(--ide-text-dim); margin-left: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-pi-ok { margin-left: auto; color: #89d185; }
.ai-pi-ok.no { color: var(--ide-text-dim); }
.ai-picker-empty { padding: 12px; text-align: center; color: var(--ide-text-dim); font-size: 12px; }

/* 选中代码悬浮工具栏 */
.ai-selection-toolbar {
    position: fixed; z-index: 999; display: flex; gap: 2px; background: #333; border: 1px solid #454545;
    border-radius: 4px; padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,0.4); transform: translateX(-50%);
}
.ai-selection-toolbar span { padding: 4px 8px; cursor: pointer; font-size: 12px; color: var(--ide-text); white-space: nowrap; }
.ai-selection-toolbar span:hover { background: #007acc; color: #fff; border-radius: 3px; }
.ai-selection-toolbar span i { margin-right: 3px; }

/* 活动栏徽标 */
.ab-badge { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; animation: ai-blink 1.2s infinite; }

/* AI 设置弹窗 */
.ai-set-providers { margin-bottom: 14px; }
.ai-set-sec-title { display: flex; align-items: center; justify-content: space-between; font-weight: 600; color: var(--ide-text-bright); margin-bottom: 8px; }
.ai-set-empty { color: var(--ide-text-dim); font-size: 12px; padding: 10px 0; }
.ai-set-provider { display: flex; align-items: center; justify-content: space-between; background: #2d2d2d; border-radius: 4px; padding: 8px 10px; margin-bottom: 6px; gap: 8px; }
.ai-sp-info { display: flex; flex-direction: column; min-width: 0; }
.ai-sp-name { color: var(--ide-text-bright); font-size: 13px; font-weight: 600; }
.ai-sp-model { color: var(--ide-accent); font-size: 12px; font-family: Consolas, monospace; }
.ai-sp-url { color: var(--ide-text-dim); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-sp-key { color: var(--ide-text-dim); font-size: 11px; }
.ai-sp-ops { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ide-text-dim); }
.ai-sp-ops i { cursor: pointer; }
.ai-sp-ops i:hover { color: var(--ide-accent); }
.ai-sp-default { font-size: 11px; color: #89d185; border: 1px solid rgba(137,209,133,0.4); padding: 1px 5px; border-radius: 3px; }
.ai-set-sec { margin-bottom: 14px; }
.ai-set-prompt { width: 100%; background: #1e1e1e; color: var(--ide-text); border: 1px solid #3c3c3c; border-radius: 4px; padding: 8px; font-size: 12px; resize: vertical; outline: none; font-family: inherit; }
.ai-link { color: var(--ide-accent); cursor: pointer; font-size: 12px; }
.ai-link:hover { text-decoration: underline; }
.ai-set-checks { display: flex; flex-wrap: wrap; gap: 12px; }
.ai-set-checks label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ide-text); cursor: pointer; }
.ai-set-row { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--ide-text); }
.ai-set-row input { background: #1e1e1e; color: var(--ide-text); border: 1px solid #3c3c3c; border-radius: 3px; padding: 4px 6px; }
.ai-set-row3 { display: flex; gap: 10px; }
.ai-set-row3 .field { flex: 1; }

/* ============ Element UI 深色模式全面适配 ============ */
.el-button {
    background: #3c3c3c !important; border-color: #3c3c3c !important; color: #ccc !important;
}
.el-button:hover { background: #4d4d4d !important; border-color: #4d4d4d !important; color: #fff !important; }
.el-button--primary {
    background: var(--ide-accent) !important; border-color: var(--ide-accent) !important; color: #fff !important;
}
.el-button--primary:hover { background: #1b8fe3 !important; border-color: #1b8fe3 !important; }
.el-button--text { background: transparent !important; border: none !important; color: var(--ide-accent) !important; }
.el-button--mini, .el-button--small { font-size: 12px; }

.el-input__inner {
    background: #1e1e1e !important; border: 1px solid #3c3c3c !important; color: #ccc !important;
}
.el-input__inner:focus { border-color: var(--ide-accent) !important; }
.el-input__inner::placeholder { color: #6f6f6f !important; }

.el-textarea__inner {
    background: #1e1e1e !important; border: 1px solid #3c3c3c !important; color: #ccc !important;
}
.el-textarea__inner:focus { border-color: var(--ide-accent) !important; }

.el-select .el-input__inner { background: #1e1e1e !important; }
.el-select-dropdown {
    background: #252526 !important; border: 1px solid #3c3c3c !important;
}
.el-select-dropdown__item { color: #ccc !important; }
.el-select-dropdown__item:hover { background: #2a2d2e !important; }
.el-select-dropdown__item.selected { color: var(--ide-accent) !important; font-weight: 600; }
.el-select-dropdown__item.hover { background: #2a2d2e !important; }

.el-dialog {
    background: #252526 !important; border: 1px solid #3c3c3c !important; border-radius: 8px !important;
}
.el-dialog__title { color: #fff !important; }
.el-dialog__header { border-bottom: 1px solid #3c3c3c !important; }
.el-dialog__body { color: #ccc !important; }
.el-dialog__footer { border-top: 1px solid #3c3c3c !important; }
.el-dialog__close { color: #858585 !important; }
.el-dialog__close:hover { color: #fff !important; }

.el-message {
    background: #2d2d2d !important; border: 1px solid #3c3c3c !important; color: #ccc !important;
}
.el-message--success { background: rgba(137,209,133,0.12) !important; border-color: rgba(137,209,133,0.4) !important; color: #89d185 !important; }
.el-message--warning { background: rgba(226,192,141,0.12) !important; border-color: rgba(226,192,141,0.4) !important; color: #e2c08d !important; }
.el-message--error { background: rgba(244,135,113,0.12) !important; border-color: rgba(244,135,113,0.4) !important; color: #f48771 !important; }
.el-message--info { background: #2d2d2d !important; border-color: #3c3c3c !important; color: #ccc !important; }
.el-message__icon { vertical-align: middle; }

.el-notification {
    background: #252526 !important; border: 1px solid #3c3c3c !important; color: #ccc !important;
}
.el-notification__title { color: #fff !important; }
.el-notification__content { color: #ccc !important; }

.el-form-item__label { color: #ccc !important; }
.el-form-item__error { color: #f48771 !important; }

.el-checkbox__label { color: #ccc !important; }
.el-checkbox__inner { background: #1e1e1e !important; border: 1px solid #3c3c3c !important; }
.el-checkbox__input.is-checked .el-checkbox__inner {
    background: var(--ide-accent) !important; border-color: var(--ide-accent) !important;
}

.el-radio__label { color: #ccc !important; }
.el-radio__inner { background: #1e1e1e !important; border: 1px solid #3c3c3c !important; }
.el-radio__input.is-checked .el-radio__inner {
    background: var(--ide-accent) !important; border-color: var(--ide-accent) !important;
}

.el-switch__core { background: #3c3c3c !important; border: 1px solid #3c3c3c !important; }
.el-switch.is-checked .el-switch__core { background: var(--ide-accent) !important; border-color: var(--ide-accent) !important; }

.el-tabs__item { color: #858585 !important; }
.el-tabs__item:hover { color: #ccc !important; }
.el-tabs__item.is-active { color: #fff !important; }
.el-tabs__active-bar { background-color: var(--ide-accent) !important; }
.el-tabs__nav-wrap::after { background-color: #3c3c3c !important; }

.el-table { background: #1e1e1e !important; color: #ccc !important; }
.el-table th, .el-table tr { background: #2d2d2d !important; color: #fff !important; }
.el-table td, .el-table th.is-leaf { border-bottom: 1px solid #3c3c3c !important; }
.el-table--enable-row-hover .el-table__body tr:hover > td { background: #2a2d2e !important; }
.el-table__empty-text { color: #858585 !important; }

.el-pagination { color: #ccc !important; }
.el-pagination button, .el-pagination span:not([class*=suffix]) { color: #ccc !important; }
.el-pagination .btn-prev, .el-pagination .btn-next { background: #3c3c3c !important; color: #ccc !important; }
.el-pager li { background: #3c3c3c !important; color: #ccc !important; }
.el-pager li.active { background: var(--ide-accent) !important; color: #fff !important; }

.el-popover {
    background: #252526 !important; border: 1px solid #3c3c3c !important; color: #ccc !important;
}
.el-popover__title { color: #fff !important; }

.el-tooltip__popper.is-dark { background: #252526 !important; border: 1px solid #3c3c3c !important; }
.el-tooltip__popper.is-dark .popper__arrow { border-bottom-color: #3c3c3c !important; }

.el-loading-mask { background: rgba(0,0,0,0.6) !important; }
.el-loading-spinner .path { stroke: var(--ide-accent) !important; }
.el-loading-text { color: #ccc !important; }

.el-scrollbar__wrap { scrollbar-width: thin; }
.el-scrollbar__thumb { background: #4a4a4a !important; }

.el-dropdown-menu {
    background: #252526 !important; border: 1px solid #3c3c3c !important;
}
.el-dropdown-menu__item { color: #ccc !important; }
.el-dropdown-menu__item:hover { background: #2a2d2e !important; color: #fff !important; }

.el-breadcrumb__inner { color: #858585 !important; }
.el-breadcrumb__inner a:hover { color: var(--ide-accent) !important; }
.el-breadcrumb__separator { color: #6f6f6f !important; }

.el-tag {
    background: #3c3c3c !important; border: 1px solid #454545 !important; color: #ccc !important;
}
.el-tag--success { background: rgba(137,209,133,0.15) !important; border-color: rgba(137,209,133,0.4) !important; color: #89d185 !important; }
.el-tag--warning { background: rgba(226,192,141,0.15) !important; border-color: rgba(226,192,141,0.4) !important; color: #e2c08d !important; }
.el-tag--danger { background: rgba(244,135,113,0.15) !important; border-color: rgba(244,135,113,0.4) !important; color: #f48771 !important; }
.el-tag--info { background: #3c3c3c !important; border-color: #454545 !important; color: #ccc !important; }

.el-card {
    background: #252526 !important; border: 1px solid #3c3c3c !important; color: #ccc !important;
}
.el-card__header { border-bottom: 1px solid #3c3c3c !important; color: #fff !important; }

.el-alert {
    background: #2d2d2d !important; border: 1px solid #3c3c3c !important;
}
.el-alert--success { background: rgba(137,209,133,0.1) !important; border-color: rgba(137,209,133,0.3) !important; }
.el-alert--warning { background: rgba(226,192,141,0.1) !important; border-color: rgba(226,192,141,0.3) !important; }
.el-alert--error { background: rgba(244,135,113,0.1) !important; border-color: rgba(244,135,113,0.3) !important; }
.el-alert__title { color: #fff !important; }
.el-alert__description { color: #ccc !important; }

.el-progress-bar__outer { background: #3c3c3c !important; }
.el-progress__text { color: #ccc !important; }

.el-slider__runway { background: #3c3c3c !important; }
.el-slider__bar { background: var(--ide-accent) !important; }
.el-slider__button { border: 2px solid var(--ide-accent) !important; }

.el-date-editor .el-input__inner { background: #1e1e1e !important; }
.el-picker-panel { background: #252526 !important; border: 1px solid #3c3c3c !important; color: #ccc !important; }
.el-date-picker__header-label { color: #fff !important; }
.el-date-table th { color: #858585 !important; border-bottom: 1px solid #3c3c3c !important; }
.el-date-table td.available:hover { background: #2a2d2e !important; }
.el-date-table td.today .el-date-table-cell__text { color: var(--ide-accent) !important; }
.el-date-table td.current:not(.disabled) .el-date-table-cell__text { background: var(--ide-accent) !important; color: #fff !important; }

/* ============ 登录/注册弹窗 ============ */
.auth-modal .auth-box { width: 400px; max-width: 90vw; }
.auth-body { padding: 20px 24px 24px; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-field label { font-size: 13px; color: #ccc; font-weight: 500; }
.auth-required { color: #f48771; }
.auth-field input {
    width: 100%; padding: 9px 12px; background: #1e1e1e; border: 1px solid #3c3c3c;
    border-radius: 4px; color: #ccc; font-size: 13px; outline: none; box-sizing: border-box;
    transition: border-color 0.15s;
}
.auth-field input:focus { border-color: var(--ide-accent); }
.auth-field input::placeholder { color: #6f6f6f; }
.auth-captcha { display: flex; gap: 8px; align-items: center; }
.auth-captcha input { flex: 1; }
.auth-captcha-img { width: 110px; height: 36px; border-radius: 4px; cursor: pointer; border: 1px solid #3c3c3c; object-fit: cover; }
.auth-captcha-refresh {
    width: 110px; height: 36px; display: flex; align-items: center; justify-content: center;
    background: #2d2d2d; border: 1px solid #3c3c3c; border-radius: 4px; color: #89d185;
    font-size: 12px; cursor: pointer; flex-shrink: 0;
}
.auth-captcha-refresh:hover { background: #3a3a3a; }
.auth-submit {
    width: 100%; padding: 10px; background: var(--ide-accent); color: #fff; border: none;
    border-radius: 4px; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px;
    transition: filter 0.15s;
}
.auth-submit:hover:not(:disabled) { filter: brightness(1.1); }
.auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-switch { text-align: center; font-size: 13px; color: #858585; margin-top: 4px; }
.auth-switch span { color: #4daafc; cursor: pointer; }
.auth-switch span:hover { text-decoration: underline; }

/* ========== 增强版文件历史查看器（IDEA 风格） ========== */
.history-viewer-modal { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.6); z-index: 100003; display: flex; align-items: center; justify-content: center; }
.hv-box { width: 90vw; height: 80vh; background: #1e1e1e; border: 1px solid #3c3c3c; border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5); }
.hv-head { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #2d2d2d; border-bottom: 1px solid #3c3c3c; }
.hv-title { display: flex; align-items: center; gap: 6px; color: #fff; font-size: 13px; font-weight: 600; max-width: 300px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-title i { color: #4daafc; }
.hv-nav { display: flex; gap: 2px; align-items: center; }
.hv-nav-btn { width: 26px; height: 24px; display: flex; align-items: center; justify-content: center; color: #ccc; background: #3c3c3c; border: 1px solid #454545; border-radius: 3px; cursor: pointer; font-size: 12px; transition: all 0.15s; }
.hv-nav-btn:hover { background: #0e639c; border-color: #1177bb; color: #fff; }
.hv-nav-btn.disabled { opacity: 0.3; cursor: not-allowed; }
.hv-nav-btn.disabled:hover { background: #3c3c3c; border-color: #454545; color: #ccc; }
.hv-tabs { display: flex; gap: 2px; background: #1e1e1e; border-radius: 4px; padding: 2px; }
.hv-tab { padding: 4px 12px; font-size: 12px; color: #858585; cursor: pointer; border-radius: 3px; transition: all 0.15s; }
.hv-tab:hover { color: #ccc; }
.hv-tab.active { background: #0e639c; color: #fff; }
.hv-ref-select { background: #3c3c3c; color: #ccc; border: 1px solid #454545; border-radius: 3px; padding: 4px 8px; font-size: 12px; outline: none; }
.hv-ref-select:focus { border-color: #0e639c; }
.hv-close { color: #858585; font-size: 18px; cursor: pointer; padding: 2px 6px; border-radius: 3px; margin-left: auto; }
.hv-close:hover { color: #fff; background: #3c3c3c; }
.hv-body { flex: 1; display: flex; overflow: hidden; }
.hv-list { width: 280px; border-right: 1px solid #3c3c3c; overflow-y: auto; background: #252526; }
.hv-list::-webkit-scrollbar { width: 6px; }
.hv-list::-webkit-scrollbar-thumb { background: #4a4a4a; border-radius: 3px; }
.hv-item { padding: 10px 12px; border-bottom: 1px solid #2a2a2a; cursor: pointer; transition: background 0.15s; }
.hv-item:hover { background: #2a2d2e; }
.hv-item.active { background: #094771; border-left: 3px solid #0e639c; }
.hv-item-top { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.hv-commit { font-family: Consolas, monospace; font-size: 11px; color: #fff; background: #0e639c; padding: 1px 6px; border-radius: 3px; flex-shrink: 0; }
.hv-author { font-size: 12px; color: #4daafc; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hv-item-msg { font-size: 12px; color: #ccc; line-height: 1.4; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hv-item-date { font-size: 11px; color: #858585; }
.hv-diff { flex: 1; overflow: hidden; position: relative; }
.history-diff-host { width: 100%; height: 100%; }
.hv-empty { padding: 40px 20px; text-align: center; color: #858585; font-size: 12px; }

/* ========== 行内 Blame 标注 ========== */
.blame-gutter-line { background: rgba(77,170,252,0.06); border-left: 2px solid rgba(77,170,252,0.3); }
.monaco-editor .blame-gutter-line + .view-line { opacity: 1; }

/* ========== Git 面板 AI 按钮 ========== */
.git-ai-bar { display: flex; gap: 6px; padding: 8px 10px; border-top: 1px solid #3c3c3c; background: #2d2d2d; }
.git-ai-btn { flex: 1; padding: 6px 10px; font-size: 12px; color: #ccc; background: #3c3c3c; border: 1px solid #454545; border-radius: 4px; cursor: pointer; text-align: center; transition: all 0.15s; display: flex; align-items: center; justify-content: center; gap: 4px; }
.git-ai-btn:hover { background: #0e639c; border-color: #1177bb; color: #fff; }
.git-ai-btn i { font-size: 13px; }