:root {
    --bg-deep: #050507;
    --primary: #00f2ea;
    --primary-glow: rgba(0, 242, 234, 0.4);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.4);
    --danger: #ef4444;
    --danger-glow: rgba(239, 68, 68, 0.4);
    --text-main: #ffffff;
    --text-muted: #94a3b8;
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-highlight: rgba(255, 255, 255, 0.1);
    --card-radius: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-deep);
    color: var(--text-main);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(76, 29, 149, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(16, 185, 129, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

/* 动态光效背景 */
.ambient-glow {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
    background: 
        radial-gradient(circle at 50% -20%, rgba(0, 242, 234, 0.05), transparent 70%);
}

/* Container */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    position: relative;
    z-index: 1;
}

/* Header */
#header {
    padding: 60px 0 40px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 1px solid var(--glass-border);
    margin-bottom: 60px;
    position: relative;
}

#header::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100px;
    height: 1px;
    background: linear-gradient(90deg, var(--primary), transparent);
}

.brand {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.logo {
    font-weight: 700;
    font-size: 32px;
    letter-spacing: -1px;
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--text-main);
    text-shadow: 0 0 30px rgba(255,255,255,0.1);
}

.logo svg {
    filter: drop-shadow(0 0 10px var(--primary-glow));
    color: var(--primary);
}

/* Dynamic Logo Icon */
.logo-icon {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-pulse {
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    position: relative;
    box-shadow: 0 0 15px var(--primary);
}

.logo-pulse::before, .logo-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--primary);
    width: 100%;
    height: 100%;
    animation: radar-wave 2s infinite linear;
    opacity: 0;
}

.logo-pulse::after {
    animation-delay: 1s;
}

@keyframes radar-wave {
    0% { width: 100%; height: 100%; opacity: 0.8; border-width: 2px; }
    100% { width: 400%; height: 400%; opacity: 0; border-width: 0px; }
}

.subtitle {
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.navi {
    display: flex;
    gap: 32px;
}

.navi a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 8px 0;
}

.navi a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--primary);
}

.navi a:hover {
    color: var(--text-main);
}

.navi a:hover::after {
    width: 100%;
}

/* Overall Status Hero */
.status-hero {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    padding: 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 60px;
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.status-hero:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.3);
    border-color: var(--glass-highlight);
}

.status-hero.operational {
    background: linear-gradient(145deg, rgba(16, 185, 129, 0.05) 0%, rgba(16, 185, 129, 0.01) 100%);
    border-left: 4px solid var(--success);
}

.status-hero.degraded {
    background: linear-gradient(145deg, rgba(239, 68, 68, 0.05) 0%, rgba(239, 68, 68, 0.01) 100%);
    border-left: 4px solid var(--danger);
}

.hero-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.hero-content p {
    color: var(--text-muted);
    font-size: 16px;
    font-weight: 300;
}

.pulse-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 var(--success-glow);
    animation: pulse-green 2s infinite;
    display: inline-block;
    margin-right: 12px;
}

.status-hero.degraded .pulse-dot {
    background: var(--danger);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-green {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(16, 185, 129, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.last-updated {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-muted);
    opacity: 0.7;
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 12px;
}

/* Monitor List */
.monitor-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.monitor-item {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px 32px;
    transition: all 0.3s ease;
}

.monitor-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--glass-highlight);
    transform: scale(1.01);
    box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* Monitor Header */
.monitor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.monitor-name {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 12px;
}

.monitor-name::before {
    content: '';
    display: block;
    width: 4px;
    height: 16px;
    background: var(--text-muted);
    border-radius: 2px;
    transition: background 0.3s;
}

.monitor-item:hover .monitor-name::before {
    background: var(--primary);
    box-shadow: 0 0 10px var(--primary);
}

.monitor-status-text {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
}

.status-text-up { color: var(--success); text-shadow: 0 0 10px var(--success-glow); }
.status-text-down { color: var(--danger); text-shadow: 0 0 10px var(--danger-glow); }

/* Timeline Visual */
.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.timeline-bars {
    display: flex;
    gap: 3px;
    height: 48px;
    align-items: flex-end;
    padding: 4px 0;
}

.bar {
    flex: 1;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    height: 100%;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    min-width: 4px;
}

.bar.up {
    background-color: var(--success);
    box-shadow: 0 0 5px var(--success-glow);
}

.bar.down {
    background-color: var(--danger);
    box-shadow: 0 0 10px var(--danger);
}

.bar:hover {
    transform: scaleY(1.3) scaleX(1.1);
    z-index: 10;
    border-radius: 2px;
    box-shadow: 0 0 15px currentColor;
}

/* Tooltip */
.bar::before {
    content: attr(data-title);
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid var(--glass-border);
    color: white;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    z-index: 20;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
    font-family: 'Segoe UI Mono', 'Roboto Mono', 'Ubuntu Mono', Menlo, Consolas, Monaco, monospace;
}

.bar::after {
    content: '';
    position: absolute;
    bottom: 140%;
    left: 50%;
    transform: translateX(-50%) translateY(14px);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: all 0.2s;
    z-index: 20;
}

.bar:hover::before {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.bar:hover::after {
    opacity: 1;
    transform: translateX(-50%) translateY(4px);
}

/* Timeline Meta */
.timeline-meta {
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 300;
    padding: 0 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Footer */
#footer {
    margin-top: 100px;
    margin-bottom: 60px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
    padding-top: 40px;
    border-top: 1px solid var(--glass-border);
    font-weight: 300;
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }

    #header {
        flex-direction: column;
        gap: 24px;
        align-items: center;
        text-align: center;
        padding: 40px 0 30px;
        margin-bottom: 40px;
    }
    
    /* Header underline center fix */
    #header::after {
        left: 50%;
        transform: translateX(-50%);
        width: 60px; /* Make it slightly smaller on mobile */
    }

    .logo {
        justify-content: center;
    }
    
    .navi {
        justify-content: center;
        width: 100%;
        gap: 24px;
        flex-wrap: wrap;
    }

    .status-hero {
        flex-direction: column;
        gap: 20px;
        text-align: center;
        padding: 24px;
        margin-bottom: 40px;
    }
    
    .hero-content h2 {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 24px;
    }
    
    .last-updated {
        align-self: center;
        margin-top: 4px;
    }

    .monitor-item {
        padding: 20px;
    }

    .monitor-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .monitor-status-text {
        align-self: stretch;
        text-align: center;
        display: flex;
        justify-content: center; /* Center align items */
        align-items: center;
        flex-wrap: wrap; /* Allow wrapping */
        gap: 10px;
    }
    
    /* Timeline Mobile Adaptation */
    .timeline-bars {
        gap: 1px;
    }

    /* Show only last 30 days on mobile (hide older than 30 days) */
    .bar:nth-last-child(n+31) {
        display: none;
    }

    /* Update label to 30 days */
    .timeline-meta span:first-child {
        visibility: hidden;
        position: relative;
    }
    .timeline-meta span:first-child::after {
        content: "30 天前";
        visibility: visible;
        position: absolute;
        left: 0;
        top: 0;
    }
    
    .bar {
        min-width: 2px; /* Reduce min-width */
    }
    
    /* Tooltip Edge Handling for Small Screens */
    .bar:nth-child(-n+10)::before, 
    .bar:nth-child(-n+10)::after {
        left: 0;
        transform: translateY(10px);
    }
    .bar:nth-child(-n+10):hover::before {
        transform: translateY(0);
    }
    .bar:nth-child(-n+10):hover::after {
        transform: translateY(4px);
    }

    .bar:nth-last-child(-n+10)::before, 
    .bar:nth-last-child(-n+10)::after {
        left: auto;
        right: 0;
        transform: translateY(10px);
    }
    .bar:nth-last-child(-n+10):hover::before {
        transform: translateY(0);
    }
    .bar:nth-last-child(-n+10):hover::after {
        transform: translateY(4px);
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 24px;
    }
    
    .subtitle {
        font-size: 12px;
    }

    .hero-content h2 {
        font-size: 20px;
    }
    
    .monitor-name {
        font-size: 16px;
    }

    .timeline-bars {
        gap: 0; /* Remove gap completely for continuity */
    }
    
    .bar {
        min-width: 0;
        border-radius: 0; /* Remove radius for solid look */
    }
    /* Add subtle separator */
    .bar:not(:last-child) {
        border-right: 1px solid rgba(0,0,0,0.3);
    }
    
    .timeline-meta {
        font-size: 10px;
    }
}
