/* 电子实验室专用样式 - 强制全屏布局 */

/* 容器全屏固定 */
#electroniclab-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 50;
    background:
        radial-gradient(ellipse at 70% 20%, rgba(0, 255, 200, 0.05) 0%, transparent 40%) fixed,
        radial-gradient(ellipse at 30% 80%, rgba(0, 180, 255, 0.05) 0%, transparent 40%) fixed,
        linear-gradient(160deg, #000510 0%, #020a1a 35%, #0a0e2b 60%, #0d0520 100%) fixed;
    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;
    /* 新增：为了定位右上角的选择器 */
}

/* 引擎视口 - 占据剩余所有空间 */
.engine-viewport {
    flex: 1;
    width: 111%;
    height: 85%;
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(46, 204, 113, 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: #000510;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    align-items: center;
    color: #2ecc71;
    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;
    }
}
/* =====================================================================
   电子实验室：电路模拟 / 电路板布局 单按钮子模块切换
   按钮视觉沿用加密实验室 .submodule-btn 的霓虹/切角风格，
   但这里是单个按钮循环切换，按钮文字分别显示【电路模拟】【电路板布局】。
   ===================================================================== */

#electroniclab-content .electronic-module-header {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    position: relative;
    min-height: 64px;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
    pointer-events: none;
}

#electroniclab-content .electronic-submodule-btn {
    pointer-events: auto;
    position: absolute;
    top: 50%;
    right: 24px;
    transform: translateY(-50%);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 196px;
    height: 56px;
    padding: 0 18px;
    border: 1px solid rgba(64, 224, 255, 0.24);
    background: linear-gradient(135deg, rgba(64, 224, 255, 0.08) 0%, rgba(120, 200, 255, 0.05) 50%, rgba(180, 140, 255, 0.08) 100%);
    color: rgba(255, 255, 255, 0.78);
    font-family: 'Orbitron', 'Segoe UI', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    backdrop-filter: blur(6px);
    clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px);
    box-shadow: inset 0 0 20px rgba(64, 224, 255, 0.1);
    z-index: 20;
    overflow: hidden;
}

#electroniclab-content .electronic-submodule-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    border-top: 2px solid rgba(64, 224, 255, 0.5);
    border-left: 2px solid rgba(64, 224, 255, 0.5);
    opacity: 0.6;
    transition: all 0.4s ease;
}

#electroniclab-content .electronic-submodule-btn::after {
    content: attr(data-mode);
    position: absolute;
    right: 14px;
    bottom: 6px;
    color: rgba(64, 224, 255, 0.42);
    font-family: monospace;
    font-size: 0.58rem;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

#electroniclab-content .electronic-submodule-btn:hover {
    transform: translateY(calc(-50% - 4px)) scale(1.02);
    background: rgba(64, 224, 255, 0.12);
    border-color: rgba(64, 224, 255, 0.62);
    color: #fff;
    text-shadow: 0 0 15px rgba(64, 224, 255, 0.8);
    box-shadow:
        0 10px 30px -10px rgba(0, 243, 255, 0.28),
        inset 0 0 20px rgba(64, 224, 255, 0.15);
}

#electroniclab-content .electronic-submodule-btn:hover::before {
    width: 100%;
    height: 95%;
    border-color: #fff;
    opacity: 1;
    box-shadow: -2px -2px 10px rgba(64, 224, 255, 0.5);
}

#electroniclab-content .electronic-submodule-btn:active {
    transform: translateY(-50%) scale(0.98);
}

#electroniclab-content .electronic-submodule-btn.active {
    background: rgba(64, 224, 255, 0.14);
    border-color: rgba(64, 224, 255, 0.72);
    color: #fff;
    text-shadow: 0 0 15px rgba(64, 224, 255, 0.85);
    box-shadow:
        0 10px 30px -10px rgba(0, 243, 255, 0.24),
        inset 0 0 22px rgba(64, 224, 255, 0.18);
}

#electroniclab-content .electronic-submodule-btn.active::after {
    color: rgba(255, 255, 255, 0.55);
}

#electroniclab-content .electronic-submodule-btn-label {
    text-align: center;
    color: #fff;
    font-size: 1.02rem;
    letter-spacing: 2px;
    line-height: 1.2;
    white-space: nowrap;
    text-shadow: 0 0 14px rgba(64, 224, 255, 0.55);
}

/* ---- 子模块面板 ---- */
#electroniclab-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 100%;
}

#electroniclab-content .electronic-submodule-stack {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    position: relative;
}

#electroniclab-content .electronic-submodule {
    display: none;
    flex: 1 1 auto;
    min-height: 0;
    flex-direction: column;
}

#electroniclab-content .electronic-submodule.active {
    display: flex;
}

#electroniclab-content .electronic-submodule .engine-viewport {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
}

#electroniclab-content .pcb-engine-viewport {
    border-color: rgba(64, 224, 255, 0.32);
}

#electroniclab-content #circuit-frame,
#electroniclab-content #pcb-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* ---- 窄屏适配：按钮移到标题下方 ---- */
@media (max-width: 900px) {
    #electroniclab-content .electronic-module-header {
        flex-direction: column;
        gap: 8px;
        min-height: auto;
        padding: 6px 8px 0;
    }

    #electroniclab-content .electronic-module-header .neon-title {
        font-size: 1.35rem;
    }

    #electroniclab-content .electronic-submodule-btn {
        position: relative;
        top: auto;
        right: auto;
        transform: none;
        margin: 0 auto;
        min-width: 174px;
        height: 48px;
        padding: 0 18px;
    }

    #electroniclab-content .electronic-submodule-btn:hover {
        transform: translateY(-3px) scale(1.02);
    }

    #electroniclab-content .electronic-submodule-btn:active {
        transform: scale(0.98);
    }
}
