/* ==========================================================================
   BUDA OPUS 0 · STAGE 8 (EVO) 专有样式表
   工业级规范：100% 内部命名空间隔离，零全局污染，绝不越权干预底盘与导轨
   ========================================================================== */

#stage8-viewport {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: none;
    background: transparent;
    z-index: 10;
}

#stage8-viewport.active {
    display: block;
}

/* [1] 篇首哲学锚点：全站统一基准 24px / 500 / -0.01em */
#s8-anchor-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 120;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

#s8-anchor-layer.visible {
    opacity: 1;
}

#s8-anchor-text {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: #141418;
    letter-spacing: -0.01em;
    text-align: center;
    line-height: 1.4;
    white-space: nowrap;
}

/* [2] 核心态势舞台：依托 .stage-safe-container 物理视窗 */
#s8-tactical-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    z-index: 100;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: opacity;
}

#s8-tactical-stage.active {
    opacity: 1;
}

#s8-tactical-stage.fading-out {
    opacity: 0 !important;
    transition: opacity 2.0s cubic-bezier(0.16, 1, 0.3, 1);
}

#s8-tactical-canvas {
    width: 100%;
    height: 100%;
    display: block;
    will-change: viewBox;
}

/* 高精度美国大陆实体：暖灰底板 (#EAEAE5) + 锐利炭黑轮廓 (#141418) */
.us-map-outline {
    fill: #EAEAE5;
    stroke: #141418;
    stroke-width: 1.2px;
    stroke-linejoin: round;
    vector-effect: non-scaling-stroke;
}

/* 微观建筑设施：纯白实体 (#FFFFFF) + 炭黑工规细线 */
#micro-facilities-layer {
    transition: opacity 1.0s cubic-bezier(0.16, 1, 0.3, 1);
}

.farm-building {
    fill: #FFFFFF;
    stroke: rgba(20, 20, 24, 0.65);
    stroke-width: 0.7px;
    vector-effect: non-scaling-stroke;
}

.farm-road {
    stroke: rgba(20, 20, 24, 0.18);
    stroke-width: 0.8px;
    stroke-dasharray: 2, 3;
    vector-effect: non-scaling-stroke;
}

/* 跨州联邦学习骨干网动效 */
.backbone-pipeline {
    animation: s8BackboneFlow 0.5s linear infinite;
    pointer-events: none;
}

@keyframes s8BackboneFlow {
    from { stroke-dashoffset: 8; }
    to { stroke-dashoffset: 0; }
}

/* 局部微观通信虚线动效 */
.telemetry-pipeline {
    animation: s8PipelineFlow 0.8s linear infinite;
    pointer-events: none;
}

@keyframes s8PipelineFlow {
    from { stroke-dashoffset: 5; }
    to { stroke-dashoffset: 0; }
}

/* 蜂窝相控阵感知域动画 */
.hub-control-zone {
    pointer-events: none;
    transform-origin: center;
}

@keyframes zoneBreathA {
    0%, 100% { fill-opacity: 0.30; stroke-opacity: 0.40; }
    45% { fill-opacity: 0.95; stroke-opacity: 1.00; }
}
@keyframes zoneBreathB {
    0%, 100% { fill-opacity: 0.35; stroke-opacity: 0.45; }
    50% { fill-opacity: 1.00; stroke-opacity: 0.95; }
}
@keyframes zoneBreathC {
    0%, 100% { fill-opacity: 0.25; stroke-opacity: 0.35; }
    40% { fill-opacity: 0.90; stroke-opacity: 0.90; }
}

.breath-mode-0 { animation: zoneBreathA 2.2s infinite cubic-bezier(0.4, 0, 0.2, 1); animation-delay: 0.0s; }
.breath-mode-1 { animation: zoneBreathB 2.7s infinite cubic-bezier(0.4, 0, 0.2, 1); animation-delay: 0.8s; }
.breath-mode-2 { animation: zoneBreathC 2.4s infinite cubic-bezier(0.4, 0, 0.2, 1); animation-delay: 1.4s; }
.breath-mode-3 { animation: zoneBreathA 2.9s infinite cubic-bezier(0.4, 0, 0.2, 1); animation-delay: 0.3s; }
.breath-mode-4 { animation: zoneBreathB 2.3s infinite cubic-bezier(0.4, 0, 0.2, 1); animation-delay: 1.1s; }
.breath-mode-5 { animation: zoneBreathC 2.6s infinite cubic-bezier(0.4, 0, 0.2, 1); animation-delay: 1.8s; }

/* 系统中枢：深炭灰圆盘 (#383838) */
.hub-base-circle {
    fill: #383838;
    stroke: rgba(255, 255, 255, 0.25);
    stroke-width: 0.4px;
    vector-effect: non-scaling-stroke;
}

/* 节点底盘：Siren 顶视工规特征轮廓 */
.chassis-siren-body {
    fill: #FFFFFF;
    stroke: #141418;
    stroke-width: 0.55px;
    vector-effect: non-scaling-stroke;
}

.chassis-wheel-pad {
    stroke: #141418;
    stroke-width: 0.55px;
    vector-effect: non-scaling-stroke;
}

.chassis-siren-dot {
    fill: #00AEEF;
}

/* 微观角标：炭黑纯色 + LIGHT 极细字重 */
.micro-labels-layer {
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.micro-sys-title {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.36px;
    font-weight: 600;
    fill: #141418;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.micro-node-label {
    font-family: 'SF Mono', Consolas, monospace;
    font-size: 0.28px;
    font-weight: 300 !important;
    fill: #141418 !important;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* 极简内敛工规遥测比例尺 (左下角) */
#s8-scale-widget {
    position: absolute;
    bottom: 24px;
    left: 28px;
    background: transparent;
    font-family: 'SF Mono', Consolas, monospace;
    z-index: 110;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.scale-hud-title {
    font-size: 8.5px;
    font-weight: 700;
    color: rgba(20, 20, 24, 0.45);
    letter-spacing: 0.08em;
    margin-bottom: 3px;
}

.scale-hud-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 5px;
}

.scale-hud-num {
    font-size: 14px;
    font-weight: 700;
    color: #141418;
    letter-spacing: 0.02em;
    font-variant-numeric: tabular-nums;
}

.scale-hud-unit {
    font-size: 9px;
    font-weight: 600;
    color: rgba(20, 20, 24, 0.55);
}

.scale-track {
    width: 80px;
    height: 1.5px;
    background: rgba(20, 20, 24, 0.15);
    position: relative;
}

.scale-track-fill {
    height: 100%;
    background: #00AEEF;
    width: 0%;
}

/* 右上角宏观推演遥测看板 */
#s8-macro-hud {
    position: absolute;
    top: 24px;
    right: 28px;
    background: #FFFFFF;
    border: 1px solid rgba(20, 20, 24, 0.16);
    border-left: 3.5px solid #00AEEF;
    border-radius: 2px;
    padding: 12px 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    font-family: 'SF Mono', Consolas, monospace;
    z-index: 110;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.hud-line-head {
    font-size: 11px;
    font-weight: 700;
    color: #141418;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 2px;
}

.hud-subhead {
    font-size: 9px;
    font-weight: 600;
    color: rgba(20, 20, 24, 0.5);
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

.hud-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #00AEEF;
    display: inline-block;
    animation: s8HudDotPulse 1.4s infinite ease-in-out;
}

@keyframes s8HudDotPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

.hud-row {
    font-size: 10px;
    line-height: 1.6;
    color: #141418;
    letter-spacing: 0.02em;
    display: flex;
    justify-content: space-between;
    gap: 18px;
}

.hud-label {
    color: rgba(20, 20, 24, 0.72);
}

.hud-val {
    color: #141418;
    font-weight: 600;
}

.hud-val-accent {
    color: #00AEEF;
    font-weight: 700;
}

/* 收官题词层：整体居中 + 内部左对齐 */
#s8-epilogue-layer {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    width: max-content;
    max-width: 90vw;
    z-index: 130;
    pointer-events: none;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

#s8-epilogue-layer.active {
    opacity: 1;
}

#s8-epilogue-layer.fading-out {
    opacity: 0 !important;
    transition: opacity 1.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.epilogue-line {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 24px;
    font-weight: 500;
    color: #141418;
    letter-spacing: -0.015em;
    text-align: left;
    line-height: 1.35;
    white-space: nowrap;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.epilogue-line.visible {
    opacity: 1;
    transform: translateY(0);
}