/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    background: #000;
    color: #fff;
    min-height: 100vh;
    overflow: hidden;
}

.dashboard {
    position: relative;
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 背景区域：设备上报的最后一张图铺满，无图时用渐变 */
.background {
    flex: 1;
    min-height: 0;
    background: linear-gradient(180deg, #1a1a2e 0%, #16213e 50%, #0f0f23 100%);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.background.has-image {
    background-color: #0a0a0f;
}

/* 底部面板 */
.bottom-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 168px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 32px 16px;
    background: transparent;
}

/* 阶梯形内凹背景容器（与缩小后的仪表协调） */
.step-background {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 150px;
    pointer-events: none;
    z-index: 0;
}

/* 阶梯毛玻璃：两侧层（模糊略降），越向中间 mask 越透明 */
.step-background::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.06) 0%,
        rgba(0, 0, 0, 0.25) 40%,
        rgba(0, 0, 0, 0.35) 100%
    );
    backdrop-filter: blur(12px) saturate(1.15);
    -webkit-backdrop-filter: blur(12px) saturate(1.15);
    clip-path: polygon(
        0 0, 28% 0, 33% 85%, 67% 85%, 72% 0, 100% 0, 100% 100%, 0 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        black 0%,
        black 32%,
        transparent 48%,
        transparent 52%,
        black 68%,
        black 100%
    );
    mask-image: linear-gradient(
        to right,
        black 0%,
        black 32%,
        transparent 48%,
        transparent 52%,
        black 68%,
        black 100%
    );
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.08),
        inset 0 -1px 0 rgba(0, 0, 0, 0.15),
        0 -10px 30px rgba(0, 0, 0, 0.4);
}

/* 中间层：更弱模糊、更高透明度，与两侧渐变衔接 */
.step-glass-center {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        180deg,
        rgba(255, 255, 255, 0.04) 0%,
        rgba(0, 0, 0, 0.12) 50%,
        rgba(0, 0, 0, 0.18) 100%
    );
    backdrop-filter: blur(6px) saturate(1.1);
    -webkit-backdrop-filter: blur(6px) saturate(1.1);
    clip-path: polygon(
        0 0, 28% 0, 33% 85%, 67% 85%, 72% 0, 100% 0, 100% 100%, 0 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 30%,
        black 44%,
        black 56%,
        transparent 70%
    );
    mask-image: linear-gradient(
        to right,
        transparent 30%,
        black 44%,
        black 56%,
        transparent 70%
    );
    pointer-events: none;
    z-index: 0;
}

/* 内凹边缘高亮线 + 轻微质感 */
.step-background::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(255, 255, 255, 0.06) 0%,
        transparent 30%
    );
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    z-index: 1;
    clip-path: polygon(
        0 0, 
        28% 0, 
        33% 85%, 
        67% 85%, 
        72% 0, 
        100% 0, 
        100% 2px, 
        72% 2px, 
        67% calc(85% + 2px), 
        33% calc(85% + 2px), 
        28% 2px, 
        0 2px
    );
    pointer-events: none;
}

/* 左侧仪表盘 */
.left-gauges,
.right-gauges {
    display: flex;
    gap: 28px;
    align-items: flex-end;
    position: relative;
    z-index: 1;
    margin-bottom: -32px;
}

.gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 155px;
    max-width: 100%;
    flex-shrink: 0;
    aspect-ratio: 1;
    overflow: visible;
    font-family: "Helvetica Neue", "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.gauge-inner {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: visible;
    padding: 4px;
    box-sizing: border-box;
}

/* 中间信息区（与缩小后的内凹框协调） */
.center-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 560px;
    z-index: 1;
    margin-bottom: 28px;
}

/* 日出日落进度条 */
.sun-progress {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.progress-labels {
    display: flex;
    justify-content: space-between;
    width: calc(100% - 40px); /* 减小边距以拉长条 */
    padding: 0 10px;
    margin: 0 20px;
}

.progress-labels .label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.progress-labels .label.active {
    color: rgba(255, 255, 255, 0.8);
}

/* 进度条背景（当前点右侧的颜色：暗灰色） */
.progress-bar {
    width: calc(100% - 40px); /* 减小边距以拉长条 */
    height: 4px;
    position: relative;
    background: rgba(255, 255, 255, 0.05); /* 更暗的灰色 */
    margin: 0 20px;
}

/* 左侧延伸小尖尖（常亮：亮灰色） */
.progress-bar::before {
    content: '';
    position: absolute;
    right: calc(100% - 1px);
    top: 0;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4); /* 亮灰色 */
    clip-path: polygon(0 50%, 100% 0, 100% 100%);
}

/* 右侧延伸小尖尖（常暗：暗灰色） */
.progress-bar::after {
    content: '';
    position: absolute;
    left: calc(100% - 1px);
    top: 0;
    width: 40px;
    height: 4px;
    background: rgba(255, 255, 255, 0.05); /* 暗灰色 */
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.progress-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 0;
}

/* 主进度填充：从左侧到当前时刻（中心） */
.progress-fill {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 50%;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 2px;
    transition: width 0.2s ease;
    z-index: 1;
}

/* 一天中的时刻标记：零点、日出、正午、日落 */
.progress-day-marks {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.progress-day-marks .mark {
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 8px;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 1px;
}

.progress-day-marks .mark span {
    position: absolute;
    top: -18px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 9px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
}

/* 当前时刻：始终在进度条中心（屏幕中心）+ 呼吸效果 */
@keyframes point-breathe {
    0%, 100% {
        transform: translate(-50%, -50%) scale(1);
        box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
        opacity: 1;
    }
    50% {
        transform: translate(-50%, -50%) scale(1.35);
        box-shadow: 0 0 20px rgba(255, 255, 255, 0.95);
        opacity: 0.92;
    }
}

.point.current {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.9);
    z-index: 3;
    pointer-events: none;
    animation: point-breathe 2.5s ease-in-out infinite;
}

.progress-times {
    display: flex;
    justify-content: space-between;
    width: calc(100% - 40px); /* 减小边距以拉长条 */
    padding: 0;
    margin: 0 20px;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
}

/* 时间显示 + 警告在时间左右（最多 2 个，左一右一） */
.time-display {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 14px 20px;
}

.time-prefix {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.time-value {
    font-size: 42px;
    font-weight: 300;
    letter-spacing: 2px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* 时间左右各一个警告槽位；禁止警告时隐藏 */
.time-warnings-slot {
    min-width: 72px;
    max-width: 100px;
    display: flex;
    align-items: center;
}

body.warnings-disabled .time-warnings-left,
body.warnings-disabled .time-warnings-right {
    display: none;
}

.time-warnings-left {
    justify-content: flex-end;
}

.time-warnings-right {
    justify-content: flex-start;
}

/* 警告标签：黄色 低温/湿度/温度，红色 结冰/积水 */
.warning-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    white-space: nowrap;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.warning-badge.active {
    opacity: 1;
    transform: scale(1);
}

.warning-badge.yellow {
    background: rgba(241, 196, 15, 0.25);
    color: #f1c40f;
    border: 1px solid rgba(241, 196, 15, 0.5);
}

.warning-badge.red {
    background: rgba(231, 76, 60, 0.25);
    color: #e74c3c;
    border: 1px solid rgba(231, 76, 60, 0.5);
}

/* 电压信息 */
.voltage-info {
    display: flex;
    align-items: center;
    gap: 20px;
    font-size: 12px;
}

.voltage-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.voltage-label {
    color: rgba(255, 255, 255, 0.5);
}

.voltage-value {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
}

.voltage-divider {
    color: rgba(255, 255, 255, 0.2);
}

/* 屏幕正底部图标栏（扁平化图标） */
.bottom-icons {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 2;
    pointer-events: none;
}

.bottom-icons .bottom-icon {
    pointer-events: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: rgba(255, 255, 255, 0.65);
    transition: color 0.2s ease, transform 0.2s ease;
    text-decoration: none;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
}

.bottom-icons .bottom-icon:hover {
    color: rgba(255, 255, 255, 0.95);
    transform: scale(1.08);
}

.bottom-icons .icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bottom-icons .icon-svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

/* 摄像头/激光：按下为禁用态，红色 + 斜杠 */
.bottom-icons .bottom-icon-toggle.disabled {
    color: #e74c3c;
}

.bottom-icons .bottom-icon-toggle.disabled:hover {
    color: #ec7063;
}

.bottom-icons .bottom-icon-toggle .icon-wrap::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 130%;
    height: 2px;
    background: currentColor;
    transform: translate(-50%, -50%) rotate(-45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.bottom-icons .bottom-icon-toggle.disabled .icon-wrap::after {
    opacity: 1;
}

/* 右侧功率信息 */
.right-gauges {
    display: flex;
    gap: 20px;
    align-items: flex-end;
}

.power-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 40px; /* 增加底部内边距，使文字相对于仪表盘往上移 */
}

.power-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.power-label {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.power-value {
    font-size: 18px;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
}

/* 响应式适配 */
@media (max-width: 768px) {
    .bottom-panel {
        height: auto;
        padding: 20px;
        flex-wrap: wrap;
        gap: 20px;
    }
    
    .left-gauges,
    .right-gauges {
        flex: 1;
        min-width: 150px;
        justify-content: center;
    }
    
    .center-info {
        order: -1;
        width: 100%;
        max-width: none;
    }
    
    .gauge {
        width: 70px;
        height: 70px;
    }
    
    .gauge-value {
        font-size: 22px;
    }
    
    .time-value {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .bottom-panel {
        padding: 15px;
    }
    
    .gauge {
        width: 60px;
        height: 60px;
    }
    
    .gauge-value {
        font-size: 18px;
    }
    
    .time-value {
        font-size: 28px;
    }
    
    .voltage-info {
        flex-direction: column;
        gap: 4px;
    }
    
    .voltage-divider {
        display: none;
    }
}
