/* ════════════════════════════════════════════════════════════
   HOLO · NEXUS  v2 主题
   元祖高达 RX-78 红白蓝 · 轻柔感 · 质感升级
   ════════════════════════════════════════════════════════════ */

:root {
  /* ── 表面层 ────────────────────────────────────────────── */
  --bg:        #eef2f8;         /* 主背景 */
  --bg-grad-1: #f7faff;         /* 顶部高光 */
  --bg-grad-2: #e6ecf6;         /* 底部蓝灰 */
  --surface:   rgba(255,255,255,0.78);   /* 玻璃卡 */
  --surface-2: #ffffff;
  --surface-3: #f4f7fc;
  --surface-deep: #11203a;       /* 反白卡（hero） */

  /* ── 描边 ────────────────────────────────────────────── */
  --border:        rgba(29,53,87,0.08);
  --border-2:      rgba(29,53,87,0.14);
  --border-strong: rgba(29,53,87,0.30);
  --border-line:   rgba(29,53,87,0.04);   /* 极淡分隔线 */

  /* ── 文本 ────────────────────────────────────────────── */
  --ink:    #0a1a32;     /* 强调正文 */
  --text:   #1d3557;
  --text-2: #5a6b85;
  --text-3: #94a3b8;
  --on-deep: #f1faee;    /* 深色卡上的文字 */

  /* ── 高达三色族 ──────────────────────────────────────── */
  --gd-blue:   #1d3557;
  --gd-blue-2: #2f5a82;
  --gd-blue-3: #457b9d;
  --gd-red:    #e63946;
  --gd-red-2:  #c1212e;
  --gd-yellow: #ffd60a;
  --gd-yellow-2:#f0a500;
  --gd-cyan:   #a8dadc;
  --gd-white:  #f1faee;

  /* ── 软色（半透明色块） ──────────────────────────────── */
  --blue-soft:  rgba(29,53,87,0.07);
  --blue-soft-2:rgba(29,53,87,0.14);
  --red-soft:   rgba(230,57,70,0.08);
  --red-soft-2: rgba(230,57,70,0.16);
  --yellow-soft:rgba(255,214,10,0.18);
  --cyan-soft:  rgba(168,218,220,0.40);

  /* ── 状态色 ──────────────────────────────────────────── */
  --ok:      #2a9d8f;
  --ok-soft: rgba(42,157,143,0.12);
  --warn:    #f4a261;
  --warn-soft: rgba(244,162,97,0.14);
  --err:     var(--gd-red);
  --err-soft:var(--red-soft);
  --info:    var(--gd-blue-3);
  --info-soft: rgba(69,123,157,0.10);

  /* ── 阴影分层 ─────────────────────────────────────────── */
  --shadow-1: 0 1px 2px rgba(11,29,54,0.04), 0 1px 1px rgba(11,29,54,0.03);
  --shadow-2: 0 6px 18px rgba(11,29,54,0.07), 0 2px 4px rgba(11,29,54,0.04);
  --shadow-3: 0 20px 48px rgba(11,29,54,0.12), 0 6px 14px rgba(11,29,54,0.06);
  --shadow-glow-blue: 0 8px 24px rgba(29,53,87,0.30);
  --shadow-glow-red:  0 8px 24px rgba(230,57,70,0.28);

  /* ── 圆角 ────────────────────────────────────────────── */
  --r-xs: 6px;
  --r-sm: 10px;
  --r:    14px;
  --r-lg: 18px;
  --r-xl: 24px;

  /* ── 间距 ────────────────────────────────────────────── */
  --safe-b: env(safe-area-inset-bottom, 0px);
  --side-w: 224px;       /* 桌面侧栏宽度 */
  --tab-h:  68px;        /* 移动底栏高度 */

  /* ── 字体 ────────────────────────────────────────────── */
  --f-display: 'Syne', 'PingFang SC', -apple-system, system-ui, sans-serif;
  --f-text:    'Noto Sans SC', 'PingFang SC', -apple-system, system-ui, sans-serif;
  --f-mono:    'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;

  /* ── 动效曲线 ──────────────────────────────────────────── */
  --ease:    cubic-bezier(0.4, 0, 0.2, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  overscroll-behavior: none;
}

body {
  font-family: var(--f-text);
  color: var(--text);
  height: 100dvh;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(120% 80% at 0% 0%,   rgba(168,218,220,0.20) 0%, transparent 55%),
    radial-gradient(120% 80% at 100% 100%, rgba(230,57,70,0.06) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
  background-attachment: fixed;
  display: flex;
  flex-direction: column;
}

body::before {
  /* 极淡的方格背景，机械感 */
  content: '';
  position: fixed; inset: 0;
  background-image:
    linear-gradient(0deg,  rgba(29,53,87,0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(29,53,87,0.022) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
  z-index: 0;
}

/* ── 滚动条 ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(29,53,87,0.18);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(29,53,87,0.32); }

/* ════════════════════════════════════════════════════════════
   启动屏 / Splash
   ════════════════════════════════════════════════════════════ */
#splash {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(60% 60% at 50% 40%, rgba(168,218,220,0.35), transparent 70%),
    linear-gradient(180deg, #f7faff 0%, #dde6f3 100%);
  transition: opacity 0.6s var(--ease), visibility 0.6s;
}
#splash.gone { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-radar {
  position: relative;
  width: 168px; height: 168px;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, transparent 35%, rgba(29,53,87,0.06) 36%, transparent 38%) ,
    radial-gradient(circle at center, transparent 65%, rgba(29,53,87,0.06) 66%, transparent 68%) ,
    conic-gradient(from 0deg, rgba(29,53,87,0.0), rgba(29,53,87,0.18) 60%, transparent 70%);
  border: 1.5px solid rgba(29,53,87,0.20);
  margin-bottom: 28px;
  animation: radar-spin 2.6s linear infinite;
}
.splash-radar::before, .splash-radar::after {
  content: '';
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px dashed rgba(29,53,87,0.12);
}
.splash-radar::after {
  inset: 24px;
  border: 1px solid rgba(29,53,87,0.10);
}
@keyframes radar-spin { to { transform: rotate(360deg); } }

.splash-mark {
  position: absolute; left: 50%; top: 50%;
  width: 64px; height: 64px;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  background: linear-gradient(135deg, #ffffff, var(--gd-cyan));
  border: 2px solid var(--gd-blue);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-3);
  animation: mark-pulse 2s ease-in-out infinite;
}
.splash-mark::before {
  content: '';
  width: 32px; height: 22px;
  background: var(--gd-yellow);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 0 var(--gd-red));
}
@keyframes mark-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(29,53,87,0.0), var(--shadow-3); }
  50%      { box-shadow: 0 0 0 14px rgba(29,53,87,0.0), var(--shadow-3); }
}

.splash-title {
  font-family: var(--f-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 8px;
  color: var(--gd-blue);
  margin-top: 4px;
}
.splash-sub {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 4px;
  color: var(--text-2);
  margin-top: 6px;
}
.splash-progress {
  margin-top: 22px;
  width: 220px;
  height: 2px;
  background: rgba(29,53,87,0.12);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}
.splash-progress::after {
  content: '';
  position: absolute; left: -40%; top: 0; bottom: 0; width: 40%;
  background: linear-gradient(90deg, transparent, var(--gd-red), transparent);
  animation: splash-bar 1.4s var(--ease) infinite;
}
@keyframes splash-bar {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ════════════════════════════════════════════════════════════
   总体应用框架
   ════════════════════════════════════════════════════════════ */
.app {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* 顶栏 ─ 高级玻璃感 */
.topbar {
  flex-shrink: 0;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  background: rgba(255,255,255,0.72);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 60;
}
.topbar::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--gd-blue) 22%,
    var(--gd-blue) 38%,
    var(--gd-red)  50%,
    var(--gd-blue) 62%,
    var(--gd-blue) 78%,
    transparent 100%);
  opacity: 0.55;
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffffff 0%, var(--gd-cyan) 100%);
  border: 1.5px solid var(--gd-blue);
  display: flex; align-items: center; justify-content: center;
  position: relative;
  box-shadow: var(--shadow-1);
}
.brand-mark::before {
  content: '';
  width: 20px; height: 14px;
  background: var(--gd-yellow);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 1.5px 0 var(--gd-red));
}
.brand-name {
  font-family: var(--f-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gd-blue);
  display: flex; align-items: baseline; gap: 8px;
}
.brand-name em {
  font-family: var(--f-mono);
  font-style: normal;
  font-size: 9px;
  letter-spacing: 2px;
  color: var(--gd-red);
  font-weight: 600;
  padding: 2px 7px;
  background: var(--red-soft);
  border: 1px solid rgba(230,57,70,0.25);
  border-radius: 4px;
}

.conn-row { display: flex; align-items: center; gap: 6px; }
.conn-pill {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px;
  background: rgba(255,255,255,0.6);
  border: 1px solid var(--border-2);
  border-radius: 18px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: var(--text-3);
  transition: all 0.25s var(--ease);
}
.conn-pill.ok   { background: var(--ok-soft);  color: var(--ok);  border-color: rgba(42,157,143,0.30); }
.conn-pill.fail { background: var(--err-soft); color: var(--err); border-color: rgba(230,57,70,0.30); }
.conn-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.conn-pill.ok .conn-dot {
  box-shadow: 0 0 6px currentColor;
  animation: dot-pulse 2.2s ease-in-out infinite;
}
@keyframes dot-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.4; } }

.gear-btn {
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-2);
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.gear-btn:hover {
  color: var(--gd-blue);
  background: var(--blue-soft);
  border-color: var(--border-2);
}

/* ════════════════════════════════════════════════════════════
   主体：左侧栏 + 内容区
   ════════════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex;
  overflow: hidden;
  min-height: 0;
}

.sidebar {
  flex-shrink: 0;
  width: var(--side-w);
  padding: 22px 14px;
  background: rgba(255,255,255,0.55);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.sidebar-section {
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 2.5px;
  color: var(--text-3);
  text-transform: uppercase;
  padding: 14px 12px 8px;
}
.sidebar-section:first-child { padding-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px;
  border-radius: 11px;
  color: var(--text-2);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.3px;
  position: relative;
}
.nav-item:hover {
  color: var(--gd-blue);
  background: rgba(29,53,87,0.04);
}
.nav-item.active {
  color: var(--gd-blue);
  background: rgba(255,255,255,0.85);
  border-color: var(--border-2);
  box-shadow: var(--shadow-1);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 12px; bottom: 12px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gd-blue), var(--gd-red));
  box-shadow: 0 0 6px rgba(230,57,70,0.45);
}
.nav-item svg { flex-shrink: 0; opacity: 0.85; }
.nav-item.active svg { opacity: 1; }
.nav-item .nav-meta {
  margin-left: auto;
  font-family: var(--f-mono);
  font-size: 9px;
  color: var(--text-3);
  letter-spacing: 1px;
}
.nav-item.active .nav-meta {
  color: var(--gd-red);
}

.sidebar-foot {
  margin-top: auto;
  padding: 14px 12px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 1.5px;
  color: var(--text-3);
  border-top: 1px solid var(--border);
}
.sidebar-foot b { color: var(--gd-blue); font-weight: 600; }

/* ── 内容区 ─────────────────────────────────────────────── */
.content {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-width: 0;
}
.page {
  position: absolute; inset: 0;
  overflow-y: auto;
  padding: 26px 32px 32px;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}
.page.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ════════════════════════════════════════════════════════════
   Hero / Page 标题区
   ════════════════════════════════════════════════════════════ */
.hero {
  position: relative;
  border-radius: var(--r-xl);
  padding: 22px 26px;
  margin-bottom: 22px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(241,250,238,0.85) 100%);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-2);
  overflow: hidden;
}
.hero::before {
  /* 右上一道蓝红剪线 */
  content: '';
  position: absolute;
  top: 0; right: 32px;
  width: 56px; height: 4px;
  background: linear-gradient(90deg, var(--gd-blue), var(--gd-red));
  border-radius: 0 0 4px 4px;
}
.hero::after {
  /* 右下角警示斜条 */
  content: '';
  position: absolute;
  right: -12px; bottom: -12px;
  width: 110px; height: 110px;
  background: repeating-linear-gradient(
    45deg,
    var(--gd-yellow) 0 8px,
    transparent 8px 16px);
  opacity: 0.10;
  pointer-events: none;
}
.hero-row { display: flex; align-items: flex-start; gap: 18px; flex-wrap: wrap; }
.hero-icon {
  width: 56px; height: 56px;
  flex-shrink: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gd-blue), var(--gd-blue-3));
  color: var(--gd-white);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow-blue);
}
.hero-text { flex: 1; min-width: 0; }
.hero-eyebrow {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--gd-red);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.hero-title {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--ink);
  line-height: 1.2;
}
.hero-desc {
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.65;
  max-width: 720px;
}
.hero-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-left: auto;
}

/* ── 卡片 ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-1);
  transition: box-shadow 0.25s var(--ease);
  position: relative;
}
.card:hover { box-shadow: var(--shadow-2); }
.card.accent::before {
  content: '';
  position: absolute;
  top: -1px; left: 22px;
  width: 30px; height: 3px;
  background: var(--gd-red);
  border-radius: 0 0 2px 2px;
}
.card-title {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 2.8px;
  text-transform: uppercase;
  color: var(--text-3);
  margin-bottom: 14px;
}
.card-title::before {
  content: '';
  width: 3px; height: 13px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--gd-blue), var(--gd-red));
}
.card-title span { color: var(--gd-blue); font-weight: 700; }
.card-title .right { margin-left: auto; color: var(--text-3); font-weight: 500; }

/* ── 网格容器 ─────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.row    { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col    { display: flex; flex-direction: column; gap: 10px; }
.divider { height: 1px; background: var(--border); margin: 14px 0; }

/* ════════════════════════════════════════════════════════════
   按钮
   ════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 11px 16px;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--f-text);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.4px;
  cursor: pointer;
  transition: all 0.18s var(--ease);
  box-shadow: var(--shadow-1);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.4; pointer-events: none; cursor: not-allowed; }
.btn.ghost { background: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--blue-soft); }

.btn-primary {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--gd-blue) 0%, var(--gd-blue-2) 100%);
  color: var(--gd-white);
  font-family: var(--f-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 2.2px;
  cursor: pointer;
  transition: all 0.22s var(--ease);
  box-shadow: var(--shadow-glow-blue);
}
.btn-primary:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.96); }
.btn-primary:disabled { opacity: 0.4; pointer-events: none; }

.btn-danger {
  background: linear-gradient(135deg, var(--gd-red) 0%, var(--gd-red-2) 100%);
  box-shadow: var(--shadow-glow-red);
}
.btn-warn {
  background: linear-gradient(135deg, var(--gd-yellow), var(--gd-yellow-2));
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(240,165,0,0.30);
}
.btn-ghost {
  background: rgba(255,255,255,0.7);
  color: var(--gd-blue);
  border: 1px solid var(--border-2);
  box-shadow: none;
}
.btn-ghost:hover { background: var(--blue-soft); }

/* ── 输入与表单 ─────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 13px;
  outline: none;
  transition: all 0.2s var(--ease);
}
.input.text { font-family: var(--f-text); }
.input:focus {
  border-color: var(--gd-blue);
  box-shadow: 0 0 0 3px var(--blue-soft);
}
textarea.input {
  resize: none;
  line-height: 1.6;
  min-height: 96px;
}

/* ── 滑块 ─────────────────────────────────────────────── */
input[type=range] {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 4px;
  background: var(--blue-soft-2);
  border-radius: 4px;
  outline: none;
}
input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid var(--gd-blue);
  box-shadow: 0 2px 6px rgba(29,53,87,0.30);
  cursor: pointer;
  transition: transform 0.15s var(--ease);
}
input[type=range]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type=range].red-range { background: var(--red-soft-2); }
input[type=range].red-range::-webkit-slider-thumb { border-color: var(--gd-red); }
input[type=range].yellow-range { background: var(--yellow-soft); }
input[type=range].yellow-range::-webkit-slider-thumb { border-color: var(--gd-yellow-2); }

/* ── 开关 ─────────────────────────────────────────────── */
.toggle-sw {
  width: 44px; height: 26px;
  background: rgba(29,53,87,0.12);
  border: 1px solid transparent;
  border-radius: 14px;
  position: relative;
  cursor: pointer;
  transition: all 0.25s var(--ease);
  flex-shrink: 0;
}
.toggle-sw.on {
  background: linear-gradient(135deg, var(--gd-blue), var(--gd-blue-2));
}
.toggle-sw::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  background: #ffffff;
  border-radius: 50%;
  top: 2px; left: 2px;
  transition: all 0.25s var(--ease-back);
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
}
.toggle-sw.on::after { left: 21px; }

/* ── 通用 chip ─────────────────────────────────────────── */
.chip {
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.18s var(--ease);
  font-family: var(--f-mono);
  letter-spacing: 0.5px;
  box-shadow: var(--shadow-1);
}
.chip:hover { transform: translateY(-1px); }
.chip.active {
  background: linear-gradient(135deg, var(--blue-soft), rgba(29,53,87,0.04));
  border-color: var(--gd-blue);
  color: var(--gd-blue);
}
.chip.red.active {
  background: linear-gradient(135deg, var(--red-soft), rgba(230,57,70,0.03));
  border-color: var(--gd-red);
  color: var(--gd-red);
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }

.subtabs {
  display: inline-flex;
  padding: 4px;
  background: rgba(29,53,87,0.06);
  border-radius: 12px;
  margin-bottom: 16px;
  gap: 4px;
}
.subtab {
  padding: 9px 18px;
  border: none; background: transparent;
  border-radius: 9px;
  font-family: var(--f-text);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.22s var(--ease);
}
.subtab.active {
  background: #ffffff;
  color: var(--gd-blue);
  box-shadow: var(--shadow-1);
}

/* ── 状态徽章 ─────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 20px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1.2px;
  font-weight: 600;
}
.badge.blue { background: var(--blue-soft);  color: var(--gd-blue); }
.badge.red  { background: var(--red-soft);   color: var(--gd-red);  }
.badge.ok   { background: var(--ok-soft);    color: var(--ok);      }
.badge.warn { background: var(--warn-soft);  color: var(--warn);    }

/* ════════════════════════════════════════════════════════════
   连接面板
   ════════════════════════════════════════════════════════════ */
#setupPanel {
  position: fixed; inset: 0;
  z-index: 500;
  background:
    radial-gradient(60% 50% at 50% 30%, rgba(168,218,220,0.40), transparent 70%),
    linear-gradient(180deg, var(--bg-grad-1) 0%, var(--bg-grad-2) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 32px 18px;
  overflow-y: auto;
  transition: opacity 0.4s var(--ease), visibility 0.4s;
}
#setupPanel.hidden { opacity: 0; visibility: hidden; pointer-events: none; }

.setup-card {
  width: 100%;
  max-width: 460px;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-2);
  border-radius: var(--r-xl);
  padding: 32px 28px;
  box-shadow: var(--shadow-3);
  position: relative;
  overflow: hidden;
}
.setup-card::before {
  content: '';
  position: absolute;
  top: 0; left: 32px;
  width: 64px; height: 4px;
  background: linear-gradient(90deg, var(--gd-blue), var(--gd-red));
  border-radius: 0 0 4px 4px;
}
.setup-head { text-align: center; margin-bottom: 22px; }
.setup-logo {
  width: 72px; height: 72px;
  margin: 0 auto 14px;
  border-radius: 18px;
  background: linear-gradient(135deg, #ffffff 0%, var(--gd-cyan) 100%);
  border: 2px solid var(--gd-blue);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-2);
}
.setup-logo::before {
  content: '';
  width: 38px; height: 26px;
  background: var(--gd-yellow);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  filter: drop-shadow(0 2px 0 var(--gd-red));
}
.setup-title {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 5px;
  color: var(--gd-blue);
  margin-bottom: 6px;
}
.setup-sub {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.7;
}
.setup-sub b { color: var(--gd-red); font-weight: 600; }

.setup-grp { margin-bottom: 12px; }
.setup-grp.row-grp { display: flex; gap: 8px; }
.setup-grp.row-grp > div { flex: 1; }
.setup-label {
  display: flex; align-items: center; gap: 6px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 1.5px;
  color: var(--text-2);
  margin-bottom: 5px;
  text-transform: uppercase;
}
.setup-label::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gd-red);
}
.setup-foot {
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-3);
  text-align: center;
  line-height: 1.7;
}

/* ════════════════════════════════════════════════════════════
   Toast
   ════════════════════════════════════════════════════════════ */
#toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(255,255,255,0.95);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  z-index: 600;
  opacity: 0;
  transition: all 0.3s var(--ease-back);
  box-shadow: var(--shadow-3);
  color: var(--text);
}
#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
#toast.ok   { border-color: var(--ok);  color: var(--ok);  background: var(--ok-soft); }
#toast.err  { border-color: var(--err); color: var(--err); background: var(--err-soft); }
#toast.info { border-color: var(--info); color: var(--info); background: var(--info-soft); }

/* ── 通用 ───────────────────────────────────────────────── */
.empty {
  text-align: center;
  padding: 32px 18px;
  color: var(--text-3);
  font-size: 12.5px;
  line-height: 1.8;
}
.muted { color: var(--text-3); }
.text-mono { font-family: var(--f-mono); }
.hidden { display: none !important; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes pulse-border {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230,57,70,0.0); }
  50%      { box-shadow: 0 0 0 7px rgba(230,57,70,0.18); }
}

/* ════════════════════════════════════════════════════════════
   响应式：宽屏 → 侧栏；窄屏 → 底部导航
   ════════════════════════════════════════════════════════════ */
.tabbar { display: none; }

@media (max-width: 900px) {
  .sidebar { display: none; }
  .tabbar {
    flex-shrink: 0;
    height: calc(var(--tab-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--border);
    display: flex;
    position: relative;
    z-index: 60;
  }
  .tab {
    flex: 1;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    cursor: pointer;
    border: none; background: none;
    color: var(--text-3);
    padding: 8px 0;
    transition: all 0.2s var(--ease);
    font-family: inherit;
  }
  .tab-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
  }
  .tab.active { color: var(--gd-blue); }
  .tab.active svg { filter: drop-shadow(0 0 4px rgba(29,53,87,0.25)); }
  .tab-indicator {
    position: absolute;
    top: -1px;
    height: 3px;
    width: 22%;
    border-radius: 0 0 3px 3px;
    background: linear-gradient(90deg, var(--gd-blue), var(--gd-red));
    box-shadow: 0 1px 8px rgba(29,53,87,0.35);
    transition: left 0.32s var(--ease-back);
  }
  .page { padding: 18px 16px calc(var(--tab-h) + var(--safe-b) + 18px); }
  .hero { padding: 18px; border-radius: var(--r-lg); }
  .hero-title { font-size: 20px; }
  .topbar { padding: 0 16px; }
  .brand-name { font-size: 14px; letter-spacing: 3px; }
  .conn-pill span { display: none; }
  .conn-pill { padding: 5px 8px; }
}
