/* ===== 大屏基础 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #02070f;
    color: #c9dcff;
    font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

.screen-wrap {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1200px 700px at 50% -10%, rgba(23, 92, 190, .35), transparent 70%),
        radial-gradient(900px 600px at 10% 110%, rgba(0, 190, 255, .12), transparent 70%),
        #02070f;
}

.screen-wrap::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(64, 158, 255, .045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(64, 158, 255, .045) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
}

.screen {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1920px;
    height: 1080px;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    padding: 14px 20px 12px;
    gap: 12px;
}

/* ===== 顶部 ===== */
.hd {
    position: relative;
    height: 74px;
    flex: 0 0 74px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 18px;
}

.hd-bg {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 132, 255, .22), rgba(0, 132, 255, 0));
    clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
    opacity: .8;
}

.hd-left, .hd-right { position: relative; z-index: 2; display: flex; align-items: center; }
.hd-left h1 {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 2px;
    background: linear-gradient(180deg, #ffffff 30%, #68c8ff 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 0 24px rgba(0, 160, 255, .35);
}

.live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 14px;
    padding: 3px 10px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #ff5c7c;
    border: 1px solid rgba(255, 92, 124, .6);
    border-radius: 3px;
    background: rgba(255, 92, 124, .12);
}

.live i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #ff5c7c;
    box-shadow: 0 0 8px #ff5c7c;
    animation: blink 1.2s infinite;
}

.hd-sub {
    margin-left: 14px;
    font-size: 14px;
    color: #7fa8dd;
    border-left: 1px solid rgba(127, 168, 221, .35);
    padding-left: 14px;
}

.hd-clock { display: flex; flex-direction: column; align-items: flex-end; margin-right: 20px; }
.clock-time { font-size: 26px; font-weight: 700; color: #eaf4ff; letter-spacing: 1px; font-variant-numeric: tabular-nums; }
.clock-date { font-size: 13px; color: #7fa8dd; }

.hd-status { display: flex; align-items: center; gap: 7px; font-size: 13px; color: #9dc0ee; margin-right: 16px; }
.hd-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #6b7f9c; }
.hd-status .dot.ok { background: #21e6a4; box-shadow: 0 0 9px #21e6a4; }
.hd-status .dot.err { background: #ff5c7c; box-shadow: 0 0 9px #ff5c7c; }

.hd-ops { display: flex; gap: 8px; }
.op-btn {
    cursor: pointer;
    padding: 6px 12px;
    font-size: 13px;
    color: #a9c9f5;
    background: rgba(24, 62, 116, .5);
    border: 1px solid rgba(88, 156, 235, .45);
    border-radius: 3px;
    transition: .2s;
}
.op-btn:hover { color: #fff; border-color: #4da3ff; background: rgba(35, 96, 178, .7); }
.op-btn.on { color: #052; background: #21e6a4; border-color: #21e6a4; font-weight: 700; }

/* ===== KPI ===== */
.kpi { flex: 0 0 108px; display: flex; gap: 12px; }

.kpi-card {
    position: relative;
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: linear-gradient(135deg, rgba(20, 58, 112, .55), rgba(8, 24, 50, .45));
    border: 1px solid rgba(64, 145, 255, .28);
    border-radius: 4px;
    overflow: hidden;
}

.kpi-card::after {
    content: "";
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #00d4ff, #1f6bff);
}

.kpi-label { font-size: 14px; color: #8fb4e6; letter-spacing: 1px; }
.kpi-value {
    font-size: 38px;
    font-weight: 700;
    line-height: 1.15;
    color: #ffffff;
    font-variant-numeric: tabular-nums;
    text-shadow: 0 0 18px rgba(0, 170, 255, .45);
}
.kpi-value.cyan { color: #4fe3ff; }
.kpi-value.blue { color: #6ea8ff; }
.kpi-value.warn { color: #ffb547; }
.kpi-value.danger { color: #ff5c7c; }
.kpi-value.green { color: #21e6a4; }
.kpi-foot { font-size: 12px; color: #6f92bd; }
.kpi-foot b { color: #ffb547; font-size: 14px; }

.kpi-card.alarm::after { background: linear-gradient(180deg, #ff5c7c, #ffb547); }
.kpi-card.alarm.active {
    border-color: rgba(255, 92, 124, .85);
    animation: alarmFlash 1.1s infinite;
}

/* ===== 主体 ===== */
.main { flex: 1; display: flex; gap: 12px; min-height: 0; }
.col { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.col-l { flex: 0 0 460px; }
.col-c { flex: 1; min-width: 0; }
.col-r { flex: 0 0 430px; }

.panel {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 8px 12px 10px;
    background: linear-gradient(180deg, rgba(15, 44, 88, .5), rgba(6, 18, 38, .62));
    border: 1px solid rgba(64, 145, 255, .22);
    border-radius: 4px;
}

.panel::before, .panel::after {
    content: "";
    position: absolute;
    width: 12px; height: 12px;
    border: 2px solid #29a3ff;
}
.panel::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; }
.panel::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }

.panel-hd {
    flex: 0 0 34px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: 1px;
    color: #dcecff;
    border-bottom: 1px solid rgba(64, 145, 255, .18);
}

.dot-line { width: 4px; height: 15px; background: linear-gradient(180deg, #00e5ff, #1f6bff); border-radius: 2px; }
.panel-hd b { color: #ffb547; }

.panel-bd { flex: 1; min-height: 0; position: relative; }
.chart { width: 100%; height: 100%; }

.panel-alert { border-color: rgba(255, 92, 124, .35); }
.panel-alert::before, .panel-alert::after { border-color: #ff5c7c; }

.alert-tag {
    margin-left: auto;
    min-width: 30px;
    padding: 1px 10px;
    font-size: 15px;
    text-align: center;
    color: #fff;
    background: #ff5c7c;
    border-radius: 10px;
    box-shadow: 0 0 12px rgba(255, 92, 124, .6);
}

/* ===== 告警列表 ===== */
.alert-bd { display: flex; }
.alert-list { flex: 1; overflow-y: auto; padding-right: 4px; }
.alert-list::-webkit-scrollbar { width: 4px; }
.alert-list::-webkit-scrollbar-thumb { background: rgba(80, 160, 255, .4); border-radius: 2px; }

.alert-item {
    display: grid;
    grid-template-columns: 150px 1fr 92px;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    padding: 9px 12px;
    background: linear-gradient(90deg, rgba(255, 92, 124, .16), rgba(255, 92, 124, .03));
    border: 1px solid rgba(255, 92, 124, .38);
    border-left: 4px solid #ff5c7c;
    border-radius: 3px;
    animation: itemIn .35s ease;
}

.alert-item.level-danger { animation: itemIn .35s ease, alarmFlash 1s infinite; }
.alert-item.level-half {
    background: linear-gradient(90deg, rgba(255, 181, 71, .22), rgba(255, 181, 71, .05));
    border-color: rgba(255, 181, 71, .55);
    border-left-color: #ffb547;
    animation: itemIn .35s ease, halfFlash 2.5s infinite;
}
.alert-item.level-half .countdown .cd-value { color: #ffb547; text-shadow: 0 0 12px rgba(255, 181, 71, .55); }
.alert-item.level-half .countdown .cd-label { color: #ffc77a; }

.countdown { text-align: center; }
.countdown .cd-value {
    font-size: 26px;
    font-weight: 700;
    color: #ff5c7c;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    text-shadow: 0 0 14px rgba(255, 92, 124, .55);
}
.countdown .cd-label { font-size: 12px; color: #ff97ab; }

.alert-main { min-width: 0; }
.alert-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.alert-meta { margin-top: 4px; font-size: 13px; color: #96b6dd; }
.alert-meta span { margin-right: 14px; }
.alert-meta .tag {
    display: inline-block;
    padding: 0 6px;
    margin-right: 6px;
    color: #ffd7a1;
    background: rgba(255, 181, 71, .16);
    border: 1px solid rgba(255, 181, 71, .4);
    border-radius: 2px;
}
.alert-meta .tag-danger {
    color: #fff;
    background: rgba(255, 92, 124, .32);
    border-color: #ff5c7c;
    animation: blink 1.2s infinite;
}
.alert-meta .zero { color: #ff5c7c; font-weight: 700; }
.alert-meta .has { color: #21e6a4; font-weight: 700; }

.alert-link {
    display: block;
    text-align: center;
    padding: 7px 0;
    font-size: 13px;
    color: #bfe4ff;
    text-decoration: none;
    border: 1px solid rgba(80, 170, 255, .5);
    border-radius: 3px;
    transition: .2s;
}
.alert-link:hover { color: #fff; background: rgba(40, 120, 220, .55); }

.empty {
    position: absolute;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    color: #5e83b3;
    letter-spacing: 1px;
}
.empty.show { display: flex; }

/* ===== 历史告警 ===== */
.panel-hd .hd-tag {
    margin-left: auto;
    padding: 2px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #ffb547;
    background: rgba(255, 181, 71, .12);
    border: 1px solid rgba(255, 181, 71, .4);
    border-radius: 10px;
}

.history-list { height: 100%; overflow-y: auto; padding-right: 4px; }
.history-list::-webkit-scrollbar { width: 4px; }
.history-list::-webkit-scrollbar-thumb { background: rgba(80, 160, 255, .4); }

.history-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 10px;
    margin-bottom: 6px;
    font-size: 13px;
    background: rgba(255, 92, 124, .08);
    border-left: 3px solid rgba(255, 92, 124, .7);
}
.history-item .h-name {
    flex: 1;
    min-width: 0;
    color: #d7e8ff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.history-item .h-time { color: #ff97ab; font-variant-numeric: tabular-nums; }
.history-item .h-area { color: #7fa8dd; }

/* ===== 待截止项目列表(横向行, 不滚动) ===== */
.up-list { height: 100%; overflow-y: auto; padding-right: 4px; }
.up-list::-webkit-scrollbar { width: 4px; }
.up-list::-webkit-scrollbar-thumb { background: rgba(80, 160, 255, .4); }

.up-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 7px;
    font-size: 13px;
    background: rgba(0, 229, 255, .06);
    border-left: 3px solid rgba(0, 229, 255, .7);
    cursor: pointer;
    transition: background .18s, border-color .18s;
}
.up-item:hover {
    background: rgba(0, 229, 255, .16);
    border-left-color: #00e5ff;
}
.up-item.danger {
    background: rgba(255, 92, 124, .08);
    border-left-color: rgba(255, 92, 124, .75);
}
.up-item.danger:hover {
    background: rgba(255, 92, 124, .18);
    border-left-color: #ff5c7c;
}

.up-cd {
    flex: 0 0 98px;
    font-size: 16px;
    font-weight: 700;
    color: #ffb547;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0;
}
.up-item.danger .up-cd { color: #ff5c7c; }

.up-name {
    flex: 1;
    min-width: 0;
    color: #d7e8ff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.up-area { flex: 0 0 auto; color: #7fa8dd; white-space: nowrap; }
.up-end { flex: 0 0 auto; color: #6f92bd; white-space: nowrap; font-variant-numeric: tabular-nums; }
.up-item .zero { flex: 0 0 auto; color: #ff5c7c; white-space: nowrap; }
.up-item .has { flex: 0 0 auto; color: #21e6a4; white-space: nowrap; }
.up-go { flex: 0 0 auto; margin-left: -4px; color: #4d6f9c; font-size: 17px; line-height: 1; }
.up-item:hover .up-go { color: #00e5ff; }

/* ===== 底部状态栏 ===== */
.ft {
    flex: 0 0 40px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 0 14px;
    background: rgba(10, 30, 62, .55);
    border: 1px solid rgba(64, 145, 255, .22);
    border-radius: 4px;
}

.ft-tag {
    flex: 0 0 auto;
    padding: 4px 12px;
    font-size: 14px;
    font-weight: 700;
    color: #041c33;
    background: linear-gradient(90deg, #00e5ff, #1f9bff);
    border-radius: 3px;
}

.ft-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 26px;
    font-size: 13px;
    color: #7fa8dd;
}
.ft-info b { color: #bcd8f8; font-weight: 600; }
.ft-info i { font-style: normal; color: #ffb547; }

/* ===== 弹窗提示 ===== */
.toast-wrap {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 340px;
    max-width: 520px;
    padding: 12px 16px;
    background: linear-gradient(90deg, rgba(255, 92, 124, .3), rgba(24, 44, 82, .95));
    border: 1px solid rgba(255, 92, 124, .7);
    border-left: 4px solid #ff5c7c;
    border-radius: 4px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .5);
    animation: toastIn .3s ease;
}
.toast .t-title { font-size: 15px; font-weight: 700; color: #ffd0d9; margin-bottom: 4px; }
.toast .t-body { font-size: 13px; color: #dfeeff; }

/* ===== 接口配置 ===== */
.cfg-mask {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(2, 8, 18, .82);
}
.cfg-mask.show { display: flex; }

.cfg-box {
    width: 520px;
    padding: 26px 28px;
    background: linear-gradient(180deg, #10264a, #081428);
    border: 1px solid rgba(80, 160, 255, .5);
    border-radius: 6px;
}
.cfg-box h3 { font-size: 20px; color: #ff8fa4; margin-bottom: 10px; }
.cfg-box p { font-size: 14px; color: #9dc0ee; line-height: 1.7; }
.cfg-box code { color: #ffd479; }
.cfg-box input {
    width: 100%;
    margin: 12px 0;
    padding: 9px 12px;
    font-size: 14px;
    color: #eaf4ff;
    background: rgba(3, 14, 32, .9);
    border: 1px solid rgba(80, 160, 255, .45);
    border-radius: 3px;
    outline: none;
}
.cfg-btns { display: flex; gap: 10px; }
.cfg-btns button {
    cursor: pointer;
    padding: 8px 18px;
    font-size: 14px;
    color: #041c33;
    font-weight: 700;
    background: linear-gradient(90deg, #00e5ff, #1f9bff);
    border: 0;
    border-radius: 3px;
}
.cfg-btns .ghost { color: #a9c9f5; background: rgba(24, 62, 116, .6); font-weight: 400; }
.cfg-tip { margin-top: 12px; font-size: 12px; color: #6f92bd; }

/* ===== 动画 ===== */
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes alarmFlash {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 92, 124, 0); background-color: rgba(255, 92, 124, .1); }
    50% { box-shadow: 0 0 22px rgba(255, 92, 124, .55); background-color: rgba(255, 92, 124, .26); }
}
@keyframes halfFlash {
    0%, 100% { box-shadow: 0 0 0 rgba(255, 181, 71, 0); }
    50% { box-shadow: 0 0 16px rgba(255, 181, 71, .45); }
}
@keyframes itemIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: none; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
