/* ==========================================================================
   内部系统 - 赛博霓虹 HUD 设计系统
   风格蓝本: uiverse.io/reglobby/stupid-penguin-97 (MIT)
   - 深空蓝黑背景 + 霓虹光晕 + 动态网格
   - 深色玻璃拟态 (backdrop blur + 霓虹描边)
   - 霓虹蓝 (主/待机) / 霓虹绿 (开启/成功) / 霓虹红 (危险) / 霓虹琥珀 (警告)
   - 动画: 流动数据线 · 脉冲核心 · 扫描线 · 粒子漂浮 · 辉光呼吸 · 3D 透视
   ========================================================================== */

:root {
  /* ---- 背景 (提亮版) ---- */
  --bg-base: #0b1220;
  --bg-grad-1: rgba(0, 110, 255, 0.22);   /* 左上 蓝 */
  --bg-grad-2: rgba(130, 70, 255, 0.18);  /* 右上 紫 */
  --bg-grad-3: rgba(0, 210, 170, 0.13);   /* 中下 青绿 */
  --bg-grad-4: rgba(255, 70, 150, 0.10);  /* 粉色点缀 */

  /* ---- 玻璃表面 (提亮版) ---- */
  --glass-bg: rgba(22, 34, 58, 0.58);
  --glass-bg-strong: rgba(20, 32, 56, 0.82);
  --glass-bg-soft: rgba(22, 34, 58, 0.42);
  --glass-border: rgba(0, 180, 255, 0.30);
  --glass-border-soft: rgba(0, 180, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --glass-shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.45);

  /* ---- 文字 (提亮) ---- */
  --text: #eef4ff;
  --text-secondary: #b4c2da;
  --text-muted: #7a8aa6;
  --text-faint: #4a5a78;

  /* ---- 霓虹色 ---- */
  --accent: #00a8ff;
  --accent-hover: #2fb8ff;
  --accent-soft: rgba(0, 168, 255, 0.13);
  --success: #00ff9d;
  --success-soft: rgba(0, 255, 157, 0.12);
  --danger: #ff3b5c;
  --danger-soft: rgba(255, 59, 92, 0.13);
  --warn: #ffb020;
  --warn-soft: rgba(255, 176, 32, 0.13);
  --purple: #8b6bff;
  --purple-soft: rgba(139, 107, 255, 0.14);

  /* ---- 圆角 ---- */
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-xl: 26px;

  /* ---- 尺寸 ---- */
  --sidebar-w: 240px;
  --topbar-h: 60px;

  /* ---- 缓动 (参考组件同款) ---- */
  --ease-neon: cubic-bezier(0.23, 1, 0.32, 1);
}

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

html, body {
  height: 100%;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, "PingFang SC", "Microsoft YaHei", monospace;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "tnum", "ss01";
  letter-spacing: 0.01em;
  overflow-x: hidden;
}

/* ---- 全局背景: 霓虹光晕 + 动态网格 + 扫描大气 ---- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 0% 0%, var(--bg-grad-1) 0%, transparent 70%),
    radial-gradient(ellipse 50% 50% at 100% 0%, var(--bg-grad-2) 0%, transparent 70%),
    radial-gradient(ellipse 70% 60% at 50% 100%, var(--bg-grad-3) 0%, transparent 70%),
    radial-gradient(circle 420px at 88% 26%, var(--bg-grad-4) 0%, transparent 62%);
  background-attachment: fixed;
}
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(0, 180, 255, 0.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 180, 255, 0.065) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: grid-scroll 16s linear infinite;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 40%, #000 30%, transparent 100%);
}
@keyframes grid-scroll {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 0 44px, 44px 0; }
}

button, input, textarea, select {
  font: inherit;
  color: inherit;
}

* { caret-color: var(--accent); }
::selection { background: rgba(0, 168, 255, 0.35); color: #fff; }

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-shadow: 0 0 10px rgba(0, 168, 255, 0.6); }

code {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  padding: 2px 6px;
  background: rgba(0, 168, 255, 0.1);
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 5px;
  color: #7fd4ff;
}

/* ---- 自动填充 (深色适配) ---- */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px #0b1526 inset;
  box-shadow: 0 0 0 1000px #0b1526 inset;
  caret-color: var(--accent);
  transition: background-color 999999s ease-out;
}

/* ============== 自定义滚动条 (霓虹) ============== */
*::-webkit-scrollbar { width: 9px; height: 9px; }
*::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.25); }
*::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(0, 168, 255, 0.35), rgba(0, 90, 200, 0.25));
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: padding-box;
  transition: background 0.2s;
}
*::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(0, 200, 255, 0.6), rgba(0, 120, 255, 0.4));
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, rgba(0, 230, 255, 0.8), rgba(0, 150, 255, 0.55));
  background-clip: padding-box;
}
*::-webkit-scrollbar-corner { background: transparent; }
.scrollable-x::-webkit-scrollbar { height: 6px; }

html, body, * {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 168, 255, 0.35) rgba(0, 0, 0, 0.25);
}

.scroll-light, .dd-menu, .user-menu, .toast-anchor * {
  scrollbar-color: rgba(0, 168, 255, 0.35) rgba(0, 0, 0, 0.3);
}
.scroll-light::-webkit-scrollbar-thumb,
.dd-menu::-webkit-scrollbar-thumb,
.user-menu::-webkit-scrollbar-thumb {
  background: rgba(0, 168, 255, 0.3);
  background-clip: padding-box;
}
.scroll-light::-webkit-scrollbar-thumb:hover,
.dd-menu::-webkit-scrollbar-thumb:hover,
.user-menu::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 200, 255, 0.55);
  background-clip: padding-box;
}

/* ============== App Layout ============== */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ============== Sidebar (深色霓虹玻璃) ============== */
.sidebar {
  background: linear-gradient(180deg, rgba(18, 30, 52, 0.84), rgba(14, 24, 44, 0.88));
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border-right: 1px solid var(--glass-border-soft);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 10;
  box-shadow: inset -12px 0 32px rgba(0, 80, 255, 0.05);
}

.sidebar-brand {
  padding: 18px 18px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: relative;
}
.sidebar-brand::after {
  content: '';
  position: absolute;
  left: 16px; right: 16px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 168, 255, 0.35), transparent);
}
.sidebar-brand .logo {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  position: relative;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  overflow: visible;
}
.sidebar-brand .logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.sidebar-brand .name {
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text);
  line-height: 1.1;
  text-shadow: 0 0 12px rgba(0, 168, 255, 0.35);
}
.sidebar-brand .subname {
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--text-muted);
  text-transform: uppercase;
  line-height: 1;
}

.sidebar-menu {
  flex: 1;
  padding: 8px 12px;
  overflow-y: auto;
}
.menu-section {
  padding: 16px 12px 7px;
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.28em;
  font-weight: 700;
  text-shadow: 0 0 8px rgba(0, 168, 255, 0.2);
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  margin: 2px 0;
  color: var(--text-secondary);
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  font-size: 13.5px;
  position: relative;
  border: 1px solid transparent;
  transition: color 0.2s, border-color 0.2s, box-shadow 0.25s, background 0.2s, text-shadow 0.2s;
}
.menu-item:hover {
  background: rgba(0, 168, 255, 0.07);
  color: var(--text);
  border-color: rgba(0, 168, 255, 0.18);
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.12);
}
.menu-item.active {
  background: linear-gradient(90deg, rgba(0, 168, 255, 0.2), rgba(0, 120, 255, 0.06));
  color: #fff;
  border-color: rgba(0, 200, 255, 0.5);
  box-shadow:
    0 0 18px rgba(0, 168, 255, 0.3),
    inset 0 0 14px rgba(0, 180, 255, 0.12);
  text-shadow: 0 0 10px rgba(0, 220, 255, 0.7);
}
.menu-item.active::before {
  content: '';
  position: absolute;
  left: -13px; top: 22%;
  bottom: 22%;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent);
  box-shadow: 0 0 10px var(--accent);
  animation: neon-slash 2.6s ease-in-out infinite;
}
@keyframes neon-slash {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--accent); }
  50%      { opacity: 0.55; box-shadow: 0 0 4px var(--accent); }
}
.menu-item .icon {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0.9;
}

.sidebar-footer {
  padding: 14px 14px 16px;
  border-top: 1px solid rgba(0, 168, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sidebar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00a8ff, #8b6bff);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.5);
}
.sidebar-user .info { min-width: 0; }
.sidebar-user .name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sidebar-user .role {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}
.sidebar-logout {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.sidebar-logout:hover {
  background: var(--danger-soft);
  color: var(--danger);
  box-shadow: 0 0 12px rgba(255, 59, 92, 0.3);
  text-shadow: 0 0 8px rgba(255, 59, 92, 0.6);
}

/* ============== Content ============== */
.content {
  min-width: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  height: var(--topbar-h);
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(16, 26, 46, 0.55);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  border-bottom: 1px solid rgba(0, 168, 255, 0.12);
}
.crumbs {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.crumbs .sep { margin: 0 8px; opacity: 0.5; }
.crumbs .current {
  color: var(--text);
  font-weight: 700;
  text-shadow: 0 0 10px rgba(0, 168, 255, 0.4);
}

.main {
  flex: 1;
  padding: 8px 28px 10px;
  max-width: 1200px;
  width: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-top: 4px;
}
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.2;
  background: linear-gradient(90deg, #7fd4ff, #00a8ff 45%, #8b6bff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(0, 168, 255, 0.25);
  filter: drop-shadow(0 0 14px rgba(0, 168, 255, 0.25));
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 13px;
  margin-top: 6px;
  letter-spacing: 0.03em;
}

/* ============== Glass Card (深色霓虹) ============== */
.glass,
.glass-strong {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}
.glass-strong {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
}
/* 卡片顶部霓虹高光线 */
.glass::before,
.glass-strong::before {
  content: '';
  position: absolute;
  top: 0; left: 8%; right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 255, 0.5), transparent);
  opacity: 0.6;
}

/* ============== App Icon (霓虹方块 + 光晕) ============== */
.app-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  position: relative;
  flex-shrink: 0;
  background: linear-gradient(135deg, #00a8ff, #8b6bff);
  box-shadow:
    0 0 18px rgba(0, 168, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.lg { width: 64px; height: 64px; border-radius: 18px; font-size: 28px; }
.app-icon.xl { width: 80px; height: 80px; border-radius: 22px; font-size: 36px; }

.app-icon.purple-pink {
  background: linear-gradient(135deg, #6a8cff 0%, #8b6bff 50%, #ff5c8a 100%);
  box-shadow: 0 0 18px rgba(139, 107, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.blue-cyan {
  background: linear-gradient(135deg, #00a8ff 0%, #00e5ff 100%);
  box-shadow: 0 0 18px rgba(0, 200, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.purple-deep {
  background: linear-gradient(135deg, #8b6bff 0%, #5a3dd8 100%);
  box-shadow: 0 0 18px rgba(139, 107, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.pink-orange {
  background: linear-gradient(135deg, #ff5c8a 0%, #ffb020 100%);
  box-shadow: 0 0 18px rgba(255, 92, 138, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.green-cyan {
  background: linear-gradient(135deg, #00ff9d 0%, #00e5ff 100%);
  box-shadow: 0 0 18px rgba(0, 255, 157, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.orange-red {
  background: linear-gradient(135deg, #ff5c8a 0%, #ff3b5c 100%);
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
.app-icon.dark {
  background: linear-gradient(135deg, #1a2740 0%, #0d1526 100%);
  box-shadow: 0 0 16px rgba(0, 168, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(0, 168, 255, 0.3);
}

.app-icon-wrap {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
}
.app-icon-wrap::before {
  content: '';
  position: absolute;
  inset: -8px;
  border-radius: inherit;
  background: inherit;
  filter: blur(16px);
  opacity: 0.4;
  z-index: -1;
}

/* ============== 霓虹开关 (通用 .toggle, 兼容 slider 结构) ============== */
.toggle {
  position: relative;
  display: inline-block;
  width: 56px;
  height: 30px;
  flex-shrink: 0;
}
.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle .slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: rgba(0, 45, 85, 0.55);
  border-radius: 30px;
  border: 1px solid rgba(0, 150, 255, 0.35);
  box-shadow:
    0 0 12px rgba(0, 80, 255, 0.2),
    inset 0 0 10px rgba(0, 0, 0, 0.7);
  transition: all 0.6s var(--ease-neon);
  overflow: hidden;
}
/* 轨道流动数据线 */
.toggle .slider::after {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 200%; height: 1px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(90deg, rgba(0, 150, 255, 0.5) 0 4px, transparent 4px 12px);
  animation: ch-track-move 2.6s linear infinite;
  opacity: 0.7;
}
.toggle .slider::before {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  left: 2px;
  top: 2px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 255, 0.9) 0%, rgba(0, 50, 120, 0.9) 60%, rgba(0, 20, 50, 1) 100%);
  box-shadow:
    0 0 12px rgba(0, 150, 255, 0.6),
    inset 0 0 8px rgba(0, 150, 255, 0.5);
  transition: all 0.6s var(--ease-neon);
  z-index: 2;
  border: 1px solid rgba(0, 170, 255, 0.6);
}
.toggle input:checked + .slider {
  background: rgba(0, 80, 45, 0.55);
  border-color: rgba(0, 255, 150, 0.4);
  box-shadow:
    0 0 12px rgba(0, 255, 150, 0.25),
    inset 0 0 10px rgba(0, 0, 0, 0.7);
}
.toggle input:checked + .slider::after {
  background: repeating-linear-gradient(90deg, rgba(0, 255, 150, 0.5) 0 4px, transparent 4px 12px);
  animation-direction: reverse;
}
.toggle input:checked + .slider::before {
  transform: translateX(26px);
  background: radial-gradient(circle, rgba(0, 255, 150, 0.9) 0%, rgba(0, 120, 50, 0.9) 60%, rgba(0, 50, 20, 1) 100%);
  box-shadow:
    0 0 14px rgba(0, 255, 150, 0.7),
    inset 0 0 8px rgba(0, 255, 150, 0.5);
  border-color: rgba(0, 255, 150, 0.7);
}
.toggle input:hover + .slider { box-shadow: 0 0 18px rgba(0, 150, 255, 0.35), inset 0 0 10px rgba(0, 0, 0, 0.7); }
.toggle input:checked:hover + .slider { box-shadow: 0 0 18px rgba(0, 255, 150, 0.35), inset 0 0 10px rgba(0, 0, 0, 0.7); }

/* ============== List Row ============== */
.list-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  position: relative;
}
.list-card::before {
  content: '';
  position: absolute;
  top: 0; left: 6%; right: 6%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 255, 0.5), transparent);
  opacity: 0.5;
}
.list-section {
  padding: 14px 18px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.list-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  border-top: 1px solid rgba(0, 180, 255, 0.12);
  transition: background 0.2s, box-shadow 0.2s;
}
.list-item:hover { background: rgba(0, 180, 255, 0.08); box-shadow: inset 3px 0 0 rgba(0, 168, 255, 0.5); }
.list-item:first-child { border-top: none; }
.list-item .body { flex: 1; min-width: 0; }
.list-item .title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
  color: var(--text);
}
.list-item .desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}
.list-item .action {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* ============== Buttons (霓虹) ============== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 16px;
  border: none;
  background: var(--glass-bg-soft);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s var(--ease-neon);
  border: 1px solid var(--glass-border-soft);
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transition: left 0.5s ease;
  pointer-events: none;
}
.btn:hover::after { left: 100%; }
.btn:hover {
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 200, 255, 0.5);
  color: #fff;
  box-shadow: 0 0 16px rgba(0, 168, 255, 0.3);
  transform: translateY(-1px);
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.5);
}
.btn:active { transform: translateY(0) scale(0.98); }
.btn:disabled { opacity: 0.35; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-primary {
  background: linear-gradient(135deg, #0090ff 0%, #0060e0 100%);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(0, 140, 255, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #2fb8ff 0%, #0077ff 100%);
  border-color: transparent;
  box-shadow: 0 0 26px rgba(0, 170, 255, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  color: #fff;
}
.btn-danger { color: var(--danger); }
.btn-danger:hover {
  background: var(--danger-soft);
  border-color: rgba(255, 59, 92, 0.5);
  color: var(--danger);
  box-shadow: 0 0 16px rgba(255, 59, 92, 0.3);
  text-shadow: 0 0 8px rgba(255, 59, 92, 0.5);
}
.btn-sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 7px; }
.btn-ghost { background: transparent; border-color: transparent; backdrop-filter: none; }
.btn-ghost:hover { background: rgba(0, 180, 255, 0.12); border-color: transparent; }

/* ============== Icon Button ============== */
.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg-soft);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-neon);
  backdrop-filter: blur(10px);
  padding: 0;
}
.icon-btn:hover {
  background: rgba(0, 168, 255, 0.14);
  color: #fff;
  border-color: rgba(0, 200, 255, 0.55);
  transform: translateY(-1px);
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.3);
}
.icon-btn:active { transform: translateY(0) scale(0.95); }
.icon-btn:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn.primary {
  background: linear-gradient(135deg, #0090ff, #0060e0);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(0, 140, 255, 0.4);
}
.icon-btn.primary:hover {
  background: linear-gradient(135deg, #2fb8ff, #0077ff);
  color: #fff;
  box-shadow: 0 0 20px rgba(0, 170, 255, 0.6);
}
.icon-btn.danger {
  background: linear-gradient(135deg, #ff3b5c, #d92e4c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.4);
}
.icon-btn.danger:hover { background: linear-gradient(135deg, #ff5c78, #ff3b5c); color: #fff; box-shadow: 0 0 20px rgba(255, 59, 92, 0.6); }
.icon-btn.ghost {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.icon-btn.ghost:hover { background: rgba(0, 168, 255, 0.1); border-color: rgba(0, 200, 255, 0.3); }

.icon-btn.tone-primary {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: transparent;
}
.icon-btn.tone-primary:hover {
  background: rgba(0, 168, 255, 0.22);
  color: var(--accent-hover);
  border-color: rgba(0, 200, 255, 0.4);
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.3);
}
.icon-btn.tone-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: transparent;
}
.icon-btn.tone-success:hover {
  background: rgba(0, 255, 157, 0.2);
  color: var(--success);
  border-color: rgba(0, 255, 157, 0.4);
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.3);
}
.icon-btn.tone-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
}
.icon-btn.tone-danger:hover {
  background: rgba(255, 59, 92, 0.22);
  color: var(--danger);
  border-color: rgba(255, 59, 92, 0.4);
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.3);
}
.icon-btn.tone-warn {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: transparent;
}
.icon-btn.tone-warn:hover {
  background: rgba(255, 176, 32, 0.22);
  color: var(--warn);
  border-color: rgba(255, 176, 32, 0.4);
  box-shadow: 0 0 14px rgba(255, 176, 32, 0.3);
}

/* ============== Inputs (深色霓虹) ============== */
.input, .textarea, .select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(16, 26, 48, 0.6);
  font-size: 13.5px;
  outline: none;
  transition: all 0.25s var(--ease-neon);
  font-family: inherit;
  color: var(--text);
}
.input::placeholder, .textarea::placeholder, .select::placeholder {
  color: var(--text-muted);
}
.input:hover, .textarea:hover, .select:hover {
  border-color: rgba(0, 168, 255, 0.35);
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
  background: rgba(18, 30, 54, 0.78);
  box-shadow:
    0 0 0 3px rgba(0, 168, 255, 0.14),
    0 0 18px rgba(0, 168, 255, 0.25);
}
.textarea {
  resize: none;
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.85;
  letter-spacing: 0;
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
  word-break: normal;
}
textarea {
  white-space: pre;
  overflow-x: auto;
  overflow-wrap: normal;
  word-break: normal;
}
.field { display: block; margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============== Stats (霓虹玻璃卡片组) ============== */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 20px;
}
.stat {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  box-shadow: var(--glass-shadow);
  transition: transform 0.25s var(--ease-neon), box-shadow 0.25s, border-color 0.25s;
  position: relative;
  overflow: hidden;
}
.stat::before {
  content: '';
  position: absolute;
  top: 0; left: 10%; right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 255, 0.6), transparent);
}
.stat:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 24px rgba(0, 168, 255, 0.2), var(--glass-shadow-lg);
  border-color: rgba(0, 200, 255, 0.45);
}
.stat-label {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  margin-bottom: 6px;
}
.stat-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}
.stat-value.live {
  color: var(--success);
  text-shadow: 0 0 16px rgba(0, 255, 157, 0.55);
  animation: neon-breathe 3s ease-in-out infinite;
}
.stat-value.dead {
  color: var(--danger);
  text-shadow: 0 0 16px rgba(255, 59, 92, 0.5);
}
.stat-value.pending {
  color: var(--accent);
  text-shadow: 0 0 16px rgba(0, 168, 255, 0.55);
}
.stat-value.tested {
  color: var(--purple);
  text-shadow: 0 0 16px rgba(139, 107, 255, 0.5);
}
@keyframes neon-breathe {
  0%, 100% { text-shadow: 0 0 12px rgba(0, 255, 157, 0.4); }
  50%      { text-shadow: 0 0 22px rgba(0, 255, 157, 0.75); }
}

/* ============== Dashboard Layout ============== */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
  flex: 1;
  min-height: 0;
  position: relative;
  z-index: 1;
}
.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  min-height: 260px;
  overflow: hidden;
  position: relative;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.panel:hover {
  border-color: rgba(0, 200, 255, 0.4);
  box-shadow: 0 0 22px rgba(0, 168, 255, 0.14), var(--glass-shadow);
}
/* 面板顶部扫描光效 */
.panel::before {
  content: '';
  position: absolute;
  top: 0; left: -40%;
  width: 60%; height: 2px;
  background: linear-gradient(90deg, transparent, rgba(0, 220, 255, 0.7), transparent);
  z-index: 3;
  animation: panel-scan 5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes panel-scan {
  0%   { left: -40%; opacity: 0; }
  12%  { opacity: 1; }
  50%  { left: 120%; opacity: 0; }
  100% { left: 120%; opacity: 0; }
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 168, 255, 0.1);
  background: rgba(0, 180, 255, 0.07);
}
.panel-title {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text);
}
.panel-actions {
  display: flex;
  gap: 6px;
}
.panel-body {
  flex: 1;
  padding: 14px 18px;
  display: flex;
  min-height: 0;
}
.panel-body .textarea {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
  border: none;
  padding: 0;
  margin: 0;
  background: transparent;
  font-size: 13px;
  resize: none;
  overflow-y: auto;
}
.panel-body .textarea:focus { box-shadow: none; background: transparent; }
.panel-counter {
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 10px 18px;
  border-top: 1px solid rgba(0, 168, 255, 0.1);
  display: flex;
  justify-content: space-between;
  background: rgba(0, 180, 255, 0.05);
  letter-spacing: 0.06em;
}

/* ============== Toolbar ============== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 14px;
  box-shadow: var(--glass-shadow);
}
.toolbar .spacer { flex: 1; }
.toolbar .status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  font-weight: 600;
}
.toolbar .status .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-faint);
}
.toolbar .status.running .dot {
  background: var(--success);
  animation: neon-dot-pulse 1.5s ease-out infinite;
  box-shadow: 0 0 8px rgba(0, 255, 157, 0.8);
}
.toolbar .status.idle .dot { background: var(--text-faint); }
@keyframes neon-dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 255, 157, 0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 255, 157, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 255, 157, 0); }
}

/* ============== Log ============== */
.log-card {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
  max-height: 380px;
  display: flex;
  flex-direction: column;
}
.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(0, 168, 255, 0.1);
  background: rgba(0, 180, 255, 0.07);
}
.log-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.log {
  background: rgba(16, 26, 48, 0.45);
  color: var(--text-secondary);
  font-family: "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.85;
  height: 320px;
  overflow-y: auto;
  padding: 12px 16px;
}
.log:empty::before {
  content: '等待任务...';
  color: var(--text-faint);
  font-family: inherit;
}
.log-line { display: block; }
.log-line .ts { color: var(--text-faint); margin-right: 10px; font-size: 11px; }
.log-line.live {
  color: var(--success);
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.45);
}
.log-line.dead {
  color: var(--danger);
  text-shadow: 0 0 8px rgba(255, 59, 92, 0.45);
}
.log-line.info {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0, 168, 255, 0.45);
}
.log-line.error { color: var(--danger); font-weight: 700; text-shadow: 0 0 8px rgba(255, 59, 92, 0.5); }
.log-line.testing {
  color: var(--warn);
  font-weight: 600;
  text-shadow: 0 0 8px rgba(255, 176, 32, 0.4);
}
.log-line.testing::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid var(--warn);
  border-top-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  margin-left: 8px;
  animation: spin 0.8s linear infinite;
  box-shadow: 0 0 8px rgba(255, 176, 32, 0.5);
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ============== Status Pill ============== */
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 700;
  background: var(--glass-bg-soft);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border-soft);
  color: var(--text-secondary);
  transition: all 0.25s;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.status-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-faint);
}
.status-pill.idle {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(0, 255, 157, 0.3);
}
.status-pill.idle .dot { background: var(--success); box-shadow: 0 0 8px rgba(0, 255, 157, 0.8); }
.status-pill.running {
  color: var(--success);
  background: var(--success-soft);
  border-color: rgba(0, 255, 157, 0.3);
}
.status-pill.running .dot {
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(0, 255, 157, 0.2);
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============== Table ============== */
.table-wrap {
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  overflow: hidden;
}
.table {
  width: 100%;
  border-collapse: collapse;
}
.table th, .table td {
  padding: 12px 18px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid rgba(0, 180, 255, 0.12);
}
.table th {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  background: rgba(0, 180, 255, 0.08);
  text-shadow: 0 0 8px rgba(0, 168, 255, 0.2);
}
.table tr:last-child td { border-bottom: none; }
.table tbody tr { transition: background 0.15s, box-shadow 0.15s; }
.table tbody tr:hover {
  background: rgba(0, 168, 255, 0.06);
  box-shadow: inset 3px 0 0 rgba(0, 168, 255, 0.55);
}
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { margin-left: 4px; }

/* ============== Badge ============== */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1px solid transparent;
}
.badge-admin {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: rgba(0, 168, 255, 0.3);
  box-shadow: 0 0 10px rgba(0, 168, 255, 0.15);
}
.badge-user {
  background: var(--purple-soft);
  color: var(--purple);
  border-color: rgba(139, 107, 255, 0.3);
}
.badge-active {
  background: var(--success-soft);
  color: var(--success);
  border-color: rgba(0, 255, 157, 0.3);
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.15);
}
.badge-disabled {
  background: rgba(100, 117, 143, 0.12);
  color: var(--text-muted);
  border-color: rgba(100, 117, 143, 0.25);
}

/* ============== Login (霓虹) ============== */
.login {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  position: relative;
  z-index: 1;
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 60px rgba(0, 120, 255, 0.18), var(--glass-shadow-lg);
  padding: 40px 36px;
  position: relative;
  overflow: hidden;
  animation: card-enter 0.7s var(--ease-neon);
}
@keyframes card-enter {
  from { opacity: 0; transform: translateY(24px) scale(0.96); filter: blur(6px); }
  to   { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 18px rgba(0, 168, 255, 0.8);
  animation: login-line 3.2s ease-in-out infinite;
}
@keyframes login-line {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}
.login-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 40% at 50% 0%, rgba(0, 180, 255, 0.12), transparent 70%);
  pointer-events: none;
}
.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  position: relative;
  flex-shrink: 0;
  border: none;
  box-shadow: none;
  margin: 0 auto 20px;
  overflow: hidden;
  filter: drop-shadow(0 0 14px rgba(0, 168, 255, 0.4));
}
.login-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}
.login-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: center;
  margin-bottom: 6px;
  background: linear-gradient(90deg, #7fd4ff, #00a8ff 55%, #8b6bff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 16px rgba(0, 168, 255, 0.35));
}
.login-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.login .btn {
  width: 100%;
  height: 44px;
  font-size: 14px;
  margin-top: 8px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.login-error {
  font-size: 12.5px;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(255, 59, 92, 0.3);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 14px;
  display: none;
  text-shadow: 0 0 8px rgba(255, 59, 92, 0.4);
  box-shadow: 0 0 14px rgba(255, 59, 92, 0.15);
}
.login-error.show { display: block; animation: shake-x 0.4s ease; }
@keyframes shake-x {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-5px); }
  75%      { transform: translateX(5px); }
}

/* ============== Modal (深色霓虹) ============== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 32, 0.65);
  backdrop-filter: blur(10px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-backdrop.show { display: flex; }
.modal {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(40px) saturate(180%);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: 0 0 50px rgba(0, 120, 255, 0.15), var(--glass-shadow-lg);
  width: 100%;
  max-width: 440px;
  padding: 28px;
  animation: modal-in 0.3s var(--ease-neon);
  position: relative;
}
@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.04em;
  margin-bottom: 18px;
  color: var(--text);
  text-shadow: 0 0 12px rgba(0, 168, 255, 0.3);
}
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 22px;
}

/* ============== Control Bar ============== */
.control-bar {
  display: flex;
  align-items: center;
  gap: 12px 16px;
  padding: 8px 16px;
  background: var(--glass-bg);
  backdrop-filter: blur(28px) saturate(160%);
  -webkit-backdrop-filter: blur(28px) saturate(160%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--glass-shadow);
  position: relative;
  z-index: 100;
  flex-wrap: wrap;
  row-gap: 6px;
}
.control-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 1 auto;
  min-width: 0;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.control-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.control-select {
  height: 34px;
  padding: 0 28px 0 12px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 26, 48, 0.6) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364758f' stroke-width='2.5' stroke-linecap='round'><polyline points='6 9 12 15 18 9'/></svg>") no-repeat right 10px center;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.2s;
  min-width: 0;
  text-align: center;
  text-align-last: center;
  width: 100%;
}
.control-select:hover { background-color: rgba(0, 168, 255, 0.06); }
.control-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.14), 0 0 14px rgba(0, 168, 255, 0.22);
}

/* ============== 自定义 Dropdown (深色霓虹) ============== */
.dd { position: relative; width: 100%; }
.dd.open { z-index: 200000; }
.dd-trigger {
  width: 100%;
  height: 34px;
  padding: 0 30px 0 12px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 26, 48, 0.6);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: all 0.2s var(--ease-neon);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: inherit;
}
.dd-trigger:hover {
  background-color: rgba(0, 168, 255, 0.07);
  border-color: rgba(0, 168, 255, 0.35);
}
.dd.open .dd-trigger,
.dd-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.14), 0 0 14px rgba(0, 168, 255, 0.22);
}
.dd-arrow {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  transition: transform 0.25s, color 0.2s;
}
.dd.open .dd-arrow { transform: translateY(-50%) rotate(180deg); color: var(--accent); }
.dd-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow-y: auto;
  background: rgba(20, 32, 58, 0.93);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 120, 255, 0.12);
  z-index: 9999;
  padding: 5px;
  display: none;
  animation: dd-pop 0.18s var(--ease-neon);
  transform-origin: top center;
}
@keyframes dd-pop {
  from { opacity: 0; transform: translateY(-5px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.dd.open .dd-menu { display: block; }
.dd-item {
  padding: 7px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  text-align: center;
  transition: all 0.13s;
}
.dd-item:hover {
  background: var(--accent-soft);
  color: #fff;
}
.dd-item.active {
  background: linear-gradient(90deg, rgba(0, 168, 255, 0.25), rgba(0, 120, 255, 0.12));
  color: #fff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(0, 200, 255, 0.4);
  text-shadow: 0 0 8px rgba(0, 200, 255, 0.6);
}
.dd-item.active:hover { background: linear-gradient(90deg, rgba(0, 180, 255, 0.32), rgba(0, 140, 255, 0.16)); }

/* ============== 通道下拉 ============== */
.channel-group { min-width: 220px; }
.channel-dd .dd-trigger,
.channel-dd .dd-label {
  text-align: left;
  justify-content: flex-start;
}
.channel-dd .dd-menu { min-width: 100%; }
.channel-dd .dd-item { text-align: left; justify-content: flex-start; }

/* ============== 下拉空状态 ============== */
.dd.is-empty .dd-trigger { color: var(--text-faint); }
.dd.is-empty .dd-trigger:hover { background-color: rgba(0, 180, 255, 0.08); }
.dd.is-empty .dd-arrow { opacity: 0.45; }

/* ============== 通道管理 ============== */
.ch-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 168, 255, 0.14);
  border-radius: 12px;
  background: rgba(18, 28, 50, 0.5);
  transition: all 0.2s var(--ease-neon);
}
.ch-item:hover {
  background: rgba(0, 168, 255, 0.07);
  border-color: rgba(0, 200, 255, 0.4);
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.14);
}
.ch-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; color: #fff;
}
.ch-icon.blue   { background: linear-gradient(135deg, #00a8ff, #8b6bff); box-shadow: 0 0 12px rgba(0, 168, 255, 0.45); }
.ch-icon.green  { background: linear-gradient(135deg, #00ff9d, #00c896); box-shadow: 0 0 12px rgba(0, 255, 157, 0.4); }
.ch-icon.orange { background: linear-gradient(135deg, #ffb020, #ff5c8a); box-shadow: 0 0 12px rgba(255, 176, 32, 0.4); }
.ch-info { flex: 1; min-width: 0; }
.ch-name {
  font-size: 13.5px; font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  margin-bottom: 4px;
}
.ch-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ch-tag {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 6px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid rgba(0, 168, 255, 0.25);
  white-space: nowrap;
  letter-spacing: 0.06em;
}
.ch-proxy {
  font-size: 11.5px; color: var(--text-muted);
  font-family: 'SF Mono', Menlo, monospace;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 220px;
}
.ch-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

/* =====================================================================
   赛博朋克开关 (ch-toggle) — 移植自 uiverse.io/reglobby/stupid-penguin-97
   button 结构: <button class="ch-toggle on|off"><span class="ch-toggle-knob"></span></button>
   ===================================================================== */
.ch-toggle {
  width: 54px; height: 28px; border-radius: 999px;
  border: 1px solid rgba(0, 150, 255, 0.4);
  cursor: pointer; padding: 0;
  position: relative;
  background: rgba(0, 45, 85, 0.55);
  box-shadow:
    0 0 14px rgba(0, 80, 255, 0.25),
    inset 0 0 10px rgba(0, 0, 0, 0.75);
  overflow: hidden;
  transition: all 0.6s var(--ease-neon);
  flex-shrink: 0;
}
/* 轨道顶部高光 */
.ch-toggle::after {
  content: '';
  position: absolute;
  top: 2px; left: 3px; right: 3px;
  height: 4px;
  border-radius: 999px 999px 0 0;
  background: linear-gradient(90deg, rgba(0, 170, 255, 0.35), rgba(0, 80, 255, 0.1));
  filter: blur(1px);
  opacity: 0.7;
  transition: all 0.6s var(--ease-neon);
}
/* 轨道流动数据线 */
.ch-toggle::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  width: 400%; height: 1px;
  transform: translateY(-50%);
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 150, 255, 0.5) 0 5px,
    transparent 5px 15px
  );
  animation: ch-track-move 3s linear infinite;
  opacity: 0.75;
}
@keyframes ch-track-move {
  0%   { transform: translateY(-50%) translateX(0); }
  100% { transform: translateY(-50%) translateX(-20px); }
}
/* 拇指 (能量核心) */
.ch-toggle-knob {
  position: absolute; top: 2px; left: 2px;
  width: 22px; height: 22px; border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 180, 255, 0.85) 0%, rgba(0, 50, 120, 0.9) 55%, rgba(0, 20, 50, 1) 100%);
  border: 1px solid rgba(0, 170, 255, 0.7);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    0 0 12px rgba(0, 150, 255, 0.55),
    inset 0 0 8px rgba(0, 150, 255, 0.5);
  transition: all 0.6s var(--ease-neon);
  z-index: 2;
  overflow: hidden;
}
/* 脉冲核心 */
.ch-toggle-knob::before {
  content: '';
  position: absolute;
  inset: 26%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(100, 200, 255, 0.55) 70%);
  box-shadow: 0 0 8px rgba(100, 200, 255, 0.8);
  animation: ch-core-pulse 1.8s ease-in-out infinite alternate;
}
@keyframes ch-core-pulse {
  0%   { transform: scale(0.82); opacity: 0.55; }
  100% { transform: scale(1.12); opacity: 1; }
}
/* 扫描线 */
.ch-toggle-knob::after {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -3px;
  height: 2.5px;
  background: linear-gradient(90deg, transparent, rgba(0, 150, 255, 0.6) 25%, rgba(255, 255, 255, 0.9) 50%, rgba(0, 150, 255, 0.6) 75%, transparent);
  filter: blur(0.5px);
  opacity: 0.85;
  animation: ch-scan 2.2s linear infinite;
  pointer-events: none;
}
@keyframes ch-scan {
  0%   { top: -4px; opacity: 0; }
  15%  { opacity: 0.9; }
  85%  { opacity: 0.9; }
  100% { top: 24px; opacity: 0; }
}

/* ---- ON 状态: 霓虹绿 ---- */
.ch-toggle.on {
  background: rgba(0, 80, 45, 0.55);
  border-color: rgba(0, 255, 150, 0.45);
  box-shadow:
    0 0 14px rgba(0, 255, 150, 0.28),
    inset 0 0 10px rgba(0, 0, 0, 0.75);
}
.ch-toggle.on::after {
  background: linear-gradient(90deg, rgba(0, 255, 150, 0.35), rgba(0, 160, 80, 0.1));
}
.ch-toggle.on::before {
  background: repeating-linear-gradient(
    90deg,
    rgba(0, 255, 150, 0.5) 0 5px,
    transparent 5px 15px
  );
  animation-direction: reverse;
}
.ch-toggle.on .ch-toggle-knob {
  transform: translateX(26px);
  background: radial-gradient(circle, rgba(0, 255, 150, 0.85) 0%, rgba(0, 120, 50, 0.9) 55%, rgba(0, 50, 20, 1) 100%);
  border-color: rgba(0, 255, 150, 0.75);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.5),
    0 0 14px rgba(0, 255, 150, 0.6),
    inset 0 0 8px rgba(0, 255, 150, 0.5);
}
.ch-toggle.on .ch-toggle-knob::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.9) 0%, rgba(100, 255, 200, 0.55) 70%);
  box-shadow: 0 0 8px rgba(100, 255, 200, 0.8);
}
.ch-toggle.on .ch-toggle-knob::after {
  background: linear-gradient(90deg, transparent, rgba(0, 255, 150, 0.6) 25%, rgba(255, 255, 255, 0.9) 50%, rgba(0, 255, 150, 0.6) 75%, transparent);
}
.ch-toggle:hover {
  box-shadow:
    0 0 20px rgba(0, 150, 255, 0.35),
    inset 0 0 10px rgba(0, 0, 0, 0.75);
}
.ch-toggle.on:hover {
  box-shadow:
    0 0 20px rgba(0, 255, 150, 0.35),
    inset 0 0 10px rgba(0, 0, 0, 0.75);
}

/* ============== control-dd / form-dd 对齐 ============== */
.control-dd .dd-trigger {
  height: 34px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 10px;
  font-size: 13px;
}
.control-dd .dd-trigger:hover { background-color: rgba(0, 168, 255, 0.07); }
.control-dd .dd-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.14), 0 0 14px rgba(0, 168, 255, 0.22);
}

.form-dd { width: 100%; }
.form-dd .dd-trigger {
  width: 100%;
  height: 36px;
  padding: 0 30px 0 12px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 26, 48, 0.6);
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  font-family: inherit;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.form-dd .dd-trigger:hover { background: rgba(0, 180, 255, 0.12); }
.form-dd.open .dd-trigger,
.form-dd .dd-trigger:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.14), 0 0 14px rgba(0, 168, 255, 0.22);
}
.form-dd .dd-menu {
  background: rgba(9, 16, 32, 0.96);
  border: 1px solid var(--glass-border);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 120, 255, 0.12);
}

.control-input {
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 26, 48, 0.6);
  font-size: 13px;
  color: var(--text);
  outline: none;
  transition: all 0.2s;
  min-width: 0;
  text-align: center;
  width: 100%;
  font-family: inherit;
}
.control-input::placeholder { color: var(--text-muted); }
.control-input:hover { background-color: rgba(0, 168, 255, 0.07); border-color: rgba(0, 168, 255, 0.35); }
.control-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.14), 0 0 14px rgba(0, 168, 255, 0.22);
}

.control-number {
  width: 60px;
  height: 34px;
  padding: 0 8px;
  border: 1px solid rgba(0, 168, 255, 0.18);
  border-radius: 10px;
  background: rgba(16, 26, 48, 0.6);
  font-size: 13px;
  color: var(--text);
  text-align: center;
  outline: none;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  font-family: inherit;
  transition: all 0.2s;
}
.control-number::-webkit-outer-spin-button,
.control-number::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.control-number:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 168, 255, 0.14), 0 0 14px rgba(0, 168, 255, 0.22);
}

.control-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 代理输入框 + 检测按钮 */
#proxyInline     { width: 280px; flex: 0 0 280px; height: 34px; }
#proxyTestInline {
  height: 34px;
  padding: 0 10px;
  font-size: 12.5px;
  font-weight: 700;
  background: transparent;
  border: none;
  border-radius: 0;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: opacity 0.18s, transform 0.12s, color 0.2s;
  text-shadow: 0 0 8px rgba(0, 168, 255, 0.4);
  letter-spacing: 0.08em;
}
#proxyTestInline .icon {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
  filter: drop-shadow(0 0 3px rgba(0, 168, 255, 0.6));
  transition: color 0.2s, filter 0.2s;
}
#proxyTestInline .icon svg { display: block; }
#proxyTestInline .icon svg.spin { animation: proxy-btn-spin 0.8s linear infinite; }
@keyframes proxy-btn-spin { to { transform: rotate(360deg); } }

#proxyTestInline:hover:not(:disabled) { opacity: 0.7; }
#proxyTestInline:active:not(:disabled) { transform: scale(0.97); }
#proxyTestInline:disabled { cursor: not-allowed; pointer-events: none; }

#proxyTestInline.is-testing { color: var(--accent); pointer-events: none; }
#proxyTestInline.is-testing .icon { color: var(--accent); filter: drop-shadow(0 0 5px rgba(0, 168, 255, 0.7)); }
#proxyTestInline.is-ok {
  color: var(--success);
  animation: proxy-btn-ok 0.55s ease-out;
}
#proxyTestInline.is-ok .icon { color: var(--success); filter: drop-shadow(0 0 5px rgba(0, 255, 157, 0.65)); }
#proxyTestInline.is-err {
  color: var(--danger);
  animation: proxy-btn-err 0.5s ease-out;
}
#proxyTestInline.is-err .icon { color: var(--danger); filter: drop-shadow(0 0 5px rgba(255, 59, 92, 0.65)); }
#proxyTestInline.is-clear { color: var(--warn); }
#proxyTestInline.is-clear .icon { color: var(--warn); filter: drop-shadow(0 0 5px rgba(255, 176, 32, 0.65)); }
@keyframes proxy-btn-ok {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.12); }
  100% { transform: scale(1); }
}
@keyframes proxy-btn-err {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-3px); }
  40%      { transform: translateX(3px); }
  60%      { transform: translateX(-2px); }
  80%      { transform: translateX(2px); }
}

/* 大号图标按钮 */
.icon-btn-lg {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  border: 1px solid var(--glass-border-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s var(--ease-neon);
  backdrop-filter: blur(10px);
  padding: 0;
  font-size: 16px;
  background: var(--glass-bg-soft);
  color: var(--text-secondary);
}
.icon-btn-lg:hover {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 200, 255, 0.5);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 0 18px rgba(0, 168, 255, 0.25);
}
.icon-btn-lg:active { transform: translateY(0) scale(0.96); }
.icon-btn-lg:disabled { opacity: 0.3; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn-lg.primary {
  background: linear-gradient(135deg, #0090ff, #0060e0);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(0, 140, 255, 0.45);
}
.icon-btn-lg.primary:hover {
  background: linear-gradient(135deg, #2fb8ff, #0077ff);
  box-shadow: 0 0 26px rgba(0, 170, 255, 0.65);
  color: #fff;
}
.icon-btn-lg.warn {
  background: linear-gradient(135deg, #ffb020, #ff9500);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(255, 176, 32, 0.45);
}
.icon-btn-lg.warn:hover { background: linear-gradient(135deg, #ffc94d, #ffb020); color: #fff; }
.icon-btn-lg.danger {
  background: linear-gradient(135deg, #ff3b5c, #d92e4c);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 0 18px rgba(255, 59, 92, 0.45);
}
.icon-btn-lg.danger:hover { background: linear-gradient(135deg, #ff5c78, #ff3b5c); color: #fff; }
.icon-btn-lg.ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  box-shadow: none;
  backdrop-filter: none;
}
.icon-btn-lg.ghost:hover {
  background: rgba(0, 168, 255, 0.1);
  border-color: rgba(0, 200, 255, 0.35);
  box-shadow: 0 0 16px rgba(0, 168, 255, 0.2);
  transform: translateY(-1px);
  color: #fff;
}
.icon-btn-lg.ghost.play  { color: var(--success); }
.icon-btn-lg.ghost.play:hover  { background: var(--success-soft); border-color: rgba(0, 255, 157, 0.4); box-shadow: 0 0 16px rgba(0, 255, 157, 0.25); color: var(--success); }
.icon-btn-lg.ghost.stop  { color: var(--danger); }
.icon-btn-lg.ghost.stop:hover  { background: var(--danger-soft); border-color: rgba(255, 59, 92, 0.4); box-shadow: 0 0 16px rgba(255, 59, 92, 0.25); color: var(--danger); }
.icon-btn-lg.ghost.pause { color: var(--warn); }
.icon-btn-lg.ghost.pause:hover { background: var(--warn-soft); border-color: rgba(255, 176, 32, 0.4); box-shadow: 0 0 16px rgba(255, 176, 32, 0.25); color: var(--warn); }
.hamburger {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--glass-border-soft);
  background: var(--glass-bg-soft);
  backdrop-filter: blur(10px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
}
.hamburger:hover {
  background: rgba(0, 168, 255, 0.12);
  border-color: rgba(0, 200, 255, 0.45);
  color: #fff;
  box-shadow: 0 0 14px rgba(0, 168, 255, 0.25);
}

/* Sidebar 遮罩 (移动端) */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(10, 16, 32, 0.55);
  backdrop-filter: blur(4px);
  z-index: 49;
  opacity: 0;
  transition: opacity 0.25s;
}
.sidebar-backdrop.show { opacity: 1; }

/* ============== Responsive ============== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 220px; }
  .stats { gap: 12px; }
  .stat { padding: 16px 18px; }
  .stat-value { font-size: 30px; }
}

@media (max-width: 900px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .dash-grid { grid-template-columns: 1fr; }
  .main { padding: 8px 20px 20px; }
  .stat-value { font-size: 28px; }
  .modal { max-width: 90vw; }
  .table th, .table td { padding: 10px 14px; }
}

@media (max-width: 768px) {
  html, body { font-size: 13.5px; }

  .topbar { padding: 0 16px; height: 56px; position: relative; z-index: 10; }
  .main { padding: 20px 14px 14px; max-width: 100%; }
  .topbar .crumbs { font-size: 12px; }

  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat { padding: 14px; border-radius: 16px; }
  .stat-label { font-size: 10px; }
  .stat-value { font-size: 26px; }

  .panel { min-height: 240px; border-radius: 16px; }
  .panel-header { padding: 12px 14px; }
  .panel-body { padding: 10px 14px; }
  .panel-counter { padding: 8px 14px; }

  .list-item { padding: 12px 14px; gap: 12px; }
  .list-item .title { font-size: 13.5px; }
  .list-item .desc { font-size: 12px; }
  .app-icon { width: 38px; height: 38px; border-radius: 10px; font-size: 16px; }

  .toolbar { padding: 10px 14px; border-radius: 16px; }
  .log-card { border-radius: 16px; }
  .log { height: 200px; padding: 10px 14px; font-size: 11.5px; }

  .table thead { display: none; }
  .table, .table tbody, .table tr, .table td { display: block; width: 100%; }
  .table tr {
    background: rgba(18, 28, 50, 0.55);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    border: 1px solid rgba(0, 168, 255, 0.12);
  }
  .table td {
    padding: 4px 0;
    border: none;
    font-size: 13px;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  .table td.actions {
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 168, 255, 0.12);
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
  }
  .table td.actions::before { display: none; }
  .table td[data-label]::before {
    content: attr(data-label);
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
}

@media (max-width: 480px) {
  html, body { font-size: 13px; }
  .main { padding: 4px 10px 10px; }
  .topbar { padding: 0 12px; }
  .stats { gap: 8px; }
  .stat { padding: 12px; }
  .stat-value { font-size: 24px; }
  .panel { min-height: 200px; border-radius: 14px; }
  .panel-body .textarea { font-size: 12px; }
  .icon-btn { width: 26px; height: 26px; }

  .login-card { padding: 28px 22px; border-radius: 22px; }
  .login-title { font-size: 20px; }
  .login-logo { width: 48px; height: 48px; font-size: 20px; }

  .modal { padding: 22px 18px; border-radius: 20px; }
  .modal-title { font-size: 16px; }

  .log { height: 180px; font-size: 11px; }
}

/* 手机宽度: 侧边栏转为抽屉 + 汉堡按钮 */
@media (max-width: 640px) {
  .app { grid-template-columns: 1fr; }
  .hamburger { display: inline-flex; }
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 280px;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.5);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-backdrop { display: block; }
  .sidebar-toggle { display: none; }
}

@media (min-width: 1400px) {
  :root { --sidebar-w: 260px; }
  .main { max-width: 1280px; }
}

/* ============== Toast 通知 (顶部下拉) ============== */
.toast-container {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  align-items: center;
  width: auto;
  max-width: min(520px, calc(100vw - 32px));
}
.toast {
  position: relative;
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 13px 18px 13px 16px;
  box-shadow: 0 0 32px rgba(0, 120, 255, 0.15), 0 12px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  gap: 12px;
  pointer-events: auto;
  width: max-content;
  max-width: 100%;
  min-width: 240px;
  animation: toastIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
  transform-origin: top center;
  overflow: hidden;
}
/* 顶部霓虹高光线 */
.toast::before {
  content: '';
  position: absolute;
  top: 0; left: 12%; right: 12%;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 10px var(--accent);
  opacity: 0.85;
}
.toast.success::before { background: linear-gradient(90deg, transparent, var(--success), transparent); box-shadow: 0 0 10px var(--success); }
.toast.error::before   { background: linear-gradient(90deg, transparent, var(--danger), transparent); box-shadow: 0 0 10px var(--danger); }
.toast.warning::before { background: linear-gradient(90deg, transparent, var(--warn), transparent); box-shadow: 0 0 10px var(--warn); }
.toast.info::before    { background: linear-gradient(90deg, transparent, var(--accent), transparent); box-shadow: 0 0 10px var(--accent); }
.toast.removing { animation: toastOut 0.3s ease-in forwards; }
.toast.success {
  border-left: 3px solid var(--success);
  box-shadow: 0 0 28px rgba(0, 255, 157, 0.16), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.toast.error {
  border-left: 3px solid var(--danger);
  box-shadow: 0 0 28px rgba(255, 59, 92, 0.18), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.toast.warning {
  border-left: 3px solid var(--warn);
  box-shadow: 0 0 28px rgba(255, 176, 32, 0.17), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.toast.info {
  border-left: 3px solid var(--accent);
  box-shadow: 0 0 28px rgba(0, 168, 255, 0.18), 0 12px 40px rgba(0, 0, 0, 0.6);
}
.toast .toast-icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0, 168, 255, 0.12);
  border: 1px solid rgba(0, 168, 255, 0.25);
}
.toast .toast-icon.success { color: var(--success); background: rgba(0, 255, 157, 0.12); border-color: rgba(0, 255, 157, 0.3); filter: drop-shadow(0 0 4px rgba(0, 255, 157, 0.5)); }
.toast .toast-icon.error   { color: var(--danger); background: rgba(255, 59, 92, 0.12); border-color: rgba(255, 59, 92, 0.3); filter: drop-shadow(0 0 4px rgba(255, 59, 92, 0.5)); }
.toast .toast-icon.warning { color: var(--warn); background: rgba(255, 176, 32, 0.12); border-color: rgba(255, 176, 32, 0.3); filter: drop-shadow(0 0 4px rgba(255, 176, 32, 0.5)); }
.toast .toast-icon.info    { color: var(--accent); background: rgba(0, 168, 255, 0.12); border-color: rgba(0, 168, 255, 0.3); filter: drop-shadow(0 0 4px rgba(0, 168, 255, 0.5)); }
.toast .toast-msg {
  flex: 1; font-size: 13.5px; line-height: 1.5; color: var(--text);
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: pre-wrap;
  min-width: 0;
  max-width: 380px;
}
.toast .toast-close {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 18px; line-height: 1;
  width: 22px; height: 22px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px; transition: all 0.15s;
}
.toast .toast-close:hover { background: rgba(0, 168, 255, 0.12); color: #fff; }
@keyframes toastIn {
  0%   { transform: translateY(-50px) scale(0.92); opacity: 0; filter: blur(4px); }
  60%  { transform: translateY(4px) scale(1.02); opacity: 1; filter: blur(0); }
  100% { transform: translateY(0) scale(1); opacity: 1; filter: blur(0); }
}
@keyframes toastOut {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-30px) scale(0.92); opacity: 0; filter: blur(4px); }
}

/* ============== Confirm 确认对话框 ============== */
.confirm-backdrop {
  position: fixed; inset: 0; z-index: 200000;
  background: rgba(10, 16, 32, 0.68);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  animation: confirmFadeIn 0.2s ease-out;
  padding: 20px;
}
.confirm-dialog {
  background: var(--glass-bg-strong);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 400px;
  width: 100%;
  box-shadow: 0 0 44px rgba(0, 120, 255, 0.16), 0 20px 60px rgba(0, 0, 0, 0.6);
  animation: confirmIn 0.28s var(--ease-neon);
}
.confirm-dialog .confirm-title {
  font-size: 15px; font-weight: 700; margin-bottom: 8px;
  color: var(--text); display: flex; align-items: center; gap: 10px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 10px rgba(0, 168, 255, 0.25);
}
.confirm-dialog .confirm-title .icon { width: 22px; height: 22px; flex-shrink: 0; }
.confirm-dialog .confirm-title.danger .icon { color: var(--danger); filter: drop-shadow(0 0 5px rgba(255, 59, 92, 0.6)); }
.confirm-dialog .confirm-title.warn .icon { color: var(--warn); filter: drop-shadow(0 0 5px rgba(255, 176, 32, 0.6)); }
.confirm-dialog .confirm-msg {
  font-size: 13.5px; color: var(--text-secondary);
  margin-bottom: 20px; line-height: 1.55;
}
.confirm-dialog .confirm-actions {
  display: flex; gap: 10px; justify-content: flex-end;
}
.confirm-dialog.closing { animation: confirmOut 0.18s ease-in forwards; }
.confirm-backdrop.closing { animation: confirmFadeOut 0.18s ease-in forwards; }
@keyframes confirmFadeIn  { from { opacity: 0; } to { opacity: 1; } }
@keyframes confirmFadeOut { to   { opacity: 0; } }
@keyframes confirmIn {
  from { transform: scale(0.94) translateY(10px); opacity: 0; filter: blur(4px); }
  to   { transform: scale(1) translateY(0); opacity: 1; filter: blur(0); }
}
@keyframes confirmOut {
  to { transform: scale(0.96); opacity: 0; filter: blur(2px); }
}

@media (max-width: 480px) {
  .toast-container { top: 12px; left: 12px; right: 12px; transform: none; max-width: none; }
  .toast { min-width: 0; max-width: 100%; }
  .confirm-dialog { padding: 20px 18px; }
  .confirm-dialog .confirm-title { font-size: 14px; }
}

/* ============== 按钮 Armed 反馈 ============== */
.armed {
  animation: armedPulse 0.6s ease-out;
  position: relative;
}
.armed::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid var(--accent);
  box-shadow: 0 0 12px rgba(0, 168, 255, 0.6);
  pointer-events: none;
  animation: armedRing 0.6s ease-out forwards;
}
@keyframes armedPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(0.92); }
  100% { transform: scale(1); }
}
@keyframes armedRing {
  0%   { opacity: 0.8; transform: scale(1); }
  100% { opacity: 0;   transform: scale(1.4); }
}

/* ============== 进度条 (生成卡片) ============== */
#progressFill {
  background: linear-gradient(90deg, #00a8ff, #8b6bff, #00e5ff, #00a8ff);
  background-size: 300% 100%;
  animation: progress-flow 2.4s linear infinite;
  box-shadow: 0 0 10px rgba(0, 168, 255, 0.6);
}
@keyframes progress-flow {
  0%   { background-position: 0% 0; }
  100% { background-position: 300% 0; }
}
