/* 
 * Ride IDE - 赛博朋克霓虹风格样式表
 * 纯文本编辑器，无语法高亮
 */

/* ===== CSS 变量定义 ===== */
:root {
    /* 深色主背景 - 赛博朋克风格 */
    --bg-primary: #050510;
    --bg-secondary: #0a0b1e;
    --bg-tertiary: #1a1b2e;
    --bg-hover: #2a2b4a;
    --bg-active: #3a3b5a;
    
    /* 文字颜色 */
    --text-primary: #f0f6fc;
    --text-secondary: #7aa2f7;
    --text-muted: #565f89;
    --text-dim: #3b4261;
    
    /* 彩色霓虹装饰色 - 赛博朋克版 */
    --neon-pink: #ff2a6d;
    --neon-orange: #ff9e64;
    --neon-yellow: #fcee0a;
    --neon-green: #05d9e8;
    --neon-cyan: #00f0ff;
    --neon-blue: #7aa2f7;
    --neon-purple: #d400ff;
    
    /* 渐变装饰 */
    --gradient-rainbow: linear-gradient(90deg, 
        #ff2a6d 0%, 
        #ff9e64 20%, 
        #fcee0a 40%, 
        #05d9e8 60%, 
        #7aa2f7 80%, 
        #d400ff 100%
    );
    
    --gradient-sunset: linear-gradient(135deg, 
        #ff2a6d 0%, 
        #d400ff 50%, 
        #05d9e8 100%
    );
    
    --gradient-cyber: linear-gradient(135deg,
        #ff2a6d 0%,
        #05d9e8 50%,
        #fcee0a 100%
    );
    
    /* 边框颜色 */
    --border-color: rgba(255, 255, 255, 0.1);
    --border-light: rgba(255, 255, 255, 0.2);
    
    /* 阴影 */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 20px rgba(5, 217, 232, 0.3);
    --shadow-lg: 0 8px 40px rgba(212, 0, 255, 0.4);
    --shadow-neon-pink: 0 0 20px rgba(255, 42, 109, 0.5);
    --shadow-neon-cyan: 0 0 20px rgba(5, 217, 232, 0.5);
    --shadow-neon-purple: 0 0 20px rgba(212, 0, 255, 0.5);
    
    /* 过渡动画 */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* 字体 */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    
    /* 尺寸 - 电脑端优化 */
    --sidepanel-width: 280px;
    --statusbar-height: 28px;
    --terminal-height: 180px;
    --topbar-height: 56px;
    --tab-height: 44px;
}

/* ===== 基础重置 ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

/* ===== 动态背景层 ===== */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 20%, rgba(255, 42, 109, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 80%, rgba(5, 217, 232, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 50% 50%, rgba(212, 0, 255, 0.1) 0%, transparent 60%);
    animation: backgroundPulse 8s ease-in-out infinite;
    z-index: -10;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* 网格背景 */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 50px 50px;
    transform: perspective(500px) rotateX(60deg) scale(2);
    transform-origin: center top;
    animation: gridMove 20s linear infinite;
    z-index: -9;
    pointer-events: none;
}

@keyframes gridMove {
    0% { transform: perspective(500px) rotateX(60deg) scale(2) translateY(0); }
    100% { transform: perspective(500px) rotateX(60deg) scale(2) translateY(50px); }
}

/* 扫描线效果 */
.scanlines {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.1) 0px,
        rgba(0, 0, 0, 0.1) 1px,
        transparent 1px,
        transparent 3px
    );
    pointer-events: none;
    z-index: 10000;
    opacity: 0.3;
}

/* 浮动粒子 */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -8;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--neon-cyan);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--neon-cyan);
    animation: floatParticle 15s linear infinite;
}

.particle:nth-child(1) { left: 10%; animation-delay: 0s; animation-duration: 20s; }
.particle:nth-child(2) { left: 20%; animation-delay: 2s; animation-duration: 18s; background: var(--neon-pink); box-shadow: 0 0 10px var(--neon-pink); }
.particle:nth-child(3) { left: 30%; animation-delay: 4s; animation-duration: 22s; }
.particle:nth-child(4) { left: 40%; animation-delay: 1s; animation-duration: 19s; background: var(--neon-purple); box-shadow: 0 0 10px var(--neon-purple); }
.particle:nth-child(5) { left: 50%; animation-delay: 3s; animation-duration: 21s; }
.particle:nth-child(6) { left: 60%; animation-delay: 5s; animation-duration: 17s; background: var(--neon-yellow); box-shadow: 0 0 10px var(--neon-yellow); }
.particle:nth-child(7) { left: 70%; animation-delay: 2.5s; animation-duration: 23s; }
.particle:nth-child(8) { left: 80%; animation-delay: 0.5s; animation-duration: 18s; background: var(--neon-pink); box-shadow: 0 0 10px var(--neon-pink); }
.particle:nth-child(9) { left: 90%; animation-delay: 4.5s; animation-duration: 20s; }
.particle:nth-child(10) { left: 15%; animation-delay: 3.5s; animation-duration: 19s; background: var(--neon-cyan); box-shadow: 0 0 10px var(--neon-cyan); }

@keyframes floatParticle {
    0% {
        transform: translateY(100vh) scale(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
        transform: translateY(90vh) scale(1);
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-10vh) scale(0.5);
        opacity: 0;
    }
}

/* 发光球体 */
.glow-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: orbFloat 10s ease-in-out infinite;
    z-index: -7;
    pointer-events: none;
}

.glow-orb:nth-child(1) {
    width: 300px;
    height: 300px;
    background: var(--neon-pink);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.glow-orb:nth-child(2) {
    width: 400px;
    height: 400px;
    background: var(--neon-cyan);
    bottom: -150px;
    left: -100px;
    animation-delay: 3s;
}

.glow-orb:nth-child(3) {
    width: 200px;
    height: 200px;
    background: var(--neon-purple);
    top: 50%;
    left: 50%;
    animation-delay: 6s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -30px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.9); }
    75% { transform: translate(40px, 10px) scale(1.05); }
}

/* ===== 滚动条样式 ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-cyan));
    border-radius: 4px;
    box-shadow: 0 0 10px rgba(5, 217, 232, 0.5);
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, var(--neon-pink), var(--neon-purple));
    box-shadow: 0 0 15px rgba(255, 42, 109, 0.7);
}
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--border-light);
}

/* ===== 主应用布局 ===== */
.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

/* ===== 顶部导航栏 ===== */
.topbar {
    height: var(--topbar-height);
    background: rgba(10, 11, 30, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
    padding: 0 20px;
    position: relative;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.topbar::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-rainbow);
    background-size: 200% 100%;
    animation: borderFlow 3s linear infinite;
    box-shadow: 0 0 10px var(--neon-pink), 0 0 20px var(--neon-cyan);
}

@keyframes borderFlow {
    0% { background-position: 0% 0%; }
    100% { background-position: 200% 0%; }
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-text {
    font-size: 22px;
    font-weight: 800;
    background: var(--gradient-cyber);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 3px;
    text-shadow: 0 0 30px rgba(5, 217, 232, 0.5);
    animation: logoGlow 2s ease-in-out infinite;
}

@keyframes logoGlow {
    0%, 100% {
        filter: drop-shadow(0 0 10px rgba(5, 217, 232, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 25px rgba(212, 0, 255, 0.8)) drop-shadow(0 0 50px rgba(255, 42, 109, 0.4));
    }
}

.logo-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gradient-cyber);
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-pink);
    animation: pulseDot 1.5s ease-in-out infinite;
}

@keyframes pulseDot {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-pink);
    }
    50% {
        transform: scale(1.3);
        box-shadow: 0 0 30px var(--neon-cyan), 0 0 60px var(--neon-pink), 0 0 80px var(--neon-purple);
    }
}

.topbar-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.nav-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-btn:hover::before {
    left: 100%;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 20px rgba(5, 217, 232, 0.4), inset 0 0 20px rgba(5, 217, 232, 0.1);
    transform: translateY(-2px);
}

.nav-btn:active {
    transform: translateY(0) scale(0.98);
}

.nav-btn.primary {
    background: linear-gradient(135deg, var(--neon-pink), var(--neon-purple));
    border: none;
    box-shadow: 0 0 20px rgba(255, 42, 109, 0.5);
}

.nav-btn.primary:hover {
    box-shadow: 0 0 30px rgba(255, 42, 109, 0.7), 0 0 60px rgba(212, 0, 255, 0.4);
    transform: translateY(-2px) scale(1.02);
}

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

.nav-btn svg {
    width: 16px;
    height: 16px;
    filter: drop-shadow(0 0 5px currentColor);
}

/* 按钮点击波纹效果 */
.nav-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    transform: scale(0);
    opacity: 0;
    pointer-events: none;
}

.nav-btn:active::after {
    animation: ripple 0.4s ease-out;
}

@keyframes ripple {
    from {
        transform: scale(0);
        opacity: 0.3;
    }
    to {
        transform: scale(1.5);
        opacity: 0;
    }
}

/* ===== 主内容区 ===== */
.main-container {
    display: flex;
    flex: 1;
    overflow: hidden;
}

/* ===== 侧边面板 ===== */
.side-panel {
    width: var(--sidepanel-width);
    background: rgba(10, 11, 30, 0.85);
    backdrop-filter: blur(20px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.5);
    position: relative;
}

.side-panel::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 1px;
    height: 100%;
    background: linear-gradient(180deg, 
        transparent 0%, 
        var(--neon-cyan) 20%, 
        var(--neon-purple) 50%, 
        var(--neon-pink) 80%, 
        transparent 100%
    );
    opacity: 0.5;
    animation: sidePanelGlow 3s ease-in-out infinite;
}

@keyframes sidePanelGlow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.8; }
}

.panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--neon-cyan);
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-shadow: 0 0 10px var(--neon-cyan);
}

.panel-actions {
    display: flex;
    gap: 6px;
}

.panel-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 16px;
    transition: all var(--transition-normal);
}

.panel-btn:hover {
    color: var(--neon-cyan);
    background: rgba(5, 217, 232, 0.1);
    border-color: var(--neon-cyan);
    box-shadow: 0 0 15px rgba(5, 217, 232, 0.4);
    transform: scale(1.1);
}

.file-section {
    flex: 1;
    overflow-y: auto;
    padding: 12px 0;
}

.file-list {
    padding: 4px 0;
}

.file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px 10px 36px;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    border-left: 3px solid transparent;
    animation: slideInLeft 0.3s ease;
}

.file-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-cyber);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.file-item:hover::before {
    opacity: 1;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.file-item.active {
    background: rgba(5, 217, 232, 0.1);
    border-left-color: var(--neon-cyan);
}

.file-item.active::before {
    opacity: 1;
    box-shadow: 0 0 20px var(--neon-cyan);
    animation: borderGlow 2s ease-in-out infinite;
}

@keyframes borderGlow {
    0%, 100% {
        box-shadow: 0 0 10px var(--neon-cyan);
    }
    50% {
        box-shadow: 0 0 25px var(--neon-cyan), 0 0 50px var(--neon-purple);
    }
}

.file-item.just-opened {
    animation: flashHighlight 0.5s ease;
}

@keyframes flashHighlight {
    0% {
        background: rgba(5, 217, 232, 0.4);
    }
    100% {
        background: rgba(5, 217, 232, 0.1);
    }
}

.file-item.modified::after {
    content: '●';
    position: absolute;
    right: 16px;
    color: var(--neon-pink);
    font-size: 10px;
    animation: pulseDotModified 1s ease-in-out infinite;
}

@keyframes pulseDotModified {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.3); }
}

.file-icon {
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.file-name {
    font-size: 13px;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.storage-info {
    padding: 12px 16px;
    border-top: 1px solid var(--border-color);
}

.storage-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 6px;
}

.storage-used {
    height: 100%;
    background: var(--gradient-rainbow);
    border-radius: 2px;
    width: 0%;
    transition: width 0.3s ease;
}

.storage-text {
    font-size: 11px;
    color: var(--text-muted);
}

/* ===== 编辑区域 ===== */
.editor-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: rgba(5, 5, 16, 0.95);
    position: relative;
    box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.5);
}

/* 装饰边框 */
.editor-area::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-cyber);
    background-size: 200% 100%;
    opacity: 1;
    z-index: 10;
    animation: borderFlow 3s linear infinite;
    box-shadow: 0 0 20px var(--neon-cyan), 0 0 40px var(--neon-pink);
}

/* 标签栏 */
.tabs-container {
    display: flex;
    background: rgba(10, 11, 30, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    flex-shrink: 0;
    height: var(--tab-height);
}

.tab {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.02);
    border-right: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid transparent;
    cursor: pointer;
    position: relative;
    transition: all var(--transition-normal);
    min-width: 120px;
    max-width: 200px;
    height: var(--tab-height);
    animation: tabSlideIn 0.3s ease;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(5, 217, 232, 0.1) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tab:hover::before {
    opacity: 1;
}

@keyframes tabSlideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tab:hover {
    background: rgba(255, 255, 255, 0.05);
}

.tab.active {
    background: rgba(5, 217, 232, 0.05);
    border-bottom-color: var(--neon-cyan);
    box-shadow: 0 -2px 20px rgba(5, 217, 232, 0.3);
}

.tab.active::before {
    opacity: 1;
}

.tab.active .tab-name {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px var(--neon-cyan);
}

@keyframes tabActivePulse {
    0%, 100% {
        border-bottom-color: var(--neon-cyan);
        box-shadow: 0 -2px 15px rgba(5, 217, 232, 0.3);
    }
    50% {
        border-bottom-color: var(--neon-pink);
        box-shadow: 0 -2px 25px rgba(255, 42, 109, 0.5);
    }
}

.tab.modified {
    background: var(--bg-tertiary);
}

.tab.modified::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 3px;
    height: 100%;
    background: var(--neon-orange);
    animation: modifiedBar 1s ease-in-out infinite;
}

@keyframes modifiedBar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.tab-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.tab-name {
    font-size: 13px;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tab-close {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    border-radius: 4px;
    color: var(--text-muted);
    font-size: 14px;
    opacity: 0;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.tab:hover .tab-close {
    opacity: 1;
}

.tab-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* ===== 简洁编辑器容器 ===== */
.editor-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.simple-editor {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    min-height: 0;
}

/* 行号区域 */
.line-numbers {
    width: auto;
    min-width: 50px;
    max-width: 80px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 16px 8px 16px 0;
    text-align: right;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-muted);
    user-select: none;
    overflow: hidden;
    flex-shrink: 0;
    will-change: transform;
    white-space: pre;
    animation: lineFadeIn 0.3s ease;
    position: relative;
    height: auto;
    align-self: stretch;
}

@keyframes lineFadeIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.line-fade-in {
    animation: lineFadeIn 0.3s ease !important;
}

.content-fade-in {
    animation: contentFadeIn 0.3s ease !important;
}

/* 代码编辑器 */
#codeEditor {
    flex: 1;
    background: var(--bg-primary);
    border: none;
    padding: 16px 16px 16px 8px;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-primary);
    resize: none;
    outline: none;
    overflow: auto;
    white-space: pre;
    tab-size: 4;
    letter-spacing: 0;
    animation: contentFadeIn 0.3s ease;
    height: 100%;
    box-sizing: content-box; /* 确保padding不影响总高度 */
}

@keyframes contentFadeIn {
    from {
        opacity: 0;
        filter: blur(2px);
    }
    to {
        opacity: 1;
        filter: blur(0);
    }
}

#codeEditor::placeholder {
    color: var(--text-muted);
}

/* 编辑器状态栏 */
.editor-status {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    background: rgba(10, 11, 30, 0.95);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    color: var(--text-muted);
    flex-shrink: 0;
    backdrop-filter: blur(10px);
}

.status-name {
    color: var(--text-primary);
    font-weight: 500;
}

.status-info {
    color: var(--text-muted);
}

/* ===== 终端区域 ===== */
.terminal-section {
    background: rgba(10, 11, 30, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    flex-grow: 0;
    height: var(--terminal-height);
    min-height: 150px;
    max-height: 40%;
    transition: height 0.3s ease;
    position: relative;
    box-shadow: 0 -5px 30px rgba(0, 0, 0, 0.5);
    /* 修复：确保高度计算包含所有元素 */
    box-sizing: border-box;
}

.terminal-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--neon-pink) 20%, 
        var(--neon-cyan) 80%, 
        transparent 100%
    );
    opacity: 0.8;
    animation: terminalBorderGlow 2s ease-in-out infinite;
}

@keyframes terminalBorderGlow {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

.terminal-section.collapsed {
    height: 44px;
    min-height: 44px;
}

.terminal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    height: 44px;
    background: rgba(5, 5, 16, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    /* 修复：确保header不会额外占用空间 */
    box-sizing: border-box;
}

.terminal-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--neon-pink);
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 0 10px var(--neon-pink);
}

.terminal-actions {
    display: flex;
    gap: 6px;
}

.terminal-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    cursor: pointer;
    border-radius: 6px;
    font-size: 12px;
    transition: all var(--transition-normal);
}

.terminal-btn:hover {
    background: rgba(255, 42, 109, 0.2);
    border-color: var(--neon-pink);
    color: var(--neon-pink);
    box-shadow: 0 0 15px rgba(255, 42, 109, 0.4);
}

.terminal-body {
    flex: 1;
    padding: 12px 16px 16px 16px;
    overflow-y: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    background: rgba(0, 0, 0, 0.3);
    /* 修复：确保最后一行能完整显示，不多不少 */
    box-sizing: border-box;
}

.terminal-line {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: var(--text-primary);
    animation: terminalSlideIn 0.2s ease;
    text-shadow: 0 0 5px currentColor;
}

@keyframes terminalSlideIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.terminal-line.error {
    color: var(--neon-pink);
    text-shadow: 0 0 10px var(--neon-pink);
    animation: terminalSlideIn 0.2s ease, errorPulse 1.5s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

.terminal-line.success {
    color: var(--neon-green);
    text-shadow: 0 0 10px var(--neon-green);
    animation: terminalSlideIn 0.2s ease, successPulse 1.5s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.terminal-line.warning {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    animation: terminalSlideIn 0.2s ease;
}

.term-prompt {
    color: var(--neon-cyan);
    font-weight: 600;
    text-shadow: 0 0 10px var(--neon-cyan);
}

.term-path {
    color: var(--neon-purple);
    font-weight: 500;
    text-shadow: 0 0 8px var(--neon-purple);
}

.term-command {
    color: var(--text-primary);
}

.term-cursor {
    color: var(--neon-yellow);
    text-shadow: 0 0 10px var(--neon-yellow);
    animation: blink 1s step-end infinite;
}

/* 终端末尾空白行 - 确保最后一行内容完整显示 */
.terminal-spacer {
    height: 20px;
    flex-shrink: 0;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

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

.toast {
    padding: 12px 16px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 10px;
    animation: slideInRight 0.3s ease;
    color: var(--text-primary);
    font-size: 13px;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.toast.success {
    border-left: 3px solid var(--neon-green);
    animation: slideInRight 0.3s ease, successPulse 2s ease-in-out infinite;
}

@keyframes successPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(158, 206, 106, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(158, 206, 106, 0); }
}

.toast.error {
    border-left: 3px solid var(--neon-pink);
    animation: slideInRight 0.3s ease, errorPulse 2s ease-in-out infinite;
}

@keyframes errorPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(247, 118, 142, 0.3); }
    50% { box-shadow: 0 0 0 8px rgba(247, 118, 142, 0); }
}

.toast.warning {
    border-left: 3px solid var(--neon-yellow);
}

/* ===== 选中效果 ===== */
::selection {
    background: rgba(187, 154, 247, 0.3);
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
    .topbar-nav .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        padding: 8px 10px;
    }
}

@media (max-width: 768px) {
    .side-panel {
        width: 180px;
    }
    
    .topbar-nav {
        gap: 4px;
    }
    
    .nav-btn {
        padding: 8px;
    }
    
    .nav-btn span {
        display: none;
    }
}

/* ===== 手机端适配 ===== */
@media (max-width: 480px) {
    .side-panel {
        display: none;
    }
    
    .topbar {
        padding: 0 8px;
    }
    
    .logo-text {
        font-size: 16px;
    }
    
    .line-numbers {
        width: 44px;
        padding: 12px 6px;
        font-size: 12px;
    }
    
    #codeEditor {
        padding: 12px 8px;
        font-size: 13px;
    }
}

/* ===== 自定义模态对话框 ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    animation: fadeInOverlay 0.3s ease;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-dialog {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 400px;
    max-width: 90%;
    box-shadow: var(--shadow-lg);
    transform: scale(0.9) translateY(-20px);
    transition: transform 0.2s ease;
    animation: modalSlideIn 0.3s ease;
}

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

.modal-overlay.active .modal-dialog {
    transform: scale(1) translateY(0);
}

.modal-overlay.active .modal-dialog {
    transform: scale(1);
}

/* ===== 手机端侧边栏遮罩层 ===== */
.mobile-sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 998;
}

.mobile-sidebar-overlay.active {
    display: block;
}

.mobile-sidebar-overlay.active {
    display: block;
}

/* ===== 手机端文件列表按钮 ===== */
.mobile-only {
    display: none;
}

.nav-btn.mobile-only {
    padding: 8px;
}

.nav-btn.mobile-only svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.modal-close {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    cursor: pointer;
    border-radius: 6px;
    transition: all var(--transition-fast);
}

.modal-close:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

.modal-message {
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.modal-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color var(--transition-fast);
}

.modal-input:focus {
    border-color: var(--neon-purple);
}

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

/* 手机端侧边栏展开状态 */
.side-panel.expanded-mobile {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 220px;
    z-index: 999;
    box-shadow: var(--shadow-lg);
    pointer-events: none;
}

.side-panel.expanded-mobile > * {
    pointer-events: auto;
}

.mobile-sidebar-close {
    display: none;
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--bg-hover);
    border: none;
    border-radius: 6px;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    z-index: 1000;
}

.mobile-sidebar-close:hover {
    background: var(--bg-active);
    color: var(--text-primary);
}

@media (max-width: 480px) {
    .mobile-sidebar-close {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.modal-btn {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.modal-btn-cancel {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.modal-btn-cancel:hover {
    background: var(--bg-hover);
}

.modal-btn-confirm {
    background: var(--gradient-sunset);
    border: none;
    color: white;
}

.modal-btn-confirm:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 42, 109, 0.4);
}

/* ===== 电脑端优化 - 大屏幕适配 ===== */
@media screen and (min-width: 1200px) {
    :root {
        --sidepanel-width: 300px;
        --terminal-height: 260px;
        --base-font-size: 15px;
    }
    
    html, body {
        font-size: 15px;
    }
    
    /* 侧边栏优化 */
    .side-panel {
        width: var(--sidepanel-width);
        min-width: 280px;
    }
    
    /* 顶部导航栏 */
    .topbar {
        padding: 0 32px;
        height: 60px;
    }
    
    .logo-text {
        font-size: 26px;
        letter-spacing: 4px;
    }
    
    .nav-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    /* 面板头部 */
    .panel-header {
        padding: 20px 24px;
        font-size: 13px;
    }
    
    /* 文件列表 */
    .file-item {
        padding: 14px 24px 14px 40px;
        font-size: 14px;
    }
    
    /* 标签栏 */
    .tabs-container {
        height: 48px;
    }
    
    .tab {
        height: 48px;
        padding: 0 24px;
        min-width: 140px;
        max-width: 220px;
    }
    
    .tab-name {
        font-size: 14px;
    }
    
    /* 编辑器 */
    .editor-wrapper {
        padding: 8px;
    }
    
    #codeEditor {
        padding: 20px 24px;
        font-size: 15px;
        line-height: 1.7;
    }
    
    .line-numbers {
        padding: 20px 16px 20px 0;
        font-size: 15px;
        line-height: 1.7;
        min-width: 60px;
        max-width: 90px;
    }
    
    /* 终端 */
    .terminal-section {
        height: 250px;
        min-height: 200px;
    }
    
    .terminal-section.collapsed {
        height: 44px;
        min-height: 44px;
    }
    
    .terminal-header {
        height: 44px;
        padding: 0 20px;
    }
    
    .terminal-body {
        padding: 16px 20px;
        font-size: 14px;
    }
    
    /* 状态栏 */
    .editor-status {
        padding: 10px 24px;
        font-size: 13px;
    }
    
    /* 存储信息 */
    .storage-info {
        padding: 16px 24px;
    }
    
    /* 模态框 */
    .modal-dialog {
        width: 480px;
        max-width: 90%;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px 28px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-body {
        padding: 24px 28px;
    }
    
    .modal-message {
        font-size: 15px;
        margin-bottom: 16px;
    }
    
    .modal-input {
        padding: 14px 18px;
        font-size: 15px;
        border-radius: 10px;
    }
    
    .modal-footer {
        padding: 20px 28px;
    }
    
    .modal-btn {
        padding: 12px 28px;
        font-size: 14px;
    }
    
    /* Toast */
    .toast-container {
        top: 80px;
        right: 32px;
        gap: 12px;
    }
    
    .toast {
        padding: 16px 24px;
        font-size: 14px;
        border-radius: 10px;
    }
}

/* ===== 超大屏幕优化 - 宽屏显示器 ===== */
@media screen and (min-width: 1600px) {
    :root {
        --sidepanel-width: 320px;
        --terminal-height: 300px;
        --base-font-size: 16px;
    }
    
    html, body {
        font-size: 16px;
    }
    
    .topbar {
        padding: 0 48px;
        height: 64px;
    }
    
    .logo-text {
        font-size: 28px;
        letter-spacing: 5px;
    }
    
    .nav-btn {
        padding: 14px 28px;
        font-size: 15px;
    }
    
    .side-panel {
        width: var(--sidepanel-width);
        min-width: 300px;
    }
    
    .file-item {
        padding: 16px 28px 16px 44px;
    }
    
    #codeEditor {
        padding: 24px 32px;
        font-size: 16px;
        line-height: 1.8;
    }
    
    .line-numbers {
        padding: 24px 20px 24px 0;
        font-size: 16px;
        line-height: 1.8;
    }
    
    .terminal-section {
        height: 350px;
        min-height: 280px;
    }
    
    .terminal-section.collapsed {
        height: 48px;
        min-height: 48px;
    }
    
    /* 限制内容最大宽度，防止眼睛疲劳 */
    .editor-wrapper {
        max-width: 1800px;
        margin: 0 auto;
        width: 100%;
    }
}

/* ===== 大屏幕下的工具提示 ===== */
@media screen and (min-width: 1200px) {
    .nav-btn[title]:hover::after {
        content: attr(title);
        position: absolute;
        bottom: -32px;
        left: 50%;
        transform: translateX(-50%);
        padding: 6px 12px;
        background: rgba(0, 0, 0, 0.9);
        color: var(--text-primary);
        font-size: 12px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 1000;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
        animation: tooltipFadeIn 0.2s ease;
    }
    
    @keyframes tooltipFadeIn {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(5px);
        }
        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }
    
    .panel-btn[title]:hover::after {
        content: attr(title);
        position: absolute;
        bottom: -28px;
        left: 50%;
        transform: translateX(-50%);
        padding: 4px 10px;
        background: rgba(0, 0, 0, 0.9);
        color: var(--text-primary);
        font-size: 11px;
        border-radius: 4px;
        white-space: nowrap;
        z-index: 1000;
    }
}

/* ===== 桌面端状态栏固定 ===== */
@media screen and (min-width: 1200px) {
    .editor-status {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 280px;
        z-index: 100;
        background: rgba(10, 11, 30, 0.95);
        backdrop-filter: blur(10px);
    }
}

/* ===== 桌面端模态框优化 ===== */
@media screen and (min-width: 1200px) {
    .modal-overlay {
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(8px);
    }
    
    .modal-dialog {
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 
                    0 0 40px rgba(5, 217, 232, 0.2),
                    0 0 80px rgba(212, 0, 255, 0.1);
    }
}

/* ===== 桌面端滚动条优化 ===== */
@media screen and (min-width: 1200px) {
    ::-webkit-scrollbar {
        width: 10px;
        height: 10px;
    }
    
    ::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.3);
        border-radius: 5px;
    }
    
    ::-webkit-scrollbar-thumb {
        background: linear-gradient(180deg, var(--neon-pink), var(--neon-cyan));
        border-radius: 5px;
        box-shadow: 0 0 15px rgba(5, 217, 232, 0.5);
    }
    
    ::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(180deg, var(--neon-pink), var(--neon-purple));
        box-shadow: 0 0 20px rgba(255, 42, 109, 0.7);
    }
}

/* ===== 桌面端按钮效果增强 ===== */
@media screen and (min-width: 1200px) {
    .nav-btn {
        position: relative;
        overflow: hidden;
    }
    
    .nav-btn::before {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(
            90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent
        );
        transition: left 0.5s ease;
    }
    
    .nav-btn:hover::before {
        left: 100%;
    }
    
    .nav-btn.primary {
        box-shadow: 0 0 20px rgba(255, 42, 109, 0.5);
    }
    
    .nav-btn.primary:hover {
        box-shadow: 0 0 30px rgba(255, 42, 109, 0.7),
                    0 0 60px rgba(212, 0, 255, 0.4);
        transform: translateY(-2px);
    }
    
    .nav-btn:active {
        transform: translateY(0) scale(0.98);
        transition: transform 0.1s ease;
    }
}

/* ===== 桌面端文件列表动画增强 ===== */
@media screen and (min-width: 1200px) {
    .file-item {
        transition: all 0.2s ease;
    }
    
    .file-item:hover {
        background: rgba(5, 217, 232, 0.1);
        transform: translateX(4px);
    }
    
    .file-item.active {
        background: rgba(5, 217, 232, 0.15);
        box-shadow: inset 0 0 30px rgba(5, 217, 232, 0.1);
    }
    
    .file-item.active:hover {
        background: rgba(5, 217, 232, 0.2);
    }
    
    .file-item .file-icon {
        transition: transform 0.2s ease;
    }
    
    .file-item:hover .file-icon {
        transform: scale(1.2);
    }
}

/* ===== 桌面端标签页优化 ===== */
@media screen and (min-width: 1200px) {
    .tab {
        transition: all 0.2s ease;
    }
    
    .tab:hover {
        background: rgba(5, 217, 232, 0.1);
    }
    
    .tab.active {
        background: rgba(5, 217, 232, 0.08);
    }
    
    .tab-close {
        width: 22px;
        height: 22px;
        font-size: 16px;
        opacity: 0;
        transition: all 0.2s ease;
    }
    
    .tab:hover .tab-close {
        opacity: 1;
    }
    
    .tab-close:hover {
        background: rgba(255, 42, 109, 0.3);
        color: var(--neon-pink);
        transform: scale(1.1);
    }
}

/* ===== 桌面端终端优化 ===== */
@media screen and (min-width: 1200px) {
    .terminal-btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }
    
    .terminal-btn:hover {
        transform: scale(1.1);
    }
    
    .terminal-line {
        margin-bottom: 8px;
    }
    
    .term-prompt {
        font-size: 14px;
    }
    
    .term-path {
        font-size: 14px;
    }
}

/* ===== 桌面端存储信息优化 ===== */
@media screen and (min-width: 1200px) {
    .storage-info {
        padding: 20px 24px;
    }
    
    .storage-bar {
        height: 6px;
        border-radius: 3px;
        margin-bottom: 8px;
    }
    
    .storage-text {
        font-size: 12px;
    }
}

