:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #22252a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-color: #e2e8f0;
    --accent-color: #2196f3;
    --accent-hover: #1976d2;
    --accent-light: rgba(33, 150, 243, 0.1);
    --success-color: #10b981;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05), 0 2px 6px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.12);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-full: 9999px;
    
    /* 动画缓动函数 */
    --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
    --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Z-index 层级 */
    --z-base: 1;
    --z-dropdown: 10;
    --z-sticky: 20;
    --z-overlay: 100;
    --z-modal: 200;
    --z-toast: 300;
    --z-tooltip: 400;
    
    /* 过渡时间 */
    --duration-fast: 150ms;
    --duration-normal: 300ms;
    --duration-slow: 500ms;
}

[data-mode="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: #475569;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2), 0 2px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.3), 0 4px 12px rgba(0, 0, 0, 0.4);
}

[data-color="blue"] {
    --accent-color: #2196f3;
    --accent-hover: #1976d2;
    --accent-light: rgba(33, 150, 243, 0.1);
}

[data-color="blue"][data-mode="dark"] {
    --accent-color: #42a5f5;
    --accent-hover: #2196f3;
    --accent-light: rgba(66, 165, 245, 0.15);
}

[data-color="green"] {
    --accent-color: #30a14e;
    --accent-hover: #216e39;
    --accent-light: rgba(48, 161, 78, 0.1);
}

[data-color="green"][data-mode="dark"] {
    --accent-color: #40c463;
    --accent-hover: #30a14e;
    --accent-light: rgba(64, 196, 99, 0.15);
}

[data-color="red"] {
    --accent-color: #dc2626;
    --accent-hover: #b91c1c;
    --accent-light: rgba(220, 38, 38, 0.1);
}

[data-color="red"][data-mode="dark"] {
    --accent-color: #ef4444;
    --accent-hover: #dc2626;
    --accent-light: rgba(239, 68, 68, 0.15);
}

[data-color="gold"] {
    --accent-color: #d4af37;
    --accent-hover: #b8860b;
    --accent-light: rgba(212, 175, 55, 0.1);
}

[data-color="gold"][data-mode="dark"] {
    --accent-color: #f4c430;
    --accent-hover: #d4af37;
    --accent-light: rgba(244, 196, 48, 0.15);
}

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

/* Vue 初始化前隐藏带 v-cloak 的元素 */
[v-cloak] {
    display: none;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', 'Microsoft YaHei', sans-serif;
    background-color: var(--bg-primary); 
    color: var(--text-secondary); 
    line-height: 1.6; 
    font-weight: 400; 
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.navbar { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    z-index: 50; 
    background: var(--bg-secondary); 
    backdrop-filter: blur(10px); 
    -webkit-backdrop-filter: blur(10px); 
    border-bottom: 1px solid var(--border-color); 
    height: 64px; 
}

.navbar-content { 
    max-width: 1600px; 
    margin: 0 auto; 
    padding: 0 24px; 
    height: 100%; 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
}

.logo { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.logo-icon { 
    width: 36px; 
    height: 36px; 
    background: var(--accent-color); 
    border-radius: var(--radius-md); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: white;
    box-shadow: var(--shadow-sm);
}

.nav-actions { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
}

.btn { 
    display: inline-flex; 
    align-items: center; 
    gap: 8px; 
    padding: 10px 20px; 
    border-radius: var(--radius-full); 
    font-size: 13px; 
    font-weight: 600; 
    cursor: pointer; 
    border: none; 
    outline: none; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    will-change: transform;
    letter-spacing: -0.01em;
}

.btn i, .btn svg {
    pointer-events: none;
    flex-shrink: 0;
}

.btn-primary { 
    background: var(--accent-color); 
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover { 
    background: var(--accent-hover); 
    transform: translateY(-2px); 
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary { 
    background: var(--bg-secondary); 
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover { 
    background: var(--bg-tertiary); 
    border-color: var(--accent-color);
    transform: translateY(-1px);
    color: var(--accent-color);
}

.btn-success { 
    background: var(--success-color); 
    color: white;
    box-shadow: var(--shadow-sm);
}

.btn-success:hover { 
    background: #059669; 
    transform: translateY(-2px); 
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3); 
}

.btn-ghost { 
    background: transparent; 
    color: var(--text-tertiary); 
}

.btn-ghost:hover { 
    background: var(--bg-tertiary); 
    color: var(--text-secondary); 
}

.btn-sm { 
    padding: 6px 14px; 
    font-size: 12px; 
}

.btn-lg {
    padding: 12px 28px;
    font-size: 14px;
}

.main-container { 
    display: flex; 
    padding-top: 64px; 
    min-height: 100vh; 
}

.sidebar { 
    width: 280px; 
    background: var(--bg-secondary); 
    border-right: 1px solid var(--border-color); 
    height: calc(100vh - 64px); 
    position: fixed; 
    left: 0; 
    top: 64px; 
    display: flex; 
    flex-direction: column; 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    z-index: 40; 
    will-change: transform;
    box-shadow: var(--shadow-sm);
}

.sidebar.collapsed { 
    transform: translateX(-280px); 
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-280px);
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.open-mobile {
        transform: translateX(0);
    }
    
    .overlay-mobile-visible {
        display: block !important;
    }
    
    .sidebar-toggle {
        display: none !important;
    }
    
    .sidebar-header {
        padding: 16px;
    }
    
    .sidebar-title {
        font-size: 12px;
        margin-bottom: 10px;
    }
    
    .sidebar-actions .btn {
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .current-path-indicator {
        margin: 10px;
        font-size: 11px;
        padding: 6px 10px;
    }
    
    .sidebar-content {
        padding: 12px;
    }
    
    .sidebar-footer {
        padding: 12px 16px;
        font-size: 11px;
    }
    
    .tree-item {
        padding: 7px 10px;
        font-size: 12px;
    }
    
    .tree-icon {
        width: 16px;
        height: 16px;
    }
    
    .tree-name {
        max-width: 150px;
        font-size: 12px;
    }
}

.sidebar-toggle { 
    position: absolute; 
    right: -12px; 
    top: 50%; 
    transform: translateY(-50%); 
    width: 24px; 
    height: 48px; 
    background: var(--bg-secondary); 
    border: 1px solid var(--border-color); 
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    z-index: var(--z-overlay); 
    color: var(--text-tertiary); 
    transition: all var(--duration-normal) var(--ease-in-out);
    box-shadow: var(--shadow-sm);
    pointer-events: auto;
}

.sidebar-toggle:hover { 
    background: var(--bg-tertiary); 
    color: var(--accent-color);
    transform: translateY(-50%) scale(1.05);
}

.sidebar-header { 
    padding: 20px; 
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

.sidebar-title { 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px; 
}

.sidebar-actions { 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
}

.sidebar-actions .btn { 
    font-size: 12px; 
    padding: 6px 12px; 
}

.sidebar-content { 
    flex: 1; 
    overflow-y: auto; 
    padding: 16px; 
    overscroll-behavior: contain; 
}

.sidebar-footer { 
    padding: 16px 20px; 
    border-top: 1px solid var(--border-color); 
    background: var(--bg-tertiary); 
    flex-shrink: 0;
}

.file-tree { 
    font-size: 13px; 
    user-select: none; 
}

.tree-item { 
    padding: 8px 12px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    border-radius: var(--radius-md); 
    margin: 2px 0; 
    transition: all 0.15s ease; 
    gap: 6px;
}

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

.tree-item.selected { 
    background: var(--accent-light); 
    color: var(--accent-color);
    box-shadow: inset 0 0 0 1px var(--accent-color);
}

.tree-item.editing { 
    background: rgba(16, 185, 129, 0.1); 
    color: var(--success-color);
    box-shadow: inset 0 0 0 1px var(--success-color);
}

.tree-icon { 
    width: 18px; 
    height: 18px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    flex-shrink: 0; 
    color: var(--text-tertiary); 
}

.tree-item.selected .tree-icon { 
    color: var(--accent-color); 
}

.tree-toggle { 
    width: 16px; 
    height: 16px; 
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    cursor: pointer; 
    color: var(--text-tertiary); 
    flex-shrink: 0; 
    font-size: 10px; 
    transition: all 0.15s ease; 
    will-change: transform; 
}

.tree-toggle:hover { 
    color: var(--accent-color); 
}

.tree-toggle.expanded { 
    transform: rotate(90deg); 
}

.tree-name { 
    flex: 1; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    white-space: nowrap; 
    max-width: 180px;
}

.tree-actions { 
    opacity: 0; 
    transition: opacity 0.15s ease; 
    display: flex; 
    align-items: center; 
    gap: 4px; 
}

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

.tree-action-btn { 
    padding: 4px 8px; 
    color: var(--text-tertiary); 
    cursor: pointer; 
    border-radius: var(--radius-sm); 
    transition: all 0.15s ease;
    font-size: 11px;
}

.tree-action-btn:hover { 
    color: var(--accent-color); 
    background: var(--bg-tertiary); 
}

.tree-action-btn.delete:hover { 
    color: #ef4444; 
    background: rgba(239, 68, 68, 0.1); 
}

.tree-children { 
    overflow: hidden; 
}

.file-size { 
    font-size: 11px; 
    color: var(--text-tertiary); 
    margin-left: 8px; 
}

.main-content { 
    flex: 1; 
    margin-left: 280px; 
    min-height: calc(100vh - 64px); 
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex;
    flex-direction: column;
}

.main-content.expanded { 
    margin-left: 0; 
}

.content-area { 
    padding: 16px;
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.stats-row { 
    display: grid; 
    grid-template-columns: repeat(3, 1fr); 
    gap: 16px; 
    margin-bottom: 24px; 
}

.stat-card { 
    background: var(--bg-secondary); 
    border-radius: var(--radius-lg); 
    padding: 24px; 
    box-shadow: var(--shadow-md);
    display: flex; 
    align-items: center; 
    gap: 16px; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    will-change: transform;
    border: 1px solid var(--border-color);
}

.stat-card:hover { 
    transform: translateY(-4px); 
    box-shadow: var(--shadow-lg);
}

.stat-icon { 
    width: 52px; 
    height: 52px; 
    border-radius: var(--radius-md); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue { 
    background: var(--accent-light); 
    color: var(--accent-color); 
}

.stat-icon.green { 
    background: var(--accent-light); 
    color: var(--accent-color); 
}

.stat-icon.accent { 
    background: var(--accent-light); 
    color: var(--accent-color); 
}

.stat-content h3 { 
    font-size: 26px; 
    font-weight: 700; 
    color: var(--text-primary); 
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.stat-content p { 
    font-size: 13px; 
    color: var(--text-tertiary); 
    margin-top: 4px; 
}

.editor-container { 
    background: var(--bg-secondary); 
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden; 
    flex: 1;
    display: flex; 
    flex-direction: column;
    border: 1px solid var(--border-color);
}

.editor-header { 
    padding: 14px 20px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    justify-content: space-between; 
    background: var(--bg-tertiary); 
    position: relative; 
    z-index: 1; 
}

.editor-file-info { 
    display: flex; 
    align-items: center; 
    gap: 8px; 
    font-size: 13px; 
    color: var(--text-tertiary); 
}

.editor-file-path { 
    font-family: 'SF Mono', 'Monaco', 'Inconsolata', 'Fira Code', monospace; 
    font-size: 12px; 
    background: var(--bg-secondary); 
    padding: 6px 10px; 
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
}

.editor-content { 
    flex: 1; 
    overflow: visible; 
    position: relative; 
}

.vditor { 
    height: 100%; 
    display: flex; 
    flex-direction: column; 
    border-radius: 0 0 var(--radius-lg) var(--radius-lg); 
    overflow: visible; 
}

/* 确保 Vditor 占满所有空间 */
#vditor {
    flex: 1;
    border: none !important;
}

#vditor .vditor {
    border: none !important;
}

#vditor .vditor-toolbar {
    border-radius: 0;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-tertiary);
}

#vditor .vditor-content {
    flex: 1;
    display: flex;
    height: 100%;
}

#vditor .vditor-ir,
#vditor .vditor-sv,
#vditor .vditor-wysiwyg {
    flex: 1;
    height: 100%;
}

#vditor .vditor-preview {
    flex: 1;
    height: 100%;
}

#vditor .vditor-reset {
    max-width: none;
}

.vditor-content { 
    overflow: hidden; 
    flex: 1; 
}

.vditor-toolbar { 
    border-bottom: 1px solid var(--border-color); 
    background: var(--bg-tertiary); 
    padding: 8px 12px; 
    overflow: visible; 
    position: relative; 
    z-index: 50; 
}

.vditor-toolbar__item { 
    overflow: visible; 
}

.vditor-tooltipped::after, .vditor-tooltipped::before { 
    position: absolute !important; 
}

.empty-state { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center; 
    height: 100%; 
    color: var(--text-tertiary); 
    text-align: center; 
    padding: 40px; 
}

.empty-state h3 { 
    font-size: 18px; 
    font-weight: 600; 
    color: var(--text-secondary); 
    margin-bottom: 8px; 
}

.empty-state p { 
    font-size: 14px; 
    color: var(--text-tertiary); 
}

.side-panel { 
    position: fixed; 
    top: 64px; 
    right: 0; 
    width: 420px; 
    height: calc(100vh - 64px); 
    background: var(--bg-secondary); 
    box-shadow: var(--shadow-lg);
    z-index: 100; 
    transform: translateZ(0) translateX(100%); 
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1); 
    display: flex; 
    flex-direction: column; 
    will-change: transform;
    border-left: 1px solid var(--border-color);
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform-style: preserve-3d;
}

.side-panel.open { 
    transform: translateZ(0) translateX(0); 
}

.overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(0, 0, 0, 0.4); 
    z-index: 99; 
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--duration-normal);
    will-change: opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
}

.side-panel-content { 
    padding: 24px; 
    overflow-y: auto; 
    flex: 1; 
    overscroll-behavior: contain; 
}

.overlay[style*="display: none"] {
    opacity: 0;
    visibility: hidden;
}

.overlay:not([style*="display: none"]) {
    opacity: 1;
    visibility: visible;
}

.side-panel-header { 
    padding: 24px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    flex-shrink: 0;
    background: var(--bg-tertiary);
    position: relative;
    z-index: 101;
}

.side-panel-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.side-panel-close { 
    cursor: pointer; 
    color: var(--text-tertiary); 
    transition: all 0.15s ease;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    z-index: 102;
}

.side-panel-close:hover { 
    color: var(--text-secondary);
    background: var(--bg-tertiary);
}

.side-panel-content { 
    padding: 24px; 
    overflow-y: auto; 
    flex: 1; 
    overscroll-behavior: contain; 
}

.form-group { 
    margin-bottom: 24px; 
}

.form-label { 
    display: block; 
    font-size: 13px; 
    font-weight: 600; 
    color: var(--text-secondary); 
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.form-input { 
    width: 100%; 
    padding: 12px 16px; 
    border: 1.5px solid var(--border-color); 
    border-radius: var(--radius-md); 
    font-size: 14px; 
    transition: all 0.2s ease; 
    background: var(--bg-secondary); 
    color: var(--text-primary);
    font-family: inherit;
}

.form-input:focus { 
    outline: none; 
    border-color: var(--accent-color); 
    box-shadow: 0 0 0 4px var(--accent-light);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

.form-input.input-error {
    border-color: var(--error-color, #ef4444);
}

.form-input.input-error:focus {
    border-color: var(--error-color, #ef4444);
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.15);
}

.form-hint-error {
    color: var(--error-color, #ef4444) !important;
    display: flex;
    align-items: center;
    gap: 4px;
}

.form-textarea { 
    width: 100%; 
    padding: 12px 16px; 
    border: 1.5px solid var(--border-color); 
    border-radius: var(--radius-md); 
    font-size: 14px; 
    min-height: 150px; 
    resize: vertical; 
    transition: all 0.2s ease; 
    font-family: inherit; 
    background: var(--bg-secondary); 
    color: var(--text-primary); 
}

.form-textarea:focus { 
    outline: none; 
    border-color: var(--accent-color); 
    box-shadow: 0 0 0 4px var(--accent-light);
}

.form-hint { 
    font-size: 12px; 
    color: var(--text-tertiary); 
    margin-top: 8px; 
}

.form-actions { 
    display: flex; 
    gap: 12px; 
    margin-top: 28px; 
}

.context-menu { 
    position: fixed; 
    background: var(--bg-secondary); 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-lg);
    z-index: 1000; 
    min-width: 200px; 
    padding: 8px; 
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
}

.context-menu-item { 
    padding: 10px 14px; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    font-size: 13px; 
    border-radius: var(--radius-md); 
    transition: all 0.15s ease; 
    color: var(--text-secondary); 
}

.context-menu-item:hover { 
    background: var(--bg-tertiary); 
    color: var(--accent-color);
}

.context-menu-item.danger { 
    color: #ef4444; 
}

.context-menu-item.danger:hover { 
    background: rgba(239, 68, 68, 0.1); 
}

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

.changes-list li { 
    padding: 14px 16px; 
    border-bottom: 1px solid var(--border-color); 
    font-size: 13px; 
    display: flex; 
    align-items: center; 
    gap: 10px; 
    color: var(--text-secondary);
    transition: background 0.15s ease;
}

.changes-list li:hover {
    background: var(--bg-tertiary);
}

.changes-list li:last-child { 
    border-bottom: none; 
}

.change-icon { 
    width: 24px; 
    height: 24px; 
    border-radius: var(--radius-sm); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-size: 10px; 
    flex-shrink: 0;
}

.change-icon.modified { 
    background: rgba(245, 158, 11, 0.1); 
    color: #f59e0b; 
}

.loading { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    min-height: 200px;
    padding: 40px 20px;
}

.loading-spinner { 
    width: 40px; 
    height: 40px; 
    border: 4px solid var(--border-color); 
    border-top-color: var(--accent-color); 
    border-radius: 50%; 
    animation: spin 0.8s linear infinite;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.loading-text {
    margin-left: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.loading-container {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px;
}

@keyframes spin { 
    to { 
        transform: rotate(360deg); 
    } 
}

.toast { 
    position: fixed; 
    top: 80px; 
    right: 24px; 
    padding: 14px 24px; 
    border-radius: var(--radius-lg); 
    box-shadow: var(--shadow-lg); 
    z-index: 200; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    font-size: 14px; 
    font-weight: 600; 
    transform: translateX(120%); 
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    border: 1px solid;
}

.toast.show { 
    transform: translateX(0); 
}

.toast.success { 
    background: rgba(16, 185, 129, 0.1); 
    color: #059669; 
    border-color: rgba(16, 185, 129, 0.3);
}

.toast.error { 
    background: rgba(239, 68, 68, 0.1); 
    color: #dc2626; 
    border-color: rgba(239, 68, 68, 0.3);
}

.toast.info { 
    background: var(--accent-light); 
    color: var(--accent-color); 
    border-color: var(--accent-color);
}

.current-path-indicator { 
    font-size: 12px; 
    color: var(--text-tertiary); 
    background: var(--bg-tertiary); 
    padding: 8px 12px; 
    border-radius: var(--radius-md); 
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.unsaved-indicator { 
    font-size: 11px; 
    color: #f59e0b; 
    margin-left: 8px; 
}

@media (max-width: 1024px) {
    .stats-row { 
        grid-template-columns: 1fr; 
    }
    .sidebar { 
        transform: translateX(-280px); 
    }
    .sidebar.open-mobile { 
        transform: translateX(0); 
    }
    .main-content { 
        margin-left: 0; 
    }
    .sidebar-toggle { 
        display: none; 
    }
}

@media (max-width: 768px) {
    .navbar-content { 
        padding: 0 12px; 
    }
    
    .mobile-menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        border: none;
        border-radius: var(--radius-md);
        cursor: pointer;
        color: var(--text-secondary);
        transition: all 0.2s ease;
        margin-right: 8px;
        padding: 0;
    }
    
    .mobile-menu-toggle:hover {
        background: var(--bg-tertiary);
        color: var(--accent-color);
    }
    
    .logo span {
        display: none;
    }
    
    .logo {
        gap: 8px;
    }
    
    .logo-icon {
        width: 32px;
        height: 32px;
    }
    
    .logo-icon i {
        width: 16px !important;
        height: 16px !important;
    }
    
    .nav-actions {
        gap: 4px;
    }
    
    .nav-actions .btn {
        padding: 6px 10px;
        font-size: 11px;
    }
    
    .nav-actions .btn-success span {
        display: none;
    }
    
    .nav-actions .btn-ghost:not(:last-child) span {
        display: none;
    }
    
    .nav-actions .btn i {
        width: 16px !important;
        height: 16px !important;
        margin: 0;
    }
    
    .side-panel { 
        width: 100%; 
    }
    
    .content-area {
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .navbar-content { 
        padding: 0 8px; 
    }
    
    .nav-actions {
        gap: 2px;
    }
    
    .nav-actions .btn {
        padding: 6px 8px;
        min-width: 36px;
        justify-content: center;
    }
    
    .btn { 
        padding: 8px 12px; 
        font-size: 11px; 
    }
    
    .side-panel { 
        width: 100%; 
    }
    
    .stat-card {
        padding: 16px;
    }
    
    .stat-icon {
        width: 44px;
        height: 44px;
    }
    
    .stat-content h3 {
        font-size: 22px;
    }
    
    .editor-container {
        height: calc(100vh - 140px);
    }
    
    .editor-header {
        padding: 10px 12px;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .editor-file-info {
        flex: 1;
        min-width: 0;
    }
    
    .editor-file-path {
        font-size: 11px;
        padding: 4px 8px;
        max-width: calc(100% - 60px);
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .editor-header .btn {
        padding: 4px 10px;
        font-size: 11px;
        flex-shrink: 0;
    }
    
    .editor-header .btn i {
        width: 14px !important;
        height: 14px !important;
    }
    
    .editor-header .btn span {
        display: none;
    }
    
    .content-area {
        padding: 12px;
    }
    
    .side-panel-header {
        padding: 16px;
    }
    
    .side-panel-title {
        font-size: 16px;
    }
    
    .side-panel-close {
        width: 28px;
        height: 28px;
    }
    
    .side-panel-close i {
        width: 16px !important;
        height: 16px !important;
    }
    
    .side-panel-content {
        padding: 16px;
    }
    
    .empty-state h3 {
        font-size: 16px;
    }
    
    .empty-state p {
        font-size: 13px;
    }
    
    .empty-state i {
        width: 40px !important;
        height: 40px !important;
    }
}

@media (max-width: 375px) {
    .navbar-content {
        padding: 0 6px;
    }
    
    .nav-actions {
        gap: 1px;
    }
    
    .nav-actions .btn {
        padding: 5px 6px;
        min-width: 32px;
    }
    
    .nav-actions .btn i {
        width: 14px !important;
        height: 14px !important;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .logo-icon i {
        width: 14px !important;
        height: 14px !important;
    }
    
    .mobile-menu-toggle {
        width: 32px;
        height: 32px;
    }
    
    .mobile-menu-toggle i {
        width: 18px !important;
        height: 18px !important;
    }
    
    .stat-card {
        padding: 12px;
        gap: 12px;
    }
    
    .stat-icon {
        width: 38px;
        height: 38px;
    }
    
    .stat-content h3 {
        font-size: 18px;
    }
    
    .stat-content p {
        font-size: 11px;
    }
    
    .sidebar {
        width: 260px;
    }
}

::-webkit-scrollbar { 
    width: 8px; 
    height: 8px; 
}

::-webkit-scrollbar-track { 
    background: transparent; 
}

::-webkit-scrollbar-thumb { 
    background: var(--border-color); 
    border-radius: 4px; 
}

::-webkit-scrollbar-thumb:hover { 
    background: var(--text-tertiary); 
}

.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: rgba(0, 0, 0, 0.4); 
    z-index: 150; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    backdrop-filter: blur(4px);
}

.modal { 
    background: var(--bg-secondary); 
    border-radius: var(--radius-xl); 
    box-shadow: var(--shadow-lg); 
    max-width: 440px; 
    width: 90%; 
    overflow: hidden; 
    animation: modalIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid var(--border-color);
}

@keyframes modalIn { 
    from { 
        opacity: 0; 
        transform: scale(0.9) translateY(-20px); 
    } 
    to { 
        opacity: 1; 
        transform: scale(1) translateY(0); 
    } 
}

.modal-header { 
    padding: 24px; 
    border-bottom: 1px solid var(--border-color); 
    display: flex; 
    align-items: center; 
    gap: 16px;
    background: var(--bg-tertiary);
}

.modal-icon { 
    width: 44px; 
    height: 44px; 
    border-radius: var(--radius-md); 
    display: flex; 
    align-items: center; 
    justify-content: center;
    flex-shrink: 0;
}

.modal-icon.warning { 
    background: rgba(245, 158, 11, 0.1); 
    color: #f59e0b; 
}

.modal-icon.danger { 
    background: rgba(239, 68, 68, 0.1); 
    color: #ef4444; 
}

.modal-icon.info { 
    background: var(--accent-light); 
    color: var(--accent-color); 
}

.modal-title { 
    font-size: 18px; 
    font-weight: 700; 
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.modal-body { 
    padding: 24px; 
}

.modal-message { 
    font-size: 14px; 
    color: var(--text-secondary); 
    line-height: 1.6; 
}

.modal-details { 
    margin-top: 16px; 
    padding: 16px; 
    background: var(--bg-tertiary); 
    border-radius: var(--radius-md); 
    font-size: 13px; 
    color: var(--text-tertiary);
    border: 1px solid var(--border-color);
}

.modal-details ul { 
    margin: 10px 0 0 0; 
    padding-left: 20px; 
}

.modal-details li { 
    margin: 6px 0; 
}

.modal-footer { 
    padding: 20px 24px; 
    border-top: 1px solid var(--border-color); 
    display: flex; 
    justify-content: flex-end; 
    gap: 12px; 
    background: var(--bg-tertiary); 
}

.color-selector { 
    display: grid; 
    grid-template-columns: repeat(4, 1fr); 
    gap: 12px; 
    margin-top: 12px; 
}

.color-option { 
    padding: 14px; 
    border: 2px solid var(--border-color); 
    border-radius: var(--radius-lg); 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    text-align: center;
    background: var(--bg-secondary);
}

.color-option:hover { 
    border-color: var(--accent-color); 
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.color-option.active { 
    border-color: var(--accent-color); 
    background: var(--accent-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.color-option-preview { 
    width: 36px; 
    height: 36px; 
    border-radius: 50%; 
    margin: 0 auto 8px;
    box-shadow: var(--shadow-sm);
}

.color-option-name { 
    font-size: 12px; 
    font-weight: 600; 
    color: var(--text-primary); 
}

.mode-selector { 
    display: flex; 
    gap: 10px; 
    margin-top: 12px; 
}

.mode-option { 
    flex: 1; 
    padding: 14px; 
    border: 1.5px solid var(--border-color); 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    text-align: center; 
    font-size: 13px; 
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-weight: 600;
}

.mode-option:hover { 
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.mode-option.active { 
    border-color: var(--accent-color); 
    background: var(--accent-light); 
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.editor-mode-selector { 
    display: flex; 
    gap: 10px; 
    margin-top: 12px; 
}

.editor-mode-option { 
    flex: 1; 
    padding: 14px; 
    border: 1.5px solid var(--border-color); 
    border-radius: var(--radius-md); 
    cursor: pointer; 
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); 
    text-align: center; 
    font-size: 13px; 
    color: var(--text-secondary);
    background: var(--bg-secondary);
    font-weight: 600;
}

.editor-mode-option:hover { 
    border-color: var(--accent-color);
    background: var(--bg-tertiary);
}

.editor-mode-option.active { 
    border-color: var(--accent-color); 
    background: var(--accent-light); 
    color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.section-divider { 
    height: 1px; 
    background: var(--border-color); 
    margin: 24px 0; 
}

.section-title { 
    font-size: 13px; 
    font-weight: 700; 
    color: var(--text-primary); 
    margin-bottom: 14px; 
    display: flex; 
    align-items: center; 
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.section-title i { 
    color: var(--accent-color); 
}

.auth-screen { 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0; 
    background: var(--bg-primary); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 1000; 
}

.auth-card { 
    background: var(--bg-secondary); 
    border-radius: var(--radius-xl); 
    padding: 40px; 
    box-shadow: var(--shadow-lg); 
    max-width: 420px; 
    width: 90%; 
    text-align: center;
    border: 1px solid var(--border-color);
}

.auth-title { 
    font-size: 26px; 
    font-weight: 700; 
    color: var(--text-primary); 
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.auth-subtitle { 
    font-size: 14px; 
    color: var(--text-tertiary); 
    margin-bottom: 28px; 
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.vditor-outline {
    display: none;
}

@media (min-width: 1024px) {
    .vditor-outline {
        display: block;
    }
}

@media (max-width: 768px) {
    .editor-actions {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .export-dropdown .btn span {
        display: none;
    }
    
    .export-menu {
        right: -50px;
        min-width: 140px;
    }
    
    .word-count-badge {
        font-size: 10px;
        padding: 3px 8px;
        margin-left: 8px;
    }
    
    .vditor-toolbar {
        padding: 6px 8px;
    }
    
    .vditor-toolbar__item {
        padding: 4px 6px;
    }
}

@media (max-width: 640px) {
    .editor-header {
        flex-wrap: wrap;
        padding: 10px 12px;
        gap: 8px;
    }
    
    .editor-file-info {
        width: 100%;
        justify-content: space-between;
    }
    
    .editor-actions {
        width: 100%;
        justify-content: flex-end;
    }
    
    .export-menu {
        position: fixed;
        top: auto;
        bottom: 20px;
        right: 20px;
        left: 20px;
        width: auto;
    }
}

.vditor--dark .vditor-toolbar {
    background: var(--bg-tertiary);
    border-bottom-color: var(--border-color);
}

.vditor--dark .vditor-content {
    background: var(--bg-secondary);
}

.vditor--dark .vditor-sv {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.vditor--dark .vditor-preview {
    background: var(--bg-secondary);
}

.vditor-counter {
    color: var(--text-tertiary);
    font-size: 12px;
    padding: 4px 8px;
}

.typewriter-mode .vditor-ir pre.vditor-reset,
.typewriter-mode .vditor-sv {
    padding-top: 50vh;
    padding-bottom: 50vh;
}
