/* HTML在线运行工具 - 专业代码编辑器风格 */
:root {
    /* Default: Dark theme */
    --bg-app: #1e1e1e;
    --bg-sidebar: #252526;
    --bg-editor: #1e1e1e;
    --bg-titlebar: #323233;
    --bg-tab: #2d2d2d;
    --bg-tab-active: #1e1e1e;
    --bg-hover: #2a2d2e;
    --bg-active: #094771;
    --border: #3c3c3c;
    --text-primary: #cccccc;
    --text-secondary: #858585;
    --text-muted: #6e6e6e;
    --accent: #007acc;
    --accent-light: #3794ff;
    --accent-dim: #0d3a58;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-mono: "SF Mono", "Cascadia Code", "Fira Code", Consolas, monospace;
}
body.theme-light {
    --bg-app: #ffffff;
    --bg-sidebar: #f5f5f5;
    --bg-editor: #ffffff;
    --bg-titlebar: #f0f0f0;
    --bg-tab: #e8e8e8;
    --bg-tab-active: #ffffff;
    --bg-hover: #e0e0e0;
    --bg-active: #0078d4;
    --border: #d4d4d4;
    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --accent: #0078d4;
    --accent-light: #1084d8;
    --accent-dim: #e5f1fb;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: var(--font-sans); font-size: 13px; color: var(--text-primary); background: var(--bg-app); overflow: hidden; }

/* Layout */
.page-wrapper { width: 100%; max-width: 1200px; height: 100vh; display: flex; flex-direction: column; background: var(--bg-app); overflow: hidden; margin: 0 auto; }

/* Title Bar */
.title-bar { height: 35px; background: var(--bg-titlebar); display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.title-bar-controls { display: flex; gap: 8px; }
.title-bar-btn { width: 14px; height: 14px; border-radius: 50%; border: none; cursor: pointer; transition: transform 0.1s; }
.title-bar-btn.close { background: #ff5f56; }
.title-bar-btn.minimize { background: #ffbd2e; }
.title-bar-btn.maximize { background: #27ca40; }
.title-bar-btn:active { transform: scale(0.95); }
.title-bar-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; margin: 0 100px; }
.title-bar-title { font-size: 13px; font-weight: 500; color: var(--text-primary); max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.title-bar-right { display: flex; gap: 12px; }
.window-controls { display: flex; gap: 4px; }
.window-ctrl { width: 28px; height: 22px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 3px; transition: all 0.15s; }
.window-ctrl:hover { background: var(--bg-hover); color: var(--text-primary); }
.window-ctrl svg { width: 14px; height: 14px; }

/* Main Container */
.main-container { flex: 1; display: flex; overflow: hidden; }

/* Sidebar */
.sidebar { width: 250px; background: var(--bg-sidebar); border-right: 1px solid var(--border); display: flex; flex-direction: column; flex-shrink: 0; }
.sidebar-header { height: 38px; display: flex; align-items: center; padding: 0 12px; border-bottom: 1px solid var(--border); }
.sidebar-title { font-size: 11px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 8px; }
.sidebar-section { margin-bottom: 16px; }
.sidebar-section-title { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; padding: 8px; margin-bottom: 4px; }
.sidebar-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; color: var(--text-primary); cursor: pointer; border-radius: 3px; transition: background 0.1s; font-size: 13px; }
.sidebar-item:hover { background: var(--bg-hover); }
.sidebar-item svg { width: 16px; height: 16px; opacity: 0.7; }
.sidebar-divider { height: 1px; background: var(--border); margin: 8px 0; }

/* Editor Area */
.editor-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Toolbar */
.toolbar { height: 30px; background: var(--bg-titlebar); display: flex; align-items: center; padding: 0 12px; gap: 12px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.toolbar-group { display: flex; align-items: center; gap: 8px; }
.toolbar-btn { padding: 4px 8px; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 3px; font-size: 12px; display: flex; align-items: center; gap: 4px; transition: all 0.1s; }
.toolbar-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.toolbar-btn svg { width: 14px; height: 14px; }
.toolbar-sep { width: 1px; height: 16px; background: var(--border); }
.toolbar-select { padding: 2px 8px; background: var(--bg-tab); border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; border-radius: 3px; cursor: pointer; }
.template-tags { display: flex; gap: 4px; }
.template-tag { padding: 2px 8px; background: transparent; border: 1px solid var(--border); color: var(--text-secondary); font-size: 11px; border-radius: 3px; cursor: pointer; transition: all 0.1s; }
.template-tag:hover { border-color: var(--accent); color: var(--accent); }
.template-tag.active { background: var(--accent-dim); border-color: var(--accent); color: var(--accent-light); }

/* Search Bar */
.search-bar { display: none; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-titlebar); border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.search-bar.active { display: flex; }
.search-input-wrap { flex: 1; max-width: 400px; position: relative; display: flex; align-items: center; }
.search-input { width: 100%; padding: 4px 12px; padding-left: 30px; background: var(--bg-tab); border: 1px solid var(--border); color: var(--text-primary); font-size: 13px; border-radius: 3px; }
.search-input:focus { outline: none; border-color: var(--accent); }
.search-input-icon { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); color: var(--text-muted); }
.search-count { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.search-btn { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 3px; transition: all 0.1s; }
.search-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.search-actions { display: flex; flex-direction: row; gap: 4px; align-items: center; }
#replaceInputWrap { max-width: 300px; }
#replaceInputWrap .search-input { padding-left: 12px; }

/* Tab Bar */
.tab-bar { height: 38px; background: var(--bg-tab); display: flex; align-items: flex-end; border-bottom: 1px solid var(--border); overflow-x: auto; flex-shrink: 0; }
.tab-bar::-webkit-scrollbar { height: 3px; }
.tab-bar::-webkit-scrollbar-thumb { background: var(--border); }
.tab { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: var(--bg-tab); border: none; border-right: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; font-size: 13px; height: 100%; position: relative; transition: all 0.1s; }
.tab:hover { background: var(--bg-hover); }
.tab.active { background: var(--bg-tab-active); color: var(--text-primary); }
.tab.active::after { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px; background: var(--accent); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; }
.tab-dot.html { background: #e44d26; }
.tab-dot.css { background: #264de4; }
.tab-dot.js { background: #f7df1e; }
.tab-actions { display: flex; gap: 4px; margin-left: auto; padding: 0 8px; }
.tab-action { padding: 4px 8px; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 3px; font-size: 12px; transition: all 0.1s; }
.tab-action:hover { background: var(--bg-hover); color: var(--text-primary); }

/* Error Panel */
.error-panel { display: none; align-items: center; gap: 8px; padding: 8px 12px; background: #f14c4c; color: #fff; font-size: 12px; }
.error-panel.show { display: flex; }
.error-panel svg { flex-shrink: 0; }
.error-content { flex: 1; font-family: var(--font-mono); }
.error-close { background: transparent; border: none; color: #fff; cursor: pointer; opacity: 0.7; padding: 4px; display: flex; align-items: center; }
.error-close:hover { opacity: 1; }

/* Editor Container */
.editor-container { flex: 1; display: flex; overflow: hidden; min-height: 0; }
.editor-panel { flex: 1; display: flex; flex-direction: column; overflow: hidden; background: var(--bg-editor); }
.editor-panel.preview { border-left: 1px solid var(--border); }
.editor-panel.hidden { display: none; }
.editor-content { flex: 1; display: flex; overflow: hidden; position: relative; }
.code-highlight-wrapper { position: relative; flex: 1; min-height: 0; }
.code-highlight { position: absolute; top: 0; left: 0; right: 0; bottom: 0; margin: 0; padding: 16px; padding-left: 60px; font-family: var(--font-mono); font-size: 14px; line-height: 1.6; white-space: pre; word-wrap: break-word; overflow: auto; pointer-events: none; tab-size: 4; background: var(--bg-editor); border: none; }
.code-highlight code { font-family: inherit; font-size: inherit; line-height: inherit; background: transparent !important; padding: 0 !important; display: block; }
/* VS Code 风格高亮颜色 */
.code-highlight code.hljs { background: transparent; }
.hljs-keyword, .hljs-selector-tag, .hljs-literal, .hljs-section, .hljs-link { color: #569cd6; }
.hljs-string, .hljs-title, .hljs-name, .hljs-type, .hljs-attribute, .hljs-symbol, .hljs-bullet, .hljs-addition, .hljs-variable, .hljs-template-tag, .hljs-template-variable { color: #ce9178; }
.hljs-comment, .hljs-quote, .hljs-deletion, .hljs-meta { color: #6a9955; }
.hljs-number { color: #b5cea8; }
.hljs-tag .hljs-name { color: #569cd6; }
.hljs-attr { color: #9cdcfe; }
.hljs-function .hljs-title, .hljs-title.function_ { color: #dcdcaa; }
.hljs-params { color: #9cdcfe; }
.hljs-class .hljs-title, .hljs-title.class_ { color: #4ec9b0; }
.hljs-css .hljs-selector-class, .hljs-css .hljs-selector-id { color: #d7ba7d; }
.hljs-punctuation { color: #808080; }
.hljs-operator { color: #d4d4d4; }
.hljs-property { color: #9cdcfe; }
.hljs-regexp { color: #d16969; }
.hljs-selector-attr { color: #9cdcfe; }
.hljs-selector-pseudo { color: #d7ba7d; }
.code-editor { position: absolute; top: 0; left: 0; right: 0; bottom: 0; width: 100%; height: 100%; background: transparent; color: transparent; caret-color: var(--text-primary); border: none; outline: none; padding: 16px; padding-left: 60px; font-family: var(--font-mono); font-size: 14px; line-height: 1.6; resize: none; tab-size: 4; white-space: pre; overflow: auto; z-index: 2; -webkit-text-fill-color: transparent; }
.code-editor::selection { background: rgba(0, 122, 204, 0.4); }
.line-numbers { position: absolute; left: 0; top: 0; width: 50px; height: 100%; background: var(--bg-editor); color: var(--text-muted); font-family: var(--font-mono); font-size: 14px; line-height: 1.6; padding: 16px 8px; text-align: right; white-space: pre; overflow: hidden; user-select: none; border-right: 1px solid var(--border); z-index: 3; }

/* Resizer */
.resizer { width: 4px; cursor: col-resize; background: var(--border); transition: background 0.1s; flex-shrink: 0; }
.resizer:hover, .resizer.active { background: var(--accent); }

/* Preview Panel */
.preview-panel { flex: 1; display: flex; flex-direction: column; background: #fff; overflow: hidden; }
.preview-header { height: 38px; background: var(--bg-tab); display: flex; align-items: center; justify-content: space-between; padding: 0 12px; border-bottom: 1px solid var(--border); }
.preview-title { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.preview-controls { display: flex; gap: 4px; }
.preview-control { width: 28px; height: 22px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 3px; transition: all 0.1s; }
.preview-control:hover { background: var(--bg-hover); color: var(--text-primary); }
.preview-control.active { color: var(--accent); }
.preview-frame { flex: 1; width: 100%; height: 100%; border: none; background: #fff; display: block; }
.preview-placeholder { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #999; gap: 16px; background: #fafafa; z-index: 1; }
.preview-placeholder.hidden { display: none; }
.preview-placeholder svg { width: 64px; height: 64px; opacity: 0.3; }
.preview-placeholder span { font-size: 14px; }
.preview-placeholder strong { color: var(--accent); font-weight: 500; }
.device-switcher { display: flex; background: var(--bg-tab); border: 1px solid var(--border); border-radius: 3px; overflow: hidden; }
.device-btn { width: 28px; height: 22px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-muted); cursor: pointer; transition: all 0.1s; }
.device-btn:not(:last-child) { border-right: 1px solid var(--border); }
.device-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.device-btn.active { background: var(--bg-active); color: var(--accent-light); }

/* Status Bar */
.status-bar { height: 24px; background: linear-gradient(180deg, var(--accent) 0%, #0066a3 100%); display: flex; align-items: center; padding: 0 8px; font-size: 12px; color: rgba(255, 255, 255, 0.95); flex-shrink: 0; }
.status-left, .status-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.status-right { margin-left: auto; }
.status-item { display: flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; cursor: default; white-space: nowrap; }
.status-item:hover { background: rgba(255,255,255,0.15); }
.status-item svg { width: 12px; height: 12px; opacity: 0.8; }
.status-sep { width: 1px; height: 14px; background: rgba(255,255,255,0.3); margin: 0 4px; }
.status-text { font-weight: 500; }
.lang-badge { background: rgba(255,255,255,0.2); padding: 1px 6px; border-radius: 2px; font-weight: 600; font-size: 10px; letter-spacing: 0.5px; }

/* Panels */
.panel-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 1000; }
.panel-overlay.active { display: block; }
.panel { display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 600px; max-height: 70vh; background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 3px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); z-index: 1001; flex-direction: column; }
.panel.active { display: flex; }
.panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.panel-title { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.panel-close { width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; background: transparent; border: none; color: var(--text-secondary); cursor: pointer; border-radius: 3px; transition: all 0.1s; }
.panel-close:hover { background: var(--bg-hover); color: var(--text-primary); }
.panel-content { flex: 1; overflow-y: auto; padding: 16px; }

/* Snippets */
.snippet-category { margin-bottom: 24px; }
.snippet-category-title { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 12px; padding: 0 16px; }
.snippet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; padding: 0 16px; }
.snippet-item { position: relative; padding: 12px; background: var(--bg-tab); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; transition: all 0.1s; overflow: hidden; }
.snippet-item:hover { border-color: var(--accent); background: var(--bg-active); }
.snippet-item-title { font-size: 13px; font-weight: 500; color: var(--text-primary); }
.snippet-item-desc { font-size: 11px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* History */
.history-item { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--bg-tab); border: 1px solid var(--border); border-radius: 3px; cursor: pointer; transition: all 0.1s; }
.history-item:hover { border-color: var(--accent); }
.history-time { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.history-preview { flex: 1; font-size: 12px; color: var(--text-secondary); font-family: var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-restore { padding: 4px 8px; background: var(--accent); border: none; color: #fff; font-size: 11px; border-radius: 3px; cursor: pointer; opacity: 0; transition: all 0.1s; }
.history-item:hover .history-restore { opacity: 1; }
.history-restore:hover { background: var(--accent-light); }
.history-empty { text-align: center; padding: 48px; color: var(--text-muted); }

/* Modal */
.modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.15); z-index: 1000; align-items: center; justify-content: center; }
.modal-overlay.active { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal { display: none; width: 90%; max-width: 500px; background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 3px; padding: 24px; box-shadow: 0 8px 32px rgba(0,0,0,0.5); }
.modal.active { display: block; }
.modal-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.modal-title svg { color: var(--accent); }
.modal-textarea { width: 100%; height: 100px; padding: 12px; background: var(--bg-tab); border: 1px solid var(--border); color: var(--text-primary); font-family: var(--font-mono); font-size: 13px; resize: vertical; border-radius: 3px; }
.modal-textarea:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-btn { padding: 8px 16px; border: none; border-radius: 3px; font-size: 13px; cursor: pointer; transition: all 0.1s; }
.modal-btn.secondary { background: var(--bg-tab); color: var(--text-primary); border: 1px solid var(--border); }
.modal-btn.secondary:hover { background: var(--bg-hover); }
.modal-btn.primary { background: var(--accent); color: #fff; }
.modal-btn.primary:hover { background: var(--accent-light); }
.shortcuts-modal { max-width: 580px; max-height: 80vh; overflow: hidden; display: none; flex-direction: column; padding: 0; background: var(--bg-editor); border: 1px solid var(--border); box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4); }
.shortcuts-modal.active { display: flex; animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1); }
.shortcuts-modal .modal-title { padding: 16px 20px; border-bottom: 1px solid var(--border); margin-bottom: 0; background: var(--bg-tab); border-radius: 12px 12px 0 0; }
.shortcuts-modal .modal-title svg { color: var(--accent); }
.shortcuts-modal .modal-actions { padding: 12px 20px; border-top: 1px solid var(--border); margin-top: 0; background: var(--bg-tab); border-radius: 0 0 12px 12px; }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(-10px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.shortcuts-grid { display: flex; flex-direction: column; gap: 12px; padding: 16px 20px; overflow-y: auto; flex: 1; min-height: 0; }
.shortcut-section { background: var(--bg-editor); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; transition: all 0.2s ease; position: relative; overflow: hidden; }
.shortcut-section::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: linear-gradient(90deg, var(--accent) 0%, transparent 100%); opacity: 0; transition: opacity 0.2s; }
.shortcut-section:hover { border-color: var(--accent); box-shadow: 0 2px 8px rgba(0, 122, 204, 0.15); }
.shortcut-section:hover::before { opacity: 1; }
.shortcut-section-title { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.8px; margin-bottom: 12px; padding: 0 2px; display: flex; align-items: center; gap: 10px; position: relative; }
.shortcut-section-title::before { content: ''; width: 4px; height: 14px; background: linear-gradient(180deg, var(--accent-light) 0%, var(--accent) 100%); border-radius: 2px; box-shadow: 0 0 8px rgba(0, 122, 204, 0.4); }
.shortcut-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.shortcut-item { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; background: var(--bg-tab); border: 1px solid var(--border); border-radius: 8px; transition: all 0.15s ease; cursor: default; }
.shortcut-item:hover { border-color: var(--accent); transform: translateX(4px); background: var(--bg-active); box-shadow: 0 2px 6px rgba(0, 122, 204, 0.15); }
.shortcut-keys { display: flex; align-items: center; gap: 4px; }
.shortcut-keys span { color: #888; font-size: 12px; font-weight: 600; margin: 0 4px; }
.shortcut-item kbd { padding: 5px 10px; background: linear-gradient(180deg, #ffffff 0%, #e8e8e8 100%); border: 1px solid #ccc; border-bottom: 3px solid #aaa; border-radius: 6px; font-family: var(--font-mono); font-size: 11px; color: #333; font-weight: 700; white-space: nowrap; box-shadow: 0 2px 4px rgba(0,0,0,0.15), inset 0 1px 0 rgba(255,255,255,0.8); min-width: 24px; text-align: center; }
.shortcut-item:hover kbd { background: linear-gradient(180deg, #ffffff 0%, #f0f0f0 100%); border-color: var(--accent); box-shadow: 0 2px 6px rgba(0,122,204,0.2), inset 0 1px 0 rgba(255,255,255,0.9); }
.shortcut-item .desc { color: var(--text-secondary); font-size: 12px; margin-left: 12px; transition: color 0.15s; }
.shortcut-item:hover .desc { color: var(--text-primary); }
.shortcut-hint { font-size: 11px; font-weight: 400; color: var(--text-muted); margin-left: auto; }
.modal-btn { display: flex; align-items: center; gap: 6px; padding: 8px 20px; border: none; border-radius: 6px; font-size: 13px; cursor: pointer; transition: all 0.2s ease; }
.modal-btn svg { width: 14px; height: 14px; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }



/* Toast */
.toast { position: fixed; bottom: 40px; right: 24px; padding: 12px 16px; background: var(--bg-sidebar); border: 1px solid var(--border); border-radius: 3px; color: var(--text-primary); font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,0.3); z-index: 2000; transform: translateY(100px); opacity: 0; transition: all 0.3s ease; }
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-color: #89d185; }
.toast.error { border-color: #f14c4c; }
.toast.info { border-color: var(--accent); }

/* Panel Button */
.panel-btn { width: 28px; height: 24px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); color: var(--text-secondary); cursor: pointer; border-radius: 3px; transition: all 0.1s; }
.panel-btn:hover { background: var(--bg-hover); color: var(--text-primary); }
.panel-btn.danger:hover { background: #f14c4c; border-color: #f14c4c; color: #fff; }

/* Toolbar active state */
.toolbar-btn.active { color: var(--accent-light) !important; background: var(--accent-dim) !important; }

/* Footer */
.site-footer { background: var(--bg-titlebar); border-top: 1px solid var(--border); padding: 0; flex-shrink: 0; }
.footer-wrap { padding: 16px 24px; }
.footer-links { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.friend-label { font-size: 13px; font-weight: 500; color: var(--text-muted); margin-right: 4px; }
.footer-links a { font-size: 13px; color: var(--text-secondary); text-decoration: none; padding: 4px 12px; background: var(--bg-hover); border-radius: 4px; transition: all 0.2s; }
.footer-links a:hover { color: #fff; background: var(--accent); }
.footer-divider { height: 1px; background: var(--border); margin: 12px 0; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.footer-copy { font-size: 12px; color: var(--text-muted); }
.footer-copy a { color: var(--text-muted); text-decoration: none; }
.footer-copy a:hover { color: var(--accent); }
.footer-beian { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); }
.footer-beian a { color: var(--text-muted); text-decoration: none; }
.footer-beian a:hover { color: var(--accent); }

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #424242; border-radius: 5px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: #555; }
::-webkit-scrollbar-corner { background: transparent; }

/* Accessibility */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
*:focus-visible { outline: 1px solid var(--accent); outline-offset: -1px; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* Responsive */
@media (max-width: 1024px) { .sidebar { display: none; } }
@media (max-width: 768px) {
    .title-bar { display: none; }
    .toolbar { height: auto; flex-wrap: wrap; padding: 8px; }
    .toolbar-group { flex-wrap: wrap; }
    .editor-container { flex-direction: column; }
    .editor-panel { min-height: 40vh; }
    .editor-panel.preview { border-left: none; border-top: 1px solid var(--border); }
    .resizer { width: 100%; height: 4px; cursor: row-resize; }
    .panel { width: 95%; max-height: 80vh; }
    .snippet-grid { grid-template-columns: repeat(2, 1fr); }
    .footer-bottom { flex-direction: column; align-items: flex-start; gap: 6px; }
    .footer-copy, .footer-beian { font-size: 11px; }
}
@media print {
    .title-bar, .toolbar, .status-bar, .sidebar, .tab-bar, .search-bar, .resizer, footer, .panel-overlay, .modal-overlay { display: none !important; }
    .editor-panel { display: block !important; flex: none; }
}
