/* ========================================
   瞳距AI智能摄像机管理平台 - 现代化UI
   ======================================== */

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

:root {
    /* 主色调 - 科技蓝紫渐变 */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --primary-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    
    /* 辅助色 */
    --success: #10b981;
    --success-light: #d1fae5;
    --warning: #f59e0b;
    --warning-light: #fef3c7;
    --danger: #ef4444;
    --danger-light: #fee2e2;
    --info: #3b82f6;
    --info-light: #dbeafe;
    
    /* 背景色 */
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: linear-gradient(180deg, #475569 0%, #334155 100%);
    
    /* 文字色 */
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* 边框和分割线 */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-md: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* 圆角 */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    display: flex;
    min-height: 100vh;
}

/* ========== 侧边栏 ========== */
.sidebar {
    width: 260px;
    background: var(--bg-sidebar);
    padding: 0;
    display: flex;
    flex-direction: column;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}

.logo {
    padding: 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.5px;
}

.nav-menu {
    display: flex;
    flex-direction: column;
    padding: 16px 12px;
    gap: 4px;
    flex: 1;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: all 0.2s ease;
    border-radius: var(--radius);
    font-weight: 500;
    font-size: 0.95rem;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-item.active {
    background: var(--primary-gradient);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.nav-item .icon {
    font-size: 1.25rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-footer .nav-item {
    color: rgba(255, 255, 255, 0.5);
}

.sidebar-footer .nav-item:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
}

/* ========== 主内容区 ========== */
.main-content {
    flex: 1;
    padding: 32px 40px;
    margin-left: 260px;
    overflow-y: auto;
    min-height: 100vh;
}

.page {
    display: none;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.page.active {
    display: block;
}

.page h1 {
    font-size: 1.75rem;
    margin-bottom: 28px;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.5px;
}

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

.page-header h1 {
    margin-bottom: 0;
}

/* ========== 统计卡片 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--primary-gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(1) .stat-icon { background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); }
.stat-card:nth-child(2) .stat-icon { background: linear-gradient(135deg, #10b981 0%, #34d399 100%); }
.stat-card:nth-child(3) .stat-icon { background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%); }
.stat-card:nth-child(4) .stat-icon { background: linear-gradient(135deg, #3b82f6 0%, #60a5fa 100%); }

.stat-icon {
    font-size: 1.75rem;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    color: white;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
    letter-spacing: -1px;
}

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

/* ========== 区块和表格 ========== */
.section {
    margin-top: 32px;
}

.section h2 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h2::before {
    content: '';
    width: 4px;
    height: 20px;
    background: var(--primary-gradient);
    border-radius: 2px;
}

.table-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px 20px;
    text-align: left;
}

th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid var(--border-color);
    white-space: nowrap;
}

td {
    border-bottom: 1px solid var(--border-light);
    color: var(--text-primary);
    font-size: 0.95rem;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background 0.2s ease;
}

tbody tr:hover {
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.03) 0%, rgba(139, 92, 246, 0.03) 100%);
}

/* ========== 状态标签 ========== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.status::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.status-online,
.status-streaming {
    background: var(--success-light);
    color: #059669;
}

.status-online::before,
.status-streaming::before {
    background: var(--success);
}

.status-offline,
.status-idle {
    background: #f1f5f9;
    color: var(--text-secondary);
}

.status-offline::before,
.status-idle::before {
    background: var(--text-muted);
    animation: none;
}

.status-connecting {
    background: var(--warning-light);
    color: #d97706;
}

.status-connecting::before {
    background: var(--warning);
}

.status-warning {
    background: var(--warning-light);
    color: #d97706;
}

.status-warning::before {
    background: var(--warning);
}

.status-error {
    background: var(--danger-light);
    color: #dc2626;
}

.status-error::before {
    background: var(--danger);
}

/* ========== 按钮 ========== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #f87171 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f1f5f9;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
}

.board-auth-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.board-auth-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.chip {
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-secondary);
    border-radius: 999px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 0.85rem;
}

.chip.active {
    background: var(--primary-gradient);
    color: #fff;
    border-color: transparent;
}

.board-auth-inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.board-auth-inline-form label {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.board-auth-inline-form input {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
    background: #fff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.btn-sm + .btn-sm {
    margin-left: 6px;
}

/* ========== 徽章 ========== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

.badge-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.badge-success {
    background: var(--success-light);
    color: #059669;
}

/* ========== 空状态 ========== */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state div {
    font-size: 1rem;
    margin-bottom: 8px;
}

.empty-state .btn {
    margin-top: 20px;
}

/* ========== 登录页面 ========== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 50%, #1e1b4b 100%);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.login-page::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(59, 130, 246, 0.1) 0%, transparent 50%);
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(5deg); }
    66% { transform: translate(-20px, 20px) rotate(-5deg); }
}

.login-container {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg), 0 0 80px rgba(99, 102, 241, 0.15);
    padding: 48px 40px;
    width: 100%;
    max-width: 440px;
    animation: slideUp 0.6s ease-out;
    position: relative;
    backdrop-filter: blur(20px);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.login-logo {
    font-size: 3.5rem;
    margin-bottom: 16px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.3;
    letter-spacing: -0.5px;
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

.form-group input[type="text"],
.form-group input[type="password"] {
    padding: 14px 18px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    background: #f8fafc;
}

.form-group input[type="text"]:focus,
.form-group input[type="password"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

.form-group input::placeholder {
    color: var(--text-muted);
}

.remember-me {
    flex-direction: row;
    align-items: center;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--primary);
    border-radius: 4px;
}

.login-btn {
    padding: 16px;
    background: var(--primary-gradient);
    color: white;
    border: none;
    border-radius: var(--radius);
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 8px;
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
    letter-spacing: 0.5px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5);
}

.login-btn:active {
    transform: translateY(0);
}

.login-error {
    color: var(--danger);
    font-size: 0.9rem;
    text-align: center;
    min-height: 20px;
    margin-top: 8px;
    font-weight: 500;
}

.login-footer {
    margin-top: 32px;
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.login-footer p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ========== 关系树 ========== */
.relationship-container {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 28px;
    margin-top: 20px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-light);
}

.tree-root {
    list-style: none;
    padding: 0;
}

.tree-node {
    position: relative;
    padding-left: 20px;
    margin-bottom: 16px;
}

.app-node {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
    color: var(--primary);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    padding: 14px 18px;
    border-radius: var(--radius);
    border: 1px solid rgba(99, 102, 241, 0.15);
    transition: all 0.2s ease;
}

.app-node:hover {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    box-shadow: var(--shadow-sm);
}

.device-list {
    list-style: none;
    padding-left: 40px;
    margin-top: 12px;
    position: relative;
}

.device-list::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 20px;
    width: 2px;
    background: linear-gradient(180deg, var(--border-color) 0%, transparent 100%);
    border-radius: 1px;
}

.device-node {
    position: relative;
    padding: 12px 16px;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.device-node:hover {
    background: #f1f5f9;
    border-color: var(--border-color);
}

.device-node::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 50%;
    width: 20px;
    height: 2px;
    background: var(--border-color);
}

.node-icon {
    font-size: 1.3rem;
}

.node-id {
    font-family: 'SF Mono', Monaco, 'Courier New', monospace;
    background: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.badge-platform {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--text-primary);
    color: white;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: var(--shadow-lg), 0 0 60px rgba(0, 0, 0, 0.2);
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(180deg, #f8fafc 0%, white 100%);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    color: var(--text-primary);
}

.modal-close {
    background: #f1f5f9;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px 12px;
    line-height: 1;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: var(--danger-light);
    color: var(--danger);
}

.modal-form {
    padding: 28px;
}

.modal-form .form-group {
    margin-bottom: 20px;
}

.modal-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.modal-form input[type="text"],
.modal-form input[type="number"],
.modal-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    outline: none;
    background: #f8fafc;
}

.modal-form input[type="text"]:focus,
.modal-form input[type="number"]:focus,
.modal-form textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
    background: white;
}

.modal-form textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-row .form-group {
    flex: 1;
}

.checkbox-group {
    flex-direction: row !important;
    align-items: center;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
    }
    
    .logo h2 span:not(.icon),
    .nav-item span:not(.icon) {
        display: none;
    }
    
    .logo {
        padding: 20px 16px;
    }
    
    .logo h2 {
        justify-content: center;
    }
    
    .nav-menu {
        padding: 16px 8px;
    }
    
    .nav-item {
        justify-content: center;
        padding: 14px;
    }
    
    .main-content {
        margin-left: 80px;
        padding: 24px;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }
    
    .stat-card {
        padding: 20px;
    }
    
    .stat-icon {
        width: 52px;
        height: 52px;
        font-size: 1.5rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .table-container {
        overflow-x: auto;
    }
    
    th, td {
        padding: 12px 16px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .login-container {
        padding: 36px 24px;
    }
    
    .login-title {
        font-size: 1.3rem;
    }
    
    .login-logo {
        font-size: 2.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* ========== 滚动条美化 ========== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ========== 文字选中效果 ========== */
::selection {
    background: rgba(99, 102, 241, 0.2);
    color: var(--text-primary);
}

/* ========== 加载动画 ========== */
@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.loading {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

/* ========== 负荷进度条 ========== */
.load-bar-container {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 4px;
}

.load-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease, background 0.3s ease;
}

.load-low {
    background: linear-gradient(90deg, #10b981 0%, #34d399 100%);
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.load-medium {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.load-high {
    background: linear-gradient(90deg, #ef4444 0%, #f87171 100%);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
    animation: pulse-bar 1.5s ease-in-out infinite;
}

@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ========== 实时刷新状态 ========== */
.refresh-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--success-light);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #059669;
    transition: all 0.3s ease;
}

.refresh-status.refreshing {
    background: var(--info-light);
    color: #2563eb;
}

.refresh-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #10b981;
    animation: pulse-dot 2s infinite;
}

.refresh-status.refreshing .refresh-dot {
    background: #3b82f6;
    animation: pulse-dot 0.5s infinite;
}

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