/* ===== 全局重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body { padding-top: 60px; }

/* ===== 主题变量 ===== */
.sublime-app {
    /* 暗黑主题 (默认) */
    --bg: #1e1e1e;
    --bg-panel: #2d2d2d;
    --bg-sidebar: #252525;
    --bg-hover: #4a4a4a;
    --bg-file-hover: #2a2a2a;
    --bg-input: #1e1e1e;
    --border: #1a1a1a;
    --border-light: #333;
    --border-input: #555;
    --text: #ccc;
    --text-bright: #fff;
    --text-dim: #888;
    --text-muted: #999;
    --text-secondary: #aaa;
    --text-editor: #f8f8f2;
    --accent: #e6a23c;
    --accent-blue: #4a5fc6;
    --scrollbar: #555;
    --scrollbar-track: #252525;
    --gutter-bg: #252525;
    --gutter-num: #666;
    --active-line: rgba(255,255,255,0.05);
    --selection: #4a5fc6;
    --minimap-vp-bg: rgba(255,255,255,0.07);
    --minimap-vp-border: rgba(255,255,255,0.12);
    --overlay-bg: rgba(0,0,0,0.3);
    --shadow-heavy: rgba(0,0,0,0.6);
    --shadow-medium: rgba(0,0,0,0.4);
    --kbd-bg: #333;
    --kbd-text: #ddd;
    --close-hover: rgba(255,255,255,0.15);
    /* syntax */
    --syn-keyword: #f92672;
    --syn-string: #e6db74;
    --syn-comment: #75715e;
    --syn-func: #a6e22e;
    --syn-var: #f8f8f2;
    --syn-var2: #fd971f;
    --syn-number: #ae81ff;
}
.sublime-app.theme-light {
    --bg: #ffffff;
    --bg-panel: #f3f3f3;
    --bg-sidebar: #f5f5f5;
    --bg-hover: #e0e0e0;
    --bg-file-hover: #e8e8e8;
    --bg-input: #ffffff;
    --border: #e0e0e0;
    --border-light: #ddd;
    --border-input: #ccc;
    --text: #333;
    --text-bright: #000;
    --text-dim: #666;
    --text-muted: #777;
    --text-secondary: #555;
    --text-editor: #333;
    --accent: #d48806;
    --accent-blue: #4a5fc6;
    --scrollbar: #c1c1c1;
    --scrollbar-track: #f5f5f5;
    --gutter-bg: #f5f5f5;
    --gutter-num: #999;
    --active-line: rgba(0,0,0,0.04);
    --selection: #add6ff;
    --minimap-vp-bg: rgba(0,0,0,0.06);
    --minimap-vp-border: rgba(0,0,0,0.1);
    --overlay-bg: rgba(0,0,0,0.15);
    --shadow-heavy: rgba(0,0,0,0.15);
    --shadow-medium: rgba(0,0,0,0.1);
    --kbd-bg: #eee;
    --kbd-text: #333;
    --close-hover: rgba(0,0,0,0.1);
    --syn-keyword: #af00db;
    --syn-string: #a31515;
    --syn-comment: #008000;
    --syn-func: #795e26;
    --syn-var: #333;
    --syn-var2: #001080;
    --syn-number: #098658;
}

/* ===== 主布局 ===== */
.sublime-app {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 60px);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    user-select: none;
    transition: background 0.3s, color 0.3s;
}

/* ===== 文件名编辑 ===== */
.file-name-input {
    background: var(--bg-input);
    border: 1px solid var(--accent);
    border-radius: 2px;
    color: var(--text-editor);
    font-size: 12.5px;
    padding: 1px 4px;
    outline: none;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.tab-label-edit {
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--accent);
    color: inherit;
    font-size: 12px;
    outline: none;
    width: 100%;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ===== 内容区 ===== */
.st-main {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ===== 编辑器区 ===== */
.st-editor-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-width: 0;
}

/* ===== 标签栏 ===== */
.st-tabbar {
    display: flex;
    align-items: flex-end;
    background: var(--bg-panel);
    height: 35px;
    overflow-x: auto;
    overflow-y: hidden;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.st-tabbar::-webkit-scrollbar { height: 0; }
.st-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 15px;
    height: 33px;
    background: var(--bg-panel);
    color: var(--text-dim);
    border-right: 1px solid var(--border);
    cursor: pointer;
    white-space: nowrap;
    font-size: 12px;
    min-width: 100px;
    max-width: 180px;
    position: relative;
    transition: color 0.15s;
}
.st-tab:hover { color: var(--text); }
.st-tab.active {
    background: var(--bg);
    color: var(--text-bright);
    border-bottom: 2px solid var(--accent);
}
.st-tab .tab-icon { font-size: 11px; flex-shrink: 0; }
.st-tab .tab-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.st-tab .tab-modified { color: var(--accent); font-size: 16px; line-height: 1; }
.st-tab .tab-close {
    opacity: 0; font-size: 10px; padding: 2px 3px;
    border-radius: 3px; flex-shrink: 0;
}
.st-tab:hover .tab-close { opacity: 0.6; }
.st-tab .tab-close:hover { opacity: 1; background: var(--close-hover); }
.st-tab-new {
    display: flex; align-items: center; justify-content: center;
    width: 30px; height: 33px; cursor: pointer; color: var(--text-dim);
    flex-shrink: 0;
}
.st-tab-new:hover { color: var(--text-bright); }

/* ===== 编辑器容器 ===== */
.st-editor-container {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
}
.st-cm-wrap {
    flex: 1;
    overflow: hidden;
    position: relative;
}

/* ===== CodeMirror 覆盖 ===== */
.st-cm-wrap .CodeMirror {
    height: 100%;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text-editor);
}
.st-cm-wrap .CodeMirror-gutters {
    background: var(--gutter-bg) !important;
    border-right: 1px solid var(--border-light) !important;
}
.st-cm-wrap .CodeMirror-activeline-background { background: var(--active-line) !important; }
.st-cm-wrap .CodeMirror-selected { background: var(--selection) !important; }
.st-cm-wrap .CodeMirror-cursor { border-left-color: var(--text-bright) !important; border-left-width: 2px !important; }
.st-cm-wrap .CodeMirror-matchingbracket { color: var(--text-bright) !important; background: var(--close-hover); border-bottom: 1px solid var(--accent); }
.st-cm-wrap .CodeMirror-linenumber { color: var(--gutter-num) !important; font-size: 12px; padding: 0 8px 0 12px !important; }
.st-cm-wrap .CodeMirror-scrollbar-filler { background: var(--gutter-bg) !important; }
.st-cm-wrap .CodeMirror-hscrollbar::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
.st-cm-wrap .CodeMirror-vscrollbar::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }
.st-cm-wrap .CodeMirror-hscrollbar::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.st-cm-wrap .CodeMirror-vscrollbar::-webkit-scrollbar-track { background: var(--scrollbar-track); }
.st-cm-wrap .cm-s-monokai span.cm-keyword { color: var(--syn-keyword) !important; }
.st-cm-wrap .cm-s-monokai span.cm-atom { color: var(--syn-number) !important; }
.st-cm-wrap .cm-s-monokai span.cm-number { color: var(--syn-number) !important; }
.st-cm-wrap .cm-s-monokai span.cm-def { color: var(--syn-func) !important; }
.st-cm-wrap .cm-s-monokai span.cm-variable { color: var(--syn-var) !important; }
.st-cm-wrap .cm-s-monokai span.cm-variable-2 { color: var(--syn-var2) !important; }
.st-cm-wrap .cm-s-monokai span.cm-variable-3 { color: var(--syn-func) !important; }
.st-cm-wrap .cm-s-monokai span.cm-property { color: var(--syn-func) !important; }
.st-cm-wrap .cm-s-monokai span.cm-operator { color: var(--syn-keyword) !important; }
.st-cm-wrap .cm-s-monokai span.cm-string { color: var(--syn-string) !important; }
.st-cm-wrap .cm-s-monokai span.cm-string-2 { color: var(--syn-string) !important; }
.st-cm-wrap .cm-s-monokai span.cm-comment { color: var(--syn-comment) !important; font-style: italic; }
.st-cm-wrap .cm-s-monokai span.cm-tag { color: var(--syn-keyword) !important; }
.st-cm-wrap .cm-s-monokai span.cm-attribute { color: var(--syn-func) !important; }
.st-cm-wrap .cm-s-monokai span.cm-qualifier { color: var(--syn-func) !important; }
.st-cm-wrap .cm-s-monokai span.cm-type { color: var(--syn-func) !important; }
.st-cm-wrap .cm-s-monokai span.cm-builtin { color: var(--syn-var2) !important; }
.st-cm-wrap .cm-s-monokai span.cm-bracket { color: var(--text-dim) !important; }

/* ===== JSON 特定样式 - 键名高亮 ===== */
/* JSON 键名 - 使用 property 类 */
.st-cm-wrap .cm-s-monokai span.cm-property {
    color: #9cdcfe !important; /* 浅蓝色键名 */
}
/* JSON 字符串值 - 纯字符串 */
.st-cm-wrap .cm-s-monokai span.cm-string {
    color: #ce9178 !important; /* 橙色字符串值 */
}
/* 确保属性（键名）优先级更高 */
.st-cm-wrap .cm-s-monokai span.cm-property.cm-string {
    color: #9cdcfe !important;
}

/* ===== 查找高亮 ===== */
.cm-search-highlight {
    background: rgba(230, 162, 60, 0.3);
    border: 1px solid rgba(230, 162, 60, 0.8);
    border-radius: 2px;
    padding: 0 1px;
}

/* 当前选中的匹配 */
.cm-search-highlight.cm-search-selected {
    background: rgba(230, 162, 60, 0.6);
    border: 2px solid #e6a23c;
    box-shadow: 0 0 4px rgba(230, 162, 60, 0.5);
}

/* ===== CodeMirror 折叠 ===== */
.st-cm-wrap .CodeMirror-foldgutter {
    width: 15px;
}
.st-cm-wrap .CodeMirror-foldgutter-open,
.st-cm-wrap .CodeMirror-foldgutter-folded {
    color: var(--text-dim);
    cursor: pointer;
    font-size: 12px;
    text-align: center;
    line-height: 1.5;
}
.st-cm-wrap .CodeMirror-foldgutter-open:hover,
.st-cm-wrap .CodeMirror-foldgutter-folded:hover {
    color: var(--accent);
}
.st-cm-wrap .CodeMirror-foldgutter-open::after {
    content: '▼';
}
.st-cm-wrap .CodeMirror-foldgutter-folded::after {
    content: '▶';
    color: var(--accent);
}
.st-cm-wrap .CodeMirror-foldmarker {
    background: var(--bg-hover);
    border: 1px solid var(--border-input);
    border-radius: 3px;
    color: var(--accent);
    font-size: 10px;
    padding: 0 4px;
    cursor: pointer;
}

/* ===== 迷你地图 ===== */
.st-minimap {
    width: 100px;
    background: var(--bg);
    border-left: 1px solid var(--border-light);
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
    overflow: hidden;
}
.st-minimap.hidden { display: none; }
.st-minimap canvas {
    display: block;
    width: 100%;
    height: 100%;
}
.st-minimap-viewport {
    position: absolute;
    top: 0; left: 0; right: 0;
    background: var(--minimap-vp-bg);
    border: 1px solid var(--minimap-vp-border);
    pointer-events: none;
    transition: top 0.1s, height 0.1s;
}

/* ===== 查找/替换面板 ===== */
.st-find-panel {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 480px;
    max-width: calc(100% - 120px);
    background: #3a3a3a;
    border: 1px solid #555;
    border-radius: 8px;
    z-index: 100;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.st-find-panel.show { display: flex; flex-direction: column; }

/* 面板头部 */
.st-find-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-bottom: 1px solid #555;
}
.st-find-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}
.st-find-title i {
    color: var(--accent);
    font-size: 14px;
}
.st-find-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 16px;
    padding: 2px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;
}
.st-find-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
}

/* 常用正则栏 */
.st-regex-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #333;
    border-bottom: 1px solid #555;
    font-size: 12px;
}
.st-regex-label {
    color: var(--accent);
    font-weight: 500;
    font-size: 12px;
}
.st-regex-hint {
    color: #888;
    font-size: 11px;
}
.st-regex-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    flex: 1;
}
.st-regex-tag {
    background: #4a4a4a;
    border: 1px solid #555;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 11px;
    color: #ccc;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.st-regex-tag:hover {
    background: #555;
    border-color: var(--accent);
    color: #fff;
}

/* 输入区域 */
.st-find-field {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
}
.st-find-label {
    width: 50px;
    color: #888;
    font-size: 13px;
    flex-shrink: 0;
}
.st-find-input {
    flex: 1;
    background: #2a2a2a;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 6px 10px;
    color: #fff;
    font-size: 13px;
    font-family: 'Consolas', monospace;
    outline: none;
    transition: border-color 0.2s;
}
.st-find-input:focus {
    border-color: var(--accent);
}
.st-find-input::placeholder {
    color: #666;
}

/* 选项区域 */
.st-find-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px 8px 70px;
}
.st-checkbox {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}
.st-checkbox input[type="checkbox"] {
    width: 14px;
    height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
}
.st-checkbox-text {
    color: #ccc;
    font-size: 12px;
}
.st-find-info {
    color: #888;
    font-size: 12px;
}

/* 按钮区域 */
.st-find-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 8px 12px;
    border-top: 1px solid #555;
}
.st-find-action-btn {
    background: transparent;
    border: 1px solid #666;
    border-radius: 4px;
    color: #ccc;
    padding: 5px 14px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.st-find-action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: #888;
    color: #fff;
}
.st-find-action-btn.primary {
    background: var(--accent-blue);
    border-color: var(--accent-blue);
    color: #fff;
}
.st-find-action-btn.primary:hover {
    background: #5a6fd6;
    border-color: #5a6fd6;
}

/* ===== 命令面板 ===== */
.st-cmd-overlay {
    display: none;
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 500;
    background: var(--overlay-bg);
}
.st-cmd-overlay.show { display: flex; justify-content: center; }
.st-cmd-palette {
    width: 500px;
    max-width: 90%;
    background: var(--bg-panel);
    border: 1px solid var(--border-input);
    border-radius: 6px;
    box-shadow: 0 10px 40px var(--shadow-heavy);
    margin-top: 60px;
    overflow: hidden;
    height: fit-content;
    max-height: 400px;
    display: flex;
    flex-direction: column;
}
.st-cmd-input {
    width: 100%;
    background: var(--bg-input);
    border: none;
    border-bottom: 1px solid var(--border-input);
    padding: 10px 14px;
    color: var(--text-editor);
    font-size: 14px;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.st-cmd-input::placeholder { color: var(--text-dim); }
.st-cmd-list {
    overflow-y: auto;
    max-height: 340px;
    padding: 4px 0;
}
.st-cmd-item {
    padding: 6px 14px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.st-cmd-item:hover, .st-cmd-item.selected { background: var(--accent-blue); color: #fff; }
.st-cmd-item .cmd-shortcut { color: var(--text-dim); font-size: 11px; }
.st-cmd-item:hover .cmd-shortcut, .st-cmd-item.selected .cmd-shortcut { color: #bbb; }

/* ===== 通知提示 ===== */
.st-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.9);
    background: var(--bg-panel);
    color: var(--text-editor);
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    box-shadow: 0 4px 16px var(--shadow-heavy);
    border: 1px solid var(--border-input);
    opacity: 0;
    transition: all 0.3s;
    z-index: 9999;
    pointer-events: none;
}
.st-toast.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }

/* ===== 欢迎页 ===== */
.st-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-dim);
    text-align: center;
    padding: 40px;
}
.st-welcome h2 {
    font-size: 24px;
    color: var(--accent);
    margin-bottom: 10px;
    font-weight: 300;
}
.st-welcome p { font-size: 13px; margin-bottom: 6px; color: var(--text-dim); }
.st-welcome .shortcuts { margin-top: 20px; text-align: left; }
.st-welcome .shortcuts div { padding: 3px 0; font-size: 12.5px; color: var(--text-muted); }
.st-welcome .shortcuts kbd {
    background: var(--kbd-bg);
    border: 1px solid var(--border-input);
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 11px;
    color: var(--kbd-text);
    font-family: 'Consolas', monospace;
}

/* ===== 状态栏 ===== */
.st-statusbar {
    display: flex;
    align-items: center;
    background: var(--bg-panel);
    border-top: 1px solid var(--border);
    height: 26px;
    padding: 0 12px;
    font-size: 11.5px;
    color: var(--text-dim);
    flex-shrink: 0;
    position: relative;
}
.st-statusbar .st-status-left { display: flex; gap: 16px; align-items: center; flex: 1; }
.st-statusbar .st-status-center { 
    display: flex; 
    gap: 12px; 
    align-items: center;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}
.st-statusbar .st-status-right { display: flex; gap: 12px; align-items: center; flex: 1; justify-content: flex-end; }
.st-statusbar .st-status-item { cursor: default; white-space: nowrap; }
.st-statusbar .st-btn {
    cursor: pointer;
    padding: 2px 8px;
    border-radius: 3px;
    transition: all 0.2s;
}
.st-statusbar .st-btn:hover {
    background: var(--bg-hover);
    color: var(--text-bright);
}
.st-statusbar .st-center-msg {
    color: var(--text-dim);
    font-style: italic;
    margin-left: 8px;
}
.st-statusbar .st-center-msg.success {
    color: var(--accent, #4a9eff);
    font-style: normal;
}
.st-statusbar .st-center-msg.error {
    color: #ff6b6b;
    font-style: normal;
}
.st-statusbar select {
    background: transparent; border: none; color: var(--text);
    font-size: 11.5px; cursor: pointer; outline: none;
    max-width: 120px;
}
.st-statusbar select option { background: var(--bg-panel); color: var(--text); }

/* ===== 主题切换按钮 ===== */
.theme-switcher {
    display: flex;
    gap: 4px;
    align-items: center;
}
.theme-dot {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.15s;
    position: relative;
}
.theme-dot:hover { transform: scale(1.2); }
.theme-dot.active { border-color: var(--accent); }
.theme-dot-dark { background: #1e1e1e; box-shadow: inset 0 0 0 1px #555; }
.theme-dot-light { background: #ffffff; box-shadow: inset 0 0 0 1px #ccc; }

/* ===== JSON/XML 预览面板 ===== */
.st-preview-panel {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    height: 70%;
    background: var(--bg-panel);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    box-shadow: 0 10px 40px var(--shadow-heavy);
    z-index: 1000;
    flex-direction: column;
}
.st-preview-panel.show { display: flex; }
.st-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
}
.st-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-bright);
}
.st-preview-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.st-preview-btn {
    background: transparent;
    border: 1px solid var(--border-input);
    border-radius: 4px;
    color: var(--text);
    padding: 4px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.st-preview-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}
.st-preview-close {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    margin-left: 8px;
}
.st-preview-close:hover { color: var(--text-bright); }
.st-preview-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 13px;
    line-height: 1.6;
}

/* ===== JSON 树形样式 ===== */
.json-tree {
    color: var(--text-editor);
}
.json-tree .json-key {
    color: #9cdcfe;
    cursor: pointer;
}
.json-tree .json-string {
    color: #ce9178;
}
.json-tree .json-number {
    color: #b5cea8;
}
.json-tree .json-boolean {
    color: #569cd6;
}
.json-tree .json-null {
    color: #569cd6;
}
.json-tree .json-bracket,
.json-tree .json-brace {
    color: #ffd700;
}
.json-tree .json-comma {
    color: var(--text-dim);
}
.json-tree .json-collapse-btn {
    display: inline-block;
    width: 12px;
    height: 12px;
    line-height: 10px;
    text-align: center;
    margin-right: 4px;
    cursor: pointer;
    color: var(--accent);
    font-size: 10px;
    border: 1px solid var(--border-input);
    border-radius: 2px;
}
.json-tree .json-collapse-btn:hover {
    background: var(--bg-hover);
}
.json-tree .json-collapsed {
    display: none;
}
.json-tree .json-ellipsis {
    color: var(--text-dim);
    cursor: pointer;
}
.json-tree .json-ellipsis:hover {
    color: var(--accent);
}

/* ===== XML 树形样式 ===== */
.xml-tree {
    color: var(--text-editor);
}
.xml-tree .xml-tag {
    color: #569cd6;
}
.xml-tree .xml-attr-name {
    color: #9cdcfe;
}
.xml-tree .xml-attr-value {
    color: #ce9178;
}
.xml-tree .xml-text {
    color: var(--text-editor);
}
.xml-tree .xml-comment {
    color: #6a9955;
    font-style: italic;
}
.xml-tree .xml-collapse-btn {
    display: inline-block;
    width: 12px;
    height: 12px;
    line-height: 10px;
    text-align: center;
    margin-right: 4px;
    cursor: pointer;
    color: var(--accent);
    font-size: 10px;
    border: 1px solid var(--border-input);
    border-radius: 2px;
}
.xml-tree .xml-collapse-btn:hover {
    background: var(--bg-hover);
}
.xml-tree .xml-collapsed {
    display: none;
}

/* ===== 滚动条 ===== */
.st-cmd-list::-webkit-scrollbar { width: 6px; }
.st-cmd-list::-webkit-scrollbar-thumb { background: var(--scrollbar); border-radius: 3px; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    .st-minimap { display: none !important; }
    .st-find-panel { min-width: 300px; right: 10px; }
    .st-cmd-palette { margin-top: 20px; }
    .st-preview-panel { width: 95%; height: 60%; }
}


/* ===== Markdown 预览面板 ===== */
.st-preview-panel {
    display: none;
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    max-width: 900px;
    height: 70%;
    background: var(--bg-panel);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    box-shadow: 0 10px 40px var(--shadow-heavy);
    z-index: 1000;
    flex-direction: column;
}
.st-preview-panel.show { display: flex; }
.st-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    background: var(--bg-sidebar);
    border-bottom: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
}
.st-preview-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-bright);
}
.st-preview-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}
.st-preview-btn {
    background: transparent;
    border: 1px solid var(--border-input);
    border-radius: 4px;
    color: var(--text);
    padding: 4px 12px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s;
}
.st-preview-btn:hover {
    background: var(--bg-hover);
    border-color: var(--accent);
}
.st-preview-content {
    flex: 1;
    overflow: auto;
    padding: 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

/* ===== Markdown 预览样式 ===== */
.markdown-body {
    color: var(--text-editor);
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
    line-height: 1.25;
    color: var(--text-bright);
}
.markdown-body h1 { font-size: 2em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h2 { font-size: 1.5em; border-bottom: 1px solid var(--border); padding-bottom: 0.3em; }
.markdown-body h3 { font-size: 1.25em; }
.markdown-body h4 { font-size: 1em; }
.markdown-body h5 { font-size: 0.875em; }
.markdown-body h6 { font-size: 0.85em; color: var(--text-dim); }
.markdown-body p {
    margin-top: 0;
    margin-bottom: 16px;
}
.markdown-body a {
    color: var(--accent);
    text-decoration: none;
}
.markdown-body a:hover {
    text-decoration: underline;
}
.markdown-body strong {
    font-weight: 600;
    color: var(--text-bright);
}
.markdown-body em {
    font-style: italic;
}
.markdown-body code {
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    background: var(--bg-input);
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
}
.markdown-body pre {
    padding: 16px;
    overflow: auto;
    font-size: 85%;
    line-height: 1.45;
    background: var(--bg-input);
    border-radius: 6px;
    margin-bottom: 16px;
}
.markdown-body pre code {
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
}
.markdown-body blockquote {
    padding: 0 1em;
    color: var(--text-dim);
    border-left: 0.25em solid var(--accent);
    margin: 0 0 16px 0;
}
.markdown-body ul,
.markdown-body ol {
    padding-left: 2em;
    margin-bottom: 16px;
}
.markdown-body li + li {
    margin-top: 0.25em;
}
.markdown-body img {
    max-width: 100%;
    box-sizing: content-box;
    background-color: transparent;
}
.markdown-body hr {
    height: 0.25em;
    padding: 0;
    margin: 24px 0;
    background: var(--border);
    border: 0;
}
.markdown-body table {
    border-spacing: 0;
    border-collapse: collapse;
    margin-bottom: 16px;
    width: 100%;
}
.markdown-body table th,
.markdown-body table td {
    padding: 6px 13px;
    border: 1px solid var(--border);
}
.markdown-body table th {
    font-weight: 600;
    background: var(--bg-sidebar);
}
.markdown-body table tr:nth-child(2n) {
    background: var(--bg-input);
}

/* Mermaid 流程图样式 */
.markdown-body .mermaid {
    background: var(--bg-input);
    border-radius: 6px;
    padding: 16px;
    margin-bottom: 16px;
    text-align: center;
    overflow-x: auto;
}
.markdown-body .mermaid svg {
    max-width: 100%;
    height: auto;
}
.markdown-body .mermaid-error {
    color: #f97583;
    background: var(--bg-input);
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    font-family: 'Consolas', 'Monaco', monospace;
    white-space: pre-wrap;
}
