/* ============================================================
   黑灯实验室 · 页面样式
   ============================================================ */

:root {
    --floor-fill: #081220;
    --floor-edge: rgba(120, 190, 255, 0.24);
    --floor-line: rgba(120, 190, 255, 0.09);
}

.lab-page {
    transition: background-color 0.6s var(--ease);
}

/* 照明叠加层 */
.lighting-overlay {
    position: fixed;
    inset: 0;
    z-index: 900;
    pointer-events: none;
    opacity: 0;
    background:
        radial-gradient(circle at 50% 12%, rgba(255, 241, 209, 0.14), transparent 58%),
        radial-gradient(circle at 80% 70%, rgba(255, 236, 190, 0.06), transparent 50%);
    mix-blend-mode: screen;
    transition: opacity 0.7s var(--ease);
}

body.lights-on {
    background-color: #0c1626;
}

body.lights-on {
    --floor-fill: #16283d;
    --floor-edge: rgba(190, 225, 255, 0.42);
    --floor-line: rgba(190, 225, 255, 0.2);
}

body.lights-on .lighting-overlay {
    opacity: 1;
}

/* ---------- Hero ---------- */
.lab-hero {
    position: relative;
    padding-top: 76px;
    overflow: hidden;
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(900px 480px at 78% 10%, rgba(34, 211, 238, 0.1), transparent 65%),
        radial-gradient(700px 500px at 8% 80%, rgba(59, 130, 246, 0.08), transparent 65%);
    transition: background 0.6s var(--ease);
}

.lab-hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(120, 190, 255, 0.055) 1px, transparent 1px),
        linear-gradient(90deg, rgba(120, 190, 255, 0.055) 1px, transparent 1px);
    background-size: 64px 64px;
    mask-image: radial-gradient(ellipse 85% 80% at 50% 30%, #000 10%, transparent 78%);
    -webkit-mask-image: radial-gradient(ellipse 85% 80% at 50% 30%, #000 10%, transparent 78%);
    pointer-events: none;
}

/* Hero 点阵与扫描光带 */
.lab-hero-dots {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(120, 200, 255, 0.28) 1px, transparent 1px);
    background-size: 26px 26px;
    -webkit-mask-image: radial-gradient(ellipse 58% 62% at 46% 34%, #000 0%, transparent 74%);
    mask-image: radial-gradient(ellipse 58% 62% at 46% 34%, #000 0%, transparent 74%);
    opacity: 0.55;
    pointer-events: none;
}

.lab-hero-beam {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.9), transparent);
    box-shadow: 0 0 26px 2px rgba(34, 211, 238, 0.32);
    opacity: 0;
    animation: heroBeam 7.5s linear infinite;
    pointer-events: none;
}

@keyframes heroBeam {
    0% {
        transform: translateY(0);
        opacity: 0;
    }

    8% {
        opacity: 0.75;
    }

    88% {
        opacity: 0.75;
    }

    100% {
        transform: translateY(620px);
        opacity: 0;
    }
}

/* 底部数据跑马灯 */
.lab-ticker {
    position: relative;
    z-index: 2;
    overflow: hidden;
    border-top: 1px solid rgba(120, 190, 255, 0.12);
    background: rgba(4, 8, 14, 0.55);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

.lab-ticker-track {
    display: flex;
    width: max-content;
    animation: tickerMove 46s linear infinite;
}

.lab-ticker-track span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 26px;
    border-right: 1px solid rgba(120, 190, 255, 0.08);
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--muted-2);
    white-space: nowrap;
}

.lab-ticker-track b {
    color: #9fe9f6;
    font-weight: 500;
}

@keyframes tickerMove {
    to {
        transform: translateX(-50%);
    }
}

/* HUD 角标 */
.hud-corner {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid rgba(34, 211, 238, 0.55);
    pointer-events: none;
    z-index: 4;
}

.hud-corner.tl {
    top: 0;
    left: 0;
    border-top-width: 2px;
    border-left-width: 2px;
    border-top-left-radius: 5px;
}

.hud-corner.tr {
    top: 0;
    right: 0;
    border-top-width: 2px;
    border-right-width: 2px;
    border-top-right-radius: 5px;
}

.hud-corner.bl {
    bottom: 0;
    left: 0;
    border-bottom-width: 2px;
    border-left-width: 2px;
    border-bottom-left-radius: 5px;
}

.hud-corner.br {
    bottom: 0;
    right: 0;
    border-bottom-width: 2px;
    border-right-width: 2px;
    border-bottom-right-radius: 5px;
}

/* 鼠标光斑 */
.glow-card {
    position: relative;
}

.glow-card::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: inherit;
    background: radial-gradient(220px circle at var(--mx, 50%) var(--my, 50%),
            rgba(34, 211, 238, 0.12), transparent 62%);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
    pointer-events: none;
}

.glow-card:hover::after {
    opacity: 1;
}

.lab-hero-inner {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
    align-items: center;
    gap: 56px;
    padding: 80px 28px 88px;
}

.lab-title {
    margin: 26px 0 0;
    font-size: clamp(44px, 5.8vw, 78px);
    line-height: 1.06;
    font-weight: 800;
    letter-spacing: -0.035em;
}

.lab-title .grad-text {
    display: inline-block;
}

.lab-lead {
    max-width: 540px;
    margin-top: 24px;
    font-size: 15.5px;
    line-height: 1.95;
    color: var(--muted);
}

.lab-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 34px;
}

.lab-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 24px;
    margin-top: 32px;
    font-family: var(--mono);
    font-size: 10.5px;
    letter-spacing: 0.06em;
    color: var(--muted-2);
}

.lab-chips span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.dot-live {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: blink 1.8s ease-in-out infinite;
}

/* 总控卡 */
.master-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    margin-left: auto;
    padding: 22px 24px 24px;
    background: linear-gradient(165deg, rgba(18, 30, 48, 0.92), rgba(7, 12, 20, 0.92));
    border: 1px solid rgba(120, 200, 255, 0.18);
    border-radius: var(--radius-lg);
    box-shadow: 0 34px 80px -34px rgba(0, 0, 0, 0.95), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

.master-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}

.light-row {
    display: grid;
    grid-template-columns: 54px 1fr auto;
    align-items: center;
    gap: 16px;
    padding: 20px 0;
    border-bottom: 1px solid var(--line);
}

.lamp-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 14px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.07);
    border: 1px solid rgba(34, 211, 238, 0.2);
    transition: color 0.4s var(--ease), background-color 0.4s var(--ease),
        border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.lamp-icon svg {
    width: 26px;
    height: 26px;
}

body.lights-on .lamp-icon {
    color: var(--warn);
    background: rgba(251, 191, 36, 0.1);
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 30px -4px rgba(251, 191, 36, 0.5);
}

.light-info span {
    display: block;
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.light-info strong {
    display: block;
    margin-top: 4px;
    font-size: 15.5px;
    font-weight: 600;
    color: var(--text);
}

body.lights-on .light-info strong {
    color: var(--warn);
}

.light-switch {
    position: relative;
    width: 62px;
    height: 32px;
    padding: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.14);
    cursor: pointer;
    transition: background 0.3s var(--ease), border-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.light-switch .switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #64748b;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: transform 0.32s var(--ease), background-color 0.32s var(--ease);
}

.light-switch[aria-checked="true"] {
    background: rgba(251, 191, 36, 0.16);
    border-color: rgba(251, 191, 36, 0.5);
    box-shadow: 0 0 22px -4px rgba(251, 191, 36, 0.55);
}

.light-switch[aria-checked="true"] .switch-knob {
    transform: translateX(30px);
    background: #fde68a;
}

.light-switch:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.master-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 24px;
    padding-top: 20px;
}

.master-item span {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.master-item strong {
    display: block;
    margin-top: 3px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 500;
    color: #cfe4f7;
}

#labClock {
    color: var(--cyan);
}

.master-load {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px dashed rgba(120, 190, 255, 0.16);
}

.master-load-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--muted-2);
}

.master-load-head strong {
    color: var(--cyan);
    font-weight: 500;
    font-size: 10px;
}

.master-spark {
    display: block;
    width: 100%;
    height: 42px;
    margin-top: 6px;
}

.master-spark polyline {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 1.4;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.6));
}

.master-note {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    padding-top: 14px;
    border-top: 1px dashed rgba(120, 190, 255, 0.16);
    font-size: 11px;
    color: var(--muted-2);
}

/* ---------- 工作区 ---------- */
.lab-workspace {
    padding: 92px 0 72px;
}

.workspace-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 34px;
}

.workspace-head .section-title {
    margin-top: 14px;
    font-size: clamp(26px, 3vw, 36px);
}

.workspace-status {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--line);
    border-radius: 999px;
}

.lab-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.52fr) minmax(0, 0.88fr);
    gap: 24px;
    align-items: start;
}

/* 平面图 */
.floor-panel {
    background: linear-gradient(165deg, rgba(16, 26, 42, 0.9), rgba(6, 10, 17, 0.92));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.95);
}

.floor-head,
.floor-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
}

.floor-head {
    border-bottom: 1px solid var(--line);
}

.floor-foot {
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.06em;
    color: var(--muted-2);
}

.floor-legend {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.05em;
    color: var(--muted-2);
}

.floor-legend .lg {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 2px;
    margin-left: 8px;
}

.floor-legend .lg-run {
    background: var(--green);
    box-shadow: 0 0 6px rgba(52, 211, 153, 0.7);
}

.floor-legend .lg-idle {
    background: #64748b;
}

.floor-stage {
    position: relative;
}

.floor-viewport {
    position: relative;
    padding: 4px 8px 0;
    background:
        radial-gradient(ellipse 60% 55% at 50% 35%, rgba(34, 211, 238, 0.07), transparent 70%);
    transition: background 0.6s var(--ease);
}

body.lights-on .floor-viewport {
    background:
        radial-gradient(ellipse 65% 60% at 50% 30%, rgba(160, 210, 255, 0.16), transparent 72%);
}

.floor-svg {
    width: 100%;
    line-height: 0;
}

.floor-svg svg {
    display: block;
    width: 100%;
    height: auto;
    overflow: visible;
    transition: transform 0.4s var(--ease);
    will-change: transform;
}

.floor-scan {
    color: var(--cyan);
    animation: blink 2.4s ease-in-out infinite;
}

/* 图纸 HUD 与增强细节 */
.floor-hud {
    fill: none;
    stroke: rgba(34, 211, 238, 0.34);
    stroke-width: 1.3;
    stroke-linecap: round;
}

.floor-tick {
    fill: #5b7b95;
    font-family: var(--mono);
    font-size: 7.5px;
    letter-spacing: 0.06em;
    opacity: 0.8;
}

.floor-axis {
    fill: #6f9cba;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.18em;
    opacity: 0.85;
}

.floor-corridor {
    fill: none;
    stroke: rgba(34, 211, 238, 0.16);
    stroke-width: 1;
    stroke-dasharray: 7 5;
}

.floor-sonar {
    fill: none;
    stroke: rgba(34, 211, 238, 0.4);
    stroke-width: 0.9;
    transform-box: fill-box;
    transform-origin: center;
    animation: sonarPulse 4.2s ease-out infinite;
}

.floor-sonar:nth-of-type(2) {
    animation-delay: 2.1s;
}

@keyframes sonarPulse {
    0% {
        opacity: 0.55;
        transform: scale(0.28);
    }

    100% {
        opacity: 0;
        transform: scale(2);
    }
}

.floor-sweep {
    stroke: rgba(34, 211, 238, 0.28);
    stroke-width: 1;
    transform-origin: 0 0;
    animation: floorSweep 9s linear infinite;
}

@keyframes floorSweep {
    to {
        transform: rotate(360deg);
    }
}

/* 工位顶面细节 */
.st-inner {
    fill: none;
    stroke: rgba(255, 255, 255, 0.13);
    stroke-width: 0.6;
    stroke-dasharray: 3 2;
    pointer-events: none;
}

.st-well {
    fill: rgba(8, 20, 32, 0.85);
    stroke: rgba(140, 230, 255, 0.5);
    stroke-width: 0.5;
    pointer-events: none;
}

.st-pipe {
    fill: none;
    stroke: rgba(140, 220, 255, 0.32);
    stroke-width: 0.8;
    pointer-events: none;
}

.st-label {
    fill: rgba(150, 205, 235, 0.55);
    font-family: var(--mono);
    font-size: 6.5px;
    letter-spacing: 0.08em;
    pointer-events: none;
}

/* 数据流 */
.data-flow {
    fill: none;
    stroke: rgba(34, 211, 238, 0.22);
    stroke-width: 1;
    stroke-dasharray: 4 6;
    animation: dataFlow 2.8s linear infinite;
    pointer-events: none;
}

.data-flow.is-live {
    stroke: rgba(52, 211, 153, 0.85);
    stroke-width: 1.5;
    animation-duration: 1.2s;
    filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.7));
}

@keyframes dataFlow {
    to {
        stroke-dashoffset: -40;
    }
}

/* ---------- 机械臂 ---------- */
.robot-rail {
    stroke: rgba(120, 190, 255, 0.3);
    stroke-width: 4;
    stroke-linecap: round;
}

.robot-rail-line {
    stroke: rgba(34, 211, 238, 0.55);
    stroke-width: 0.9;
    stroke-dasharray: 3 4;
}

.robot-ring {
    fill: rgba(34, 211, 238, 0.08);
    stroke: rgba(34, 211, 238, 0.5);
    stroke-width: 0.8;
}

.robot {
    transition: filter 0.3s var(--ease);
}

.robot.is-busy {
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.45));
}

.robot-shadow {
    fill: rgba(0, 0, 0, 0.5);
}

.robot-pedestal {
    fill: #122234;
    stroke: rgba(34, 211, 238, 0.5);
    stroke-width: 0.8;
}

.robot-column {
    fill: #1a2d42;
    stroke: rgba(34, 211, 238, 0.45);
    stroke-width: 0.7;
}

.robot-seg {
    fill: url(#armMetal);
    stroke: rgba(34, 211, 238, 0.5);
    stroke-width: 0.7;
}

.robot-hl {
    fill: rgba(255, 255, 255, 0.55);
}

.robot-hub {
    fill: #1b2c3f;
    stroke: rgba(180, 220, 250, 0.65);
    stroke-width: 0.9;
}

.robot-joint {
    fill: #0a1622;
    stroke: rgba(34, 211, 238, 0.8);
    stroke-width: 0.9;
}

.robot-wrist {
    fill: url(#armMetalV);
    stroke: rgba(34, 211, 238, 0.55);
    stroke-width: 0.7;
}

.robot-led {
    fill: var(--cyan);
    transition: fill 0.3s var(--ease);
}

.robot.is-busy .robot-led,
.robot.is-carrying .robot-led {
    fill: var(--green);
}

.robot-grip {
    fill: none;
    stroke: #cfe0ee;
    stroke-width: 1.6;
    stroke-linecap: round;
}

.robot-tube {
    fill: rgba(52, 211, 153, 0.85);
    stroke: rgba(52, 211, 153, 0.95);
    stroke-width: 0.6;
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.robot.is-carrying .robot-tube {
    opacity: 1;
    animation: tubeGlow 1.3s ease-in-out infinite;
}

@keyframes tubeGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 2px rgba(52, 211, 153, 0.7));
    }

    50% {
        filter: drop-shadow(0 0 7px rgba(52, 211, 153, 1));
    }
}

/* 地轨能量脉冲 */
.robot-rail-pulse {
    fill: none;
    stroke: rgba(34, 211, 238, 0.9);
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-dasharray: 16 72;
    filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.8));
    animation: railPulse 2.4s linear infinite;
    pointer-events: none;
}

@keyframes railPulse {
    to {
        stroke-dashoffset: -88;
    }
}

/* 关节旋转环 */
.robot-spin {
    fill: none;
    stroke: rgba(126, 240, 255, 0.85);
    stroke-width: 1;
    stroke-dasharray: 4 6;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
    transition: opacity 0.3s var(--ease);
}

.robot.is-busy .robot-spin {
    opacity: 1;
    animation: armSpin 1.6s linear infinite;
}

@keyframes armSpin {
    to {
        transform: rotate(360deg);
    }
}

/* 机械臂特效层 */
.robot-fx {
    pointer-events: none;
}

.robot-glow {
    fill: rgba(34, 211, 238, 0.22);
    filter: blur(5px);
    opacity: 0;
    transition: opacity 0.35s var(--ease);
}

.robot-fx.is-active .robot-glow {
    opacity: 1;
}

.robot-spark {
    stroke: #7ef0ff;
    stroke-width: 2.4;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.9));
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.robot-fx.is-active .robot-spark {
    opacity: 0.95;
}

.robot-ghost {
    fill: rgba(126, 240, 255, 0.65);
    stroke: none;
    opacity: 0;
}

.robot-beam {
    stroke: rgba(126, 240, 255, 0.7);
    stroke-width: 0.9;
    stroke-dasharray: 3 4;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
    animation: dataFlow 1s linear infinite;
}

.robot-beam.is-on {
    opacity: 0.85;
}

/* 末端能量光带 */
.robot-ribbon {
    fill: none;
    stroke: rgba(126, 240, 255, 0.8);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 6px rgba(34, 211, 238, 0.9));
    opacity: 0;
}

/* 抓取时升起的全息扫描环 */
.robot-holo {
    fill: none;
    stroke: rgba(126, 240, 255, 0.9);
    stroke-width: 1;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.8));
}

/* 待机时的呼吸细节 */
.robot-led {
    animation: ledPulse 2.4s ease-in-out infinite;
}

@keyframes ledPulse {

    0%,
    100% {
        opacity: 0.55;
    }

    50% {
        opacity: 1;
        filter: drop-shadow(0 0 4px rgba(126, 240, 255, 0.9));
    }
}

.robot-ring {
    transform-box: fill-box;
    transform-origin: center;
    animation: ringBreath 3.6s ease-in-out infinite;
}

@keyframes ringBreath {

    0%,
    100% {
        opacity: 0.4;
        transform: scale(1);
    }

    50% {
        opacity: 0.85;
        transform: scale(1.08);
    }
}

/* 取放锁定框 */
.robot-reticle {
    opacity: 0;
    transition: opacity 0.25s var(--ease);
}

.robot-reticle.is-on {
    opacity: 1;
}

.rt-ring {
    fill: none;
    stroke: rgba(126, 240, 255, 0.9);
    stroke-width: 0.9;
    stroke-dasharray: 3 4;
    transform-box: fill-box;
    transform-origin: center;
    animation: armSpin 2.8s linear infinite;
}

.rt-ring-2 {
    stroke-dasharray: 2 3;
    animation-duration: 1.7s;
    animation-direction: reverse;
}

.rt-cross {
    stroke: rgba(34, 211, 238, 0.85);
    stroke-width: 1;
    stroke-linecap: round;
}

.rt-drop {
    stroke: rgba(34, 211, 238, 0.45);
    stroke-width: 0.8;
    stroke-dasharray: 2 3;
}

.rt-dot {
    fill: #bdf6ff;
    filter: drop-shadow(0 0 4px #22d3ee);
}

/* 夹持能量环 */
.robot-pulse {
    fill: none;
    stroke: #7ef0ff;
    stroke-width: 1.2;
    transform-box: fill-box;
    transform-origin: center;
    animation: robotPulse 0.95s ease-out forwards;
}

@keyframes robotPulse {
    0% {
        transform: scale(0.35);
        opacity: 0.95;
    }

    100% {
        transform: scale(3.4);
        opacity: 0;
    }
}

body.lights-on .robot-seg {
    stroke: rgba(160, 215, 255, 0.7);
}

/* 机械臂遥测条 */
.robot-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 9px 18px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.05em;
    color: var(--muted-2);
}

.robot-bar b {
    color: #cfe4f7;
    font-weight: 500;
}

.robot-bar .robot-id {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--cyan);
}

.robot-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

/* SVG 工位 */
.floor-base {
    fill: var(--floor-fill);
    stroke: var(--floor-edge);
    stroke-width: 1;
    transition: fill 0.6s var(--ease), stroke 0.6s var(--ease);
}

.floor-grid {
    stroke: var(--floor-line);
    stroke-width: 1;
    transition: stroke 0.6s var(--ease);
}

.floor-zone {
    fill: #5c7a96;
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.18em;
    opacity: 0.55;
}

.station {
    cursor: pointer;
    outline: none;
    transition: filter 0.3s var(--ease), opacity 0.3s var(--ease);
}

.station:hover {
    filter: brightness(1.28) drop-shadow(0 0 8px rgba(34, 211, 238, 0.35));
}

.station:focus-visible {
    filter: brightness(1.35) drop-shadow(0 0 10px rgba(34, 211, 238, 0.6));
}

.station.is-active {
    filter: brightness(1.32) drop-shadow(0 0 12px rgba(34, 211, 238, 0.55));
}

/* 悬停流程条时，联动高亮工位图上的对应工位 */
.station.is-linked {
    filter: brightness(1.45) drop-shadow(0 0 12px rgba(34, 211, 238, 0.6));
}

.station .st-code {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.08em;
    fill: #86d8e8;
    pointer-events: none;
}

.station .st-name {
    font-family: var(--sans);
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    fill: #eaf8ff;
    pointer-events: none;
}

.station .halo {
    fill: none;
    stroke: #22d3ee;
    stroke-width: 1.2;
    opacity: 0;
    transform-box: fill-box;
    transform-origin: center;
}

.station.is-active .halo {
    animation: haloPulse 1.8s ease-out infinite;
}

/* 机械臂作业目标：更快的脉冲强调 */
.station.is-target .halo {
    opacity: 1;
    animation: haloPulse 1.1s ease-out infinite;
}

@keyframes haloPulse {
    0% {
        opacity: 0.9;
        transform: scale(0.7);
    }

    100% {
        opacity: 0;
        transform: scale(1.7);
    }
}

.station .led {
    fill: #34d399;
    filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.9));
}

body.lights-on .station {
    filter: brightness(1.22);
}

body.lights-on .station.is-active {
    filter: brightness(1.45) drop-shadow(0 0 14px rgba(255, 220, 150, 0.45));
}

/* 右侧面板 */
.lab-side {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.station-panel {
    padding: 24px;
    background: linear-gradient(165deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.012));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    min-height: 300px;
}

.station-panel.switching > * {
    animation: fadeUp 0.4s var(--ease) both;
}

.station-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.station-code {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.14em;
    color: var(--cyan);
}

.station-head h3 {
    margin-top: 6px;
    font-size: 20px;
    font-weight: 650;
    line-height: 1.35;
}

.status-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.06em;
    color: var(--green);
    background: rgba(52, 211, 153, 0.09);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 999px;
}

.status-pill::before {
    content: "";
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
}

.station-desc {
    margin: 14px 0 18px;
    font-size: 13px;
    line-height: 1.85;
    color: var(--muted);
}

.metric-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.metric-item {
    padding: 11px 13px;
    background: rgba(5, 7, 12, 0.45);
    border: 1px solid rgba(120, 190, 255, 0.1);
    border-radius: 9px;
}

.metric-item span {
    display: block;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.metric-item strong {
    display: block;
    margin-top: 4px;
    font-family: var(--mono);
    font-size: 13.5px;
    font-weight: 500;
    color: #dff3ff;
}

.equip-box {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.equip-box h4 {
    font-family: var(--mono);
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--muted-2);
    margin-bottom: 10px;
}

.equip-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.equip-tags span {
    padding: 3px 9px;
    font-size: 11px;
    color: #a9c6df;
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 4px;
}

.station-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed rgba(120, 190, 255, 0.14);
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted-2);
}

/* 运行卡 */
.run-card {
    padding: 20px;
    background: linear-gradient(165deg, rgba(18, 30, 48, 0.85), rgba(7, 12, 20, 0.9));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.run-card.running {
    border-color: rgba(34, 211, 238, 0.45);
    box-shadow: 0 0 0 1px rgba(34, 211, 238, 0.12), 0 20px 50px -30px rgba(34, 211, 238, 0.5);
}

.run-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.run-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.16em;
    color: var(--cyan);
}

.run-state {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.08em;
    color: var(--muted-2);
}

.run-card.running .run-state {
    color: var(--cyan);
    animation: blink 1.8s ease-in-out infinite;
}

.run-progress {
    height: 4px;
    margin-top: 14px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 4px;
    overflow: hidden;
}

.run-progress i {
    display: block;
    width: 0;
    height: 100%;
    background: var(--grad);
    border-radius: 4px;
    transition: width 0.6s var(--ease);
}

.run-meta {
    display: flex;
    justify-content: space-between;
    margin-top: 9px;
    font-family: var(--mono);
    font-size: 9.5px;
    color: var(--muted-2);
}

.run-meta b {
    color: #cfe4f7;
    font-weight: 500;
}

.run-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.run-actions .btn {
    flex: 1;
    padding: 10px 14px;
    font-size: 13px;
}

/* 运行中把「重置」切换为「中止」，给出可中断的语义 */
.run-card.running #resetBtn {
    color: #fda4af;
    border-color: rgba(251, 113, 133, 0.42);
}

.run-card.running #resetBtn:hover {
    background: rgba(251, 113, 133, 0.1);
    border-color: rgba(251, 113, 133, 0.6);
}

.run-hint {
    margin-top: 11px;
    font-size: 11px;
    line-height: 1.7;
    color: var(--muted-2);
}

/* 面板内健康度与遥测 */
.health-row {
    display: grid;
    grid-template-columns: 66px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.health-ring {
    position: relative;
    width: 66px;
    height: 66px;
}

.health-ring svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.health-ring .hr-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 5;
}

.health-ring .hr-val {
    fill: none;
    stroke: var(--green);
    stroke-width: 5;
    stroke-linecap: round;
    filter: drop-shadow(0 0 5px rgba(52, 211, 153, 0.55));
}

.health-ring b {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    color: #e6f6ff;
}

.health-ring b span {
    font-size: 8px;
    font-weight: 400;
    color: var(--muted-2);
}

.health-label {
    display: block;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.14em;
    color: var(--muted-2);
}

.health-body > strong {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    font-weight: 600;
}

.health-bars {
    display: flex;
    gap: 4px;
    margin-top: 10px;
}

.health-bars i {
    height: 3px;
    border-radius: 2px;
    background: rgba(52, 211, 153, 0.75);
}

.health-bars i:nth-child(2) {
    background: rgba(52, 211, 153, 0.4);
}

.health-bars i:nth-child(3) {
    background: rgba(52, 211, 153, 0.2);
}

.telemetry {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px dashed rgba(120, 190, 255, 0.14);
}

.telemetry-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--muted-2);
}

.telemetry-head b {
    font-size: 10px;
    font-weight: 500;
    color: var(--cyan);
}

.telemetry-chart {
    display: block;
    width: 100%;
    height: 56px;
    margin-top: 8px;
    background-image: linear-gradient(rgba(120, 190, 255, 0.06) 1px, transparent 1px);
    background-size: 100% 18px;
}

.telemetry-line {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 1.4;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.55));
}

/* ---------- 运行看板 ---------- */
.lab-mission {
    padding: 84px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    background:
        radial-gradient(900px 420px at 18% 0%, rgba(34, 211, 238, 0.06), transparent 62%),
        rgba(255, 255, 255, 0.012);
}

.mission-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 30px;
}

.mission-head .section-title {
    margin-top: 14px;
    font-size: clamp(26px, 3vw, 36px);
}

.mission-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 14px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    color: var(--green);
    background: rgba(52, 211, 153, 0.06);
    border: 1px solid rgba(52, 211, 153, 0.3);
    border-radius: 999px;
}

.mission-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(0, 0.85fr);
    gap: 20px;
    align-items: start;
}

.mission-left {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.kpi-card {
    padding: 18px 20px 16px;
    background: linear-gradient(165deg, rgba(18, 30, 48, 0.85), rgba(7, 12, 20, 0.9));
    border: 1px solid var(--line);
    border-radius: 14px;
    overflow: hidden;
}

.kpi-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.kpi-label {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.1em;
    color: var(--muted-2);
}

.kpi-trend {
    padding: 2px 7px;
    font-family: var(--mono);
    font-size: 9.5px;
    border-radius: 999px;
}

.kpi-trend.up {
    color: var(--green);
    background: rgba(52, 211, 153, 0.09);
}

.kpi-trend.down {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.09);
}

.kpi-main {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-top: 8px;
}

.kpi-value {
    font-family: var(--mono);
    font-size: clamp(26px, 2.6vw, 34px);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.02em;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.kpi-unit {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted-2);
}

.kpi-spark {
    display: block;
    width: 100%;
    height: 28px;
    margin-top: 6px;
}

.kpi-spark polyline {
    fill: none;
    stroke: rgba(34, 211, 238, 0.55);
    stroke-width: 1.2;
    stroke-linejoin: round;
}

.kpi-sub {
    display: block;
    margin-top: 4px;
    font-size: 10.5px;
    color: var(--muted-2);
}

/* 事件流 */
.event-panel {
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(6, 10, 17, 0.6);
    overflow: hidden;
}

.event-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 13px 18px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.02);
}

.event-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--green);
}

.event-list {
    list-style: none;
    max-height: 268px;
    overflow: hidden;
}

.event-item {
    display: grid;
    grid-template-columns: 64px 10px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-top: 1px solid rgba(120, 190, 255, 0.07);
    font-size: 12px;
    animation: fadeUp 0.4s var(--ease) both;
}

.event-item:first-child {
    border-top: none;
}

.ev-time {
    font-family: var(--mono);
    font-size: 9.5px;
    color: #465b72;
}

.ev-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyan);
    box-shadow: 0 0 7px rgba(34, 211, 238, 0.8);
}

.ev-dot.ok {
    background: var(--green);
    box-shadow: 0 0 7px rgba(52, 211, 153, 0.8);
}

.ev-dot.wn {
    background: var(--warn);
    box-shadow: 0 0 7px rgba(251, 191, 36, 0.8);
}

.ev-text {
    color: var(--muted);
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ev-tag {
    font-family: var(--mono);
    font-size: 9px;
    color: #7dd3fc;
    text-align: right;
}

/* 系统模块 */
.module-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 20px;
    background: linear-gradient(165deg, rgba(18, 30, 48, 0.86), rgba(7, 12, 20, 0.9));
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    box-shadow: 0 30px 70px -46px rgba(0, 0, 0, 0.95);
}

.module-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.module-note {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--green);
}

.module-card {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr) 8px;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    background: rgba(5, 7, 12, 0.4);
    border: 1px solid rgba(120, 190, 255, 0.1);
    border-radius: 12px;
}

.module-ring {
    position: relative;
    width: 58px;
    height: 58px;
}

.module-ring svg {
    display: block;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.08);
    stroke-width: 4;
}

.ring-val {
    fill: none;
    stroke: var(--cyan);
    stroke-width: 4;
    stroke-linecap: round;
    filter: drop-shadow(0 0 4px rgba(34, 211, 238, 0.6));
}

.ring-val.is-green {
    stroke: var(--green);
    filter: drop-shadow(0 0 4px rgba(52, 211, 153, 0.6));
}

.ring-val.is-blue {
    stroke: #60a5fa;
    filter: drop-shadow(0 0 4px rgba(96, 165, 250, 0.6));
}

.module-ring strong {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: #e6f6ff;
}

.module-info strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.module-info span {
    display: block;
    margin-top: 2px;
    font-family: var(--mono);
    font-size: 8.5px;
    letter-spacing: 0.12em;
    color: var(--muted-2);
}

.module-info small {
    display: block;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--muted-2);
}

.module-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
}

.module-dot.is-warn {
    background: var(--warn);
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.8);
}

.module-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    border-top: 1px dashed rgba(120, 190, 255, 0.14);
    font-family: var(--mono);
    font-size: 9px;
    color: var(--muted-2);
}

/* ---------- 终端 ---------- */
.log-section {
    padding: 84px 0 0;
}

.terminal {
    position: relative;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #04070c;
    box-shadow: 0 40px 90px -50px rgba(0, 0, 0, 0.95);
}

.terminal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 13px 18px;
    background: rgba(255, 255, 255, 0.025);
    border-bottom: 1px solid var(--line);
}

.terminal-mode {
    font-family: var(--mono);
    font-size: 9.5px;
    letter-spacing: 0.12em;
    color: var(--muted-2);
}

.terminal-mode.running {
    color: var(--green);
}

.terminal-body {
    height: 286px;
    overflow-y: auto;
    padding: 18px 20px;
    font-family: var(--mono);
    font-size: 11.5px;
    line-height: 2;
    color: #8ea5bd;
    background-image:
        linear-gradient(rgba(120, 190, 255, 0.02) 1px, transparent 1px);
    background-size: 100% 22px;
}

.t-line {
    display: flex;
    gap: 12px;
    animation: fadeUp 0.35s var(--ease) both;
}

.t-time {
    flex-shrink: 0;
    color: #465b72;
}

.t-text {
    min-width: 0;
    word-break: break-word;
}

.t-text .ok {
    color: var(--green);
}

.t-text .cy {
    color: var(--cyan);
}

.t-text .wn {
    color: var(--warn);
}

.terminal-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px 18px;
    border-top: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 9.5px;
    color: #465b72;
    background: rgba(255, 255, 255, 0.015);
}

/* 上翻日志后出现的回底提示 */
.term-jump {
    position: absolute;
    right: 18px;
    bottom: 56px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.06em;
    color: #04121a;
    background: var(--cyan);
    border: 0;
    border-radius: 999px;
    cursor: pointer;
    box-shadow: 0 12px 26px -14px rgba(34, 211, 238, 0.9);
    transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.term-jump:hover {
    background: #67e8f9;
    transform: translateY(-1px);
}

.term-jump:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.term-jump[hidden] {
    display: none;
}

.terminal-cursor {
    color: var(--green);
}

.terminal-cursor::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 11px;
    margin-left: 6px;
    background: var(--green);
    vertical-align: -1px;
    animation: blink 1.1s steps(1) infinite;
}

/* ---------- 流程 ---------- */
.lab-section {
    padding: 92px 0;
}

.compare-section {
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.wf {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
    list-style: none;
}

.wf-step {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 18px 8px;
    text-align: center;
    background: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), transform 0.3s var(--ease);
}

.wf-step:hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.04);
}

/* 流程条可点击：悬停在工位上时反向高亮对应步骤 */
.wf-step[data-station] {
    cursor: pointer;
}

.wf-step:focus-visible {
    outline: 2px solid var(--cyan);
    outline-offset: 3px;
}

.wf-step.is-hover {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.35);
    background: rgba(34, 211, 238, 0.04);
}

.wf-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    right: -10px;
    width: 10px;
    height: 1px;
    background: rgba(34, 211, 238, 0.35);
}

.wf-num {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.1em;
    color: var(--cyan);
}

.wf-step strong {
    font-size: 13px;
    font-weight: 600;
}

.wf-step small {
    font-family: var(--mono);
    font-size: 8px;
    letter-spacing: 0.08em;
    color: var(--muted-2);
}

/* 演示进行中的流程联动 */
.wf-step.is-active {
    transform: translateY(-3px);
    border-color: rgba(34, 211, 238, 0.55);
    background: rgba(34, 211, 238, 0.09);
    box-shadow: 0 16px 36px -22px rgba(34, 211, 238, 0.85);
}

.wf-step.is-active .wf-num {
    color: #7dd3fc;
}

.wf-step.is-done {
    border-color: rgba(52, 211, 153, 0.4);
    background: rgba(52, 211, 153, 0.06);
}

.wf-step.is-done .wf-num {
    color: var(--green);
}

.wf-step.is-done .wf-num::after {
    content: " ✓";
}

/* 开灯后工位图整体提亮 */
body.lights-on .floor-svg svg {
    filter: saturate(1.06) brightness(1.07);
}

.station-panel {
    scroll-margin-top: 92px;
}

/* ---------- 对比表 ---------- */
.compare {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.compare-row {
    display: grid;
    grid-template-columns: 0.75fr 1fr 1fr;
    border-top: 1px solid rgba(120, 190, 255, 0.1);
}

.compare-row:first-child {
    border-top: none;
}

.compare-row:not(.compare-head):hover {
    background: rgba(255, 255, 255, 0.02);
}

.compare-head {
    background: rgba(255, 255, 255, 0.035);
}

.compare-cell {
    padding: 17px 22px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--muted);
    border-left: 1px solid rgba(120, 190, 255, 0.1);
}

.compare-cell:first-child {
    border-left: none;
}

.compare-head .compare-cell {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--muted-2);
}

.compare-head .is-hl {
    color: var(--cyan);
}

.compare-label {
    color: var(--text);
    font-weight: 500;
}

.compare-cell.is-hl {
    color: #dff3ff;
    background: rgba(34, 211, 238, 0.055);
}

/* ---------- CTA ---------- */
.lab-cta {
    padding: 90px 0;
    border-top: 1px solid var(--line);
    background: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.04));
}

.lab-cta-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 34px;
}

.lab-cta .section-title {
    margin-top: 14px;
    font-size: clamp(26px, 3vw, 36px);
}

.lab-cta .section-desc {
    margin-top: 12px;
}

.lab-cta-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
    .lab-hero-inner {
        grid-template-columns: 1fr;
        gap: 42px;
        padding: 66px 28px 72px;
    }

    .master-card {
        max-width: 560px;
        margin: 0;
    }

    .lab-layout {
        grid-template-columns: 1fr;
    }

    .lab-side {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }

    .wf {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .wf-step:not(:last-child)::after {
        display: none;
    }

    .mission-grid {
        grid-template-columns: 1fr;
    }

    .module-panel {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-items: stretch;
    }

    .module-head,
    .module-foot {
        grid-column: 1 / -1;
    }
}

@media (max-width: 860px) {
    .lab-workspace {
        padding: 76px 0 60px;
    }

    .lab-side {
        grid-template-columns: 1fr;
    }

    .kpi-grid {
        gap: 12px;
    }

    .wf {
        grid-template-columns: repeat(4, 1fr);
    }

    .module-panel {
        grid-template-columns: 1fr;
    }

    .event-item {
        grid-template-columns: 56px 10px minmax(0, 1fr) 40px;
    }

    .lab-section {
        padding: 76px 0;
    }

    .log-section {
        padding: 70px 0 0;
    }

    .compare {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .compare-row {
        min-width: 620px;
    }
}

@media (max-width: 640px) {
    .lab-hero-inner {
        padding: 56px 20px 60px;
    }

    .kpi-grid {
        gap: 10px;
    }

    .lab-mission {
        padding: 64px 0;
    }

    .mission-head {
        margin-bottom: 22px;
    }

    .event-item {
        grid-template-columns: 52px 8px minmax(0, 1fr);
        gap: 8px;
        padding: 10px 14px;
        font-size: 11.5px;
    }

    .ev-tag {
        display: none;
    }

    .module-card {
        grid-template-columns: 50px minmax(0, 1fr) 8px;
        gap: 12px;
        padding: 11px 12px;
    }

    .module-ring {
        width: 50px;
        height: 50px;
    }

    .lab-workspace {
        padding: 64px 0 52px;
    }

    .lab-section {
        padding: 64px 0;
    }

    .lab-title {
        font-size: clamp(40px, 12vw, 56px);
    }

    .lab-hero-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .lab-hero-actions .btn {
        width: 100%;
    }

    .master-card {
        padding: 18px;
    }

    .light-row {
        grid-template-columns: 46px 1fr auto;
        gap: 12px;
    }

    /* 触控友好：开关保持外观比例，同时扩大可点区域 */
    .light-switch {
        width: 66px;
        height: 36px;
    }

    .light-switch::after {
        content: "";
        position: absolute;
        inset: -8px -6px;
    }

    .light-switch .switch-knob {
        width: 28px;
        height: 28px;
    }

    .light-switch[aria-checked="true"] .switch-knob {
        transform: translateX(32px);
    }

    .run-actions .btn {
        min-height: 44px;
    }

    .lamp-icon {
        width: 46px;
        height: 46px;
        border-radius: 12px;
    }

    .lamp-icon svg {
        width: 22px;
        height: 22px;
    }

    .master-grid {
        gap: 14px 16px;
    }

    .floor-viewport {
        overflow-x: auto;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-x: contain;
    }

    .floor-foot {
        flex-wrap: wrap;
        gap: 6px;
    }

    .floor-svg {
        min-width: 540px;
    }

    .station-panel {
        padding: 20px;
    }

    .metric-grid {
        grid-template-columns: 1fr;
    }

    .wf {
        grid-template-columns: 1fr 1fr;
    }

    .lab-cta-actions {
        width: 100%;
        flex-direction: column;
    }

    .lab-cta-actions .btn {
        width: 100%;
    }

    .terminal-body {
        height: 250px;
    }

    .kpi-card {
        padding: 14px 14px 12px;
    }

    .kpi-value {
        font-size: 26px;
    }

    .kpi-spark {
        height: 24px;
    }

    .lab-ticker-track span {
        padding: 9px 18px;
    }
}

/* 降低动效偏好 */
@media (prefers-reduced-motion: reduce) {

    .lab-hero-beam,
    .lab-ticker-track,
    .floor-sweep,
    .floor-sonar,
    .data-flow,
    .master-spark,
    .robot-rail-pulse,
    .robot-spin,
    .rt-ring,
    .robot-beam,
    .robot-pulse,
    .robot-led,
    .robot-ring,
    .robot.is-carrying .robot-tube {
        animation: none !important;
    }

    .lab-hero-dots {
        display: none;
    }

    .glow-card::after {
        display: none;
    }

    .floor-svg svg {
        transition: none;
    }
}

/* ---------- 可读性：信息性小字下限（与首页规范保持一致） ---------- */
.lab-chips,
.status-chip,
.status-pill,
.mission-live {
    font-size: 11px;
}

.light-info span,
.master-item span,
.master-load-head,
.master-load-head strong,
.panel-badge,
.kpi-label,
.kpi-trend,
.equip-box h4,
.health-label,
.telemetry-head,
.terminal-mode,
.terminal-foot,
.ev-tag,
.wf-num,
.wf-step small,
.module-info span,
.module-foot,
.module-note,
.event-live,
.station-code,
.station-foot,
.robot-bar,
.metric-item span,
.floor-legend,
.lab-ticker-track span {
    font-size: 11px;
}

.kpi-sub,
.module-info small,
.terminal-body {
    font-size: 11.5px;
}

.run-label,
.run-state,
.run-meta,
.ev-time {
    font-size: 11px;
}

.compare-head .compare-cell {
    font-size: 11px;
    color: var(--muted);
}

.light-info span,
.master-item span,
.master-load-head,
.kpi-label,
.kpi-sub,
.equip-box h4,
.health-label,
.telemetry-head,
.terminal-mode,
.terminal-foot,
.module-info span,
.module-info small,
.module-foot,
.ev-time,
.wf-step small,
.metric-item span,
.station-foot,
.floor-legend {
    color: var(--muted);
}