/* ==========================================================================
   STAGE 6: EVI (生产协作与裁决大闭环)
   严格 16:9 安全画幅 · 纯 GPU 硬件合成云台平滑滑移 · 负空间透视 · 全幅极简终章
   ========================================================================== */

#stage6-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    z-index: 100;
    background: transparent;
    overflow: hidden;
}

#stage6-viewport.active {
    display: block !important;
}

/* ==========================================================================
   篇章 1：开篇工控屏任务指令下发与接单终端 (米白工业质感)
   ========================================================================== */
#s6-dispatch-screen {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    opacity: 0;
    transition: opacity 0.8s ease;
    z-index: 120;
    pointer-events: none;
}

#s6-dispatch-screen.show {
    opacity: 1;
}

#s6-dispatch-screen.fadeout {
    opacity: 0 !important;
    transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.s6-dispatch-term {
    width: 720px;
    height: 250px;
    background: rgba(244, 244, 240, 0.98);
    border: 1px solid rgba(20, 20, 24, 0.2);
    border-left: 4px solid #00AEEF;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-radius: 3px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
}

.s6-term-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(20, 20, 24, 0.1);
    padding-bottom: 6px;
    margin-bottom: 8px;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 11px;
    font-weight: 700;
}

.s6-term-title { color: #00AEEF; }
.s6-term-badge {
    font-size: 9.5px;
    padding: 2px 7px;
    border: 1px solid #00AEEF;
    color: #00AEEF;
    background: rgba(0, 174, 239, 0.08);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.s6-term-badge.engaged {
    background: #00AEEF;
    color: #000000;
    font-weight: 700;
}

.s6-term-body {
    flex: 1;
    overflow: hidden;
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 12px;
    line-height: 22px;
    color: #141418;
}

.s6-term-row {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.s6-term-row.node-ack {
    color: #00AEEF;
    font-weight: 600;
}

/* ==========================================================================
   篇章 2~5：1920×1080 物理 SCADA 数字孪生画布 (16:9 标准沙盒)
   ========================================================================== */
#s6-scada-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    background: #141519;
    border-radius: 2px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 1.0s ease, box-shadow 1.0s ease;
    transform-origin: center center;
    z-index: 110;
}

#s6-scada-container.show {
    opacity: 1;
}

#s6-scada-container.fading-epilogue {
    opacity: 0 !important;
    box-shadow: none !important;
}

#s6-world-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    transform-origin: 0 0;
    will-change: transform;
    /* 核心调优：专业航拍云台阻尼曲线，平滑度极佳，完全杜绝离屏滤镜的高频抖动 */
    transition: transform 0.75s cubic-bezier(0.25, 1, 0.35, 1);
}

.s6-bg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    display: block;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease;
    object-fit: fill;
    will-change: opacity;
}

.s6-bg-layer.active {
    opacity: 1;
}

/* 临时红格层 */
.s6-target-cage {
    position: absolute;
    background: #E03131;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    z-index: 20;
    display: none;
    opacity: 0;
}

.s6-target-cage.active {
    display: block !important;
    opacity: 1 !important;
    animation: s6AlertPop 0.15s ease-out;
}

@keyframes s6AlertPop {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

/* 顶视海妖底盘容器 (GPU translate3d 渲染) */
#s6-siren-node {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 50;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: opacity 0.35s ease;
    will-change: transform;
}

#s6-siren-car-body {
    width: 47px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

#s6-siren-car-body svg {
    width: 100%;
    height: 100%;
    display: block;
}

/* 强制锁定 evenodd 规则，恢复闪电与保险杠负空间镂空透视 */
#s6-siren-car-body svg path {
    fill-rule: evenodd !important;
    clip-rule: evenodd !important;
}

#s6-siren-label {
    margin-top: 2px;
    background: rgba(15, 16, 20, 0.75);
    color: #ffffff;
    font-size: 10px;
    font-family: monospace;
    padding: 1px 6px;
    border-radius: 2px;
    white-space: nowrap;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.s6-radar-pulse {
    animation: s6RadarFlash 0.95s infinite ease-out;
}

@keyframes s6RadarFlash {
    0% { fill-opacity: 0.95; }
    50% { fill-opacity: 0.2; }
    100% { fill-opacity: 0.95; }
}

/* NOTICES 纯平深红无边圆点 */
#s6-notices-badge {
    position: absolute;
    left: 95px;
    top: 133px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: #E03131;
    color: #ffffff;
    font-size: 9px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "SF Mono", monospace;
    display: none;
    align-items: center;
    justify-content: center;
    line-height: 1;
    z-index: 65;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    transform: translate(-50%, -50%);
}

/* 高通透赛博工控黑客算力仓 */
#s6-computing-modal {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.96);
    width: 820px;
    height: 450px;
    background: rgba(11, 13, 19, 0.25);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(0, 229, 255, 0.5);
    border-radius: 8px;
    padding: 20px 24px;
    color: #ffffff;
    z-index: 75;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

#s6-computing-modal.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.s6-matrix-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 8px;
}

.s6-matrix-title {
    color: #00E5FF;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.s6-matrix-live-dot {
    width: 6px;
    height: 6px;
    background: #00FF66;
    border-radius: 50%;
    box-shadow: 0 0 8px #00FF66;
}

.s6-matrix-body-grid {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    margin: 12px 0;
    height: 310px;
    overflow: hidden;
}

.s6-matrix-stream-col {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 229, 255, 0.25);
    border-radius: 4px;
    padding: 10px 12px;
    font-family: "SF Mono", Consolas, monospace;
    font-size: 9.5px;
    line-height: 1.45;
    color: #00FF66;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-shadow: 0 0 5px rgba(0, 255, 102, 0.6);
}

.s6-matrix-metrics-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-family: -apple-system, monospace;
}

.s6-metric-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 8px 12px;
}

.s6-metric-card-header {
    font-size: 9.5px;
    color: #00E5FF;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.s6-metric-card-content {
    font-size: 11px;
    color: #FFFFFF;
    line-height: 1.5;
}

.s6-val-highlight { color: #00E5FF; font-weight: 700; }
.s6-val-alert { color: #FFD700; font-weight: 700; }

.s6-matrix-foot-bar {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 6px;
}

.s6-comp-bar-track {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 6px;
}

#s6-comp-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #00AEEF, #00FF66);
    box-shadow: 0 0 10px #00AEEF;
    transition: width 0.08s linear;
}

/* AI 悬浮按钮原生区域触发器 */
#s6-ai-fab-hit {
    position: absolute;
    left: 1852px;
    top: 1002px;
    width: 57px;
    height: 57px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 80;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: box-shadow 0.2s, background 0.2s;
}

#s6-ai-fab-hit.glow {
    box-shadow: 0 0 24px rgba(0, 174, 239, 0.85), inset 0 0 12px rgba(0, 174, 239, 0.6);
    background: rgba(0, 174, 239, 0.25);
}

/* AI 对话窗容器 */
#s6-ai-dialog-container {
    position: absolute;
    right: 36px;
    bottom: 32px;
    width: 372px;
    height: 0px;
    z-index: 90;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.95);
    transition: height 0.45s cubic-bezier(0.2, 0.85, 0.3, 1), opacity 0.25s ease;
    opacity: 0;
    pointer-events: none;
}

#s6-ai-dialog-container.show-small {
    height: 341px;
    opacity: 1;
    pointer-events: auto;
}

#s6-ai-dialog-container.show-large {
    height: 868px;
    opacity: 1;
    pointer-events: auto;
}

.s6-ai-card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 372px;
    height: 100%;
    object-fit: fill;
    display: block;
    transition: opacity 0.3s ease;
}

#s6-img-dialog-small { opacity: 1; }
#s6-img-dialog-large { opacity: 0; }

/* 输入框纯色遮罩 */
#s6-input-cover-mask {
    position: absolute;
    left: 29px;
    bottom: 64px;
    width: 313px;
    height: 79px;
    background: #3B3C40;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 10px 12px;
    display: none;
    z-index: 95;
}

#s6-input-type-text {
    color: #ffffff;
    font-size: 14px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.4;
    white-space: pre-wrap;
}

#s6-input-cursor-caret {
    display: inline-block;
    width: 2px;
    height: 15px;
    background: #00AEEF;
    vertical-align: middle;
    animation: s6CaretBlink 0.8s infinite;
}

@keyframes s6CaretBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* 大窗专属流式文本视口 */
#s6-ai-stream-viewport {
    position: absolute;
    top: 135px;
    left: 22px;
    right: 22px;
    bottom: 125px;
    overflow-y: auto;
    z-index: 96;
    display: none;
    color: #E2E3E7;
    font-size: 14.5px;
    line-height: 1.65;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding-right: 6px;
}

#s6-ai-stream-viewport::-webkit-scrollbar { width: 4px; }
#s6-ai-stream-viewport::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 2px;
}

/* 虚拟仿真光标 */
#s6-virtual-cursor {
    position: absolute;
    width: 22px;
    height: 22px;
    z-index: 120;
    pointer-events: none;
    opacity: 0;
    transform: translate(0, 0);
    transition: transform 0.65s cubic-bezier(0.25, 1, 0.35, 1), opacity 0.3s ease;
}

#s6-virtual-cursor svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.8));
}

.s6-cursor-ripple {
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid #00AEEF;
    transform: translate(-2px, -2px) scale(0);
    opacity: 0;
}

.s6-cursor-ripple.click {
    animation: s6RippleAnim 0.4s ease-out;
}

@keyframes s6RippleAnim {
    0% { transform: translate(-2px, -2px) scale(0.3); opacity: 1; }
    100% { transform: translate(-2px, -2px) scale(1.6); opacity: 0; }
}

/* ==========================================================================
   篇章 6：全幅极简哲学沉淀幕 (与第二幕完全同级同幅，绝无卡片与阴影)
   字体、字阶、字重与字距 100% 像素级对齐第二幕 #hyp-final-question (24px)
   ========================================================================== */
#s6-epilogue-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-light, #F4F4F0);
    z-index: 150;
    opacity: 0;
    pointer-events: none;
    transition: opacity 1.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.s6-epilogue-single-line {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: var(--ink-black, #141418);
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1.4;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.2, 0.8, 0.2, 1) 0.6s;
}