:root {
    --primary-color: #1a73e8;
    --error-color: #dc3545;
    --success-color: #28a745;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, '思源黑体', '微软雅黑', sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

.overall-status {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 500;
    margin-top: 10px;
}

.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.status-card {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.site-name {
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 15px 0;
}

.site-name a {
    color: var(--primary-color);
    text-decoration: none;
}

.site-name a:hover {
    text-decoration: underline;
}

.status-indicator {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.9em;
    font-weight: 500;
}

.operational {
    background: #e8f5e9;
    color: var(--success-color);
}

.error {
    background: #ffebee;
    color: var(--error-color);
}

.metrics {
    margin-top: 15px;
    font-size: 0.9em;
    color: #666;
}

.metrics div {
    margin: 5px 0;
}

.update-time {
    font-size: 0.8em;
    color: #999;
    margin-top: 10px;
}

.last-updated {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 30px;
}

.response-chart {
    margin-top: 15px;
    height: 100px;
    width: 100%;
    background: #f8f9fa;
    border-radius: 5px;
    padding: 10px;
}

.chart-container {
    position: relative;
    height: 100%;
    width: 100%;
}

.refresh-timer {
    text-align: center;
    color: #666;
    font-size: 0.9em;
    margin-top: 10px;
}

.error-message {
    text-align: center;
    color: #dc3545;
    padding: 20px;
    background: #ffebee;
    border-radius: 8px;
    margin: 20px 0;
}

.time-range-selector {
    margin: 10px 0;
}

.time-range {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 0.9em;
    width: 150px;
}

.time-range:focus {
    outline: none;
    border-color: var(--primary-color);
}

.status-stats {
    margin: 10px 0;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 0.9em;
}

.status-stats > div {
    margin: 5px 0;
}

.perfect-months {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
}

.perfect-months h4 {
    margin: 0 0 8px 0;
    font-size: 0.9em;
    color: #28a745;
}

.perfect-months div {
    font-size: 0.85em;
    color: #666;
    line-height: 1.4;
}

.refresh-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background-color 0.2s;
    margin-left: 10px;
}

.refresh-button:hover {
    background: #1557b0;
}

.uptime-progress {
    margin: 10px 0;
}

.progress-bar {
    display: flex;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
}

.progress-segment {
    position: relative;
    height: 20px;
    display: inline-block;
    cursor: pointer;
}

.uptime-percentage {
    font-size: 0.9em;
    color: #666;
    margin-top: 5px;
}

.next-update-time {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
}

.auto-refresh-note {
    text-align: center;
    font-size: 0.8em;
    color: #666;
    margin-top: 20px;
    padding: 10px;
}

.time-range-selector select {
    padding: 5px;
    border-radius: 4px;
    border: 1px solid #ddd;
    background-color: white;
    font-size: 0.9em;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
}

.next-update-time {
    margin-top: 1rem;
    font-size: 0.9em;
    color: #666;
}

.footer {
    margin-top: 2rem;
    text-align: center;
}

.auto-refresh-note {
    font-size: 0.8em;
    color: #666;
    padding: 1rem 0;
}

.chart-container {
  position: relative;
  width: 100%;
  cursor: pointer;
}

.tooltip {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #ddd;
  padding: 10px;
  pointer-events: none;
}

.progress-segment:hover {
    transform: scaleY(1.2);
}

.progress-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 1000;
    pointer-events: none;
}

.progress-tooltip div {
    margin: 2px 0;
    white-space: nowrap;
}

.progress-tooltip:after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.8) transparent transparent transparent;
}

.uptime-progress {
    margin: 20px 0;
}

.progress-bar {
    background-color: #f5f5f5;
    border-radius: 4px;
    overflow: hidden;
    height: 20px;
    width: 100%;
    display: flex;
}

@media screen and (max-width: 768px) {
    .response-chart {
        height: 200px;
        margin-bottom: 20px; /* 为竖向标签留出额外空间 */
    }
    
    .status-card {
        padding: 10px;
    }
    
    /* 确保图表容器有足够空间显示竖向标签 */
    canvas {
        margin-bottom: 10px;
    }
}
