* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.hide {
    display: none;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #1a1a1a;
    color: #e0e0e0;
    height: 100vh;
    overflow: hidden;
}

/* 标题栏 */
.title-bar {
    height: 40px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    -webkit-app-region: drag;
}

.title-bar h1 {
    font-size: 14px;
    font-weight: 500;
    color: #e0e0e0;
}

/* 新增窗口控制容器和按钮 */
.title-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    -webkit-app-region: no-drag;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: background 0.2s;
    -webkit-app-region: no-drag;
}

.minimize-btn {
    background: #404040;
    color: #e0e0e0;
}

.minimize-btn:hover {
    background: #505050;
}

.maximize-btn {
    background: #404040;
    color: #e0e0e0;
}

.maximize-btn:hover {
    background: #505050;
}

.close-btn {
    background: #404040;
    color: #e0e0e0;
}

.close-btn:hover {
    background: #ff4444;
}


/* 主容器 */
.main-container {
    display: flex;
    height: calc(100vh - 70px);
}

/* 左侧卡片编程区域 */
.card-area {
    width: 50%;
    background: #252525;
    border-right: 1px solid #404040;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

/* 右侧代码显示区域 */
.code-area {
    width: 50%;
    background: #1e1e1e;
    display: flex;
    flex-direction: column;
    min-width: 300px;
}

.card-toolbar {
    height: 50px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}

.card-category {
    background: #404040;
    color: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.card-category:hover {
    background: #505050;
}

.card-workspace {
    flex: 1;
    overflow-y: auto;
    position: relative;
    color: #1a1a1a;
}

.code-tab {
    color: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    background: #4CAF50;
}


.code-tab:disabled {
    background: #404040;
}

.device-close-btn,
.device-clear-btn {
    background: #ff0000;
}

.code-toolbar {
    height: 50px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    padding: 0 15px;
    gap: 10px;
}

.card-category {
    background: #404040;
    color: #e0e0e0;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.card-category:hover {
    background: #505050;
}

.code-display {
    flex: 1;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.5;
    overflow-y: auto;
    white-space: pre-wrap;
    color: #e0e0e0;
}

/* 状态栏 */
.status-bar {
    height: 30px;
    background: #2d2d2d;
    border-top: 1px solid #404040;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    color: #b0b0b0;
    display: flex;
}

.status-item {
    margin: 0px 10px;
}


.status-bar .split {
    flex: 1;
}

.status-bar a {
    color: white;
    text-decoration: none;
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #2d2d2d;
}

::-webkit-scrollbar-thumb {
    background: #505050;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #666666;
}

/* 新增可拖拽的分隔条 */
.resizer {
    width: 4px;
    background: #404040;
    cursor: col-resize;
    position: relative;
    transition: background 0.2s;
}

.resizer:hover {
    background: #4CAF50;
}

.resizer::after {
    content: '';
    position: absolute;
    top: 0;
    left: -2px;
    right: -2px;
    bottom: 0;
}

/* 添加垂直分隔条样式 */
.vertical-resizer {
    height: 4px;
    background: #404040;
    cursor: row-resize;
    position: relative;
    transition: background 0.2s;
}

.vertical-resizer:hover {
    background: #4CAF50;
}

.vertical-resizer::after {
    content: '';
    position: absolute;
    left: 0;
    top: -2px;
    right: 0;
    bottom: -2px;
}

/* 添加控制台样式 */
.console-area {
    background: #1a1a1a;
    border-top: 1px solid #404040;
    display: flex;
    flex-direction: column;
    height: 200px;
}

.console-header {
    height: 30px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
    padding: 0 15px;
    font-size: 12px;
    color: #e0e0e0;
}

.console-header button {
    margin-left: auto;
    background: #404040;
    color: #e0e0e0;
    border: none;
    padding: 2px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 11px;

}

.console-content {
    flex: 1;
    padding: 10px 15px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.4;
    overflow-y: auto;
    color: #b0b0b0;
    background: #1a1a1a;
}

.console-output {
    margin-bottom: 5px;
}

.console-output.error {
    color: #ff6b6b;
}

.console-output.success {
    color: #4CAF50;
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}


.spinner {
    width: 50px;
    height: 50px;
    border: 3px solid #333;
    border-top: 3px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-text {
    font-size: 18px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.6;
    }

    50% {
        opacity: 1;
    }
}

.fade-out {
    animation: fadeOut 0.5s ease-out forwards;
}

@keyframes fadeOut {
    to {
        opacity: 0;
    }
}