/* ============ 状态页样式 · 现代卡片风 ============ */
:root {
    --bg: #f5f6f8;
    --bg-accent: radial-gradient(1200px 400px at 50% -80px, #e8f4ee 0%, rgba(232,244,238,0) 70%);
    --card: #ffffff;
    --border: #e7eaef;
    --border-strong: #d8dde4;
    --text: #17202a;
    --muted: #6b7480;
    --faint: #98a1ab;

    --green: #16a34a;
    --green-soft: #e5f6ec;
    --orange: #d97706;
    --orange-soft: #fdf1de;
    --red: #dc2626;
    --red-soft: #fdeaea;
    --gray: #d6dae0;

    --shadow: 0 1px 2px rgba(23,32,42,.04), 0 4px 16px rgba(23,32,42,.05);
    --shadow-hover: 0 2px 4px rgba(23,32,42,.06), 0 10px 28px rgba(23,32,42,.09);
    --radius: 14px;
}
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1419;
        --bg-accent: radial-gradient(1200px 400px at 50% -80px, #10241a 0%, rgba(16,36,26,0) 70%);
        --card: #161c23;
        --border: #262e37;
        --border-strong: #333d47;
        --text: #e8edf2;
        --muted: #98a4b0;
        --faint: #6d7885;

        --green: #34d399;
        --green-soft: #12301f;
        --orange: #fbbf24;
        --orange-soft: #33270f;
        --red: #f87171;
        --red-soft: #331a1a;
        --gray: #333d47;

        --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25);
        --shadow-hover: 0 2px 4px rgba(0,0,0,.35), 0 10px 28px rgba(0,0,0,.4);
    }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    background-image: var(--bg-accent);
    background-repeat: no-repeat;
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: 920px; margin: 0 auto; padding: 48px 20px 64px; }

/* ---------- 页头 ---------- */
.page-head { text-align: center; margin-bottom: 26px; }
.page-head h1 {
    font-size: 30px; font-weight: 700; letter-spacing: -.4px; margin: 0 0 8px;
}
.page-head .sub {
    margin: 0; color: var(--muted); font-size: 14px;
    display: inline-flex; align-items: center; gap: 8px;
}
.live-pill {
    display: inline-flex; align-items: center; gap: 7px;
    background: var(--card); border: 1px solid var(--border);
    border-radius: 999px; padding: 3px 12px;
    font-size: 12.5px; color: var(--muted); box-shadow: var(--shadow);
}
.live-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--green);
    position: relative; flex: none;
}
.live-dot::after {
    content: ''; position: absolute; inset: -4px; border-radius: 50%;
    border: 2px solid var(--green); opacity: .5;
    animation: pulse 1.8s ease-out infinite;
}
@keyframes pulse {
    0%   { transform: scale(.5); opacity: .7; }
    100% { transform: scale(1.6); opacity: 0; }
}

/* ---------- 总体横幅 ---------- */
.banner {
    display: flex; align-items: center; justify-content: space-between;
    gap: 18px; flex-wrap: wrap;
    border-radius: var(--radius); padding: 22px 26px; margin-bottom: 12px;
    border: 1px solid var(--border); background: var(--card);
    box-shadow: var(--shadow);
    animation: rise .35s ease both;
}
.banner-main { display: flex; align-items: center; gap: 16px; font-size: 21px; font-weight: 700; letter-spacing: -.2px; }
.banner-icon {
    display: inline-flex; width: 52px; height: 52px; border-radius: 14px;
    align-items: center; justify-content: center; flex: none;
}
.banner-text small { display: block; font-size: 12.5px; font-weight: 400; color: var(--muted); letter-spacing: 0; margin-top: 2px; }

.banner-up       .banner-icon { background: var(--green-soft);  color: var(--green); }
.banner-degraded .banner-icon { background: var(--orange-soft); color: var(--orange); }
.banner-down     .banner-icon { background: var(--red-soft);    color: var(--red); }
.banner-nodata   .banner-icon { background: var(--gray);        color: var(--muted); }
.banner-up       { border-left: 4px solid var(--green); }
.banner-degraded { border-left: 4px solid var(--orange); }
.banner-down     { border-left: 4px solid var(--red); }
.banner-nodata   { border-left: 4px solid var(--gray); }

.banner-side { text-align: right; color: var(--muted); font-size: 13px; }
.banner-side b {
    display: block; font-size: 26px; font-weight: 700; letter-spacing: -.5px;
    color: var(--text); line-height: 1.25;
}

/* ---------- 图例 ---------- */
.legend {
    display: flex; gap: 18px; flex-wrap: wrap; justify-content: flex-end;
    color: var(--muted); font-size: 12.5px; margin: 2px 4px 18px;
}
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i {
    width: 12px; height: 12px; border-radius: 3px; display: inline-block; flex: none;
}
.legend .lg-up       { background: var(--green); }
.legend .lg-degraded { background: var(--orange); }
.legend .lg-down     { background: var(--red); }
.legend .lg-empty    { background: var(--gray); }

/* ---------- 卡片 ---------- */
.card {
    background: var(--card); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px 24px; margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: box-shadow .18s ease, transform .18s ease;
    animation: rise .35s ease both;
}
.card:hover { box-shadow: var(--shadow-hover); }
.empty-card { color: var(--muted); text-align: center; padding: 34px 20px; }

@keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ---------- 监控项 ---------- */
.component-head {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.component-name { font-weight: 600; font-size: 16px; display: flex; align-items: center; gap: 9px; }
.component-uptime { color: var(--muted); font-size: 13px; }
.component-uptime b { color: var(--text); font-weight: 600; }

.dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.dot-up       { background: var(--green);  box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.dot-degraded { background: var(--orange); box-shadow: 0 0 0 3px rgba(217,119,6,.18); }
.dot-down     { background: var(--red);    box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.dot-nodata   { background: var(--faint);  box-shadow: 0 0 0 3px rgba(152,161,171,.18); }

.state-badge { font-size: 12px; font-weight: 500; padding: 2px 10px; border-radius: 999px; }
.state-degraded { background: var(--orange-soft); color: var(--orange); }
.state-down     { background: var(--red-soft);    color: var(--red); }

/* ---------- 90 天柱状条 ---------- */
.bars { display: flex; gap: 2px; height: 36px; align-items: stretch; }
.bar {
    flex: 1 1 0; min-width: 1px; border-radius: 2.5px;
    background: var(--gray); cursor: default; position: relative;
    transition: transform .1s ease, filter .1s ease;
    transform-origin: bottom;
}
.bar:hover { transform: scaleY(1.18); filter: brightness(1.08); z-index: 2; }
.bar-up       { background: var(--green); }
.bar-up       { background: linear-gradient(180deg, color-mix(in srgb, var(--green) 82%, #fff), var(--green)); }
.bar-degraded { background: var(--orange); }
.bar-degraded { background: linear-gradient(180deg, color-mix(in srgb, var(--orange) 82%, #fff), var(--orange)); }
.bar-down     { background: var(--red); }
.bar-down     { background: linear-gradient(180deg, color-mix(in srgb, var(--red) 82%, #fff), var(--red)); }
.bars-axis {
    display: flex; justify-content: space-between;
    color: var(--faint); font-size: 12px; margin-top: 7px;
    padding: 0 1px;
}

/* ---------- 悬浮提示 ---------- */
.tooltip {
    position: fixed; z-index: 50; pointer-events: none;
    background: var(--text); color: var(--bg);
    border-radius: 10px; padding: 10px 13px;
    font-size: 12.5px; line-height: 1.6;
    box-shadow: 0 8px 24px rgba(0,0,0,.28);
    max-width: 260px;
    opacity: 0; transform: translateY(4px);
    transition: opacity .12s ease, transform .12s ease;
}
.tooltip.show { opacity: 1; transform: translateY(0); }
.tooltip .tip-title { font-weight: 700; margin-bottom: 2px; }
.tooltip .tip-sub { opacity: .75; }

/* ---------- 事件 ---------- */
.incidents h2 {
    font-size: 20px; font-weight: 700; letter-spacing: -.3px;
    margin: 36px 0 6px;
}
.incidents .inc-sub { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.incident { position: relative; }
.incident-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.incident-head h3 { margin: 0; font-size: 15.5px; font-weight: 600; }
.incident-meta { color: var(--muted); font-size: 13px; margin: 7px 0 14px; }

.badge {
    font-size: 12px; font-weight: 600; padding: 2px 10px;
    border-radius: 999px; flex: none; letter-spacing: .2px;
}
.badge-investigating { background: var(--red-soft);    color: var(--red); }
.badge-monitoring    { background: var(--orange-soft); color: var(--orange); }
.badge-resolved      { background: var(--green-soft);  color: var(--green); }

.updates {
    display: flex; flex-direction: column; gap: 0;
    border-top: 1px solid var(--border); padding-top: 14px;
    margin-top: 4px;
}
.update {
    display: flex; gap: 12px; align-items: flex-start;
    position: relative; padding-bottom: 14px;
}
.update:not(:last-child)::before {
    content: ''; position: absolute; left: 15px; top: 30px; bottom: 0;
    width: 2px; background: var(--border); border-radius: 2px;
}
.update .badge { margin-top: 1px; }
.update-body { flex: 1; min-width: 0; }
.update-msg { font-size: 14px; }
.update-time { color: var(--faint); font-size: 12px; margin-top: 1px; }

/* ---------- 页脚 ---------- */
.foot {
    text-align: center; color: var(--faint); font-size: 13px; margin-top: 40px;
    display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap;
}
.foot .sep { opacity: .5; }

@media (max-width: 560px) {
    .wrap { padding: 30px 12px 44px; }
    .page-head h1 { font-size: 24px; }
    .banner { padding: 18px 18px; }
    .banner-main { font-size: 18px; }
    .banner-icon { width: 44px; height: 44px; }
    .banner-side b { font-size: 21px; }
    .bars { height: 28px; gap: 1px; }
    .card { padding: 16px 16px; }
}
