/* 电子实验室专用样式 - 强制全屏布局 */

/* 容器全屏固定 */
#electroniclab-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50; 
    background-color: #00081d; 
    overflow-y: auto; /* 允许垂直滚动 */
}

/* 内容区域布局 */
#electroniclab-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding-left: 0px;
    padding-right: 0px;
    padding-bottom: 0px;
    padding-top: 0px;
    box-sizing: border-box;
}

/* 标题区域微调 */
#electroniclab-content .module-header {
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    flex-shrink: 0;
    position: relative; /* 新增：为了定位右上角的选择器 */
}

/* 线路选择器容器 - 新增样式 */
.source-selector-container {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

/* 线路选择器样式 - 新增样式 */
.circuit-source-select {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(64, 224, 255, 0.3);
    color: #40e0ff;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    outline: none;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.3s ease;
}

.circuit-source-select:hover {
    background: rgba(64, 224, 255, 0.1);
    border-color: #40e0ff;
    box-shadow: 0 0 10px rgba(64, 224, 255, 0.2);
}

.circuit-source-select option {
    background: #000;
    color: #fff;
}

/* 引擎视口 - 占据剩余所有空间 */
.engine-viewport {
    flex: 1;
    width: 111%; 
    height: 85%; 
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(64, 224, 255, 0.3);
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.6);
}

/* iframe 全尺寸 */
iframe#circuit-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* 加载遮罩 */
.loading-mask {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #121212;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
    color: #40e0ff;
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.5s;
    opacity: 0;
    font-family: 'Orbitron', sans-serif;
    letter-spacing: 2px;
}

.loading-mask.active {
    opacity: 1;
    pointer-events: all;
}

.loading-mask i {
    font-size: 2rem;
    color: #2ecc71;
}

/* 移动端适配 */
@media (max-width: 768px) {
    #electroniclab-content {
        padding-left: 10px;
        padding-right: 10px;
        padding-top: 80px; 
    }
    
    #electroniclab-content .module-header {
        flex-direction: column;
        height: auto;
        gap: 10px;
    }

    #electroniclab-content .module-header h2 {
        font-size: 1.5rem;
    }

    .source-selector-container {
        position: static; 
        transform: none;
        margin-top: 10px;
    }
}
