/* ============================================================
   Nika — 神经意识 / 流浪地球 主题
   仅装饰性样式覆盖：不改动 HTML 结构与任何 JS 功能
   配色：深空蓝黑 + 青色神经光 + 行星引擎橙
   ============================================================ */

:root {
  /* 基础深空背景 */
  --bg: #060a16;
  --bg-strong: #0b1224;
  --bg-card: rgba(12, 20, 40, 0.85);

  /* 玻璃面板 */
  --panel: rgba(16, 24, 48, 0.55);
  --panel-soft: rgba(30, 41, 70, 0.5);

  /* 侧边栏（玻璃深空） */
  --sidebar: rgba(8, 12, 28, 0.72);
  --sidebar-hover: rgba(22, 30, 58, 0.82);
  --sidebar-active: rgba(34, 211, 238, 0.16);

  /* 神经青色强调 */
  --accent: #22d3ee;
  --accent-hover: #38bdf8;
  --accent-soft: rgba(34, 211, 238, 0.14);
  --accent-glow: rgba(34, 211, 238, 0.55);

  /* 行星引擎橙（点缀） */
  --engine: #ff8a3c;
  --engine-soft: rgba(255, 138, 60, 0.16);

  /* 文本 */
  --text: #e6edff;
  --text-secondary: #aab6d8;
  --muted: rgba(180, 195, 230, 0.62);

  /* 分割线 */
  --line: rgba(120, 150, 210, 0.16);
  --line-strong: rgba(120, 150, 210, 0.3);

  /* 状态色（适配深空） */
  --success: #34d399;
  --success-soft: rgba(52, 211, 153, 0.16);
  --warning: #fbbf24;
  --warning-soft: rgba(251, 191, 36, 0.16);
  --danger: #fb7185;
  --danger-soft: rgba(251, 113, 133, 0.16);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 28px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.55);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* 深空底色（canvas 失效时的兜底） */
html { background: radial-gradient(120% 120% at 50% 0%, #0a1430 0%, #05070f 55%, #03040a 100%); }

body {
  background: transparent;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* 动态背景画布：固定、不可交互、置于内容之下 */
#bg-canvas, #bg-fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* 内容层始终在画布之上 */
#app-container { position: relative; z-index: 1; }

/* ---------- 侧边栏：玻璃深空 + 神经辉光 ---------- */
.sidebar {
  background: var(--sidebar);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
  border-right: 1px solid var(--line);
  box-shadow: 1px 0 0 rgba(34, 211, 238, 0.08), 8px 0 40px rgba(0, 0, 0, 0.35);
}
.sidebar-header {
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.06), transparent);
}
.sidebar-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #22d3ee, #7dd3fc 60%, #a78bfa);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(34, 211, 238, 0.25);
}
.sidebar-subtitle { color: var(--muted); }

.nav-item {
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  margin: 2px 10px;
  padding: 10px 14px;
  position: relative;
  transition: background var(--transition), color var(--transition), transform var(--transition);
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--sidebar-active);
  color: #eafdff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.35), 0 0 18px rgba(34, 211, 238, 0.18);
}
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 22px;
  border-radius: 4px;
  background: linear-gradient(180deg, #22d3ee, #38bdf8);
  box-shadow: 0 0 12px var(--accent-glow);
}
.sidebar-footer { border-top: 1px solid var(--line); }

/* ---------- 顶栏 ---------- */
.top-bar {
  background: rgba(10, 16, 34, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(34, 211, 238, 0.06);
}
.top-bar h1 {
  font-weight: 700;
  background: linear-gradient(90deg, #e6edff, #9fd8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ---------- 卡片：玻璃 + 悬浮抬升 ---------- */
.card {
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.3);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.5), 0 0 22px rgba(34, 211, 238, 0.08);
}
.card h3 { color: #eafdff; }

/* ---------- 按钮：能量辉光 ---------- */
.btn {
  background: rgba(20, 30, 58, 0.6);
  color: var(--text);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: all var(--transition);
}
.btn:hover {
  background: rgba(34, 211, 238, 0.12);
  border-color: rgba(34, 211, 238, 0.45);
  color: #eafdff;
  box-shadow: 0 0 16px rgba(34, 211, 238, 0.18);
}
.btn-primary {
  background: linear-gradient(135deg, #22d3ee, #38bdf8);
  color: #04121a;
  border-color: transparent;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(34, 211, 238, 0.3);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #38bdf8, #22d3ee);
  color: #04121a;
  box-shadow: 0 8px 26px rgba(34, 211, 238, 0.45);
}
.btn-danger {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.4);
}
.btn-danger:hover {
  background: var(--danger-soft);
  border-color: var(--danger);
  box-shadow: 0 0 16px rgba(251, 113, 133, 0.2);
}

/* ---------- 表单 ---------- */
.form-input, .form-select {
  background: rgba(8, 14, 30, 0.6);
  color: var(--text);
  border: 1px solid var(--line-strong);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input::placeholder { color: rgba(180, 195, 230, 0.45); }
.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.18), 0 0 16px rgba(34, 211, 238, 0.12);
}
.form-group label { color: var(--text-secondary); }

/* ---------- 表格 ---------- */
.table th, .table td { border-bottom: 1px solid var(--line); color: var(--text); }
.table th { color: var(--text-secondary); }
.table tr:hover { background: rgba(34, 211, 238, 0.07); }

/* ---------- 徽章 ---------- */
.badge { border: 1px solid transparent; }
.badge-secondary { background: rgba(120, 150, 210, 0.12); color: var(--muted); }

/* ---------- 列表 ---------- */
.list-group-item {
  background: rgba(20, 30, 58, 0.45);
  border: 1px solid var(--line);
}
.list-group-item:hover { background: var(--accent-soft); }
.list-group-item.active {
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
}

/* ---------- 提示 Toast ---------- */
.toast {
  background: rgba(12, 20, 40, 0.82);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  color: var(--text);
  box-shadow: var(--shadow-lg), 0 0 18px rgba(34, 211, 238, 0.08);
}
.toast-close { color: var(--muted); }

/* ---------- 模态框 ---------- */
.modal-backdrop {
  background: rgba(3, 6, 16, 0.66);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.modal-card {
  background: rgba(12, 20, 40, 0.9);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg), 0 0 40px rgba(34, 211, 238, 0.1);
}
.modal-danger { border-top: 4px solid var(--danger); }

/* ---------- 状态/加载/空态 ---------- */
.loading-state .spinner {
  border: 3px solid rgba(34, 211, 238, 0.18);
  border-top-color: var(--accent);
  box-shadow: 0 0 18px rgba(34, 211, 238, 0.3);
}
.error-state h3 { color: var(--danger); }
.empty-state .empty-icon { filter: drop-shadow(0 0 14px rgba(34, 211, 238, 0.3)); }
.text-muted { color: var(--muted); }

/* ---------- 滚动条（深空霓虹） ---------- */
* { scrollbar-width: thin; scrollbar-color: rgba(34, 211, 238, 0.35) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.5), rgba(56, 189, 248, 0.35));
  border-radius: 10px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: linear-gradient(180deg, #22d3ee, #38bdf8); background-clip: padding-box; }

/* ---------- 设置区块卡片 ---------- */
.settings-section {
  background: var(--panel);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
}
.settings-section h3 { color: #eafdff; }

/* 尊重无障碍：减少动态 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
