:root {
    --primary-color: #0af;
    --primary-hover: #00ccff;
    --secondary-color: #2D7AF6;
    --success-color: #00d580;
    --error-color: #ff3366;
    --warning-color: #ffb300;
    --info-color: #26c6da;
    --text-color: #e0e0e0;
    --text-light: #a0a0a0;
    --bg-color: #121212;
    --panel-bg: #1e1e1e;
    --border-color: #333;
    --card-bg: #252525;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    --radius: 8px;
    --transition: all 0.3s ease;
    --font-primary: 'Segoe UI', 'Arial', sans-serif;
    --font-mono: 'Consolas', 'Monaco', monospace;
    --highlight-glow: 0 0 10px var(--primary-color), 0 0 20px rgba(0, 170, 255, 0.3);
    --neon-blue: #00feff;
    --neon-purple: #e23fff;
}

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

body {
    font-family: var(--font-primary);
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    overflow: hidden;
    background-image:
            radial-gradient(circle at 25% 25%, rgba(0, 170, 255, 0.05) 0%, transparent 50%),
            radial-gradient(circle at 75% 75%, rgba(226, 63, 255, 0.05) 0%, transparent 50%);
}



/* Tab system styling */
.vnc-tabs {
    display: flex;
    background-color: rgba(25, 25, 30, 0.95);
    border-bottom: 1px solid var(--border-color);
    padding: 0 10px;
    position: relative;
    z-index: 5;
}

.tab-button {
    padding: 12px 20px;
    background: transparent;
    color: var(--text-light);
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    outline: none;
    margin: 0;
    min-width: 120px;
    box-shadow: none;
}

.tab-button:hover {
    background: rgba(50, 50, 55, 0.5);
    color: var(--text-color);
}

.tab-button.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.tab-content {
    display: none;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    background-color: rgba(20, 20, 25, 0.95);
}

.tab-content.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

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


/* Workspace styling */
.workspace-browser {
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.workspace-header {
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(30, 30, 35, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.workspace-header h3 {
    margin: 0;
    font-size: 16px;
    color: var(--text-color);
}

.workspace-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    font-size: 14px;
    font-weight: 500;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

.download-all {
    color: white;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    /* background: rgba(40, 40, 40, 0.8); */
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);

}

/* File list styling */
.file-list {
    overflow-y: auto;
    flex: 1;
    padding: 10px;
    border-right: 1px solid var(--border-color);
    max-width: 300px;
}
.file-container{
    display: flex;
}

.workspace-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    margin-bottom: 5px;
    background: rgba(35, 35, 40, 0.6);
}

.workspace-file:hover {
    background: rgba(45, 45, 50, 0.8);
    transform: translateX(2px);
}

.workspace-file.selected {
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid rgba(0, 170, 255, 0.3);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.1);
}

.file-icon {
    font-size: 24px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-details {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.file-name {
    font-weight: 500;
    color: var(--text-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    font-size: 12px;
    color: var(--text-light);
}

/* Loading states */
.loading-files, .loading-preview, .no-files {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

.error-message {
    padding: 15px;
    color: var(--error-color);
    text-align: center;
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-radius: 6px;
    margin: 10px;
    background: rgba(255, 51, 102, 0.1);
}

/* File preview area */
.file-preview {
    flex: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.preview-placeholder {
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.preview-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.preview-icon.large {
    font-size: 80px;
    margin-bottom: 20px;
}

.preview-message {
    font-size: 16px;
}

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

.preview-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    max-width: 70%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.preview-actions {
    display: flex;
    gap: 10px;
}
/* File preview styling */
.image-preview, .video-preview, .audio-preview,
.pdf-preview, .code-preview, .markdown-preview, .generic-preview {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: auto;
    background: rgba(25, 25, 30, 0.5);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.image-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.video-preview, .audio-preview {
    padding: 20px;
}

.video-preview video, .audio-preview audio {
    width: 100%;
    outline: none;
}

.code-preview {
    padding: 0;
}

.code-preview pre {
    margin: 0;
    padding: 15px;
    overflow: auto;
    max-height: 100%;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.5;
}

.markdown-preview {
    padding: 20px;
    overflow: auto;
}

.generic-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
}

.preview-info {
    margin-top: 20px;
}

.preview-info p {
    margin: 5px 0;
    color: var(--text-light);
}

/* Download spinner overlay */
.download-loading {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 15, 20, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 170, 255, 0.1);
    border-radius: 50%;
    border-top: 4px solid var(--primary-color);
    animation: spin 1s linear infinite;
}

.loading-text {
    margin-top: 20px;
    color: var(--text-color);
    font-size: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


.license-footer {
    padding: 10px;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 240px;
    font-size: 12px;
    color: #777;
    border-top: 1px solid rgba(60, 60, 60, 0.3);
    z-index: 100;
}

.license-footer p {
    margin: 0;
}

.license-footer a {
    color: var(--primary-color);
    text-decoration: none;
    transition: all 0.2s ease;
}

.license-footer a:hover {
    text-decoration: underline;
    color: #00ccff;
    text-shadow: 0 0 5px rgba(0, 170, 255, 0.3);
}


/* Insufficient Balance Modal */
.balance-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
    opacity: 0;
}

.balance-modal.active {
    opacity: 1;
}

.balance-modal .modal-content {
    width: 680px;
    max-width: 90%;
    border-radius: var(--radius);
    background-color: rgba(30, 30, 35, 0.95);
    border: 1px solid rgba(0, 170, 255, 0.3);
    box-shadow:
            0 15px 35px rgba(0, 0, 0, 0.5),
            0 0 30px rgba(0, 170, 255, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.4s ease;
}

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

.balance-modal .modal-header {
    padding: 20px;
    background: linear-gradient(90deg, var(--error-color), #ff5555);
    color: white;
    position: relative;
}

.balance-modal .modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.balance-modal .close-modal {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 28px;
    cursor: pointer;
    opacity: 0.8;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.balance-modal .close-modal:hover {
    opacity: 1;
    transform: scale(1.1);
}

.balance-message {
    padding: 25px 20px;
    text-align: center;
    color: var(--text-color);
}

.balance-icon {
    font-size: 48px;
    margin-bottom: 5px;
}

.balance-message p {
    margin: 2px 0;
    font-size: 16px;
    line-height: 1.5;
}

.balance-actions {
    padding: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
}

.upgrade-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(45deg, #FFD700, #FFA500);
    color: #222;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(255, 165, 0, 0.3);
    animation: upgradeButtonGlow 2s infinite alternate;
}

@keyframes upgradeButtonGlow {
    0% {
        box-shadow: 0 4px 12px rgba(255, 165, 0, 0.3);
    }
    100% {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6);
    }
}

.upgrade-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 7px 20px rgba(255, 165, 0, 0.4);
}

.balance-help {
    padding: 0 20px 20px 20px;
    text-align: center;
    font-size: 14px;
    color: var(--text-light);
    border-top: 1px solid rgba(80, 80, 80, 0.3);
    margin-top: 10px;
    padding-top: 15px;
}

/* Insufficient Balance Warning in Task Container */
.balance-warning {
    background: rgba(35, 35, 40, 0.8);
    border: 1px solid rgba(255, 51, 102, 0.3);
    border-left: 4px solid var(--error-color);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    margin: 20px 0;
    animation: fadeIn 0.5s ease;
}

.balance-warning-icon {
    font-size: 34px;
}

.balance-warning-message h3 {
    color: var(--error-color);
    margin: 0 0 8px 0;
    font-size: 18px;
}

.balance-warning-message p {
    margin: 0;
    color: var(--text-light);
    font-size: 15px;
}

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


.login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(5, 10, 20, 0.95);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.login-container {
    background-color: rgba(28, 28, 33, 0.95);
    border-radius: 8px;
    border: 1px solid rgba(0, 170, 255, 0.3);
    padding: 30px;
    width: 600px;
    max-width: 90%;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 170, 255, 0.2);
    text-align: center;
}

.login-header {
    margin-bottom: 25px;
}

.login-header h2 {
    color: var(--primary-color);
    font-size: 24px;
    margin-bottom: 10px;
}

.login-header p {
    color: var(--text-light);
    font-size: 14px;
}

.login-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.g_id_signin {
    margin: 10px 0;
}

.login-info {
    margin-top: 20px;
    padding: 15px;
    background-color: rgba(0, 170, 255, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(0, 170, 255, 0.1);
}

.login-info p {
    color: var(--text-light);
    font-size: 13px;
    line-height: 1.5;
}

body.loading {
    overflow: hidden;
}

.loading-spinner {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    animation: loadingSpin 1.5s linear infinite;
    position: relative;
    filter: drop-shadow(0 0 10px rgba(0, 170, 255, 0.5));
}

.loading-spinner::before {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    bottom: 5px;
    left: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
    animation: loadingSpin 2s linear infinite reverse;
}

.loading-spinner::after {
    content: '';
    position: absolute;
    top: 15px;
    right: 15px;
    bottom: 15px;
    left: 15px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: var(--neon-blue);
    border-bottom-color: var(--neon-blue);
    animation: loadingSpin 1.2s linear infinite;
}

@keyframes loadingSpin {
    0% {transform: rotate(0deg);}
    100% {transform: rotate(360deg);}
}

/* 加载文本和状态 */
.loading-text {
    margin-top: 40px;
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-align: center;
    position: relative;
    text-shadow: 0 0 15px rgba(0, 170, 255, 0.5);
    animation: textPulse 2s infinite alternate;
}

@keyframes textPulse {
    0% { text-shadow: 0 0 10px rgba(0, 170, 255, 0.5); }
    100% { text-shadow: 0 0 20px rgba(0, 170, 255, 0.8); }
}

.loading-status {
    margin-top: 15px;
    color: var(--text-color);
    font-size: 16px;
    text-align: center;
    opacity: 0.9;
    max-width: 80%;
    letter-spacing: 0.5px;
}

/* 进度条 */
.loading-progress {
    width: 300px;
    height: 4px;
    background: rgba(30, 35, 50, 0.5);
    border-radius: 4px;
    margin-top: 30px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.5);
}

.loading-bar {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.7);
    transition: width 0.5s ease; /* 平滑过渡 */
}

.loading-subtitle {
    position: absolute;
    bottom: 40px;
    left: 0;
    width: 100%;
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
    letter-spacing: 2px;
    opacity: 0.7;
}

/* 高科技背景图案 */
.loading-hex-grid {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            repeating-linear-gradient(0deg, transparent, transparent 20px, rgba(0, 170, 255, 0.03) 20px, rgba(0, 170, 255, 0.03) 21px),
            repeating-linear-gradient(90deg, transparent, transparent 20px, rgba(0, 170, 255, 0.03) 20px, rgba(0, 170, 255, 0.03) 21px);
    opacity: 0.3;
    z-index: -1;
}

/* 添加额外的科幻元素 */
.circuit-lines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    overflow: hidden;
}

.circuit-line {
    position: absolute;
    background: linear-gradient(90deg, transparent, rgba(0, 170, 255, 0.2), transparent);
    height: 1px;
    width: 100%;
    animation: circuitMove 8s infinite linear;
    opacity: 0;
}

.circuit-line:nth-child(1) {
    top: 20%;
    animation-delay: 0s;
}

.circuit-line:nth-child(2) {
    top: 40%;
    animation-delay: 2s;
}

.circuit-line:nth-child(3) {
    top: 60%;
    animation-delay: 4s;
}

.circuit-line:nth-child(4) {
    top: 80%;
    animation-delay: 6s;
}

@keyframes circuitMove {
    0% { transform: translateX(-100%); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateX(100%); opacity: 0; }
}

.container {
    display: flex;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(0,0,0,0.9) 0%, rgba(30,30,30,0.9) 100%);
}

/* Sidebar panel styling */
.sidebar-panel {
    width: 240px;
    background-color: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow);
    padding: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 20px;
    background-color: rgba(45, 45, 45, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.sidebar-header h3:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 30%;
    height: 2px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
}

/* Beta 标志样式 */
.beta-badge {
    display: inline-block;
    font-size: 11px;
    padding: 2px 6px;
    margin-left: 8px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: #fff;
    border-radius: 4px;
    position: relative;
    top: -3px;
    font-weight: 700;
    letter-spacing: 0.5px;
    transform: rotate(0deg);
    box-shadow: 0 0 10px rgba(0, 170, 255, 0.4);
    text-shadow: none;
    vertical-align: middle;
    animation: betaPulse 3s infinite alternate;
}

/* Beta 标志的脉冲动画 */
@keyframes betaPulse {
    0% {
        box-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
    }
    100% {
        box-shadow: 0 0 15px rgba(0, 170, 255, 0.7);
    }
}

/* 响应式样式，确保在小屏幕上正确显示 */
@media (max-width: 480px) {
    .beta-badge {
        font-size: 9px;
        padding: 1px 4px;
        margin-left: 5px;
    }
}

/* Left chat interface styling */
.chat-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    max-width: calc(50% - 240px);
    box-shadow: var(--shadow);
    position: relative;
    height: 100vh; /* 使用视口高度确保填充整个高度 */
    overflow: hidden; /* 重要：防止整个面板溢出 */

}

.chat-panel:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 170, 255, 0.03) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.chat-header {
    padding: 20px;
    background-color: rgba(35, 35, 35, 0.9);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
}

.chat-header h1 {
    margin: 0;
    font-size: 24px;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.chat-header h1:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-blue), transparent);
}

.highlight {
    color: var(--primary-color);
    text-shadow: var(--highlight-glow);
    font-weight: 700;
}

.user-info {
    display: inline-block;
    background-color: rgba(0, 170, 255, 0.1);
    padding: 8px 15px;
    border-radius: var(--radius);
    margin: 10px 0;
    font-size: 14px;
    color: var(--text-light);
    border: 1px solid rgba(0, 170, 255, 0.2);
    display: none;
}

.user-id-value, .node-name-value {
    color: var(--primary-color);
    font-weight: 600;
}

.task-list {
    overflow-y: auto;
    flex-grow: 1;
    padding: 0;
    background-color: rgba(28, 28, 28, 0.9);
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.task-card {
    background: rgba(40, 40, 40, 0.8);
    padding: 12px 15px;
    border-bottom: 1px solid rgba(60, 60, 60, 0.5);
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.task-card:hover {
    background: rgba(50, 50, 50, 0.95);
    border-left: 3px solid var(--primary-color);
}

.task-title {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 6px;
    color: var(--text-color);
}

.task-meta {
    font-size: 11px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-completed {
    background-color: rgba(0, 213, 128, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(0, 213, 128, 0.3);
}

.status-running {
    background-color: rgba(0, 170, 255, 0.2);
    color: var(--primary-color);
    border: 1px solid rgba(0, 170, 255, 0.3);
    animation: statusGlow 3s infinite alternate;
}

@keyframes statusGlow {
    0% {
        box-shadow: 0 0 5px rgba(0, 170, 255, 0.3);
    }
    100% {
        box-shadow: 0 0 10px rgba(0, 170, 255, 0.5);
    }
}


@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 170, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 5px rgba(0, 170, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(0, 170, 255, 0);
    }
}

.status-failed {
    background-color: rgba(255, 51, 102, 0.2);
    color: var(--error-color);
    border: 1px solid rgba(255, 51, 102, 0.3);
}

.chat-messages {
    flex: 1; /* 使用 flex: 1 确保它能填充可用空间 */
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: var(--panel-bg);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 200px; /* 确保有最小高度 */
    max-height: calc(100vh - 180px); /* 限制最大高度，减去头部和底部空间 */

}

.chat-messages:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background:
            linear-gradient(45deg, rgba(0, 170, 255, 0.02) 0%, rgba(0, 0, 0, 0) 70%),
            repeating-linear-gradient(
                    rgba(60, 60, 60, 0.05) 0px,
                    rgba(60, 60, 60, 0.05) 1px,
                    transparent 1px,
                    transparent 30px
            );
    pointer-events: none;
    z-index: 0;
}

.message {
    margin-bottom: 20px;
    /*max-width: 90%;*/
    animation: fadeIn 0.5s ease;
    position: relative;
    z-index: 1;
}

.message-content {
    text-align: center;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    font-size: 15px;
    background-color: rgba(50, 50, 50, 0.7);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.message-content:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 170, 255, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.message.system .message-content {
    background-color: rgba(45, 45, 45, 0.8);
    color: var(--text-color);
    border-top-left-radius: 2px;
    border-left: 3px solid var(--primary-color);
}

.message-time {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 5px;
    padding-left: 10px;
}
.welcome-text {
    display: inline-block;
    white-space: nowrap;
    overflow: hidden;
    border-right: 3px solid var(--primary-color);
    animation:
            typing 3.5s steps(50, end),
            blink-caret 0.75s step-end 5, /* 只闪烁5次 */
            remove-caret 0s 3.5s forwards; /* typing动画结束后执行 */
    width: fit-content;
    color: var(--text-color);
}

/* 添加新的关键帧动画来移除光标 */
@keyframes remove-caret {
    to {
        border-right: 3px solid transparent;
    }
}

@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--primary-color) }
}

.chat-input {
    padding: 20px;
    background-color: rgba(30, 30, 30, 0.95);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 10px;
    position: relative;
    z-index: 10; /* 确保在最上层 */

}

.chat-input:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent,
    rgba(0, 170, 255, 0.3),
    transparent);
}

#prompt-input {
    flex-grow: 1;
    padding: 15px 20px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 16px;
    transition: var(--transition);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    background-color: rgba(40, 40, 40, 0.8);
    color: var(--text-color);
}

#prompt-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 170, 255, 0.2), var(--highlight-glow);
    outline: none;
    background-color: rgba(45, 45, 45, 0.9);
}

#prompt-input::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

button {
    padding: 15px 20px;
    background-color: var(--panel-bg);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

button: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: 0.5s;
}

.send-button {
    min-width: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    /* 通过较大的模糊值创建柔和的盒子阴影辉光 */
    box-shadow:
            0 0 10px rgba(0, 170, 255, 0.3),
            0 0 20px rgba(0, 170, 255, 0.1);
    /* 添加新的辉光动画 */
    animation: buttonGlow 3s infinite alternate;
    padding: 0;

}


@keyframes buttonGlow {
    0% {
        box-shadow:
                0 0 10px rgba(0, 170, 255, 0.3),
                0 0 20px rgba(0, 170, 255, 0.1);
    }
    100% {
        box-shadow:
                0 0 15px rgba(0, 170, 255, 0.4),
                0 0 25px rgba(0, 170, 255, 0.2),
                0 0 35px rgba(0, 170, 255, 0.1);
    }
}

/* Right VNC panel styling */
.vnc-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    max-width: 50%;
    box-shadow: var(--shadow);
    position: relative;
}

.vnc-panel:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(225deg, rgba(226, 63, 255, 0.03) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.vnc-header {
    padding: 20px;
    background-color: rgba(35, 35, 35, 0.9);
    border-bottom: 1px solid var(--border-color);
    position: relative;
    z-index: 2;
}

.vnc-header h2 {
    margin: 0;
    font-size: 20px;
    color: var(--text-color);
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.vnc-header h2:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 70%;
    height: 2px;
    background: linear-gradient(90deg, var(--neon-purple), transparent);
}

.vnc-container {
    flex-grow: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background-color: var(--panel-bg);
    position: relative;
}

.vnc-display {
    flex-grow: 1;
    border-radius: var(--radius);
    background-color: #000;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow);
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.vnc-display:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    /* 分开声明各个背景属性，而不是使用简写 */
    background-image: linear-gradient(90deg, transparent, rgba(226, 63, 255, 0.5), transparent);
    background-size: 200% 100%;
    background-position: 0% 50%;
    background-repeat: repeat;
    z-index: 10;
    animation: moveGradient 2s linear infinite;
}

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

.vnc-display iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.vnc-controls {
    padding: 5px 0;
    display: flex;
    justify-content: center;
    gap: 15px;
}

.vnc-button {
    display: flex;
    align-items: center;
    gap: 8px;
    /*background: rgba(40, 40, 40, 0.8);*/
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.button-icon {
    font-size: 16px;
}

.refresh {
    /*background: linear-gradient(45deg, #118ab2, #063f53);*/
}


.fullscreen {
    /*background: linear-gradient(45deg, #4361ee, #2b3f9e);*/
}

/* Step container and items */
/* Step container and items */
.step-container {
    display: flex;
    flex-direction: column;
    gap: 8px;  /* 减小间距 */
    width: 100%;
    overflow-y: auto;
    position: relative;
    z-index: 1;
    padding: 10px 0;
    max-height: none; /* 移除可能的高度限制 */
    flex-grow: 1; /* 允许容器扩展填充可用空间 */
}

.step-item {
    padding: 10px 12px;
    background: rgba(30, 30, 35, 0.8);
    border-radius: 10px;
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-bottom: 4px;
    opacity: 1;
    transform: translateY(10px);
    animation: slideIn 0.4s ease forwards;
    border: 1px solid rgba(50, 50, 60, 0.5);
    position: relative;
    min-height: 50px; /* 确保即使折叠状态也有最小高度 */
    transition: all 0.3s ease;
    overflow: visible; /* 修改为 visible，允许内容溢出显示 */
    height: auto; /* 高度由内容决定 */
    flex-shrink: 0; /* 重要：防止元素被压缩 */

}

/* 特别针对非折叠的元素设置样式 */
.step-item:not(.collapsed) {
    min-height: fit-content; /* 使高度适应内容 */
    flex-shrink: 0; /* 确保不被压缩 */
    flex-basis: auto; /* 根据内容设置初始大小 */
}

/* 确保内容区域不会被压缩 */
.log-content:not(.hidden) {
    min-height: fit-content;
    flex-shrink: 0;
}


.step-item:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(35, 35, 40, 0.4) 0%, rgba(25, 25, 30, 0.2) 100%);
    pointer-events: none;
}

.step-item.think {
    border-left: 3px solid var(--info-color);
    min-height: fit-content;
    height: auto;
}

.step-item.tool {
    border-left: 3px solid var(--warning-color);
}

.step-item.act {
    border-left: 3px solid var(--primary-color);
    min-height: fit-content;
    height: auto;
}

.step-item.error {
    border-left: 3px solid var(--error-color);
}

.step-item.log {
    border-left: 3px solid var(--text-light);
}

/* Collapsed items styling */
.step-item.collapsed {
    padding: 8px 12px;
    min-height: 45px; /* 折叠状态的最小高度 */

}
/* 添加动画过渡效果，让高度变化更平滑 */
.step-item,
.log-content {
    transition: height 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}

.log-header {
    display: flex;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
    min-height: 30px; /* 确保有足够的点击区域 */

}

.log-header:hover {
    background-color: rgba(40, 45, 55, 0.5);
}

/* 预览内容样式 */
.content-preview {
    flex: 1;
    margin: 0 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-color);
    font-family: var(--font-mono);
    font-size: 13px;
    max-width: calc(100% - 150px); /* 确保不会占用太多空间 */

}

.expand-icon {
    background: rgba(50, 55, 70, 0.7);
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid rgba(80, 85, 100, 0.5);
    color: var(--primary-color);
}

.step-item:hover .expand-icon {
    background: rgba(0, 170, 255, 0.2);
    border-color: rgba(0, 170, 255, 0.4);
    box-shadow: 0 0 8px rgba(0, 170, 255, 0.3);
}

.log-content {
    margin-top: 8px;
    position: relative;
    z-index: 2;
}

.log-content.hidden {
    display: none;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.log-line {
    padding: 0;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    position: relative;
    z-index: 2;
    flex-shrink: 0; /* 防止被压缩 */
    min-height: fit-content;
    width: 100%;

}

.log-prefix {
    white-space: nowrap;
    color: var(--text-light);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 120px; /* 固定宽度确保布局一致 */
    max-width: 150px; /* 限制最大宽度 */
}

/* Markdown content styles */
.markdown-content {
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background-color: rgba(35, 35, 40, 0.5);
    border-left: 3px solid rgba(80, 85, 95, 0.5);
    position: relative;
    z-index: 2;
    max-height: none; /* 移除之前的高度限制 */
    height: auto; /* 高度由内容决定 */
    flex-shrink: 0; /* 防止被压缩 */
}

/* 添加滚动条样式，使其更美观 */
.step-container::-webkit-scrollbar,
.markdown-content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.step-container::-webkit-scrollbar-track,
.markdown-content::-webkit-scrollbar-track {
    background: rgba(30, 30, 35, 0.2);
    border-radius: 4px;
}

.step-container::-webkit-scrollbar-thumb,
.markdown-content::-webkit-scrollbar-thumb {
    background: rgba(60, 65, 75, 0.6);
    border-radius: 4px;
}

.step-container::-webkit-scrollbar-thumb:hover,
.markdown-content::-webkit-scrollbar-thumb:hover {
    background: rgba(80, 85, 95, 0.8);
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    color: var(--primary-color);
    margin-top: 16px;
    margin-bottom: 8px;
    font-weight: 600;
}

.markdown-content code {
    font-family: var(--font-mono);
    background-color: rgba(50, 50, 50, 0.7);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 0.9em;
    border: 1px solid rgba(80, 80, 80, 0.3);
}

.markdown-content pre {
    background-color: rgba(30, 30, 30, 0.8);
    padding: 12px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid rgba(60, 60, 60, 0.5);
    margin: 15px 0;
}

.markdown-content pre code {
    background-color: transparent;
    padding: 0;
    border: none;
    display: block;
    line-height: 1.5;
}

.markdown-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    transition: var(--transition);
}

.markdown-content a:hover {
    color: var(--primary-hover);
    text-shadow: 0 0 8px rgba(0, 170, 255, 0.4);
}

.markdown-content blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 15px;
    margin-left: 0;
    background-color: rgba(26, 26, 26, 0.5);
    padding: 10px 15px;
    border-radius: 0 8px 8px 0;
}

.markdown-content ul,
.markdown-content ol {
    padding-left: 25px;
    margin: 10px 0;
}

.markdown-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 15px 0;
}

.markdown-content table th,
.markdown-content table td {
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    text-align: left;
}

.markdown-content table th {
    background-color: rgba(45, 45, 45, 0.8);
    font-weight: 600;
}

.markdown-content table tr:nth-child(even) {
    background-color: rgba(40, 40, 40, 0.3);
}

/* Step divider */
.step-divider {
    width: 100%;
    display: flex;
    align-items: center;
    margin: 24px 0;
    position: relative;
    z-index: 2;
}

.step-circle {
    min-width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(40, 40, 40, 0.9);
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid var(--primary-color);
    z-index: 2;
    position: relative;
    padding: 0px !important;
    display: flex !important;
    box-shadow:
            0 0 10px rgba(0, 170, 255, 0.2),
            inset 0 0 5px rgba(0, 170, 255, 0.1);
    animation: circleGlow 3s infinite alternate;
}


@keyframes circleGlow {
    0% {
        box-shadow:
                0 0 8px rgba(0, 170, 255, 0.2),
                inset 0 0 5px rgba(0, 170, 255, 0.1);
    }
    100% {
        box-shadow:
                0 0 12px rgba(0, 170, 255, 0.3),
                0 0 20px rgba(0, 170, 255, 0.1),
                inset 0 0 8px rgba(0, 170, 255, 0.2);
    }
}

/*!* 为圆点添加脉冲效果 *!*/
/*.step-circle::after {*/
/*    content: '';*/
/*    position: absolute;*/
/*    width: 100%;*/
/*    height: 100%;*/
/*    background: rgba(0, 170, 255, 0.2);*/
/*    border-radius: 50%;*/
/*    z-index: -1;*/
/*}*/

@keyframes pulsate {
    0% {
        transform: scale(0.9);
        opacity: 0.7;
    }
    50% {
        transform: scale(1.2);
        opacity: 0.3;
    }
    100% {
        transform: scale(0.9);
        opacity: 0.7;
    }
}

.step-line {
    flex: 1;
    height: 3px;
    /*background: linear-gradient(90deg, var(--primary-color), transparent);*/
    background: var(--primary-color);
    position: relative;
    overflow: hidden;
}

.step-line:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
    rgba(0, 170, 255, 0.8),
    rgba(0, 204, 255, 0.3),
    rgba(0, 170, 255, 0.8)
    );
    animation: moveGlow 2s linear infinite;
    transform: translateX(-100%);
}

@keyframes moveGlow {
    100% {
        transform: translateX(100%);
    }
}

.step-info {
    background: rgba(35, 35, 35, 0.9);
    padding: 6px 12px 6px 12px;
    border-radius: 20px;
    /*margin-left: -20px;*/
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2), 0 0 10px rgba(0, 170, 255, 0.1);
    z-index: 1;
    display: flex;
    align-items: center;
    border: 1px solid rgba(60, 60, 60, 0.5);
}

.step-info::before {
    content: "⏱";
    margin-right: 6px;
    font-size: 12px;
    color: var(--primary-color);
}

/* Error and success states */
.loading {
    padding: 20px;
    color: var(--text-light);
    text-align: center;
    font-style: italic;
    background: rgba(35, 35, 35, 0.7);
    border-radius: var(--radius);
    margin: 20px 0;
    border: 1px solid var(--border-color);
    position: relative;
}

.loading:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    animation: scanning 1.5s linear infinite;
}

@keyframes scanning {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.ping {
    color: var(--primary-color);
    text-align: center;
    margin: 5px 0;
    font-size: 20px;
    animation: blink 1s infinite;
}

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

.error {
    color: var(--error-color);
    padding: 15px;
    background: rgba(35, 35, 35, 0.7);
    border-radius: var(--radius);
    margin: 10px 0;
    border-left: 4px solid var(--error-color);
    position: relative;
    border: 1px solid rgba(60, 60, 60, 0.5);
}

.error:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 51, 102, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.complete {
    color: var(--success-color);
    padding: 15px;
    background: rgba(35, 35, 35, 0.7);
    border-radius: var(--radius);
    margin: 10px 0;
    border-left: 4px solid var(--success-color);
    position: relative;
    border: 1px solid rgba(60, 60, 60, 0.5);
}

.complete:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 213, 128, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

/* File interaction styles */
.file-interaction {
    margin-top: 15px;
    padding: 0;
    border-radius: var(--radius);
    background-color: rgba(35, 35, 35, 0.7);
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    position: relative;
}

.file-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(40, 40, 40, 0.7);
    border-bottom: 1px solid var(--border-color);
}

.file-icon {
    font-size: 20px;
    margin-right: 10px;
}

.file-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-color);
}

.preview-container {
    padding: 0;
    position: relative;
    overflow: hidden;
    background-color: rgba(25, 25, 25, 0.9);
}

.preview-image {
    max-width: 100%;
    max-height: 300px;
    display: block;
    margin: 0 auto;
    cursor: pointer;
    transition: var(--transition);
}

.preview-image:hover {
    transform: scale(1.02);
    box-shadow: 0 0 15px rgba(0, 170, 255, 0.3);
}

.audio-preview {
    width: 100%;
    margin: 10px 0;
    background-color: rgba(35, 35, 35, 0.8);
    padding: 10px;
}

.video-preview {
    width: 100%;
    max-height: 350px;
    display: block;
}

.pdf-preview, .html-preview {
    width: 100%;
    height: 400px;
    border: none;
}

.code-preview {
    padding: 15px;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre;
    background-color: rgba(25, 25, 25, 0.9);
    color: #f8f8f2;
    min-height: 100px;
    max-height: 350px;
    margin: 0;
}

.file-action {
    display: flex;
    align-items: center;
    justify-content: center;
    padding-right: 5px;
}
.action-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-light);
    opacity: 0.7;
    transition: all 0.2s ease;
}


.workspace-file:hover .action-icon {
    opacity: 1;
    color: var(--primary-color);
}

.workspace-file.directory .action-icon {
    color: var(--secondary-color);
}

/* Style for the selected file */
.workspace-file.selected {
    background: rgba(0, 170, 255, 0.1);
    border: 1px solid rgba(0, 170, 255, 0.3);
}

/* Breadcrumbs styling */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px;
    background: rgba(25, 25, 30, 0.8);
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid var(--border-color);
}

.breadcrumb {
    color: var(--primary-color);
    cursor: pointer;
    padding: 3px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 13px;
}

.breadcrumb:hover {
    background: rgba(0, 170, 255, 0.1);
    text-decoration: underline;
}

.breadcrumb.active {
    color: var(--text-color);
    background: rgba(60, 60, 65, 0.5);
    cursor: default;
}

.separator {
    margin: 0 2px;
    color: var(--text-light);
}

.file-info {
    padding: 15px;
    background-color: rgba(30, 30, 30, 0.8);
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    color: var(--text-light);
}

.preview-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(45deg, var(--info-color), #1a97ac);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.preview-button:hover {
    background: linear-gradient(45deg, #38d2e7, #26c6da);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 15px rgba(38, 198, 218, 0.3);
}

/* 文件预览弹窗样式 */
.file-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
    overflow: hidden;
}

.file-modal .modal-content {
    width: 85%;
    height: 85%;
    max-width: 1200px;
    background-color: rgba(28, 28, 33, 0.95);
    border-radius: var(--radius);
    border: 1px solid rgba(0, 170, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}

.file-modal .modal-header {
    padding: 15px 20px;
    background-color: var(--panel-bg) !important;
    background: none !important;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.file-modal .modal-header h3 {
    margin: 0;
    color: var(--text-color);
    font-size: 18px;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 70%;
}

.file-modal .modal-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.file-modal .close-modal {
    font-size: 28px;
    color: var(--text-light);
    cursor: pointer;
    transition: var(--transition);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.file-modal .close-modal:hover {
    color: var(--primary-color);
    transform: scale(1.1);
    text-shadow: var(--highlight-glow);
}

.file-modal .modal-body {
    flex: 1;
    overflow: auto;
    padding: 0;
    position: relative;
}

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

/* 预览内容容器样式 */
.file-modal .image-preview,
.file-modal .video-preview,
.file-modal .audio-preview,
.file-modal .pdf-preview,
.file-modal .preview-code-preview,
.file-modal .markdown-preview,
.file-modal .generic-preview {
    height: 100%;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
    position: relative;
    background-color: rgba(25, 25, 30, 0.7);
}

.file-modal .image-preview img {
    max-width: 95%;
    max-height: 95%;
    object-fit: contain;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.file-modal .video-preview video {
    max-width: 95%;
    max-height: 95%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.file-modal .audio-preview audio {
    width: 90%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.file-modal .preview-code-preview {
    display: block;
    padding: 0;
    width: 100%;
    height: 100%;
}

.file-modal .preview-code-preview pre {
    margin: 0;
    padding: 20px;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(30, 30, 35, 0.8);
}

.file-modal .preview-code-preview code {
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.6;
}

.file-modal .markdown-preview {
    padding: 30px 40px;
    overflow: auto;
    text-align: left;
    display: block;
}

.file-modal .pdf-preview iframe,
.file-modal .html-preview iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.file-modal .generic-preview {
    flex-direction: column;
    padding: 40px;
}

.file-modal .preview-icon.large {
    font-size: 100px;
    margin-bottom: 30px;
    opacity: 0.7;
}

.file-modal .preview-info {
    text-align: center;
}

.file-modal .loading-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-style: italic;
    color: var(--text-light);
}

/* 下载按钮样式 */
.file-modal .download-button {
    display: inline-flex;

    /* background: rgba(40, 40, 40, 0.8); */
    border: 1px solid var(--border-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);

    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background-color:var(--panel-bg);
    color: white;
    text-decoration: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.run-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: linear-gradient(45deg, var(--success-color), #00a964);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 14px;
    margin-right: 10px;
    transition: var(--transition);
    font-weight: 500;
}

.run-button:hover {
    background: linear-gradient(45deg, #00edb1, #00c07c);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 213, 128, 0.3);
}

/* Modal styles */
.image-modal, .python-modal, .run-simulation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    animation: modalFadeIn 0.3s ease;
}

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

.modal-content {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    background-color: rgba(35, 35, 35, 0.95);
    border: 1px solid rgba(60, 60, 60, 0.8);
}

#full-image {
    max-width: 100%;
    max-height: 90vh;
    display: block;
    border-radius: var(--radius);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.4);
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 30px;
    cursor: pointer;
    opacity: 0.7;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background-color: rgba(40, 40, 40, 0.7);
}

.close-modal:hover {
    opacity: 1;
    background-color: rgba(60, 60, 60, 0.9);
    transform: scale(1.1);
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
}

.run-simulation-modal .modal-content {
    width: 80%;
    max-width: 900px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background-color: rgba(30, 30, 30, 0.95);
}

.modal-header {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    color: white;
}

.modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.simulation-output {
    padding: 0;
    overflow: auto;
    flex: 1;
    max-height: calc(90vh - 60px);
    background-color: rgba(25, 25, 25, 0.95);
}

.loading-simulation {
    padding: 20px;
    text-align: center;
    color: var(--text-light);
    font-style: italic;
}

/* Terminal styling */
.terminal {
    background-color: #121212;
    color: #f8f8f2;
    font-family: var(--font-mono);
    padding: 20px;
    border-radius: 0;
    margin: 0;
    white-space: pre-wrap;
    height: 350px;
    overflow: auto;
    border: 1px solid rgba(60, 60, 60, 0.4);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.3);
}

.terminal p {
    margin: 0 0 10px 0;
    line-height: 1.5;
}

.success-message {
    color: var(--success-color);
    margin-top: 15px;
    font-weight: bold;
}

/* Browser Preview */
.browser-preview {
    background-color: rgba(30, 30, 30, 0.95);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.browser-header {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background-color: rgba(40, 40, 40, 0.9);
    border-bottom: 1px solid var(--border-color);
}

.browser-buttons {
    display: flex;
    gap: 6px;
    margin-right: 15px;
}

.browser-button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.browser-button.red {
    background-color: #ff5f56;
}

.browser-button.yellow {
    background-color: #ffbd2e;
}

.browser-button.green {
    background-color: #27c93f;
}

.browser-address {
    background-color: rgba(20, 20, 20, 0.8);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 12px;
    flex-grow: 1;
    color: var(--text-light);
    text-align: center;
    border: 1px solid rgba(60, 60, 60, 0.4);
}

.browser-content {
    height: 350px;
    overflow: hidden;
}

.browser-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* Image caption */
.image-caption {
    color: white;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    background-color: rgba(30, 30, 30, 0.8);
    border-radius: 0 0 var(--radius) var(--radius);
}

/* Button loading state */
.send-button-disabled {
    background: rgba(60, 60, 60, 0.6) !important;
    opacity: 0.8;
    cursor: progress;
    box-shadow: none !important;
}

.send-button-disabled:hover {
    transform: none;
    box-shadow: none !important;
}

/* Disable styling */
input.disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Media queries */
@media (max-width: 1200px) {
    .container {
        flex-direction: column;
    }

    .sidebar-panel {
        width: 100%;
        max-width: 100%;
        max-height: 200px;
        order: 1;
    }

    .chat-panel, .vnc-panel {
        max-width: 100%;
        flex: 1;
        height: auto;
    }

    .task-list {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
    }

    .task-card {
        min-width: 200px;
        height: 100%;
        margin-right: 10px;
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .chat-panel, .vnc-panel {
        max-width: 100%;
        flex: none;
        height: 50vh;
    }

    #prompt-input {
        padding: 12px;
    }

    .send-button {
        min-width: auto;
    }
}

/* Code syntax highlighting (dark theme) */
.language-js,
.language-py,
.language-java,
.language-cpp,
.language-php {
    color: #f8f8f2;
}

.code-preview .keyword {
    color: #ff79c6;
}

.code-preview .string {
    color: #f1fa8c;
}

.code-preview .number {
    color: #bd93f9;
}

.code-preview .comment {
    color: #6272a4;
    font-style: italic;
}

.code-preview .function {
    color: #50fa7b;
}

/* Add sci-fi glowing effects to important elements */
.chat-header h1,
.vnc-header h2,
.step-circle,
.status-running,
.send-button,
.step-line:after {
    margin: 0;
    font-weight: 600;
    position: relative;
    display: inline-block;
    letter-spacing: 0.5px;
    padding-bottom: 3px;
    /* 移除之前的动画效果 */
    animation: none;
}

@keyframes glow {
    0% {
        text-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
        box-shadow: 0 0 5px rgba(0, 170, 255, 0.5);
    }
    100% {
        text-shadow: 0 0 15px rgba(0, 170, 255, 0.8), 0 0 30px rgba(0, 170, 255, 0.5);
        box-shadow: 0 0 15px rgba(0, 170, 255, 0.8), 0 0 30px rgba(0, 170, 255, 0.5);
    }
}

/* Circuit board pattern background for panels */
.chat-panel:after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
            linear-gradient(rgba(35, 35, 35, 0.97), rgba(35, 35, 35, 0.97)),
            url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100' viewBox='0 0 100 100'%3E%3Cg fill-rule='evenodd'%3E%3Cg fill='%23007aff' fill-opacity='0.05'%3E%3Cpath opacity='.5' d='M96 95h4v1h-4v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4h-9v4h-1v-4H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15v-9H0v-1h15V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h9V0h1v15h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9h4v1h-4v9zm-1 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-10 0v-9h-9v9h9zm-9-10h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm10 0h9v-9h-9v9zm9-10v-9h-9v9h


    /* Improved header styling */
    .chat-header, .vnc-header {
    padding: 18px 24px;
    background: linear-gradient(90deg, rgba(15, 15, 20, 0.9) 0%, rgba(22, 22, 28, 0.9) 100%);
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.2);
}

.chat-header:after, .vnc-header:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg,
    transparent 0%,
    rgba(0, 170, 255, 0.6) 50%,
    transparent 100%);
}

.chat-header h1, .vnc-header h2 {
    margin: 0;
    font-weight: 600;
    position: relative;
    display: inline-block;
    letter-spacing: 0.5px;
    padding-bottom: 3px;
}

.chat-header h1 {
    font-size: 22px;
    color: #fff;
}

.vnc-header h2 {
    font-size: 20px;
    color: #fff;
}

.highlight {
    color: var(--primary-color);
    position: relative;
    font-weight: 700;
    /* 使用模糊的文本阴影创建柔和的辉光 */
    text-shadow:
            0 0 5px rgba(0, 170, 255, 0.3),
            0 0 10px rgba(0, 170, 255, 0.2),
            0 0 15px rgba(0, 170, 255, 0.1);
    /* 添加新的平滑动画 */
    animation: softGlow 3s infinite alternate;

}

/* 定义新的柔和辉光动画 */
@keyframes softGlow {
    0% {
        text-shadow:
                0 0 5px rgba(0, 170, 255, 0.3),
                0 0 10px rgba(0, 170, 255, 0.2);
    }
    100% {
        text-shadow:
                0 0 7px rgba(0, 170, 255, 0.5),
                0 0 12px rgba(0, 170, 255, 0.4),
                0 0 20px rgba(0, 170, 255, 0.3);
    }
}

.highlight:after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 1px; /* 减小高度 */
    background: linear-gradient(90deg,
    transparent 0%,
    var(--primary-color) 50%,
    transparent 100%);
    /* 更柔和的阴影 */
    box-shadow: 0 0 6px rgba(0, 170, 255, 0.5);
}

.user-info {
    display: inline-flex;
    align-items: center;
    background-color: rgba(20, 20, 25, 0.7);
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-light);
    border: 1px solid rgba(0, 170, 255, 0.15);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.user-id-value, .node-name-value {
    color: var(--primary-color);
    font-weight: 600;
    margin-left: 5px;
    display: inline-block;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Improved sidebar header */
.sidebar-header {
    padding: 15px 20px;
    background: linear-gradient(90deg, rgba(15, 15, 20, 0.9) 0%, rgba(22, 22, 28, 0.9) 100%);
    border-bottom: 1px solid rgba(0, 170, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-header h3 {
    margin: 0;
    color: var(--text-color);
    font-weight: 600;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    text-align: center;
}

.sidebar-header h3:before, .sidebar-header h3:after {
    content: '';
    position: absolute;
    top: 50%;
    width: 15px;
    height: 1px;
    background: var(--primary-color);
    box-shadow: 0 0 5px var(--primary-color);
}

.sidebar-header h3:before {
    left: -30px;
}

.sidebar-header h3:after {
    right: -30px;
}

/* Status indicator for header */
.connection-status {
    display: inline-flex;
    align-items: center;
    margin-left: 10px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--success-color);
    box-shadow: 0 0 8px var(--success-color);
    margin-right: 6px;
    animation: pulse 2s infinite;
}

/* Adjust the task list panel */
.sidebar-panel {
    width: 220px; /* Slightly narrower */
    background-color: rgba(18, 18, 23, 0.95);
    border-right: 1px solid rgba(0, 170, 255, 0.1);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.15);
}

.task-list {
    padding: 5px;
    background-color: rgba(20, 20, 25, 0.8);
}

.task-card {
    background: rgba(30, 30, 35, 0.7);
    padding: 10px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    border-left: 2px solid transparent;
    transition: all 0.2s ease;
}

.task-card:hover {
    background: rgba(35, 35, 45, 0.95);
    border-left: 2px solid var(--primary-color);
    transform: translateX(2px);
}