:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --card-bg: rgba(17, 24, 39, 0.75);
  --card-border: rgba(255, 255, 255, 0.12);
  --card-hover: rgba(255, 255, 255, 0.18);
  --accent-cyan: #06b6d4;
  --accent-blue: #3b82f6;
  --accent-purple: #8b5cf6;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  /* ============================================================ */
  /* 【文字颜色快捷配置区】在这里修改颜色，保存后刷新网页立即生效   */
  /* ============================================================ */
  --text-main: #ffffff;           /* 主文字颜色 (默认: 纯白，清晰醒目) */
  --text-muted: #cbd5e1;          /* 页面次要/说明文字 (已从暗灰色改为明亮银白色，彻底告别看不清) */
  --dialog-title: #38bdf8;        /* 对话框标题颜色 (高亮天蓝色) */
  --dialog-text: #e2e8f0;         /* 对话框/弹窗说明文字颜色 (清晰浅白) */
  --dialog-label: #f1f5f9;        /* 对话框表单标签文字颜色 (超清晰近白色) */
  --dialog-input: #ffffff;        /* 对话框输入框输入文字颜色 (纯白) */
  --dialog-placeholder: #94a3b8;  /* 对话框输入框灰色提示词 (调亮银灰) */
  /* ============================================================ */

  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, monospace;
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(at 0% 0%, rgba(6, 182, 212, 0.08) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(139, 92, 246, 0.08) 0px, transparent 50%);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 40px;
}

/* 顶部导航栏 */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--card-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  font-size: 24px;
}

.brand-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #38bdf8, #818cf8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-badge {
  font-size: 11px;
  padding: 2px 8px;
  background: rgba(6, 182, 212, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(6, 182, 212, 0.3);
  border-radius: 999px;
  font-family: var(--font-mono);
}

.nav-status {
  display: flex;
  align-items: center;
  gap: 20px;
}

.server-tags {
  display: flex;
  gap: 8px;
}

.tag-badge {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.tag-badge span {
  color: #fff;
  font-weight: 600;
}

.pulse-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 500;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--success);
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}

.pulse-dot.alert {
  background-color: var(--danger);
  box-shadow: 0 0 12px var(--danger);
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.nav-actions {
  display: flex;
  gap: 10px;
}

.btn-icon {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
}

/* 主容器 */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px;
}

/* 警报横幅 */
.alert-banner {
  background: linear-gradient(90deg, rgba(239, 68, 68, 0.2), rgba(245, 158, 11, 0.2));
  border: 1px solid rgba(239, 68, 68, 0.4);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeIn 0.3s ease;
}

.alert-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
}

.alert-pulse-icon {
  font-size: 20px;
}

.alert-banner-title {
  font-weight: 700;
  color: #fca5a5;
  font-size: 14px;
}

.alert-banner-text {
  font-size: 13px;
  color: #e5e7eb;
}

/* 栅格布局 */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(480px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

/* 卡片样式 */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  padding: 20px;
  transition: transform 0.2s, border-color 0.2s;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.card:hover {
  border-color: var(--card-hover);
}

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

.card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #e2e8f0;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

/* KPI 统计卡片 */
.kpi-card {
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
}

.kpi-card.cyan::before { background: var(--accent-cyan); }
.kpi-card.blue::before { background: var(--accent-blue); }
.kpi-card.purple::before { background: var(--accent-purple); }
.kpi-card.green::before { background: var(--success); }
.kpi-card.amber::before { background: var(--warning); }
.kpi-card.red::before { background: var(--danger); }

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.kpi-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.kpi-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 32px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: -0.5px;
}

.kpi-unit {
  font-size: 14px;
  color: var(--text-muted);
}

.kpi-subtext {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
}

/* 进度条 */
.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 8px;
  margin-bottom: 8px;
}

.progress-bar-fill {
  height: 100%;
  border-radius: 999px;
  transition: width 0.4s ease;
}

.fill-cyan { background: linear-gradient(90deg, #06b6d4, #3b82f6); }
.fill-green { background: linear-gradient(90deg, #10b981, #059669); }
.fill-amber { background: linear-gradient(90deg, #f59e0b, #d97706); }
.fill-red { background: linear-gradient(90deg, #ef4444, #b91c1c); }

/* 图表容器 */
.chart-container {
  width: 100%;
  height: 240px;
}

/* 应用网格列表 (精美卡片式) */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.app-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 14px;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.app-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(6, 182, 212, 0.4);
  transform: translateY(-2px);
}

.app-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.app-name {
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-tag {
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(139, 92, 246, 0.15);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}

.app-details {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.app-meta-row {
  display: flex;
  justify-content: space-between;
}

.app-ports {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
  font-weight: 600;
}

.badge-running {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #34d399;
}
.badge-running::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 6px #10b981;
}

/* 安全分析看板表格与列表 */
.radar-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.threat-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
}
.threat-status-badge.safe {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.threat-status-badge.warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fcd34d;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.threat-status-badge.alert {
  background: rgba(239, 68, 68, 0.2);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.4);
  animation: pulse 1.5s infinite;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.cyber-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  text-align: left;
}

.cyber-table th {
  padding: 10px 12px;
  color: var(--text-muted);
  font-weight: 500;
  border-bottom: 1px solid var(--card-border);
  background: rgba(255, 255, 255, 0.02);
}

.cyber-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #e5e7eb;
}

.cyber-table tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.ip-text {
  font-family: var(--font-mono);
  color: #38bdf8;
}

.badge-risk-high {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-risk-medium {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 2px 6px;
  border-radius: 4px;
}
.badge-risk-low {
  background: rgba(59, 130, 246, 0.2);
  color: #93c5fd;
  padding: 2px 6px;
  border-radius: 4px;
}

/* 标签云 / 用户名 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.user-tag {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--card-border);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-family: var(--font-mono);
  display: flex;
  gap: 6px;
}
.user-tag span {
  color: #ef4444;
  font-weight: 600;
}

/* 模态弹窗 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  background: #111827;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 28px;
  width: 90%;
  max-width: 480px;
  color: var(--dialog-text);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.7);
  animation: scaleUp 0.2s ease;
}

.modal-content h2 {
  color: var(--dialog-title) !important;
}

.modal-content p, .modal-subtitle {
  color: var(--dialog-text) !important;
  font-size: 13px !important;
  line-height: 1.6;
}

@keyframes scaleUp {
  from { transform: scale(0.95); }
  to { transform: scale(1); }
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--dialog-label);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: var(--dialog-input);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.form-input::placeholder {
  color: var(--dialog-placeholder);
}

.form-input:focus {
  border-color: var(--accent-cyan);
  background: rgba(255, 255, 255, 0.12);
}

.btn-primary {
  width: 100%;
  padding: 11px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s;
}
.btn-primary:hover {
  opacity: 0.9;
}

/* 响应式适配 */
@media (max-width: 768px) {
  .navbar {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  .grid-2, .grid-3 {
    grid-template-columns: 1fr;
  }
}
