/* API监控页面样式 */

.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.header-content {
    flex: 1;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 0;
}

/* 统计卡片 */
.stat-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, var(--card-bg) 100%);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.total {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stat-icon.success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.stat-icon.danger {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: white;
}

.stat-icon.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

/* 分类筛选 */
.filter-tabs {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 1rem;
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.filter-tab {
    padding: 0.75rem 1.5rem;
    border: none; /* 完全移除边框 */
    background: var(--bg-secondary);
    border-radius: 10px;
    color: var(--text-primary);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    outline: none; /* 移除默认的outline */
}

.filter-tab:focus {
    outline: none; /* 移除focus时的outline */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.filter-tab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
    color: var(--primary);
}

.filter-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4);
}

.filter-tab i {
    margin-right: 0.5rem;
}

/* API监控列表 */
.api-monitor-list {
    display: grid;
    gap: 1.5rem;
}

.api-monitor-item {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.api-monitor-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.api-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.api-title-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.api-category-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.api-category-badge.baidu {
    background: #e3f2fd;
    color: #1976d2;
}

.api-category-badge.quark {
    background: #f3e5f5;
    color: #7b1fa2;
}

.api-category-badge.xunlei {
    background: #fff3e0;
    color: #f57c00;
}

.api-category-badge.system {
    background: #e8f5e9;
    color: #388e3c;
}

.api-name {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.api-status-badge {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.api-status-badge.success {
    background: #d4edda;
    color: #155724;
}

.api-status-badge.danger {
    background: #f8d7da;
    color: #721c24;
}

.api-status-badge.warning {
    background: #fff3cd;
    color: #856404;
}

.api-status-badge.unknown {
    background: #e2e3e5;
    color: #383d41;
}

.api-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.api-endpoint {
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    word-break: break-all;
}

.api-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.metric-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.metric-value {
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.metric-value.good {
    color: #28a745;
}

.metric-value.bad {
    color: #dc3545;
}

.api-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-check {
    padding: 0.5rem 1.5rem;
    border-radius: 6px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    outline: none; /* 移除默认的outline */
}

.btn-check:focus {
    outline: none; /* 移除focus时的outline */
}

.btn-check.primary {
    background: var(--primary);
    color: white;
}

.btn-check.primary:hover {
    background: var(--primary-dark);
}

.btn-check:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.error-message {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    font-size: 0.875rem;
    margin-top: 1rem;
    border-left: 4px solid #dc2626;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.error-message.success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border-left-color: #10b981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.1);
}

/* 响应式 */
@media (max-width: 768px) {
    .api-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .api-metrics {
        grid-template-columns: 1fr;
    }
    
    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
    }
}

/* 暗黑模式适配 */
.dark-mode .stat-card,
.dark-mode .filter-tab,
.dark-mode .api-monitor-item {
    background: var(--card-bg-dark);
}

.dark-mode .filter-tab {
    border-color: var(--border-color-dark);
}

.dark-mode .api-endpoint {
    background: var(--bg-tertiary);
}


/* 暗黑模式适配 */
.dark-mode .page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
}

.dark-mode .stat-card,
.dark-mode .filter-tabs,
.dark-mode .api-monitor-item {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
}

.dark-mode .filter-tab {
    background: var(--bg-tertiary);
}

.dark-mode .filter-tab:hover {
    box-shadow: 0 4px 12px rgba(143, 148, 251, 0.2);
}

.dark-mode .filter-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.dark-mode .api-endpoint {
    background: var(--bg-tertiary);
}

.dark-mode .error-message {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border-left-color: #ef4444;
}

.dark-mode .error-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #6ee7b7;
    border-left-color: #10b981;
}
