:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --bg: #f1f5f9;
    --bg-soft: #f8fafc;
    --card-bg: #ffffff;
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border: #e2e8f0;
    --border-soft: #f1f5f9;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --success: #22c55e;
    --success-light: #dcfce7;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 20px 60px rgba(15, 23, 42, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 登录页 ==================== */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #312e81 100%);
    position: relative;
    overflow: hidden;
    padding: 20px;
}
/* 背景装饰光斑 */
.login-container::before,
.login-container::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    pointer-events: none;
}
.login-container::before {
    width: 400px; height: 400px;
    background: #3b82f6;
    top: -100px; left: -100px;
    animation: float1 12s ease-in-out infinite;
}
.login-container::after {
    width: 350px; height: 350px;
    background: #8b5cf6;
    bottom: -80px; right: -80px;
    animation: float2 14s ease-in-out infinite;
}
@keyframes float1 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(60px, 40px); } }
@keyframes float2 { 0%,100% { transform: translate(0,0); } 50% { transform: translate(-50px, -30px); } }

.login-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    padding: 44px 40px 36px;
    border-radius: 16px;
    box-shadow: 0 25px 70px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.1);
    width: 400px;
    max-width: 90vw;
    position: relative;
    z-index: 1;
    animation: cardIn 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(0.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

.login-logo {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
}
.login-logo svg { width: 34px; height: 34px; color: #fff; }

.login-card h1 {
    font-size: 24px;
    text-align: center;
    margin-bottom: 6px;
    color: var(--text);
    letter-spacing: -0.02em;
}
.login-card .subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-size: 14px;
}

/* 密码可见切换 */
.input-wrap { position: relative; }
.input-wrap .toggle-pwd {
    position: absolute;
    right: 10px; top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-tertiary);
    padding: 4px;
    border-radius: 4px;
    display: flex;
    transition: color 0.2s;
}
.input-wrap .toggle-pwd:hover { color: var(--text-secondary); }
.input-wrap .toggle-pwd svg { width: 18px; height: 18px; pointer-events: none; }

/* ==================== 表单 ==================== */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: var(--bg-soft);
    color: var(--text);
}
.form-group input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); background: #fff; }
.input-wrap input { padding-right: 40px !important; }

/* ==================== 按钮 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border: none;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.18s;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.2;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 1px 2px rgba(37,99,235,0.2); }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 4px 12px rgba(37,99,235,0.3); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0); }
.btn-danger { background: var(--danger); color: #fff; box-shadow: 0 1px 2px rgba(239,68,68,0.2); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,0.3); transform: translateY(-1px); }
.btn-outline { background: #fff; border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--bg-soft); border-color: var(--text-tertiary); }
.btn-ghost { background: transparent; color: var(--text-secondary); }
.btn-ghost:hover { background: var(--bg-soft); color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-icon { padding: 6px; width: 32px; height: 32px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

/* ==================== 布局 ==================== */
.header {
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
}
.header-brand { display: flex; align-items: center; gap: 10px; }
.header-brand .brand-mark {
    width: 32px; height: 32px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 2px 8px rgba(37,99,235,0.3);
}
.header-brand .brand-mark svg { width: 18px; height: 18px; color: #fff; }
.header h1 { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.header-right { display: flex; align-items: center; gap: 12px; }
.header-right span { font-size: 13px; color: var(--text-secondary); }
.user-chip {
    display: flex; align-items: center; gap: 8px;
    padding: 4px 12px 4px 4px;
    background: var(--bg-soft);
    border-radius: 20px;
    border: 1px solid var(--border);
}
.user-chip .avatar {
    width: 26px; height: 26px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 12px; font-weight: 600;
}

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

/* ==================== 统计卡片 ==================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card.clickable { cursor: pointer; }
.stat-card.clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.stat-card.clickable:active { transform: translateY(0); }
.stat-icon {
    width: 44px; height: 44px;
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-icon.blue { background: var(--primary-light); color: var(--primary); }
.stat-icon.green { background: var(--success-light); color: #166534; }
.stat-icon.amber { background: var(--warning-light); color: #92400e; }
.stat-icon.purple { background: #ede9fe; color: #6d28d9; }
.stat-icon.red { background: var(--danger-light); color: #991b1b; }
.stat-info { min-width: 0; }
.stat-value { font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--text); }
.stat-label { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

/* ==================== 卡片 ==================== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 0;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}
.card-body { padding: 0; }
.card h3 { font-size: 16px; margin-bottom: 16px; }

/* ==================== 表格 ==================== */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
thead { background: var(--bg-soft); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border-soft); }
th { font-weight: 600; color: var(--text-secondary); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
tbody tr { transition: background 0.15s; }
tbody tr:hover { background: var(--bg-soft); }
tbody tr:last-child td { border-bottom: none; }
td strong { font-weight: 600; }
.host-name-cell { display: flex; align-items: center; gap: 10px; }
.host-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, #dbeafe, #bfdbfe);
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.host-icon svg { width: 18px; height: 18px; }
.mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 13px; color: var(--text-secondary); }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-light); color: #166534; }
.badge-danger { background: var(--danger-light); color: #991b1b; }
.badge-info { background: #dbeafe; color: #1e40af; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-success::before { animation: none; }
.badge-danger::before { animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

/* 主机分组标签 */
.group-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}

/* 告警通知 */
.alert-badge {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.alert-badge:hover { background: #fff; border-color: var(--text-tertiary); }
.alert-badge.has-unread { background: var(--danger-light); border-color: var(--danger); color: #991b1b; }
.alert-badge .alert-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    margin-left: 6px;
    border-radius: 9px;
    background: var(--text-tertiary);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}
.alert-badge.has-unread .alert-count { background: var(--danger); animation: pulse 1.5s ease-in-out infinite; }

.severity-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.4;
}
.severity-critical { background: var(--danger-light); color: #991b1b; font-weight: 700; border-left: 3px solid var(--danger); }
.severity-warning { background: var(--warning-light); color: #92400e; }
.severity-info { background: var(--primary-light); color: var(--primary); }

.category-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 500;
    background: var(--bg-soft);
    color: var(--text-secondary);
    white-space: nowrap;
}

.actions { display: flex; gap: 6px; }

/* 2FA 二维码：统一渲染尺寸，确保可被手机扫码识别 */
#qr-box svg, #sec-qr-box svg { width: 200px; height: 200px; display: block; }

/* ==================== 工具栏 ==================== */
.page-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.page-toolbar .left, .page-toolbar .right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-box {
    position: relative;
}
.search-box svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-tertiary); pointer-events: none; }
.search-box input {
    padding: 7px 12px 7px 32px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
    min-width: 220px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.search-box input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }

/* ==================== Tabs ==================== */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px; }
.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 6px 6px 0 0;
}
.tab svg { width: 16px; height: 16px; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab:hover:not(.active) { color: var(--text); background: var(--bg-soft); }
.tab-badge {
    background: var(--border);
    color: var(--text-secondary);
    border-radius: 10px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 600;
}
.tab.active .tab-badge { background: var(--primary-light); color: var(--primary); }

/* ==================== Modal ==================== */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(4px);
    display: flex; justify-content: center; align-items: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
    padding: 20px;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 28px;
    width: 460px;
    max-width: 100%;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalIn { from { opacity: 0; transform: translateY(20px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal h2 { font-size: 18px; margin-bottom: 4px; font-weight: 600; }
.modal .modal-desc { font-size: 13px; color: var(--text-secondary); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

.hidden { display: none !important; }

/* ==================== 录像工具栏 ==================== */
.recordings-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 12px;
    flex-wrap: wrap;
}
.recordings-toolbar .filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filter-input {
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
    min-width: 140px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-input:focus { border-color: var(--primary); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.12); }
.batch-actions { display: flex; align-items: center; gap: 12px; }
.batch-actions span { font-size: 13px; color: var(--text-secondary); }
.batch-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* 排序按钮 */
.sort-btn {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 7px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    background: #fff;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}
.sort-btn:hover { background: var(--bg-soft); color: var(--text); }
.sort-btn.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.sort-btn svg { width: 14px; height: 14px; }

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--text-secondary);
}
.empty-state svg { width: 56px; height: 56px; color: var(--border); margin-bottom: 12px; }
.empty-state h4 { font-size: 15px; color: var(--text); margin-bottom: 4px; font-weight: 600; }
.empty-state p { font-size: 13px; }

/* ==================== RDP 客户端 ==================== */
#rdp-container {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: #1a1a2e;
}
#rdp-display {
    width: 100%; height: 100%;
    overflow: auto;
}
#rdp-display canvas { display: block; }
#rdp-toolbar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 44px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    z-index: 10;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
#rdp-toolbar.visible { opacity: 1; pointer-events: auto; }
.toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; }
.toolbar-title { display: flex; align-items: center; gap: 8px; color: #fff; font-size: 13px; font-weight: 500; }
.toolbar-title svg { width: 16px; height: 16px; color: #60a5fa; }
.toolbar-divider { width: 1px; height: 20px; background: rgba(255,255,255,0.12); margin: 0 4px; }
#rdp-toolbar .tb-btn {
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: background 0.15s;
}
#rdp-toolbar .tb-btn:hover { background: rgba(255,255,255,0.22); }
#rdp-toolbar .tb-btn svg { width: 15px; height: 15px; }
#rdp-toolbar .tb-btn.danger:hover { background: rgba(239,68,68,0.8); }
#rdp-toolbar .tb-btn.active { background: var(--primary); }
.toolbar-timer { color: rgba(255,255,255,0.7); font-size: 12px; font-variant-numeric: tabular-nums; padding: 0 6px; }

#rdp-status {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    z-index: 20;
    pointer-events: none;
    text-align: center;
    transition: opacity 0.5s ease;
}
#rdp-status.fade-out { opacity: 0; }
#rdp-status .status-icon {
    width: 48px; height: 48px;
    margin: 0 auto 12px;
    border-radius: 50%;
    border: 3px solid rgba(96,165,250,0.3);
    border-top-color: #60a5fa;
    animation: spin 0.9s linear infinite;
}
#rdp-status.connected .status-icon { border: none; animation: none; background: var(--success); display: flex; align-items: center; justify-content: center; }
#rdp-status.connected .status-icon svg { width: 26px; height: 26px; color: #fff; animation: none; }
#rdp-status.error .status-icon { border: none; animation: none; background: var(--danger); display: flex; align-items: center; justify-content: center; }
#rdp-status.error .status-icon svg { width: 26px; height: 26px; color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

#rdp-reconnect {
    position: fixed; top: 50%; left: 50%;
    transform: translate(-50%, calc(-50% + 60px));
    z-index: 25;
    display: none;
}
#rdp-reconnect.visible { display: block; }

#rdp-watermark {
    position: fixed; bottom: 16px; right: 16px;
    color: rgba(255,255,255,0.25);
    font-size: 12px;
    z-index: 5;
    pointer-events: none;
}

/* ==================== 录像回放 ==================== */
#playback-display canvas { display: block; }

/* ==================== Toast ==================== */
.toast {
    position: fixed; top: 20px; right: 20px;
    padding: 12px 18px;
    border-radius: var(--radius);
    color: #fff;
    font-size: 14px;
    z-index: 200;
    animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-md);
    max-width: 360px;
}
.toast svg { width: 18px; height: 18px; flex-shrink: 0; }
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
@keyframes slideIn { from { transform: translateX(110%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ==================== 滚动条 ==================== */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; background-clip: content-box; }

/* ==================== 响应式 ==================== */
@media (max-width: 640px) {
    .container { padding: 16px; }
    .header { padding: 0 14px; height: 54px; }
    .header h1 { font-size: 15px; }
    .header-right .user-chip { padding: 3px 10px 3px 3px; }
    .header-right .user-chip .avatar { width: 22px; height: 22px; font-size: 11px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .stat-card { padding: 14px; gap: 10px; }
    .stat-icon { width: 38px; height: 38px; }
    .stat-value { font-size: 18px; }
    th, td { padding: 9px 10px; font-size: 13px; }
    .search-box input { min-width: 140px; }
    .tab { padding: 8px 14px; font-size: 13px; }
}

/* ==================== 连接历史图表 ==================== */
.history-charts {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 16px;
    margin-bottom: 18px;
}
.history-charts .chart-card { padding: 16px; }
.history-charts .chart-card h3 { margin: 0 0 12px; font-size: 14px; font-weight: 600; }
/* 第三张图（Top 主机）占满整行 */
.history-charts .chart-card:nth-child(3) { grid-column: 1 / -1; }
.chart-container {
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
}
.chart-container svg { max-width: 100%; }
.chart-empty {
    color: var(--text-secondary);
    font-size: 13px;
    padding: 40px 0;
    text-align: center;
}
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 14px;
}
.pagination button:disabled { opacity: 0.5; cursor: not-allowed; }

@media (max-width: 640px) {
    .history-charts { grid-template-columns: 1fr; }
    .history-charts .chart-card:nth-child(3) { grid-column: auto; }
}
