/* ========================================
   芯枢护电 - 安全态势感知平台 样式表
   深色科技感主题
   ======================================== */

:root {
    --bg-primary: #0a0e17;
    --bg-secondary: #1a1f2e;
    --bg-tertiary: #242938;
    --bg-card: #1a1f2e;
    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-green: #10b981;
    --accent-yellow: #f59e0b;
    --accent-orange: #f97316;
    --accent-red: #ef4444;
    --accent-purple: #8b5cf6;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border-color: #2d3548;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 32px rgba(59, 130, 246, 0.15);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ---- 布局 ---- */
.app-container {
    display: grid;
    grid-template-columns: 240px 1fr;
    grid-template-rows: 64px 1fr;
    min-height: 100vh;
}

/* ---- 顶栏 ---- */
.top-bar {
    grid-column: 1 / -1;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 100;
}

.top-bar .logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.top-bar .logo i {
    font-size: 24px;
    color: var(--accent-cyan);
}

.top-bar .logo h1 {
    font-size: 18px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.top-bar .status-bar {
    display: flex;
    align-items: center;
    gap: 16px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-green);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ---- 侧边栏 ---- */
.sidebar {
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    padding: 16px 0;
    overflow-y: auto;
}

.nav-list {
    list-style: none;
}

.nav-item {
    margin: 2px 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    transition: var(--transition);
    cursor: pointer;
}

.nav-link:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.1));
    color: var(--accent-cyan);
    border-left: 3px solid var(--accent-cyan);
}

.nav-link i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

/* ---- 主内容区 ---- */
.main-content {
    padding: 24px;
    overflow-y: auto;
    max-height: calc(100vh - 64px);
}

.panel {
    display: none;
}

.panel.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---- 统计卡片 ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, var(--accent-blue), var(--accent-cyan)); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, var(--accent-green), #34d399); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, var(--accent-orange), var(--accent-red)); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, var(--accent-purple), #a78bfa); }

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent-blue);
}

.stat-icon {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.15); color: var(--accent-blue); }
.stat-icon.green { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); }
.stat-icon.orange { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.15); color: var(--accent-purple); }

.stat-info h3 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-info p {
    font-size: 13px;
    color: var(--text-secondary);
}

.stat-sub {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.stat-sub i {
    font-size: 9px;
    margin-right: 2px;
}

/* ---- 卡片容器 ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-header h2 i {
    color: var(--accent-cyan);
}

/* ---- 表格 ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table th {
    padding: 12px 16px;
    text-align: left;
    color: var(--text-secondary);
    font-weight: 500;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(45, 53, 72, 0.5);
}

.data-table tr:nth-child(even) {
    background: rgba(36, 41, 56, 0.4);
}

.data-table tr:hover {
    background: rgba(59, 130, 246, 0.05);
}

/* ---- 徽章 ---- */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-critical { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-high { background: rgba(249, 115, 22, 0.15); color: var(--accent-orange); border: 1px solid rgba(249, 115, 22, 0.3); }
.badge-medium { background: rgba(245, 158, 11, 0.15); color: var(--accent-yellow); border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-normal { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-revoked { background: rgba(239, 68, 68, 0.15); color: var(--accent-red); border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-expired { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.3); }
.badge-online { background: rgba(16, 185, 129, 0.15); color: var(--accent-green); border: 1px solid rgba(16, 185, 129, 0.3); }
.badge-offline { background: rgba(100, 116, 139, 0.15); color: var(--text-muted); border: 1px solid rgba(100, 116, 139, 0.3); }

/* ---- 筛选栏 ---- */
.filter-bar {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar input,
.filter-bar select {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 8px 14px;
    color: var(--text-primary);
    font-size: 13px;
    outline: none;
    transition: var(--transition);
}

.filter-bar input:focus,
.filter-bar select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--accent-blue);
}

/* ---- 图表容器 ---- */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 20px;
}

.chart-container h3 {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-container h3 i {
    color: var(--accent-cyan);
}

/* ---- 配置表单 ---- */
.config-form {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
}

.form-group input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* ---- 分页 ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.pagination button {
    padding: 6px 12px;
    border-radius: 6px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.pagination button:hover:not(:disabled) {
    border-color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.1);
}

.pagination button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.pagination span {
    font-size: 13px;
    color: var(--text-secondary);
}

/* ---- 网关健康独立页面（全屏展示） ---- */
.gw-full-card {
    margin-bottom: 20px;
}

.gw-full-body {
    display: grid;
    gap: 20px;
}

.gw-full-section {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    border: 1px solid var(--border-color);
}

.gw-full-section h4 {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.gw-full-section h4 i {
    color: var(--accent-cyan);
    font-size: 14px;
}

/* 组件状态单行并排 */
.gw-comp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
}

.gw-comp-inline {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 4px;
    background: var(--bg-card);
    border: 1px solid var(--border-color, #444);
}

.gw-comp-inline i {
    font-size: 11px;
    width: 14px;
    text-align: center;
}

.gw-comp-ok {
    color: var(--accent-green);
    font-weight: 600;
    font-size: 12px;
}

.gw-comp-warn {
    color: var(--accent-orange);
    font-weight: 600;
    font-size: 12px;
}

.gw-comp-fail {
    color: var(--accent-red);
    font-weight: 600;
    font-size: 12px;
    animation: pulse 1.5s infinite;
}

/* 元数据行 */
.gw-full-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    color: var(--text-secondary);
}

.gw-full-meta i {
    color: var(--text-muted);
    margin-right: 4px;
}

.gw-full-meta strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* ---- 联邦学习时间线 ---- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding: 16px 0;
    padding-left: 24px;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 22px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-cyan);
    border: 3px solid var(--bg-primary);
}

.timeline-item .round-info {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    border: 1px solid var(--border-color);
}

.timeline-item .round-id {
    font-weight: 600;
    color: var(--accent-cyan);
    margin-bottom: 6px;
}

.timeline-item .round-meta {
    display: flex;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.timeline-item .participants {
    margin-top: 8px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.participant-tag {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 11px;
    color: var(--accent-blue);
}

/* ---- Toast通知 ---- */
.toast {
    position: fixed;
    top: 80px;
    right: 24px;
    background: var(--bg-secondary);
    border: 1px solid var(--accent-green);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    color: var(--text-primary);
    font-size: 14px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    pointer-events: none;
    max-width: 360px;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
}

/* ---- 指标仪表 ---- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-item {
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.metric-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.metric-value.highlight { color: var(--accent-cyan); }
.metric-value.warning { color: var(--accent-yellow); }
.metric-value.success { color: var(--accent-green); }

.metric-label {
    font-size: 12px;
    color: var(--text-secondary);
}

/* ---- 模型哈希 ---- */
.hash-display {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--accent-purple);
    background: rgba(139, 92, 246, 0.08);
    padding: 2px 8px;
    border-radius: 4px;
    word-break: break-all;
}

/* ---- 响应式 ---- */
/* 响应式样式已移至文件末尾统一管理 */

/* ---- 滚动条 ---- */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- 加载动画 ---- */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-secondary);
}

.loading::after {
    content: '';
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ---- 数据来源徽章 ---- */
.data-source-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    white-space: nowrap;
}

.data-source-badge.mock {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-yellow);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.data-source-badge.live {
    background: rgba(16, 185, 129, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

/* ---- 实时告警条目 ---- */
.realtime-alarm-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-bottom: 1px solid rgba(45, 53, 72, 0.4);
    font-size: 12px;
    animation: fadeIn 0.3s ease;
}

.realtime-alarm-item:last-child {
    border-bottom: none;
}

.realtime-alarm-item .alarm-device {
    font-family: monospace;
    color: var(--accent-blue);
    min-width: 70px;
}

.realtime-alarm-item .alarm-time {
    color: var(--text-muted);
    margin-left: auto;
}

.realtime-alarm-item .alarm-score {
    color: var(--text-secondary);
    font-family: monospace;
    font-size: 11px;
}

/* ---- 待处理设备提醒 ---- */
.pending-notice {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(249, 115, 22, 0.05));
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: var(--radius);
    margin-bottom: 20px;
    overflow: hidden;
    animation: fadeIn 0.4s ease;
}

.pending-notice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px;
    cursor: default;
}

.pending-notice-header > span {
    font-size: 14px;
    color: var(--accent-orange);
    display: flex;
    align-items: center;
    gap: 8px;
}

.pending-notice-header > span i {
    font-size: 16px;
    animation: pulse 2s infinite;
}

.btn-pending-toggle {
    background: none;
    border: none;
    color: var(--accent-orange);
    cursor: pointer;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-pending-toggle:hover {
    background: rgba(245, 158, 11, 0.1);
}

.pending-list-wrap {
    padding: 0 20px 16px;
}

.pending-table th {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* 已删除设备行 */
.row-deleted {
    opacity: 0.65;
    background: rgba(239, 68, 68, 0.04);
}

.row-deleted code {
    text-decoration: line-through;
    color: var(--text-muted);
}

.pending-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-left: 8px;
}

.pending-tag.auto {
    background: rgba(245, 158, 11, 0.15);
    color: var(--accent-orange);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.pending-tag.unknown {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.pending-tag.gateway {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
    border: 1px solid rgba(59, 130, 246, 0.25);
}

/* ---- 设备类型徽章 ---- */
.device-type-gateway {
    background: rgba(59, 130, 246, 0.12) !important;
    color: var(--accent-blue) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    font-size: 12px !important;
    padding: 3px 10px !important;
}

.device-type-end {
    background: rgba(6, 182, 212, 0.10) !important;
    color: var(--accent-cyan) !important;
    border: 1px solid rgba(6, 182, 212, 0.22) !important;
    font-size: 12px !important;
    padding: 3px 10px !important;
}

/* ---- 网关行高亮 ---- */
.row-gateway {
    background: rgba(59, 130, 246, 0.03);
}

.row-gateway:hover {
    background: rgba(59, 130, 246, 0.07) !important;
}

/* ---- 归属网关标签 ---- */
.gw-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
}

.gw-tag i {
    font-size: 10px;
    color: var(--text-muted);
}

.gw-tag.self {
    background: rgba(59, 130, 246, 0.08);
    color: var(--accent-blue);
    border-color: rgba(59, 130, 246, 0.2);
}

.gw-tag.self i {
    color: var(--accent-blue);
}

/* ---- 确认弹窗 ---- */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    width: 100%;
    max-width: 480px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 0;
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.modal-header h3 i {
    color: var(--accent-cyan);
}

.btn-modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    transition: var(--transition);
}

.btn-modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px 24px;
}

.modal-body .form-group {
    margin-bottom: 16px;
}

.modal-body .form-group input,
.modal-body .form-group textarea {
    width: 100%;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: inherit;
}

.modal-body .form-group input:focus,
.modal-body .form-group textarea:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.confirm-info-box {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(6, 182, 212, 0.06);
    border: 1px solid rgba(6, 182, 212, 0.15);
    border-radius: var(--radius-sm);
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.confirm-info-box i {
    color: var(--accent-cyan);
    margin-top: 2px;
    flex-shrink: 0;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 0 24px 20px;
}

/* ---- 待处理设备提醒 ---- */
.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

/* ---- 移动端侧边栏 ---- */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        grid-template-rows: 64px 1fr;
    }
    .sidebar {
        position: fixed;
        top: 64px;
        left: -260px;
        width: 260px;
        height: calc(100vh - 64px);
        z-index: 200;
        transition: left 0.3s ease;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.4);
    }
    .sidebar.open {
        left: 0;
    }
    .main-content {
        grid-column: 1;
    }
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .charts-grid {
        grid-template-columns: 1fr;
    }
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .config-form {
        grid-template-columns: 1fr;
    }
    .top-bar .logo h1 {
        font-size: 14px;
    }
}

@media (max-width: 640px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    .main-content {
        padding: 12px;
    }
    .filter-bar {
        flex-direction: column;
    }
    .filter-bar input,
    .filter-bar select {
        width: 100%;
    }
    .top-bar {
        padding: 0 12px;
    }
    .top-bar .logo h1 {
        font-size: 13px;
    }
    .status-bar {
        gap: 8px;
        flex-wrap: wrap;
    }
}

/* =============================================
   侧边栏 - 网关健康状态（独立区域，始终可见）
   ============================================= */
#sidebar-gw-health {
    margin: 12px 8px 0;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.sgw-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sgw-header i {
    color: var(--accent-cyan);
    font-size: 13px;
}

.sgw-count {
    margin-left: auto;
    font-size: 10px;
    font-weight: 500;
    color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.10);
    border: 1px solid rgba(6, 182, 212, 0.20);
    border-radius: 10px;
    padding: 1px 8px;
}

.sgw-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sgw-placeholder {
    padding: 12px 8px;
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
}

/* ── 单个网关卡片 ── */
.sgw-card {
    background: var(--bg-tertiary);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    transition: var(--transition);
}

.sgw-card:hover {
    border-color: rgba(59, 130, 246, 0.25);
    background: rgba(59, 130, 246, 0.04);
}

/* ── 网关标题行：device_id + 整体状态 ── */
.sgw-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.sgw-title code {
    font-size: 11px;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.04);
    padding: 1px 6px;
    border-radius: 3px;
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sgw-status {
    font-size: 10px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}

.sgw-status.sgw-dot-ok {
    color: var(--accent-green);
    background: rgba(16, 185, 129, 0.10);
    border: 1px solid rgba(16, 185, 129, 0.20);
}

.sgw-status.sgw-dot-warn {
    color: var(--accent-orange);
    background: rgba(245, 158, 11, 0.10);
    border: 1px solid rgba(245, 158, 11, 0.20);
}

.sgw-status.sgw-dot-fail {
    color: var(--accent-red);
    background: rgba(239, 68, 68, 0.10);
    border: 1px solid rgba(239, 68, 68, 0.20);
    animation: pulse 1.5s infinite;
}

/* ── 组件行：图标 + 圆点紧凑排列 ── */
.sgw-comps {
    display: flex;
    flex-wrap: wrap;
    gap: 3px 8px;
    margin-bottom: 6px;
}

.sgw-comp {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--text-muted);
}

.sgw-comp i {
    font-size: 9px;
    width: 12px;
    text-align: center;
}

/* ── 状态圆点 ── */
.sgw-dot {
    font-size: 8px;
    line-height: 1;
}

.sgw-dot-ok  { color: var(--accent-green); }
.sgw-dot-warn { color: var(--accent-orange); }
.sgw-dot-fail { color: var(--accent-red); animation: pulse 1.5s infinite; }
.sgw-dot-none { color: var(--border-color); }

/* ── 底部：端侧设备计数 ── */
.sgw-footer {
    padding-top: 6px;
    border-top: 1px solid rgba(45, 53, 72, 0.4);
    font-size: 10px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.sgw-footer i {
    font-size: 8px;
    color: var(--accent-cyan);
}

.sgw-footer strong {
    color: var(--text-secondary);
    font-weight: 600;
}

/* ---- 网关健康状态（旧版设备面板内格式，保留兼容） ---- */
.gw-health-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.gw-health-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.gw-health-item:hover {
    border-color: var(--accent-blue);
}

.gw-hi-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.gw-hi-icon.gw-icon-ok {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.gw-hi-icon.gw-icon-fail {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
    animation: pulse 1.5s infinite;
}

.gw-hi-icon.gw-icon-warn {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-orange);
}

.gw-hi-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.gw-hi-name {
    font-size: 12px;
    color: var(--text-secondary);
}

.gw-hi-status {
    font-size: 11px;
    font-weight: 600;
    font-family: monospace;
    color: var(--text-muted);
}

.gw-hi-status.gw-ok {
    color: var(--accent-green);
}

.gw-hi-status.gw-fail {
    color: var(--accent-red);
}

.gw-hi-status.gw-warn {
    color: var(--accent-orange);
}

.gw-health-footer {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}

.gw-health-meta {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.gw-health-meta i {
    color: var(--text-muted);
    font-size: 11px;
}

.gw-health-meta strong {
    color: var(--text-primary);
}

/* ---- 多网关健康区域头部 ---- */
.gw-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.gw-section-header h2 {
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gw-section-header h2 i {
    color: var(--accent-cyan);
}

/* 多网关卡片间距 */
.gw-card {
    margin-bottom: 16px;
}

.gw-card:last-child {
    margin-bottom: 0;
}

/* 多网关卡片内标题 */
.gw-card .card-header h3 {
    font-size: 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.gw-card .card-header h3 i {
    color: var(--accent-blue);
    font-size: 14px;
}

.gw-card .card-header code {
    font-size: 14px;
}

/* ---- 联邦聚合控制 ---- */
.fed-control-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.fed-status-info {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.fed-stat-item {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fed-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fed-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: monospace;
}

/* ---- 模型版本历史 ---- */
#fed-models-tbody .hash-display {
    max-width: 160px;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* =============================================
   登录页面
   ============================================= */

.login-body {
    background: linear-gradient(135deg, #0a0e17 0%, #141829 50%, #0d1117 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 20px;
}

.login-wrapper {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 40px 36px 32px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5),
                0 0 80px rgba(59, 130, 246, 0.06);
}

/* 品牌区 */
.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(6, 182, 212, 0.15));
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: var(--accent-blue);
}

.login-brand h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 4px;
    letter-spacing: 2px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin: 0;
    letter-spacing: 1px;
}

/* 表单 */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.login-field label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.login-field label i {
    font-size: 14px;
    color: var(--text-muted);
}

.login-field input {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    font-family: inherit;
    transition: var(--transition);
    box-sizing: border-box;
}

.login-field input:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

.login-field input::placeholder {
    color: var(--text-muted);
    opacity: 0.5;
}

/* 密码框 */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 44px;
}

.btn-toggle-pwd {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: var(--transition);
    font-size: 14px;
}

.btn-toggle-pwd:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.06);
}

/* 错误提示 */
.login-error {
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    color: var(--accent-red);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.login-error::before {
    content: '\f071';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 14px;
}

/* 登录按钮 */
.login-submit {
    width: 100%;
    padding: 12px;
    font-size: 15px;
    font-weight: 600;
    margin-top: 4px;
    letter-spacing: 2px;
}

.login-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 底部信息 */
.login-footer {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.login-footer span {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0.7;
}

.login-footer i {
    font-size: 10px;
}

/* =============================================
   顶栏 - 用户信息 & 登出按钮
   ============================================= */

.user-indicator {
    display: flex;
    align-items: center;
    gap: 5px;
}

.user-indicator span {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 13px;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn-logout {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--accent-red);
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.16);
    border-color: rgba(239, 68, 68, 0.35);
}

/* ---- 设备操作列 ---- */
.action-cell {
    white-space: nowrap;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.action-cell .btn-sm {
    padding: 5px 9px;
    font-size: 11px;
    border-radius: 6px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.action-cell .btn-sm:hover {
    transform: translateY(-1px);
}

/* 删除按钮 */
.btn-delete {
    color: var(--accent-red) !important;
    border-color: rgba(239, 68, 68, 0.25) !important;
    background: rgba(239, 68, 68, 0.08) !important;
}

.btn-delete:hover {
    background: rgba(239, 68, 68, 0.18) !important;
    border-color: rgba(239, 68, 68, 0.45) !important;
}

/* 加入黑名单按钮 */
.btn-blacklist {
    color: var(--accent-orange) !important;
    border-color: rgba(249, 115, 22, 0.25) !important;
    background: rgba(249, 115, 22, 0.08) !important;
}

.btn-blacklist:hover {
    background: rgba(249, 115, 22, 0.18) !important;
    border-color: rgba(249, 115, 22, 0.45) !important;
}

/* 移出黑名单按钮 */
.btn-unblacklist {
    color: var(--accent-green) !important;
    border-color: rgba(16, 185, 129, 0.25) !important;
    background: rgba(16, 185, 129, 0.08) !important;
}

.btn-unblacklist:hover {
    background: rgba(16, 185, 129, 0.18) !important;
    border-color: rgba(16, 185, 129, 0.45) !important;
}

/* ---- 攻击横幅 ---- */
.attack-global-banner {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.9), rgba(220, 38, 38, 0.85));
    border: 1px solid rgba(239, 68, 68, 0.6);
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    overflow: hidden;
    animation: attackBannerPulse 1.5s ease-in-out infinite;
}

@keyframes attackBannerPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(239, 68, 68, 0.3); }
    50% { box-shadow: 0 0 32px rgba(239, 68, 68, 0.6); }
}

.attack-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.attack-banner-icon {
    font-size: 22px;
    animation: attackIconShake 0.5s ease-in-out infinite;
}

@keyframes attackIconShake {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(-8deg); }
    75% { transform: rotate(8deg); }
}

.attack-banner-count {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

/* ---- 受攻击行样式（优先级高于黑名单和网关） ---- */
.row-under-attack {
    background: rgba(239, 68, 68, 0.08) !important;
    border-left: 3px solid var(--accent-red) !important;
    animation: attackRowPulse 2s ease-in-out infinite;
}

@keyframes attackRowPulse {
    0%, 100% { background: rgba(239, 68, 68, 0.06); }
    50% { background: rgba(239, 68, 68, 0.12); }
}

.row-under-attack:hover {
    background: rgba(239, 68, 68, 0.14) !important;
}

/* ---- UNDER ATTACK 徽章 ---- */
.badge-under-attack {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    padding: 3px 10px !important;
    border-radius: 12px !important;
    font-size: 10px !important;
    font-weight: 700 !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: rgba(239, 68, 68, 0.2) !important;
    color: var(--accent-red) !important;
    border: 1px solid rgba(239, 68, 68, 0.45) !important;
    margin-left: 4px;
    animation: badgePulse 1s ease-in-out infinite;
}

@keyframes badgePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* ---- 黑名单行样式 ---- */
.row-blacklisted {
    background: rgba(239, 68, 68, 0.04) !important;
    opacity: 0.75;
}

.row-blacklisted:hover {
    background: rgba(239, 68, 68, 0.08) !important;
    opacity: 0.9;
}

.row-blacklisted code {
    text-decoration: line-through;
    text-decoration-color: rgba(239, 68, 68, 0.4);
}

/* 黑名单徽章 */
.badge-blacklisted {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.15);
    color: var(--accent-red);
    font-size: 9px;
    margin-left: 4px;
    vertical-align: middle;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* ---- 危险操作弹窗 ---- */
.modal-header-danger {
    border-bottom: 2px solid rgba(239, 68, 68, 0.2);
}

.modal-header-danger h3 {
    color: var(--accent-red);
}

.modal-header-danger h3 i {
    color: var(--accent-red) !important;
}

/* 危险操作确认按钮 */
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626) !important;
    color: #fff !important;
    border: none !important;
}

.btn-danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35) !important;
    transform: translateY(-1px);
}

.btn-danger:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* 恢复按钮（移出黑名单） */
.btn-restore {
    background: linear-gradient(135deg, #10b981, #059669) !important;
    color: #fff !important;
    border: none !important;
}

.btn-restore:hover {
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35) !important;
    transform: translateY(-1px);
}

.btn-restore:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ---- 面板刷新按钮 ---- */
.panel-refresh-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.btn-refresh {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--accent-cyan);
    padding: 6px 14px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-refresh:hover {
    border-color: var(--accent-cyan);
    background: rgba(6, 182, 212, 0.08);
}

.btn-refresh:active {
    transform: scale(0.97);
}

.btn-refresh i.fa-spin {
    animation: spin 0.8s linear infinite;
}

/* 上次刷新时间标签 */
.refresh-label {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 4px;
}

/* ---- 自动刷新全局开关 ---- */
.auto-refresh-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: var(--text-secondary);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.auto-refresh-toggle:hover {
    border-color: var(--accent-cyan);
}

.auto-refresh-toggle.active {
    border-color: var(--accent-green);
    background: rgba(16, 185, 129, 0.08);
}

.auto-refresh-toggle .toggle-dot {
    width: 32px;
    height: 18px;
    border-radius: 9px;
    background: var(--border-color);
    position: relative;
    transition: background 0.3s ease;
}

.auto-refresh-toggle .toggle-dot::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-muted);
    transition: transform 0.3s ease, background 0.3s ease;
}

.auto-refresh-toggle.active .toggle-dot {
    background: rgba(16, 185, 129, 0.25);
}

.auto-refresh-toggle.active .toggle-dot::after {
    transform: translateX(14px);
    background: var(--accent-green);
}

.auto-refresh-toggle .toggle-label {
    font-weight: 500;
}

.auto-refresh-toggle .toggle-interval {
    font-family: monospace;
    color: var(--accent-cyan);
}

/* ── 攻击告警弹窗 ── */
.modal-header-attack {
    background: linear-gradient(135deg, rgba(239,68,68,0.15), rgba(245,158,11,0.1));
    border-bottom: 1px solid rgba(239,68,68,0.25);
}
.modal-header-attack h3 {
    color: var(--accent-red);
}
.attack-modal-device {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-red);
    background: rgba(239,68,68,0.08);
    padding: 4px 12px;
    border-radius: 4px;
    font-family: monospace;
}
.attack-modal-icon {
    font-size: 48px;
    display: block;
    text-align: center;
    margin-bottom: 12px;
    animation: attack-pulse 1.5s ease-in-out infinite;
}
@keyframes attack-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.6; transform: scale(1.08); }
}
.btn-blacklist {
    background: var(--accent-red) !important;
    color: #fff !important;
    border: none !important;
}
.btn-blacklist:hover {
    background: #dc2626 !important;
}
.btn-acknowledge {
    background: var(--accent-yellow) !important;
    color: #000 !important;
    border: none !important;
}
.btn-acknowledge:hover {
    background: #d97706 !important;
}
/* 拉黑后设备行样式 */
.row-blacklisted-attack {
    opacity: 0.5;
    filter: grayscale(0.6);
}
