:root {
    --bg: #040710;
    --bg-accent: radial-gradient(circle at 20% 20%, rgba(47, 128, 237, 0.25), transparent 60%),
                  radial-gradient(circle at 80% 0%, rgba(67, 206, 162, 0.25), transparent 55%),
                  #040710;
    --card-bg: rgba(8, 14, 30, 0.85);
    --border: rgba(255, 255, 255, 0.08);
    --text: #f8fafc;
    --text-muted: rgba(248, 250, 252, 0.7);
    --pill-operational: #34d399;
    --pill-degraded: #fbbf24;
    --pill-down: #f87171;
    --glass-blur: blur(14px);
    --shadow-strong: 0 25px 80px rgba(0, 0, 0, 0.45);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding-top: 96px;
    font-family: 'Inter', 'PingFang SC', 'Microsoft YaHei', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg-accent);
    min-height: 100vh;
}

.status-main {
    width: min(1200px, 94%);
    margin: 24px auto 100px;
    display: flex;
    flex-direction: column;
    gap: 48px;
}

.status-hero {
    background: linear-gradient(135deg, rgba(18, 24, 49, 0.9), rgba(12, 18, 36, 0.85));
    border: 1px solid var(--border);
    border-radius: 28px;
    padding: 48px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-strong);
}

.status-hero::after,
.status-hero::before {
    content: '';
    position: absolute;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.25), transparent 70%);
    filter: blur(10px);
    z-index: 0;
}

.status-hero::after {
    top: -120px;
    right: -40px;
}

.status-hero::before {
    bottom: -160px;
    left: -40px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.25), transparent 70%);
}

.status-hero > * {
    position: relative;
    z-index: 1;
}

.status-hero h1 {
    font-size: clamp(2.2rem, 3vw, 3rem);
    margin: 16px 0 12px;
    letter-spacing: -1px;
}

.status-hero p {
    margin: 0;
    color: var(--text-muted);
    font-size: 1.05rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-transform: uppercase;
}

.status-pill::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text);
}

.status-pill[data-state='operational']::before {
    background: var(--pill-operational);
    box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
}

.status-pill[data-state='degraded']::before {
    background: var(--pill-degraded);
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.8);
}

.status-pill[data-state='incident']::before,
.status-pill[data-state='down']::before {
    background: var(--pill-down);
    box-shadow: 0 0 12px rgba(248, 113, 113, 0.7);
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-top: 18px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.hero-meta i {
    margin-right: 6px;
}

.overall-stats {
    margin-top: 32px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.overall-card {
    border-radius: 18px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.overall-card .label {
    font-size: 0.95rem;
    color: var(--text-muted);
    letter-spacing: 0.02em;
}

.overall-card strong {
    font-size: 2.2rem;
    font-family: 'JetBrains Mono', monospace;
}

.overall-card[data-state='operational'] strong {
    color: var(--pill-operational);
}

.overall-card[data-state='degraded'] strong {
    color: var(--pill-degraded);
}

.overall-card[data-state='down'] strong {
    color: var(--pill-down);
}

.status-section {
    background: var(--card-bg);
    border-radius: 26px;
    border: 1px solid var(--border);
    padding: 40px;
    box-shadow: var(--shadow-strong);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

.section-header h2 {
    margin: 8px 0 0;
    font-size: 1.6rem;
}

.section-header .eyebrow {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-note {
    color: rgba(248, 250, 252, 0.6);
    font-size: 0.9rem;
}

.ghost-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text);
    border-radius: 14px;
    padding: 8px 18px;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: border 0.15s ease, transform 0.15s;
}

.ghost-btn:hover {
    border-color: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

.service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 18px;
}

.service-card {
    padding: 24px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: var(--glass-blur);
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: relative;
}

.service-card .card-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.status-dot {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.92rem;
    color: var(--text-muted);
}

.status-dot::before {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-dot[data-state='operational']::before {
    background: var(--pill-operational);
    box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
}

.status-dot[data-state='degraded']::before {
    background: var(--pill-degraded);
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.6);
}

.status-dot[data-state='down']::before {
    background: var(--pill-down);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.6);
}

.service-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.service-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.skeleton {
    position: relative;
    overflow: hidden;
}

.skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.07) 40%, transparent 80%);
    animation: shimmer 1.5s infinite;
}

.skeleton-line {
    height: 18px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 999px;
    margin-bottom: 12px;
}

.skeleton-line.short {
    width: 60%;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.legend {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.dot.major { background: var(--pill-down); box-shadow: 0 0 10px rgba(248, 113, 113, 0.5); }
.dot.minor { background: var(--pill-degraded); box-shadow: 0 0 10px rgba(251, 191, 36, 0.5); }

.incident-board {
    display: grid;
    gap: 18px;
}

.incident-card {
    border-radius: 20px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
}

.incident-card header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.incident-card .tag {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.incident-card[data-impact='major'] .tag {
    background: rgba(248, 113, 113, 0.15);
    color: #fecaca;
}

.incident-card[data-impact='minor'] .tag {
    background: rgba(251, 191, 36, 0.15);
    color: #fde68a;
}

.incident-card .time {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.incident-card ul {
    padding-left: 20px;
    color: var(--text-muted);
}

.incident-empty {
    display: grid;
    place-items: center;
    gap: 12px;
    padding: 40px;
    color: var(--text-muted);
    border: 1px dashed rgba(255, 255, 255, 0.2);
    border-radius: 20px;
}

.incident-empty i {
    font-size: 2rem;
    color: var(--pill-operational);
}

.model-groups {
    display: grid;
    gap: 20px;
}

.model-group {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 24px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.03);
}

.group-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.group-head .title {
    font-size: 1.2rem;
    font-weight: 600;
}

.group-head .count {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.model-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.model-card {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    padding: 16px;
    background: rgba(255, 255, 255, 0.02);
}

.model-card .model-name {
    font-weight: 600;
    margin: 0;
}

.model-card .model-meta {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.model-card .status-label {
    margin-top: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.model-card .status-label::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.model-card[data-state='operational'] .status-label::before {
    background: var(--pill-operational);
}

.model-card[data-state='degraded'] .status-label::before {
    background: var(--pill-degraded);
}

.model-card[data-state='down'] .status-label::before {
    background: var(--pill-down);
}

.model-placeholder {
    height: 120px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .status-main {
        padding-top: 20px;
        margin-top: 30px;
        gap: 32px;
    }

    .status-hero,
    .status-section {
        padding: 28px;
    }

    .overall-stats {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }
}
