/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333;
    --text-secondary: #666;
    --border-color: rgba(0, 0, 0, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.08);
}

html.dark-mode,
body.dark-mode {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    padding: 0;
    margin: 0;
    transition: background 0.3s, color 0.3s;
}

#app {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* 加载状态 */
.loading-overlay {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: #10b981;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 顶部横幅 */
.top-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.top-banner.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.top-banner.warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.top-banner.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

/* ==================== 系统状态栏 ==================== */

.system-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.system-status-bar.status-operational {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.system-status-bar.status-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.system-status-bar.status-outage {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.status-main {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.status-icon {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon svg {
    width: 28px;
    height: 28px;
}

.status-text {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.status-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.status-stats {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    opacity: 0.95;
}

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

.stat-item svg {
    width: 8px;
    height: 8px;
}

.stat-online svg {
    color: #10b981;
}

.stat-retry svg {
    color: #f59e0b;
}

.stat-offline svg {
    color: #ef4444;
}

.stat-maintenance svg {
    color: #3b82f6;
}

.stat-divider {
    opacity: 0.5;
}

.banner-icon {
    width: 42px;
    height: 42px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.banner-icon svg {
    width: 24px;
    height: 24px;
}

.banner-text {
    flex: 1;
    font-size: 20px;
    font-weight: 600;
}

.banner-controls {
    display: flex;
    gap: 8px;
    margin-right: 12px;
}

.dropdown {
    position: relative;
}

.banner-icon-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: white;
}

.banner-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.banner-icon-btn svg {
    width: 20px;
    height: 20px;
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    min-width: 160px;
    padding: 8px;
    z-index: 1000;
    animation: dropdownFadeIn 0.15s ease-out;
}

body.dark-mode .dropdown-menu {
    background: #2d2d2d;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
    text-align: left;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

.dropdown-item:hover {
    background: #f5f5f5;
}

body.dark-mode .dropdown-item:hover {
    background: #3d3d3d;
}

.dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.dropdown-item span:first-child {
    font-size: 18px;
}

/* 桌面端: 包装器不影响布局 */
.banner-search-group {
    display: contents; /* 让子元素直接参与父级的flex布局 */
}

.banner-search {
    position: relative;
    margin-right: 12px;
}

.search-input {
    width: 200px;
    height: 40px;
    padding: 8px 36px 8px 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: rgba(255, 255, 255, 0.7);
    pointer-events: none;
}

.clear-search {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: transparent;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s;
}

.clear-search:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

.clear-search svg {
    width: 16px;
    height: 16px;
}

.banner-toggle {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    color: white;
}

.banner-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

.banner-toggle svg {
    width: 24px;
    height: 24px;
}

/* 控制栏 */
.control-bar {
    display: flex;
    align-items: stretch;
    gap: 20px;
    margin-bottom: 30px;
    padding: 16px 24px;
    background: var(--bg-secondary);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.control-buttons {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-left: auto; /* 将按钮推到右侧 */
}

.btn-pause, .btn-refresh {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: var(--text-primary);
}

html.dark-mode .btn-pause,
html.dark-mode .btn-refresh {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-pause svg,
.btn-refresh svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-pause:hover {
    background: #f3f4f6;
    border-color: #3b82f6;
}

html.dark-mode .btn-pause:hover {
    background: rgba(59, 130, 246, 0.1);
}

.btn-refresh:hover {
    background: #f3f4f6;
    border-color: #10b981;
}

html.dark-mode .btn-refresh:hover {
    background: rgba(16, 185, 129, 0.1);
}

.btn-refresh:disabled {
    background: #f9fafb;
    cursor: not-allowed;
    opacity: 0.5;
    border-color: var(--border-color);
}

html.dark-mode .btn-refresh:disabled {
    background: var(--bg-secondary);
}

.refresh-status {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
    min-width: 0;
}

.refresh-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 13px;
}

.refresh-time {
    color: var(--text-primary);
    font-weight: 500;
}

.refresh-countdown {
    color: var(--text-secondary);
}

.refresh-paused {
    color: #f59e0b;
    font-weight: 500;
}

.progress-bar {
    height: 4px;
    background: var(--border-color);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    /* 背景颜色通过内联样式动态设置 */
    border-radius: 2px;
    transition: width 1s linear, background 0.5s ease;
}

/* 监控分组 */
.monitor-groups {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.monitor-group {
    background: transparent;
}

.group-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 18px;
    padding-bottom: 8px;
    border-bottom: 3px solid var(--border-color);
}

/* 监控卡片网格 */
.monitor-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
    gap: 24px;
}

@media (max-width: 1400px) {
    .monitor-cards {
        grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
        gap: 20px;
    }
}

/* 平板设备适配 (768px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
    #app {
        padding: 16px;
    }
    
    .monitor-cards {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
        gap: 18px;
    }
    
    .card-main {
        padding: 16px;
    }
    
    .monitor-name {
        font-size: 18px;
    }
    
    .chart-container {
        height: 140px;
    }
}

@media (max-width: 768px) {
    #app {
        padding: 12px;
    }

    .monitor-cards {
        grid-template-columns: 1fr;
    }
    
    /* 系统状态栏移动端适配 - 第一行横向，搜索栏独占一行 */
    .system-status-bar {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
        padding: 16px;
        gap: 0;
    }
    
    .status-main {
        flex: 1;
        min-width: 0;
        margin-right: 12px;
    }
    
    .status-icon {
        width: 40px;
        height: 40px;
    }
    
    .status-icon svg {
        width: 24px;
        height: 24px;
    }
    
    .status-title {
        font-size: 16px;
    }
    
    .status-stats {
        flex-wrap: wrap;
        gap: 10px;
        font-size: 13px;
    }
    
    /* 横幅控制按钮移动端 - 靠右对齐与切换按钮对齐 */
    .banner-controls {
        display: flex;
        justify-content: flex-end;
        gap: 8px;
        flex-shrink: 0;
        margin-left: auto;
        margin-right: 0;
    }
    
    .banner-icon-btn {
        width: 40px;
        height: 40px;
    }
    
    .banner-icon-btn svg {
        width: 20px;
        height: 20px;
    }
    
    /* 搜索栏组合移动端 - 独占完整宽度 */
    .banner-search-group {
        width: 100%;
        display: flex;
        gap: 8px;
        margin-top: 12px;
    }
    
    .banner-search {
        flex: 1;
        position: relative;
    }
    
    .search-input {
        width: 100%;
        height: 40px;
        font-size: 14px;
        padding: 10px 36px 10px 12px;
    }
    
    .banner-toggle {
        width: 40px;
        height: 40px;
        flex-shrink: 0;
    }
    
    .banner-toggle svg {
        width: 20px;
        height: 20px;
    }
    
    /* 控制栏移动端适配 - 垂直布局 */
    .control-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        margin-bottom: 16px;
        gap: 12px;
    }
    
    .refresh-status {
        width: 100%;
    }
    
    .refresh-info {
        font-size: 13px;
        margin-bottom: 6px;
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .progress-bar {
        width: 100%;
    }
    
    .control-buttons {
        width: 100%;
        display: flex;
        gap: 12px;
        margin-left: 0;
    }
    
    .btn-pause,
    .btn-refresh {
        flex: 1;
        font-size: 14px;
        padding: 11px 16px;
        height: 46px;
        justify-content: center;
    }
    
    .btn-pause svg,
    .btn-refresh svg {
        width: 18px;
        height: 18px;
    }
    
    .refresh-status {
        width: 100%;
    }
    
    .refresh-info {
        font-size: 12px;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px;
    }
    
    /* 监控分组移动端适配 */
    .group-title {
        font-size: 18px;
        padding: 10px 0;
    }
    
    /* 下拉菜单移动端适配 */
    .dropdown-menu {
        min-width: 140px;
        right: auto;
        left: 0;
    }
    
    .dropdown-item {
        padding: 8px 10px;
        font-size: 13px;
        gap: 8px;
    }
    
    .dropdown-item svg {
        width: 16px;
        height: 16px;
    }
    
    /* 事件横幅移动端适配 */
    .incident-alert {
        padding: 12px 14px;
        margin-bottom: 16px;
        border-radius: 10px;
    }
    
    .incident-header {
        gap: 10px;
    }
    
    .incident-icon {
        width: 36px;
        height: 36px;
    }
    
    .incident-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .incident-title {
        font-size: 15px;
    }
    
    .incident-badge {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .incident-content {
        font-size: 13px;
        padding-left: 46px;
    }
    
    .maintenance-alert {
        padding: 12px 14px;
        margin-bottom: 16px;
        border-radius: 10px;
    }
}

/* 超小屏幕适配 (< 480px) */
@media (max-width: 480px) {
    #app {
        padding: 10px;
    }
    
    /* 系统状态栏超小屏 */
    .system-status-bar {
        padding: 14px;
        border-radius: 10px;
    }
    
    .status-icon {
        width: 36px;
        height: 36px;
    }
    
    .status-icon svg {
        width: 22px;
        height: 22px;
    }
    
    .status-title {
        font-size: 15px;
    }
    
    .status-stats {
        gap: 8px;
        font-size: 12px;
    }
    
    /* 横幅控制按钮超小屏 */
    .banner-controls {
        gap: 6px;
    }
    
    .banner-icon-btn {
        width: 36px;
        height: 36px;
    }
    
    .banner-icon-btn svg {
        width: 18px;
        height: 18px;
    }
    
    /* 搜索栏组合超小屏 */
    .banner-search-group {
        width: 100%;
        display: flex;
        gap: 6px;
        margin-top: 8px;
    }
    
    .banner-search {
        flex: 1;
        position: relative;
    }
    
    .search-input {
        height: 36px;
        font-size: 13px;
        padding: 8px 32px 8px 10px;
    }
    
    .search-icon,
    .clear-search {
        width: 20px;
        height: 20px;
    }
    
    .banner-toggle {
        width: 36px;
        height: 36px;
    }
    
    .banner-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    /* 控制栏超小屏 */
    .control-bar {
        flex-direction: column;
        padding: 12px 14px;
        gap: 10px;
    }
    
    .refresh-info {
        font-size: 12px;
        margin-bottom: 5px;
    }
    
    .control-buttons {
        gap: 10px;
        margin-left: 0;
    }
    
    .btn-pause,
    .btn-refresh {
        font-size: 13px;
        padding: 10px 14px;
        height: 42px;
    }
    
    .btn-pause svg,
    .btn-refresh svg {
        width: 16px;
        height: 16px;
    }
    
    .clear-search {
        width: 24px;
        height: 24px;
    }
    
    .clear-search svg {
        width: 14px;
        height: 14px;
    }
    
    /* 切换按钮与其他图标按钮统一尺寸 */
    .banner-toggle {
        width: 36px;
        height: 36px;
        flex-shrink: 0;
    }
    
    .banner-toggle svg {
        width: 18px;
        height: 18px;
    }
    
    .control-bar {
        padding: 10px 12px;
        gap: 10px;
    }
    
    .control-buttons {
        gap: 8px;
    }
    
    .btn-pause,
    .btn-refresh {
        font-size: 12px;
        padding: 6px 12px;
        gap: 6px;
    }
    
    .btn-pause svg,
    .btn-refresh svg {
        width: 14px;
        height: 14px;
    }
    
    .refresh-info {
        font-size: 11px;
        gap: 6px;
    }
    
    .group-title {
        font-size: 16px;
        padding: 8px 0;
        margin-bottom: 12px;
    }
    
    .monitor-groups {
        gap: 16px;
    }
    
    /* 移动端卡片优化 */
    .card-main {
        padding: 14px;
    }
    
    .monitor-name {
        font-size: 16px;
    }
    
    .monitor-method {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .monitor-tag {
        padding: 3px 8px;
        font-size: 10px;
    }
    
    .response-info {
        font-size: 12px;
        gap: 10px;
    }
    
    .response-label {
        font-size: 10px;
    }
    
    .response-value {
        font-size: 13px;
    }
    
    .status-legend {
        font-size: 11px;
        gap: 12px;
    }
    
    .chart-tabs button {
        padding: 6px 8px;
        font-size: 11px;
    }
    
    .chart-container {
        height: 120px;
    }
    
    /* 系统状态栏超小屏幕适配 */
    .system-status-bar {
        padding: 12px 14px;
    }
    
    .status-main {
        gap: 10px;
    }
    
    .status-icon {
        width: 36px;
        height: 36px;
    }
    
    .status-icon svg {
        width: 20px;
        height: 20px;
    }
    
    .status-title {
        font-size: 14px;
    }
    
    .status-stats {
        font-size: 11px;
        gap: 6px;
    }
    
    /* 事件横幅超小屏幕适配 */
    .incident-alert {
        padding: 10px 12px;
    }
    
    .incident-header {
        gap: 8px;
    }
    
    .incident-icon {
        width: 32px;
        height: 32px;
    }
    
    .incident-icon svg {
        width: 18px;
        height: 18px;
    }
    
    .incident-title {
        font-size: 14px;
    }
    
    .incident-badge {
        padding: 2px 6px;
        font-size: 9px;
    }
    
    .incident-content {
        font-size: 12px;
        padding-left: 40px;
    }
}

/* 监控卡片 */
.monitor-card {
    background: var(--bg-secondary);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.monitor-card.expanded {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.monitor-card:hover .card-main {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

.card-main {
    padding: 20px 28px;  /* 增加左右 padding 到 28px，让上方内容区域在视觉上与趋势图更协调 */
    cursor: pointer;
    transition: all 0.3s ease;
}

/* 卡片头部 */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;  /* 减小下边距，让整体更紧凑 */
}

.monitor-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}

.status-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.status-icon.up {
    background: #10b981;  /* 绿色 - 在线 */
    color: white;
}

.status-icon.down {
    background: #ef4444;  /* 红色 - 离线 */
    color: white;
}

.status-icon.retry {
    background: #f59e0b;  /* 橙色 - 重试中 */
    color: white;
}

.status-icon.maintenance {
    background: #3b82f6;  /* 蓝色 - 维护状态 */
    color: white;
}

.status-icon svg {
    width: 12px;
    height: 12px;
}

.monitor-type-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--text-secondary);
    opacity: 0.7;
    transition: opacity 0.2s;
    position: relative;
}

.monitor-type-icon:hover {
    opacity: 1;
}

.monitor-type-icon::after {
    content: attr(title);
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    padding: 4px 8px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 12px;
    white-space: nowrap;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease-in-out;
    z-index: 1000;
}

html.dark-mode .monitor-type-icon::after {
    background: rgba(255, 255, 255, 0.95);
    color: var(--text-primary);
}

.monitor-type-icon:hover::after {
    opacity: 1;
    transition-delay: 0.3s;
}

.monitor-type-icon svg {
    width: 100%;
    height: 100%;
}

.monitor-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.monitor-method {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.monitor-method.method-get {
    background: #06b6d4;  /* 青色 - GET方法标签 */
    color: white;
}

.monitor-method.method-post {
    background: #3b82f6;
    color: white;
}

.monitor-method.method-put {
    background: #f59e0b;
    color: white;
}

.monitor-method.method-delete {
    background: #ef4444;
    color: white;
}

.monitor-method.method-patch {
    background: #8b5cf6;
    color: white;
}

.monitor-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.monitor-tag {
    padding: 4px 10px;
    background: rgba(59, 130, 246, 0.15);
    color: #3b82f6;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

body.dark-mode .monitor-tag {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

/* 可用率圆形显示 */
.uptime-display {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.uptime-circle {
    width: 32px;
    height: 32px;
    position: relative;
}

.uptime-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circle-bg {
    fill: none;
    stroke: #e5e7eb;
    stroke-width: 2.5;
}

.circle-progress {
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: round;
    transition: stroke-dasharray 0.3s ease;
}

.uptime-percent {
    font-size: 15px;
    font-weight: 700;
    color: #6b7280;
}

/* 响应时间信息 - 包含延迟信息和状态图例在同一行 */
.response-info {
    margin-bottom: 8px;  /* 减小下边距 */
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: space-between;  /* 两端对齐：延迟信息左边，状态标签右边 */
    gap: 12px;  /* 两组之间的空隙 */
}

/* 延迟指标组 */
.delay-metrics {
    display: flex;
    align-items: center;
    gap: 3px;  /* 指标之间的小间距 */
}

/* 状态标签组 */
.status-labels {
    display: flex;
    align-items: center;
    gap: 3px;  /* 标签之间的小间距 */
}

.response-label {
    font-weight: 500;
    text-transform: uppercase;
    font-size: 8px;  /* 小标签 */
    letter-spacing: 0px;
}

.response-value {
    font-weight: 500;
    font-size: 10px;  /* 小数值 */
    color: var(--text-primary);
}

/* 状态图例 */
.status-legend {
    display: flex;
    align-items: center;
    gap: 8px;  /* 减小间距让图例更紧凑 */
    margin-bottom: 0;  /* 移除margin，由wrapper统一管理 */
    font-size: 11px;  /* 减小字体 */
    color: var(--text-secondary);
    flex-shrink: 0;  /* 不压缩 */
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 3px;  /* 进一步减小图标和文字间距 */
    font-size: 10px;  /* 进一步缩小字体 */
}

.legend-dot {
    width: 6px;  /* 缩小圆点 */
    height: 6px;  /* 缩小圆点 */
    border-radius: 50%;
}

.legend-dot.legend-online {
    background: #10b981;
}

.legend-dot.legend-retry {
    background: #f59e0b;
}

.legend-dot.legend-maintenance {
    background: #3b82f6;  /* 蓝色 - 维护状态 */
}

.legend-dot.legend-offline {
    background: #ef4444;
}

/* 状态条 */
.status-bar {
    display: flex;
    gap: 2px;
    height: 24px;
    margin-bottom: 8px;  /* 减小下边距，与趋势图更紧密 */
    border-radius: 6px;
    overflow: hidden;
}

.status-bar-item {
    flex: 1;
    transition: all 0.2s;
    cursor: pointer;
    position: relative;
}

.status-bar-item:hover {
    opacity: 0.9;
    transform: scaleY(1.15) scaleX(1.05);
    z-index: 10;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.3);
}

/* Vue 自定义 Tooltip */
.custom-tooltip {
    position: fixed;
    transform: translate(-50%, -100%);
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-top: -8px;
}

body.dark-mode .custom-tooltip {
    background: rgba(255, 255, 255, 0.95);
    color: #1f2937;
}

.status-bar-item.up {
    background: #10b981;  /* 绿色 - 在线 */
}

.status-bar-item.down {
    background: #ef4444;  /* 红色 - 离线 */
}

.status-bar-item.pending {
    background: #f59e0b;  /* 橙色 - 待定 */
}

.status-bar-item.retry {
    background: #f59e0b;  /* 橙色 - 重试中 */
}

.status-bar-item.maintenance {
    background: #3b82f6;  /* 蓝色 - 维护状态 */
}

/* 图表切换标签 */
.chart-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    background: #f3f4f6;
    padding: 4px;
    border-radius: 10px;
}

.chart-tabs button {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid transparent;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-secondary);
}

.chart-tabs button:hover {
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-primary);
}

.chart-tabs button.active {
    background: white;
    color: var(--text-primary);
}

/* 深色模式下的样式 */
html.dark-mode .chart-tabs {
    background: #1f2937;
}

html.dark-mode .chart-tabs button,
body.dark-mode .chart-tabs button {
    background: transparent;
}

html.dark-mode .chart-tabs button:hover,
body.dark-mode .chart-tabs button:hover {
    background: rgba(75, 85, 99, 0.5);
}

html.dark-mode .chart-tabs button.active,
body.dark-mode .chart-tabs button.active {
    background: #374151;
    color: #e5e7eb;
}

/* 图表容器 */
.chart-container {
    width: 100%;
    height: 180px;  /* 增加图表高度，让视觉更平衡 */
    border-radius: 8px;
}

/* 卡片详情区域 */
.card-detail {
    border-top: 2px solid #f3f4f6;
    padding: 20px;
    background: #fafafa;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 500px;
    }
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.detail-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.btn-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #e5e7eb;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    color: #6b7280;
}

.btn-close:hover {
    background: #d1d5db;
    color: #1f2937;
}

.detail-chart-container {
    width: 100%;
    height: 350px;
    background: white;
    border-radius: 8px;
    padding: 15px;
}

/* 页脚 */
.footer {
    margin-top: 40px;
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: #3b82f6;  /* 保持蓝色 - 减少绿色使用 */
}

.footer strong {
    color: inherit;
}

/* ==================== 维护公告和事件 ==================== */

/* 事件公告 */
.incident-alert {
    margin: 20px 0;
    padding: 16px 20px;
    border-radius: 12px;
    border-left: 4px solid;
    background: var(--bg-secondary);
    box-shadow: var(--shadow-md);
    animation: slideDown 0.3s ease-out;
}

/* 信息样式 - 蓝色 */
.incident-alert.incident-info {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15) 0%, rgba(59, 130, 246, 0.08) 100%);
}

.incident-alert.incident-info .incident-icon {
    color: #3b82f6;
}

/* 警告样式 - 橙色 */
.incident-alert.incident-warning {
    border-left-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(245, 158, 11, 0.08) 100%);
}

.incident-alert.incident-warning .incident-icon {
    color: #f59e0b;
}

/* 危险样式 - 红色 */
.incident-alert.incident-danger {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.15) 0%, rgba(239, 68, 68, 0.08) 100%);
}

.incident-alert.incident-danger .incident-icon {
    color: #ef4444;
}

/* 主要样式 - 紫色 */
.incident-alert.incident-primary {
    border-left-color: #8b5cf6;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.incident-alert.incident-primary .incident-icon {
    color: #8b5cf6;
}

/* 明亮样式 - 浅灰 */
.incident-alert.incident-light {
    border-left-color: #94a3b8;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.15) 0%, rgba(148, 163, 184, 0.08) 100%);
}

.incident-alert.incident-light .incident-icon {
    color: #64748b;
}

/* 黑暗样式 - 深灰 */
.incident-alert.incident-dark {
    border-left-color: #1e293b;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.15) 0%, rgba(30, 41, 59, 0.08) 100%);
}

.incident-alert.incident-dark .incident-icon {
    color: #1e293b;
}

/* 深色模式下的调整 */
html.dark-mode .incident-alert.incident-light {
    border-left-color: #94a3b8;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(148, 163, 184, 0.1) 100%);
}

html.dark-mode .incident-alert.incident-dark {
    border-left-color: #94a3b8;
    background: linear-gradient(135deg, rgba(148, 163, 184, 0.2) 0%, rgba(148, 163, 184, 0.1) 100%);
}

.incident-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    position: relative;
}

/* 折叠按钮 */
.collapse-toggle {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border: none;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
}

.collapse-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

html.dark-mode .collapse-toggle {
    background: rgba(255, 255, 255, 0.1);
}

html.dark-mode .collapse-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.collapse-toggle svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

/* 折叠状态样式 */
.incident-alert.collapsed .incident-content,
.maintenance-alert.collapsed > div:not(.maintenance-header) {
    display: none;
}

.incident-alert.collapsed,
.maintenance-alert.collapsed {
    margin-bottom: 8px;
}

.incident-alert.collapsed .incident-header,
.maintenance-alert.collapsed .maintenance-header {
    margin-bottom: 0;
}

.incident-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.incident-alert.incident-info .incident-icon {
    color: #3b82f6;
}

.incident-alert.incident-warning .incident-icon {
    color: #f59e0b;
}

.incident-alert.incident-danger .incident-icon {
    color: #ef4444;
}

.incident-icon svg {
    width: 100%;
    height: 100%;
}

.incident-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.incident-date {
    font-size: 13px;
    color: var(--text-secondary);
}

.incident-content {
    padding-left: 36px;
    color: var(--text-primary);
    line-height: 1.6;
}

.incident-content p {
    margin: 0;
}

.incident-content h1,
.incident-content h2,
.incident-content h3 {
    margin: 12px 0 8px 0;
    color: var(--text-primary);
}

.incident-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

html.dark-mode .incident-content code {
    background: rgba(255, 255, 255, 0.1);
}

.incident-content a {
    color: #3b82f6;
    text-decoration: none;
}

.incident-content a:hover {
    text-decoration: underline;
}

/* 内容更新时间戳 */
.content-timestamp {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
    opacity: 0.8;
}

.content-timestamp svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

/* 维护公告 */
.maintenance-alerts {
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.maintenance-alert {
    padding: 14px 18px;
    border-radius: 10px;
    border: 1px solid rgba(139, 92, 246, 0.2);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.08) 0%, rgba(139, 92, 246, 0.03) 100%);
    box-shadow: var(--shadow-sm);
    animation: slideDown 0.3s ease-out;
}

.maintenance-alert.maintenance-active {
    border-color: rgba(139, 92, 246, 0.4);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(139, 92, 246, 0.08) 100%);
}

.maintenance-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    position: relative;
}

.maintenance-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #8b5cf6;
}

.maintenance-icon svg {
    width: 100%;
    height: 100%;
}

.maintenance-title {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
}

.maintenance-status {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
    font-weight: 500;
}

.maintenance-alert.maintenance-active .maintenance-status {
    background: #8b5cf6;
    color: white;
}

.maintenance-time {
    padding-left: 30px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.maintenance-description {
    padding-left: 30px;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

.maintenance-description p {
    margin: 0;
}

.maintenance-description code {
    background: rgba(139, 92, 246, 0.1);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.maintenance-description a {
    color: #8b5cf6;
    text-decoration: none;
}

.maintenance-description a:hover {
    text-decoration: underline;
}

/* 动画 */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

