:root {
    --sp-brand: #0863c4;
    --sp-brand-light: #38bdf8;
    --sp-accent: #c8ff00;
    --sp-deep: #040a12;
    --sp-surface: rgba(12, 22, 36, 0.72);
    --sp-surface-solid: #0c1624;
    --sp-border: rgba(56, 189, 248, 0.14);
    --sp-border-bright: rgba(200, 255, 0, 0.22);
    --sp-text: #eef4fc;
    --sp-muted: #8ba4bc;
    --sp-ok: #34d399;
    --sp-warn: #fbbf24;
    --sp-partial: #fb923c;
    --sp-down: #f87171;
    --sp-maint: #818cf8;
    --sp-glow: rgba(56, 189, 248, 0.35);
    --sp-font: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: var(--sp-font);
    background: var(--sp-deep);
    color: var(--sp-text);
    -webkit-font-smoothing: antialiased;
}

/* ── Animated background ── */
.sp-bg {
    pointer-events: none;
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, rgba(8, 99, 196, 0.38), transparent 55%),
        radial-gradient(ellipse 45% 35% at 100% 0%, rgba(200, 255, 0, 0.05), transparent 50%),
        linear-gradient(180deg, #040a12 0%, #081420 50%, #0a1828 100%);
}

.sp-bg-grid {
    position: absolute;
    inset: -50%;
    background-image:
        linear-gradient(rgba(56, 189, 248, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(56, 189, 248, 0.04) 1px, transparent 1px);
    background-size: 48px 48px;
    transform: perspective(500px) rotateX(58deg);
    animation: sp-grid-drift 28s linear infinite;
    mask-image: radial-gradient(ellipse 70% 55% at 50% 35%, #000 20%, transparent 75%);
}

.sp-bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.45;
    animation: sp-glow-float 14s ease-in-out infinite;
}

.sp-bg-glow--a {
    width: 420px;
    height: 420px;
    left: -120px;
    top: 10%;
    background: rgba(8, 99, 196, 0.35);
}

.sp-bg-glow--b {
    width: 320px;
    height: 320px;
    right: -80px;
    bottom: 15%;
    background: rgba(200, 255, 0, 0.08);
    animation-delay: -7s;
}

.sp-bg-scan {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(56, 189, 248, 0.03) 50%, transparent 100%);
    background-size: 100% 8px;
    animation: sp-scan 6s linear infinite;
    opacity: 0.5;
}

@keyframes sp-grid-drift {
    from { transform: perspective(500px) rotateX(58deg) translateY(0); }
    to   { transform: perspective(500px) rotateX(58deg) translateY(48px); }
}

@keyframes sp-glow-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(24px, -18px) scale(1.08); }
}

@keyframes sp-scan {
    from { background-position: 0 -100%; }
    to   { background-position: 0 200%; }
}

/* ── Layout ── */
.sp-wrap {
    position: relative;
    z-index: 1;
    max-width: 800px;
    margin: 0 auto;
    padding: 28px 20px 72px;
}

/* ── Entrance animations ── */
.sp-animate {
    opacity: 0;
    transform: translateY(18px);
    animation: sp-fade-up 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sp-animate--1 { animation-delay: 0.05s; }
.sp-animate--2 { animation-delay: 0.12s; }
.sp-animate--3 { animation-delay: 0.2s; }
.sp-animate--4 { animation-delay: 0.45s; }
.sp-animate--5 { animation-delay: 0.52s; }
.sp-animate--6 { animation-delay: 0.58s; }

.sp-components .sp-component {
    opacity: 0;
    animation: sp-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.sp-components .sp-component:nth-child(1) { animation-delay: 0.24s; }
.sp-components .sp-component:nth-child(2) { animation-delay: 0.3s; }
.sp-components .sp-component:nth-child(3) { animation-delay: 0.36s; }
.sp-components .sp-component:nth-child(4) { animation-delay: 0.42s; }
.sp-components .sp-component:nth-child(5) { animation-delay: 0.48s; }
.sp-components .sp-component:nth-child(6) { animation-delay: 0.54s; }

@keyframes sp-fade-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Header ── */
.sp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 36px;
    flex-wrap: wrap;
}

.sp-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    color: inherit;
}

.sp-logo-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.03));
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.14);
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.sp-logo:hover .sp-logo-frame {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(8, 99, 196, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.sp-logo-img {
    display: block;
    height: 28px;
    width: auto;
    max-width: 132px;
    object-fit: contain;
    filter: drop-shadow(0 0 12px rgba(56, 189, 248, 0.35));
}

.sp-logo-sub {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--sp-brand-light);
    margin-top: 2px;
}

.sp-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* ── Language switcher (same as homepage / maintenance page) ── */
.status-page .locale-switch-bundle.locale-switch--compact .locale-switch-label-row {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0 16px 0 12px;
    min-height: 38px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    backdrop-filter: blur(8px);
    transition: border-color 0.2s, background 0.2s;
}

.status-page .locale-switch-bundle.locale-switch--compact .locale-switch-label-row:hover {
    border-color: rgba(200, 255, 0, 0.35);
    background: rgba(255, 255, 255, 0.1);
}

.status-page .locale-switch-bundle.locale-switch--compact .locale-switch-visual,
.status-page .locale-switch-bundle.locale-switch--compact .frontend-locale-select {
    transform: none;
}

.status-page .locale-switch-bundle.locale-switch--compact .locale-switch-visual {
    font-size: 15px;
    opacity: 0.9;
}

.status-page .locale-switch-bundle.locale-switch--compact .frontend-locale-select {
    border: 0;
    background: transparent;
    color: var(--sp-text);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0 20px 0 0;
    min-width: 108px;
    cursor: pointer;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23c8ff00' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right center;
}

.status-page .locale-switch-bundle.locale-switch--compact .frontend-locale-select option {
    color: #0f172a;
    background: #fff;
}

.status-page .locale-switch-hint {
    display: none;
}

.sp-home-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    font-weight: 600;
    color: var(--sp-brand-light);
    text-decoration: none;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid var(--sp-border);
    background: rgba(8, 99, 196, 0.12);
    transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.sp-home-link:hover {
    background: rgba(8, 99, 196, 0.22);
    border-color: rgba(56, 189, 248, 0.35);
    transform: translateY(-1px);
}

/* ── Overall banner ── */
.sp-banner {
    text-align: center;
    padding: 32px 24px 28px;
    border-radius: 20px;
    margin-bottom: 28px;
    border: 1px solid var(--sp-border);
    background: var(--sp-surface);
    backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.sp-banner::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg, transparent 40%, rgba(255, 255, 255, 0.04) 50%, transparent 60%);
    transform: translateX(-120%);
    animation: sp-shimmer 5s ease-in-out infinite;
}

@keyframes sp-shimmer {
    0%, 70%, 100% { transform: translateX(-120%); }
    85%           { transform: translateX(120%); }
}

.sp-banner--operational {
    border-color: rgba(52, 211, 153, 0.35);
    box-shadow: 0 0 48px rgba(52, 211, 153, 0.1), inset 0 1px 0 rgba(52, 211, 153, 0.12);
}

.sp-banner--degraded {
    border-color: rgba(251, 191, 36, 0.4);
    box-shadow: 0 0 48px rgba(251, 191, 36, 0.1);
}

.sp-banner--partial,
.sp-banner--major {
    border-color: rgba(248, 113, 113, 0.4);
    box-shadow: 0 0 48px rgba(248, 113, 113, 0.12);
}

.sp-banner--maintenance {
    border-color: rgba(129, 140, 248, 0.4);
}

.sp-banner-icon {
    position: relative;
    width: 52px;
    height: 52px;
    margin: 0 auto 16px;
}

.sp-pulse-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0.35;
    animation: sp-pulse-ring 2.4s ease-out infinite;
}

.sp-pulse-core {
    position: absolute;
    inset: 14px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 20px currentColor;
}

.sp-banner--operational .sp-banner-icon { color: var(--sp-ok); }
.sp-banner--degraded .sp-banner-icon   { color: var(--sp-warn); }
.sp-banner--partial .sp-banner-icon,
.sp-banner--major .sp-banner-icon       { color: var(--sp-down); }
.sp-banner--maintenance .sp-banner-icon { color: var(--sp-maint); }

@keyframes sp-pulse-ring {
    0%   { transform: scale(0.85); opacity: 0.5; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

.sp-banner h1 {
    margin: 0 0 10px;
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 800;
    letter-spacing: -0.03em;
    position: relative;
}

.sp-banner-meta {
    font-size: 13px;
    color: var(--sp-muted);
    position: relative;
}

.sp-banner-meta time {
    color: var(--sp-brand-light);
    font-variant-numeric: tabular-nums;
}

/* ── Section head ── */
.sp-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}

.sp-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sp-muted);
    margin: 0;
}

.sp-live-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--sp-ok);
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(52, 211, 153, 0.1);
    border: 1px solid rgba(52, 211, 153, 0.25);
}

.sp-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--sp-ok);
    box-shadow: 0 0 8px var(--sp-ok);
    animation: sp-live-blink 1.8s ease-in-out infinite;
}

@keyframes sp-live-blink {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: 0.45; transform: scale(0.85); }
}

/* ── Components list ── */
.sp-components {
    list-style: none;
    margin: 0 0 32px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sp-component {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border-radius: 14px;
    border: 1px solid var(--sp-border);
    background: var(--sp-surface);
    backdrop-filter: blur(12px);
    transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.sp-component:hover {
    border-color: rgba(56, 189, 248, 0.28);
    transform: translateX(4px);
    box-shadow: -4px 0 0 var(--sp-brand-light), 0 8px 28px rgba(0, 0, 0, 0.22);
}

.sp-component-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 99, 196, 0.18);
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--sp-brand-light);
}

.sp-component-icon svg {
    width: 20px;
    height: 20px;
}

.sp-component-info {
    flex: 1;
    min-width: 0;
}

.sp-component-info h3 {
    margin: 0 0 3px;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sp-component-info p {
    margin: 0;
    font-size: 13px;
    color: var(--sp-muted);
}

.sp-component-msg {
    margin: 6px 0 0;
    font-size: 12px;
    color: #fcd34d;
}

.sp-status-pill {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: 700;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: transform 0.2s;
}

.sp-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 0 6px currentColor;
    animation: sp-status-pulse 2s ease-in-out infinite;
}

@keyframes sp-status-pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.55; }
}

.sp-status-pill--operational {
    background: rgba(52, 211, 153, 0.12);
    color: var(--sp-ok);
    border: 1px solid rgba(52, 211, 153, 0.28);
}

.sp-status-pill--degraded {
    background: rgba(251, 191, 36, 0.12);
    color: var(--sp-warn);
    border: 1px solid rgba(251, 191, 36, 0.28);
}

.sp-status-pill--partial {
    background: rgba(251, 146, 60, 0.12);
    color: var(--sp-partial);
    border: 1px solid rgba(251, 146, 60, 0.28);
}

.sp-status-pill--major {
    background: rgba(248, 113, 113, 0.12);
    color: var(--sp-down);
    border: 1px solid rgba(248, 113, 113, 0.28);
}

.sp-status-pill--maintenance {
    background: rgba(129, 140, 248, 0.12);
    color: var(--sp-maint);
    border: 1px solid rgba(129, 140, 248, 0.28);
}

/* ── Legend ── */
.sp-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    font-size: 12px;
    color: var(--sp-muted);
    margin-bottom: 36px;
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--sp-border);
}

.sp-legend span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.sp-legend span::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    box-shadow: 0 0 6px currentColor;
}

.sp-legend .ok::before   { background: var(--sp-ok); color: var(--sp-ok); }
.sp-legend .warn::before { background: var(--sp-warn); color: var(--sp-warn); }
.sp-legend .part::before { background: var(--sp-partial); color: var(--sp-partial); }
.sp-legend .down::before { background: var(--sp-down); color: var(--sp-down); }

/* ── Incidents ── */
.sp-incidents {
    margin-bottom: 32px;
}

.sp-incidents > .sp-section-title {
    margin-bottom: 14px;
}

.sp-day {
    margin-bottom: 22px;
}

.sp-day h4 {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sp-brand-light);
    letter-spacing: 0.04em;
}

.sp-incident {
    padding: 14px 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--sp-border);
    margin-bottom: 8px;
    transition: border-color 0.2s;
}

.sp-incident:hover {
    border-color: rgba(56, 189, 248, 0.22);
}

.sp-incident-title {
    margin: 0 0 5px;
    font-size: 14px;
    font-weight: 600;
}

.sp-incident-meta {
    font-size: 12px;
    color: var(--sp-muted);
}

.sp-incident-meta strong {
    color: var(--sp-ok);
    font-weight: 700;
}

.sp-empty {
    font-size: 14px;
    color: var(--sp-muted);
    padding: 16px;
    border-radius: 12px;
    border: 1px dashed var(--sp-border);
    text-align: center;
}

/* ── Footer ── */
.sp-footer {
    text-align: center;
    font-size: 12px;
    color: var(--sp-muted);
    padding-top: 28px;
    border-top: 1px solid var(--sp-border);
    line-height: 1.8;
}

.sp-footer a {
    color: var(--sp-accent);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.sp-footer a:hover {
    color: var(--sp-brand-light);
}

/* ── Loading state ── */
.sp-loading .sp-live-dot {
    animation-duration: 0.6s;
}

.sp-loading .sp-components {
    opacity: 0.65;
    transition: opacity 0.25s;
}

/* ── Responsive ── */
@media (max-width: 560px) {
    .sp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .sp-header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .sp-component {
        flex-wrap: wrap;
    }

    .sp-status-pill {
        margin-left: 52px;
    }

    .sp-banner {
        padding: 26px 18px 22px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-animate,
    .sp-components .sp-component,
    .sp-bg-grid,
    .sp-bg-glow,
    .sp-bg-scan,
    .sp-banner::before,
    .sp-pulse-ring,
    .sp-live-dot,
    .sp-status-dot {
        animation: none !important;
        opacity: 1;
        transform: none;
    }
}
