/* ===== 基础 ===== */
:root {
    --bg: #f8f9fc;
    --card-bg: #ffffff;
    --nav-bg: #1a1d23;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --accent-bg: rgba(99,102,241,0.08);
    --text: #1e293b;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --radius: 14px;
    --radius-sm: 10px;
    --shadow: 0 1px 3px rgba(0,0,0,0.04), 0 4px 16px rgba(0,0,0,0.04);
    --shadow-hover: 0 4px 24px rgba(99,102,241,0.12);
    --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

* { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; }

body {
    background: var(--bg);
    color: var(--text);
    font-size: 0.9rem;
    min-height: 100vh;
}

.main-container { padding-top: 2rem; padding-bottom: 3rem; }

/* ===== 导航栏 ===== */
.navbar {
    background: var(--nav-bg);
    padding: 0.6rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    backdrop-filter: blur(12px);
}
.navbar-brand {
    color: #fff !important;
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.02em;
}
.navbar-brand i { color: var(--accent-light); }
.nav-link {
    color: rgba(255,255,255,0.6) !important;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.5rem 1rem !important;
    border-radius: 8px;
    transition: var(--transition);
    margin: 0 2px;
}
.nav-link:hover { color: #fff !important; background: rgba(255,255,255,0.08); }
.nav-link.active { color: #fff !important; background: var(--accent); }
.btn-nav-logout {
    color: rgba(255,255,255,0.5);
    font-size: 0.82rem;
    font-weight: 500;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0.35rem 0.9rem;
    transition: var(--transition);
    text-decoration: none;
}
.btn-nav-logout:hover { color: #fff; border-color: rgba(255,255,255,0.3); background: rgba(255,255,255,0.06); }

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: var(--transition);
    overflow: hidden;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.card-header {
    background: var(--accent-bg);
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent);
    padding: 0.75rem 1.2rem;
}
.card-body { padding: 1.2rem; }
.card-title { font-weight: 600; font-size: 0.95rem; letter-spacing: -0.01em; }

/* ===== 仪表盘状态卡片 ===== */
.card-status {
    border-left: 4px solid var(--accent);
    position: relative;
}
.card-status.rotating { border-left-color: #f59e0b; }
.card-status.error { border-left-color: #ef4444; }
.card-status.monitoring { border-left-color: #22c55e; }
.card-status:hover { transform: translateY(-3px); }

/* ===== 覆盖层 ===== */
.card-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: inherit;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--accent);
}

/* ===== 按钮 ===== */
.btn {
    font-weight: 500;
    font-size: 0.82rem;
    border-radius: var(--radius-sm);
    padding: 0.4rem 0.9rem;
    transition: var(--transition);
    letter-spacing: -0.01em;
}
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; border-radius: 8px; }
.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
}
.btn-primary:hover {
    background: var(--accent-light);
    border-color: var(--accent-light);
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}
.btn-outline-primary {
    color: var(--accent);
    border-color: var(--accent);
}
.btn-outline-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 12px rgba(99,102,241,0.25);
}

/* ===== 进度条 ===== */
.progress {
    height: 22px;
    border-radius: 12px;
    background: #f1f5f9;
    overflow: hidden;
}
.progress-bar {
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    transition: width 0.6s ease;
}
.bg-success { background: linear-gradient(135deg, #22c55e, #16a34a) !important; }
.bg-warning { background: linear-gradient(135deg, #f59e0b, #d97706) !important; }
.bg-danger { background: linear-gradient(135deg, #ef4444, #dc2626) !important; }

/* ===== 表格 ===== */
.table { font-size: 0.84rem; }
.table th {
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.72rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}
.table td { vertical-align: middle; border-color: var(--border); }
.table-hover tbody tr:hover { background: var(--accent-bg); }
.table-light th { background: #f8fafc; }

/* ===== 表单 ===== */
.form-control, .form-select {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    padding: 0.55rem 0.9rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-label {
    font-weight: 500;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

/* ===== 徽章 ===== */
.badge {
    font-weight: 600;
    font-size: 0.7rem;
    padding: 0.3em 0.7em;
    border-radius: 6px;
    letter-spacing: 0.02em;
}
.status-badge { text-transform: uppercase; }

/* ===== 动画 ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}
.animate-in { animation: fadeInUp 0.4s ease both; }
.row.g-3 > [class*="col"] { animation: fadeInUp 0.4s ease both; }
.row.g-3 > [class*="col"]:nth-child(1) { animation-delay: 0.05s; }
.row.g-3 > [class*="col"]:nth-child(2) { animation-delay: 0.1s; }
.row.g-3 > [class*="col"]:nth-child(3) { animation-delay: 0.15s; }
.row.g-3 > [class*="col"]:nth-child(4) { animation-delay: 0.2s; }
.row.g-3 > [class*="col"]:nth-child(5) { animation-delay: 0.25s; }
.row.g-3 > [class*="col"]:nth-child(6) { animation-delay: 0.3s; }
.card-overlay .spinner-border { animation: pulse 1.2s ease infinite; }

/* ===== 页面标题 ===== */
.page-title {
    font-weight: 700;
    font-size: 1.3rem;
    letter-spacing: -0.02em;
    color: var(--text);
}

/* ===== 信息栏 ===== */
.info-bar {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0.6rem 1.2rem;
    font-size: 0.82rem;
}
.info-bar strong { color: var(--accent); }

/* ===== Alert ===== */
.alert {
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.84rem;
    font-weight: 500;
}

/* ===== 分页 ===== */
.page-link {
    border-radius: 8px !important;
    margin: 0 2px;
    font-size: 0.82rem;
    border: 1px solid var(--border);
    color: var(--text);
}
.page-item.active .page-link {
    background: var(--accent);
    border-color: var(--accent);
}

/* ===== 登录页 ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-card {
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.15);
    padding: 2.5rem;
    width: 100%;
    max-width: 380px;
    animation: fadeInUp 0.5s ease;
}
.login-card h5 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ===== SweetAlert2 自定义 ===== */
.swal2-popup {
    border-radius: 16px !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 0.9rem !important;
}
.swal2-confirm {
    border-radius: 10px !important;
    font-weight: 600 !important;
    background: var(--accent) !important;
}
.swal2-cancel {
    border-radius: 10px !important;
    font-weight: 500 !important;
}
