:root {
    --primary: #3b82f6;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --bg: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-sub: #64748b;
    --border: #e2e8f0;
}

body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background-color: var(--bg); color: var(--text-main); margin: 0; padding: 20px; line-height: 1.5; }
.container { max-width: 1200px; margin: 0 auto; }

/* 头部 Header */
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.logo { display: flex; align-items: center; gap: 12px; }
.logo h1 { margin: 0; font-size: 1.5rem; font-weight: 700; color: var(--text-main); }
.logo i { font-size: 1.5rem; }

.header-right { display: flex; gap: 20px; text-align: right; }
.status-time-row { display: flex; flex-direction: column; align-items: flex-end; }
.time-label { font-size: 0.75rem; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.5px; }
.time-value { font-family: monospace; font-weight: 600; font-size: 1.1rem; color: var(--text-main); }
.countdown { color: var(--primary); }

/* 全局状态横幅 */
.status-banner { 
    padding: 16px; 
    border-radius: 10px; 
    color: #ffffff; /* 强制白色 */
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 12px; 
    font-weight: 600; 
    font-size: 1.1rem; 
    margin-bottom: 30px; 
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1); 
}

/* 横幅内的文字单独控制 (水平排列，无宽度限制) */
.status-banner .status-text {
    width: auto !important; 
    display: inline;
    white-space: nowrap;
    color: #ffffff !important;
}
.status-banner .status-icon,
.status-banner .status-icon i {
    color: #ffffff !important;
}

.status-banner.operational { background: linear-gradient(135deg, #10b981 0%, #059669 100%); }
.status-banner.degraded { background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%); }
.status-banner.outage { background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%); }
.status-banner.loading { background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%); }

/* 统计与图表布局 (Grid) */
.section-stats { display: grid; grid-template-columns: 1fr 2fr; gap: 20px; margin-bottom: 40px; }
@media (max-width: 768px) { .section-stats { grid-template-columns: 1fr; } }

/* 统计网格 */
.global-stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 15px; }
.stat-card { background: var(--card-bg); padding: 20px; border-radius: 12px; box-shadow: 0 1px 2px rgba(0,0,0,0.05); border: 1px solid var(--border); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.stat-card h3 { margin: 0 0 5px 0; font-size: 0.85rem; color: var(--text-sub); font-weight: 500; }
.stat-card p { margin: 0; font-size: 1.8rem; font-weight: 700; color: var(--text-main); }

/* 图表区域 */
.trend-chart-area { background: var(--card-bg); padding: 20px; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 1px 2px rgba(0,0,0,0.05); position: relative; display: flex; flex-direction: column; }
.trend-header { margin-bottom: 15px; }
.trend-chart-title { margin: 0; font-weight: 600; color: var(--text-sub); font-size: 0.95rem; }
.trend-chart-container { flex: 1; position: relative; min-height: 200px; }
.chart-overlay { position: absolute; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.85); display: none; flex-direction: row; justify-content: center; align-items: center; z-index: 10; border-radius: 12px; gap: 8px; font-weight: 600; color: var(--text-sub); backdrop-filter: blur(2px); }

/* 服务列表 */
.section { margin-bottom: 40px; }
.section-heading { font-size: 1.25rem; margin-bottom: 20px; color: var(--text-main); display: flex; align-items: center; gap: 10px; border-left: 4px solid var(--primary); padding-left: 12px; }

.services-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 15px; }
.service-card { background: var(--card-bg); padding: 18px 20px; border-radius: 10px; border: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; transition: all 0.2s ease; }
.service-card:hover { transform: translateY(-2px); box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05); border-color: var(--primary); }

/* 🟢 修改：服务名称样式 (去掉了 a 标签样式，直接加在 div 上) */
.service-name { 
    color: var(--text-main); 
    font-weight: 600; /* 加粗 */
    font-size: 1rem;
    display: flex; 
    align-items: center; 
}

/* 服务状态区 */
.service-status { 
    display: flex; 
    align-items: center; 
    justify-content: flex-end; /* 靠右对齐 */
    gap: 8px; 
    font-size: 0.9rem; 
    min-width: 170px; 
}
.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }

/* 列表内的状态文字 (固定宽度，垂直对齐) */
.service-status .status-text {
    width: 40px; 
    text-align: center; 
    font-weight: 600;
    display: inline-block;
}

/* 状态颜色 */
.operational .dot { background-color: var(--success); box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2); }
.operational .status-text { color: var(--success); }

.degraded .dot { background-color: var(--warning); box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2); }
.degraded .status-text { color: var(--warning); }

.outage .dot { background-color: var(--error); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2); }
.outage .status-text { color: var(--error); }

/* 延迟文字 */
.latency-text { 
    background: #f1f5f9; 
    padding: 2px 0; 
    width: 65px; /* 固定宽度 */
    text-align: center;
    border-radius: 6px; 
    font-size: 0.8rem; 
    color: var(--text-sub); 
    font-family: monospace; 
    display: inline-block;
}

/* 日志列表 */
.logs-container { background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); overflow: hidden; }

.log-item { 
    padding: 16px 24px; 
    border-bottom: 1px solid var(--border); 
    display: flex; 
    align-items: flex-start; /* 顶部对齐 */
    gap: 20px; 
    cursor: pointer; 
    transition: background 0.15s; 
}
.log-item:last-child { border-bottom: none; }
.log-item:hover { background-color: #f8fafc; }

.log-time { 
    font-family: monospace; 
    color: var(--text-sub); 
    font-size: 0.9rem; 
    min-width: 110px; 
    padding-top: 2px; 
}

.log-message { 
    flex: 1; 
    display: flex; 
    align-items: flex-start; 
    gap: 10px; 
    font-weight: 500; 
    color: var(--text-main); 
    line-height: 1.5;
}
.log-message i {
    margin-top: 3px; 
    flex-shrink: 0;
    width: 18px; 
    text-align: center;
}

.log-latency { font-size: 0.8rem; background: #e2e8f0; padding: 4px 10px; border-radius: 20px; color: var(--text-sub); font-weight: 600; align-self: flex-start; }

/* 移动端日志特殊处理 */
@media (max-width: 768px) {
    .log-item {
        flex-direction: column; 
        gap: 8px;
        padding: 15px;
    }
    .log-time {
        width: 100%;
        min-width: auto;
        font-size: 0.85rem;
        opacity: 0.8;
    }
    .log-message {
        width: 100%;
        font-size: 0.95rem;
    }
    .log-latency {
        align-self: flex-start;
        margin-top: 4px;
    }
}

/* 分页 */
.pagination { display: flex; justify-content: center; padding: 25px 0 0; gap: 8px; }
.page-btn { background: white; border: 1px solid var(--border); width: 36px; height: 36px; border-radius: 8px; cursor: pointer; color: var(--text-sub); transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Footer */
.footer { margin-top: 50px; text-align: center; color: var(--text-sub); font-size: 0.9rem; padding-top: 20px; border-top: 1px solid var(--border); }
.version-tag { background: #e2e8f0; padding: 2px 6px; border-radius: 4px; font-size: 0.75rem; margin-left: 5px; }

/* Modal 弹窗 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; opacity: 0; transition: opacity 0.3s; }
.modal-overlay.show { display: flex; opacity: 1; }

.modal-content { background: white; width: 90%; max-width: 500px; border-radius: 16px; box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25); overflow: hidden; transform: translateY(20px); transition: transform 0.3s; }
.modal-overlay.show .modal-content { transform: translateY(0); }

.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #f8fafc; }
.modal-header h3 { margin: 0; font-size: 1.1rem; color: var(--text-main); }
.close-btn { background: none; border: none; font-size: 1.2rem; color: var(--text-sub); cursor: pointer; padding: 0; transition: color 0.2s; }
.close-btn:hover { color: var(--error); }

.modal-body { padding: 24px; }
.detail-row { display: flex; justify-content: space-between; margin-bottom: 12px; font-size: 1rem; }
.detail-row .label { color: var(--text-sub); display: flex; align-items: center; gap: 8px; }
.detail-row .value { font-weight: 600; color: var(--text-main); font-family: monospace; }
.modal-body hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.detail-section h4 { margin: 0 0 10px 0; font-size: 0.9rem; color: var(--text-sub); text-transform: uppercase; }
.detail-message { background: #f1f5f9; padding: 15px; border-radius: 8px; color: var(--text-main); font-size: 0.95rem; line-height: 1.6; border-left: 4px solid var(--primary); margin: 0; }

/* 文本颜色助手 */
.text-green { color: var(--success); }
.text-red { color: var(--error); }