/* ============================================================
   管理控制台外观：侧栏 + 顶栏 + 工作台
   —— 独立于前台主题，三套皮肤由 body[data-admin-skin] 控制
   ============================================================ */

/* ---------- 皮肤变量 ---------- */
body[data-admin-skin='aurora'] {
  --page-bg: #0a0e17;
  --page-bg-2: #0d1220;
  --glow-a: radial-gradient(circle at 40% 40%, rgba(91, 140, 255, 0.22), rgba(91, 140, 255, 0) 68%);
  --glow-b: radial-gradient(circle at 50% 50%, rgba(139, 92, 246, 0.18), rgba(139, 92, 246, 0) 70%);
  --sidebar-bg: rgba(13, 18, 29, 0.82);
  --topbar-bg: rgba(12, 17, 27, 0.78);
  --card-bg: rgba(21, 27, 40, 0.66);
  --modal-bg: #171d2b;
  --dock-bg: rgba(21, 27, 40, 0.92);
  --surface: #1a2130;
  --surface-2: #151b28;
  --text: #e8eefb;
  --text-muted: #93a0b8;
  --accent: #5b8cff;
  --accent-hover: #7aa2ff;
  --accent-soft: rgba(91, 140, 255, 0.16);
  --accent-glow: rgba(91, 140, 255, 0.32);
  --on-accent: #ffffff;
  --danger: #ff6b6b;
  --on-danger: #ffffff;
  --success: #3ddc97;
  --on-success: #06231a;
  --warning: #fbbf24;
  --edge: rgba(255, 255, 255, 0.075);
  --edge-weak: rgba(255, 255, 255, 0.045);
  --overlay: rgba(5, 8, 14, 0.72);
  --hover-bg: rgba(91, 140, 255, 0.08);
  --raised-sm: 0 2px 10px rgba(0, 0, 0, 0.22);
  --raised: 0 10px 30px rgba(0, 0, 0, 0.32);
  --raised-lg: 0 18px 50px rgba(0, 0, 0, 0.45);
  --pressed-sm: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  --inset: inset 0 1px 2px rgba(0, 0, 0, 0.35);
  --sh-dark: rgba(0, 0, 0, 0.5);
  --sh-light: rgba(255, 255, 255, 0.05);
  --scroll-thumb: rgba(255, 255, 255, 0.14);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.26);
  --btn-bg: rgba(255, 255, 255, 0.045);
  --stat-1: #5b8cff;
  --stat-2: #a78bfa;
  --stat-3: #fbbf24;
  --stat-4: #3ddc97;
  --stat-5: #22d3ee;
  --stat-6: #f472b6;
  /* 侧栏选中项：胶囊底 + 描边 + 柔和外发光 */
  --nav-active-bg: linear-gradient(90deg, rgba(91, 140, 255, 0.24), rgba(91, 140, 255, 0.06));
  --nav-active-ring: rgba(91, 140, 255, 0.22);
  --nav-active-glow: 0 4px 14px rgba(91, 140, 255, 0.16);
  color-scheme: dark;
}

body[data-admin-skin='neon'] {
  --page-bg: #07050f;
  --page-bg-2: #0b0716;
  --glow-a: radial-gradient(circle at 40% 40%, rgba(177, 108, 255, 0.26), rgba(177, 108, 255, 0) 68%);
  --glow-b: radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0) 70%);
  --sidebar-bg: rgba(12, 8, 24, 0.86);
  --topbar-bg: rgba(11, 7, 22, 0.8);
  --card-bg: rgba(23, 16, 41, 0.7);
  --modal-bg: #150e26;
  --dock-bg: rgba(20, 13, 36, 0.92);
  --surface: #171029;
  --surface-2: #120b22;
  --text: #ecf0ff;
  --text-muted: #9aa3c8;
  --accent: #b16cff;
  --accent-hover: #c88bff;
  --accent-soft: rgba(177, 108, 255, 0.18);
  --accent-glow: rgba(177, 108, 255, 0.4);
  --on-accent: #ffffff;
  --danger: #fb7185;
  --on-danger: #ffffff;
  --success: #4ade80;
  --on-success: #052012;
  --warning: #fbbf24;
  --edge: rgba(177, 108, 255, 0.16);
  --edge-weak: rgba(177, 108, 255, 0.09);
  --overlay: rgba(4, 2, 10, 0.74);
  --hover-bg: rgba(177, 108, 255, 0.1);
  --raised-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --raised: 0 10px 30px rgba(0, 0, 0, 0.36);
  --raised-lg: 0 18px 50px rgba(0, 0, 0, 0.5);
  --pressed-sm: inset 0 1px 3px rgba(0, 0, 0, 0.45);
  --inset: inset 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-dark: rgba(0, 0, 0, 0.55);
  --sh-light: rgba(255, 255, 255, 0.06);
  --scroll-thumb: rgba(177, 108, 255, 0.24);
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.3);
  --btn-bg: rgba(177, 108, 255, 0.07);
  --stat-1: #b16cff;
  --stat-2: #22d3ee;
  --stat-3: #f472b6;
  --stat-4: #4ade80;
  --stat-5: #fbbf24;
  --stat-6: #818cf8;
  --nav-active-bg: linear-gradient(90deg, rgba(177, 108, 255, 0.26), rgba(177, 108, 255, 0.07));
  --nav-active-ring: rgba(177, 108, 255, 0.26);
  --nav-active-glow: 0 4px 14px rgba(177, 108, 255, 0.2);
  color-scheme: dark;
}

body[data-admin-skin='element'] {
  --page-bg: #f4f6fb;
  --page-bg-2: #eef2f9;
  --glow-a: radial-gradient(circle at 40% 40%, rgba(37, 99, 235, 0.08), rgba(37, 99, 235, 0) 68%);
  --glow-b: radial-gradient(circle at 50% 50%, rgba(99, 102, 241, 0.07), rgba(99, 102, 241, 0) 70%);
  --sidebar-bg: #ffffff;
  --topbar-bg: rgba(255, 255, 255, 0.86);
  --card-bg: #ffffff;
  --modal-bg: #ffffff;
  --dock-bg: #ffffff;
  --surface: #f5f7fb;
  --surface-2: #f8fafd;
  --text: #1f2637;
  --text-muted: #6b7486;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-soft: rgba(37, 99, 235, 0.1);
  --accent-glow: rgba(37, 99, 235, 0.2);
  --on-accent: #ffffff;
  --danger: #dc2626;
  --on-danger: #ffffff;
  --success: #10b981;
  --on-success: #ffffff;
  --warning: #f59e0b;
  --edge: #e5e9f2;
  --edge-weak: #eef1f7;
  --overlay: rgba(15, 23, 42, 0.38);
  --hover-bg: #f2f5fa;
  --raised-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --raised: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.06);
  --raised-lg: 0 18px 40px rgba(16, 24, 40, 0.12);
  --pressed-sm: inset 0 1px 2px rgba(16, 24, 40, 0.08);
  --inset: inset 0 1px 2px rgba(16, 24, 40, 0.06);
  --sh-dark: rgba(16, 24, 40, 0.12);
  --sh-light: rgba(255, 255, 255, 0.9);
  --scroll-thumb: rgba(16, 24, 40, 0.18);
  --shadow-card: 0 1px 2px rgba(16, 24, 40, 0.04), 0 6px 20px rgba(16, 24, 40, 0.05);
  --btn-bg: #ffffff;
  --stat-1: #2563eb;
  --stat-2: #7c3aed;
  --stat-3: #f59e0b;
  --stat-4: #10b981;
  --stat-5: #0891b2;
  --stat-6: #db2777;
  --nav-active-bg: rgba(37, 99, 235, 0.09);
  --nav-active-ring: rgba(37, 99, 235, 0.16);
  --nav-active-glow: none;
  color-scheme: light;
}

/* ---------- 页面基础 ---------- */
body.admin-console {
  margin: 0;
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  transition: background 240ms ease, color 240ms ease;
}

body.admin-console a { color: inherit; text-decoration: none; }
body.admin-console button { font: inherit; color: inherit; cursor: pointer; }
body.admin-console input, body.admin-console select, body.admin-console textarea { font: inherit; }
body.admin-console [hidden] { display: none !important; }

body.admin-console ::-webkit-scrollbar { width: 10px; height: 10px; }
body.admin-console ::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 99px;
  border: 3px solid transparent;
  background-clip: padding-box;
}
body.admin-console ::-webkit-scrollbar-track { background: transparent; }

.console-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}
.console-glow::before,
.console-glow::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.9;
}
.console-glow::before {
  width: 58vw;
  height: 58vw;
  left: -14vw;
  top: -18vw;
  background: var(--glow-a);
  animation: csFloatA 26s ease-in-out infinite alternate;
}
.console-glow::after {
  width: 54vw;
  height: 54vw;
  right: -16vw;
  bottom: -20vw;
  background: var(--glow-b);
  animation: csFloatB 32s ease-in-out infinite alternate;
}
@keyframes csFloatA {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(3vw, 4vh, 0) scale(1.08); }
}
@keyframes csFloatB {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(-4vw, -3vh, 0) scale(1.06); }
}

/* ---------- 外壳 ---------- */
.console-shell {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100vh;
}

.console-sidebar {
  position: sticky;
  top: 0;
  flex: 0 0 236px;
  width: 236px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  backdrop-filter: blur(20px) saturate(140%);
  z-index: 40;
  transition: width 220ms cubic-bezier(0.4, 0, 0.2, 1), flex-basis 220ms cubic-bezier(0.4, 0, 0.2, 1);
}
.console-shell.collapsed .console-sidebar {
  flex-basis: 76px;
  width: 76px;
}

.cs-brand {
  flex: 0 0 auto;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px 0 18px;
  border-bottom: 1px solid var(--edge);
  overflow: hidden;
}
.cs-logo {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: transparent;
}
.cs-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.cs-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
}
.cs-brand-text b { font-size: 14px; letter-spacing: 0.2px; }
.cs-brand-text span { font-size: 11px; color: var(--text-muted); }
.cs-collapse {
  margin-left: auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--edge);
  background: transparent;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: background 160ms ease, color 160ms ease, transform 220ms ease;
}
.cs-collapse:hover { background: var(--hover-bg); color: var(--accent); }
.console-shell.collapsed .cs-collapse { transform: rotate(180deg); margin-left: 0; }
.console-shell.collapsed .cs-brand-text { display: none; }
.console-shell.collapsed .cs-brand { justify-content: center; padding: 0; }
/* 收起后隐藏 LOGO，只留展开按钮，否则没有入口可以展开回来 */
.console-shell.collapsed .cs-logo { display: none; }

/* 侧栏收起时的功能名称气泡（fixed 定位，避免被导航滚动区裁掉） */
.cs-tip {
  position: fixed;
  z-index: 9999;
  transform: translateY(-50%);
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--text);
  color: var(--card-bg);
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 120ms ease;
}
.cs-tip.on { opacity: 1; }

/* 导航（复用 .admin-tabs 容器，保持原有 tab 机制） */
body.admin-console .cs-nav {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 3px;
  margin: 0;
  padding: 12px 10px 18px;
  overflow-x: hidden;
  overflow-y: auto;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
body.admin-console .cs-nav::-webkit-scrollbar { width: 6px; }
.cs-nav-group {
  padding: 12px 10px 4px;
  font-size: 10.5px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
}
body.admin-console .cs-nav .tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13.5px;
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
  box-shadow: none;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}
body.admin-console .cs-nav .tab:hover {
  background: var(--hover-bg);
  color: var(--text);
}
body.admin-console .cs-nav .tab.active {
  background: var(--nav-active-bg, var(--accent-soft));
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px var(--nav-active-ring, transparent), var(--nav-active-glow, none);
}
/* 选中项左侧圆角指示条，不再用通高竖条切断圆角 */
body.admin-console .cs-nav .tab.active::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 50%;
  width: 3px;
  height: 16px;
  margin-top: -8px;
  border-radius: 999px;
  background: var(--accent);
}
.cs-ico {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  font-size: 14px;
  opacity: 0.9;
}
.cs-ico svg { width: 18px; height: 18px; display: block; }
.cs-label { overflow: hidden; text-overflow: ellipsis; }

.console-shell.collapsed .cs-nav-group { height: 8px; padding: 0; opacity: 0; }
.console-shell.collapsed .cs-nav .tab { justify-content: center; padding: 10px; }
.console-shell.collapsed .cs-nav .tab .cs-label { display: none; }
.console-shell.collapsed .cs-nav .tab.active { box-shadow: inset 0 0 0 1px var(--nav-active-ring, transparent); }
.console-shell.collapsed .cs-nav .tab.active::before { display: none; }

.cs-side-foot {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--edge);
}
.cs-user { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cs-avatar {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6);
  box-shadow: 0 6px 16px var(--accent-glow);
}
.cs-user-meta { min-width: 0; }
.cs-user-meta b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cs-user-meta span { font-size: 11px; color: var(--text-muted); }
.cs-side-actions { display: flex; gap: 6px; }
.cs-side-actions .btn { flex: 1; padding: 6px 8px; font-size: 12px; }
.cs-ver { font-size: 11px; color: var(--text-muted); display: flex; gap: 4px; align-items: center; }
.console-shell.collapsed .cs-user-meta,
.console-shell.collapsed .cs-side-actions,
.console-shell.collapsed .cs-ver { display: none; }
.console-shell.collapsed .cs-user { justify-content: center; }

/* ---------- 主区域 ---------- */
.console-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.console-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  height: 64px;
  padding: 0 26px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--edge);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
}
.cs-menu-btn {
  display: none;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: var(--btn-bg);
  color: var(--text-muted);
  font-size: 15px;
  place-items: center;
}
.cs-crumb {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
}
.cs-crumb i { font-style: normal; opacity: 0.5; }
.cs-crumb b { font-size: 14.5px; color: var(--text); font-weight: 600; }
.cs-top-actions { display: flex; align-items: center; gap: 10px; }
.cs-live {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}
.cs-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.12);
  animation: csPulse 2.4s ease-in-out infinite;
}
@keyframes csPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.1); }
  50% { box-shadow: 0 0 0 6px rgba(61, 220, 151, 0.02); }
}
.cs-clock {
  padding: 4px 10px;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--edge);
  font-size: 12.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.cs-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  border: 1px solid var(--edge);
  background: var(--btn-bg);
  color: var(--text-muted);
  font-size: 14px;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.cs-icon-btn:hover {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}
/* 顶栏「后端主题」「查看主页」文字按钮 */
.cs-skin-btn {
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--edge);
  background: var(--btn-bg);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  transition: color 160ms ease, background 160ms ease, border-color 160ms ease;
}
.cs-skin-btn:hover,
.cs-skin-btn[aria-expanded='true'] {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-soft);
}

/* ---------- 内容容器 ---------- */
body.admin-console .admin-wrap {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 22px 26px 44px;
}

body.admin-console .admin-panel {
  padding: 22px 24px;
  border-radius: 18px;
  background: var(--card-bg);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  animation: csPanelIn 300ms cubic-bezier(0.2, 0.7, 0.3, 1) both;
}
body.admin-console .admin-panel.glass:hover,
body.admin-console .admin-panel:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}
@keyframes csPanelIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

body.admin-console #tab-dashboard {
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  overflow: visible;
}

body.admin-console .panel-head h2 {
  font-size: 19px;
  letter-spacing: -0.2px;
}
body.admin-console .admin-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  padding: 26px 4px 6px;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.85;
}
body.admin-console .admin-footer a { color: inherit; }
body.admin-console .admin-footer a:hover { color: var(--accent); }

/* ---------- 通用组件重绘 ---------- */
body.admin-console .glass,
body.admin-console .glass-strong {
  background: var(--card-bg);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-card);
}
body.admin-console .glass:hover,
body.admin-console .glass-strong:hover {
  transform: none;
  box-shadow: var(--shadow-card);
}

body.admin-console .btn {
  padding: 8px 15px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--btn-bg);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: none;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}
body.admin-console .btn:hover {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  box-shadow: none;
  transform: translateY(-1px);
}
body.admin-console .btn:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}
body.admin-console .btn-sm { padding: 5px 11px; font-size: 12px; }
body.admin-console .btn-primary {
  background: var(--accent);
  border-color: transparent;
  color: var(--on-accent, #fff);
  box-shadow: 0 6px 18px var(--accent-glow);
}
body.admin-console .btn-primary:hover {
  background: var(--accent-hover);
  color: var(--on-accent, #fff);
  border-color: transparent;
  box-shadow: 0 8px 22px var(--accent-glow);
}
body.admin-console .btn-danger { color: var(--danger); }
body.admin-console .btn-danger:hover {
  background: var(--danger);
  border-color: transparent;
  color: var(--on-danger, #fff);
}

body.admin-console .input,
body.admin-console .select,
body.admin-console .textarea {
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--edge);
  background: var(--surface-2);
  color: var(--text);
  box-shadow: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
body.admin-console .input::placeholder,
body.admin-console .textarea::placeholder { color: var(--text-muted); opacity: 0.62; }
body.admin-console .input:focus,
body.admin-console .select:focus,
body.admin-console .textarea:focus {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
body.admin-console .select option {
  background: var(--surface);
  color: var(--text);
}
body.admin-console .form-hint { color: var(--text-muted); }
body.admin-console .form-item > label { color: var(--text-muted); }

body.admin-console .table th {
  color: var(--text-muted);
  font-weight: 600;
  border-bottom: 1px solid var(--edge);
}
body.admin-console .table td { border-bottom: 1px solid var(--edge-weak); }
body.admin-console .table tbody tr:hover td { background: var(--hover-bg); }

/* 二级分区导航 */
body.admin-console .settings-subnav {
  justify-content: flex-start;
  padding: 5px;
  gap: 4px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--edge);
  box-shadow: none;
}
body.admin-console .settings-subnav .subtab {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--text-muted);
  font-size: 12.5px;
}
body.admin-console .settings-subnav .subtab:hover {
  background: var(--hover-bg);
  color: var(--text);
}
body.admin-console .settings-subnav .subtab.active {
  background: var(--accent);
  color: var(--on-accent, #fff);
  font-weight: 600;
  box-shadow: 0 6px 16px var(--accent-glow);
}

body.admin-console .settings-section {
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: 14px;
  padding: 18px 20px 4px;
}
body.admin-console .section-head h3 { font-size: 16px; letter-spacing: -0.2px; }
body.admin-console .sub-group-title { color: var(--text-muted); }


body.admin-console .account-card {
  background: var(--surface-2);
  border: 1px solid var(--edge);
  border-radius: 14px;
  box-shadow: none;
  padding: 18px;
}
body.admin-console .account-card-title { font-weight: 600; }

body.admin-console .backup-row { border-bottom: 1px solid var(--edge-weak); }
body.admin-console .backup-actions { background: transparent; }

body.admin-console .changelog .log-item {
  background: var(--surface-2);
  border: 1px solid var(--edge);
  border-radius: 12px;
}

body.admin-console .modal {
  background: var(--overlay);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
body.admin-console .modal-box {
  background: var(--modal-bg);
  border: 1px solid var(--edge);
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.42);
  padding: 22px;
}
body.admin-console .modal-box.glass-strong:hover { transform: none; }
body.admin-console .modal-head h3 { font-size: 17px; }
body.admin-console .toast {
  background: var(--modal-bg);
  border: 1px solid var(--edge);
  color: var(--text);
}

/* ---------- 工作台 ---------- */
.dash-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 2px 0 18px;
}
.dash-head h2 {
  margin: 0 0 4px;
  font-size: 23px;
  letter-spacing: -0.6px;
  font-weight: 700;
}
.dash-head p { margin: 0; font-size: 13px; color: var(--text-muted); }
.dash-head-actions { display: flex; align-items: center; gap: 8px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.stat-card {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: border-color 200ms ease, transform 200ms ease;
}
.stat-card:hover { border-color: var(--accent-soft); transform: translateY(-2px); }
.stat-card::after {
  content: '';
  position: absolute;
  right: -34px;
  top: -44px;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--tone) 0%, transparent 68%);
  opacity: 0.16;
  pointer-events: none;
}
.tone-blue { --tone: var(--stat-1); }
.tone-purple { --tone: var(--stat-2); }
.tone-amber { --tone: var(--stat-3); }
.tone-green { --tone: var(--stat-4); }
.stat-top {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.stat-label { font-size: 12.5px; color: var(--text-muted); letter-spacing: 0.3px; }
.stat-glyph { font-size: 15px; color: var(--tone); opacity: 0.9; display: inline-flex; }
.stat-glyph svg { width: 18px; height: 18px; display: block; }
.stat-value {
  position: relative;
  z-index: 1;
  margin: 8px 0 3px;
  font-size: 32px;
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
}
.stat-foot {
  position: relative;
  z-index: 1;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-bar {
  position: relative;
  z-index: 1;
  height: 4px;
  margin-top: 12px;
  border-radius: 99px;
  background: var(--edge-weak);
  overflow: hidden;
}
.stat-bar i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--tone);
  transition: width 900ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.dash-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}
.dash-card {
  min-width: 0;
  padding: 18px 20px;
  border-radius: 16px;
  background: var(--card-bg);
  border: 1px solid var(--edge);
  box-shadow: var(--shadow-card);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.dash-card.span-2 { grid-column: span 2; }
.dash-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.dash-card-head h3 { margin: 0; font-size: 15px; letter-spacing: -0.2px; }
.dash-card-head p { margin: 2px 0 0; font-size: 11.5px; color: var(--text-muted); }
.dash-sub-head { margin: 18px 0 10px; }
.dash-chip {
  flex: 0 0 auto;
  padding: 3px 9px;
  border-radius: 7px;
  border: 1px solid var(--edge);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.donut-row {
  display: flex;
  align-items: center;
  gap: 22px;
}
.donut-wrap {
  position: relative;
  flex: 0 0 200px;
  width: 200px;
  height: 200px;
}
.donut-wrap canvas { width: 200px; height: 200px; display: block; }
.donut-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.donut-center b {
  font-size: 27px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}
.donut-center span { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }
.legend {
  flex: 1;
  min-width: 0;
  /* 两列纵向流：先填满左列再填右列，保持「父组 → 子组」的先后顺序 */
  column-count: 2;
  column-gap: 22px;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 12.5px;
  min-width: 0;
  margin-bottom: 8px;
  break-inside: avoid;
}
/* 分组分布与「打开方式」「最近添加」并列成三卡：环形图与图例改为上下排列 */
.group-card .donut-row { flex-direction: column; align-items: stretch; gap: 12px; }
.group-card .donut-wrap { align-self: center; flex: 0 0 176px; width: 176px; height: 176px; }
.group-card .donut-wrap canvas { width: 176px; height: 176px; }
.group-card .donut-center b { font-size: 24px; }
.group-card .legend { column-gap: 16px; }
.group-card .legend-row { font-size: 11.5px; gap: 6px; }

/* 审计日志预览 */
.audit-preview { display: flex; flex-direction: column; }
/* 宽屏时审计日志改为两列，9 条记录不增加卡片高度 */
@media (min-width: 1101px) {
  .audit-preview {
    display: block;
    column-count: 2;
    column-gap: 24px;
  }
  .audit-preview .audit-row { break-inside: avoid; }
}
.audit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--edge-weak);
  min-width: 0;
}
.audit-row:last-child { border-bottom: 0; }
.audit-cat {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 6px;
  border: 1px solid var(--edge);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
}
.audit-main {
  flex: 1;
  min-width: 0;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.audit-main b { font-weight: 600; }
.audit-main span { margin-left: 6px; color: var(--text-muted); }
.audit-main .audit-fail { color: var(--danger); }
.audit-time {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.legend-dot { flex: 0 0 9px; width: 9px; height: 9px; border-radius: 3px; }
.legend-name {
  flex: 1;
  min-width: 0;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.legend-val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.legend-pct { flex: 0 0 40px; text-align: right; color: var(--text-muted); font-size: 11.5px; }

.bar-list { display: flex; flex-direction: column; gap: 13px; }
.bar-row-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.bar-row-head .k { color: var(--text-muted); }
.bar-row-head .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.bar-track { height: 6px; border-radius: 99px; background: var(--edge-weak); overflow: hidden; }
.bar-fill {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--accent), var(--stat-5));
  transition: width 900ms cubic-bezier(0.2, 0.7, 0.3, 1);
}

.mini-list .mini-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--edge);
  font-size: 12.5px;
}
.mini-list .mini-row:last-child { border-bottom: 0; }
.mini-row .k { flex: 0 0 auto; color: var(--text-muted); }
.mini-row .v {
  min-width: 0;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 62%;
  font-weight: 500;
}

.recent-list { display: flex; flex-direction: column; }
.recent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--edge-weak);
  min-width: 0;
}
.recent-row:last-child { border-bottom: 0; }
.recent-ico {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-soft);
}
.recent-main { flex: 1; min-width: 0; }
.recent-main b {
  display: block;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-main span {
  display: block;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid var(--edge);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.recent-tag.hidden {
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
  background: rgba(245, 158, 11, 0.1);
}
.dash-empty {
  padding: 18px 4px;
  font-size: 12.5px;
  color: var(--text-muted);
  text-align: center;
}

.quick-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-btn {
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--edge);
  background: var(--surface-2);
  text-align: left;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}
.quick-btn:hover {
  border-color: var(--accent-soft);
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.quick-btn span { display: flex; align-items: center; font-size: 16px; color: var(--accent); margin-bottom: 7px; }
.quick-btn span svg { width: 19px; height: 19px; display: block; }
.quick-btn b { display: block; font-size: 12.5px; font-weight: 600; }
.quick-btn i {
  display: block;
  margin-top: 2px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- 风格切换停靠（吸附在顶栏「后端主题」下方） ---------- */
.skin-dock {
  position: fixed;
  right: 64px;
  top: 72px;
  bottom: auto;
  z-index: 150;
  width: 168px;
  transform-origin: top right;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-radius: 14px;
  background: var(--dock-bg);
  border: 1px solid var(--edge);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.36);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  animation: csPanelIn 200ms ease both;
}
.skin-dock[hidden] { display: none !important; }
.skin-dock-title {
  padding: 2px 4px 6px;
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--text-muted);
}
.skin-opt {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border-radius: 9px;
  border: 1px solid transparent;
  background: transparent;
  font-size: 12.5px;
  text-align: left;
  transition: background 160ms ease, border-color 160ms ease;
}
.skin-opt:hover { background: var(--hover-bg); }
.skin-opt.on { border-color: var(--accent-soft); background: var(--accent-soft); }
.skin-swatch {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.sw-aurora { background: linear-gradient(135deg, #5b8cff, #0b0f17); }
.sw-neon { background: linear-gradient(135deg, #b16cff, #22d3ee); }
.sw-element { background: linear-gradient(135deg, #ffffff, #2563eb); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .dash-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-card.span-2 { grid-column: span 2; }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .console-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 240ms cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.45);
  }
  .console-shell.drawer-open .console-sidebar { transform: none; }
  .cs-collapse { display: none; }
  .cs-menu-btn { display: grid; }
  .console-backdrop {
    position: fixed;
    inset: 0;
    z-index: 35;
    background: rgba(0, 0, 0, 0.5);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .console-main { width: 100%; }
  .console-topbar { padding: 0 14px; }
  .dash-grid { grid-template-columns: 1fr; }
  .dash-card.span-2 { grid-column: auto; }
  .cs-live { display: none; }
  body.admin-console .admin-wrap { padding: 16px 14px 40px; }
}

@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr; }
  .cs-clock { display: none; }
  .donut-row { flex-direction: column; align-items: stretch; gap: 14px; }
  .donut-wrap { align-self: center; }
  .legend { width: 100%; column-count: 1; }
  .quick-grid { grid-template-columns: 1fr; }
  .dash-head h2 { font-size: 20px; }
  body.admin-console .admin-panel { padding: 14px 12px; border-radius: 16px; }
  body.admin-console #tab-dashboard { padding: 0; }
  .skin-dock { right: 52px; top: 64px; }
}

/* ---------- 表格滚动容器：窄屏只让表格自身横向滚动，筛选栏保持不动 ---------- */
body.admin-console .table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
body.admin-console .table-scroll::-webkit-scrollbar { height: 4px; }
body.admin-console .table-scroll::-webkit-scrollbar-track { background: transparent; }
body.admin-console .table-scroll::-webkit-scrollbar-thumb { background: var(--edge); border-radius: 999px; }

@media (max-width: 960px) {
  .console-topbar { padding: 0 12px; gap: 8px; }
  .cs-menu-btn { width: 38px; height: 38px; }
  body.admin-console .admin-wrap {
    padding: 14px 12px calc(36px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 640px) {
  .cs-icon-btn { width: 34px; height: 34px; }
  .cs-crumb { gap: 6px; font-size: 13px; }

  /* 其余表格保留表格形态：单元格 nowrap + 最小宽度，交由滚动容器横向滑动 */
  body.admin-console .table-scroll > .table { min-width: 620px; }
  body.admin-console .table-scroll > .table.audit-table { min-width: 720px; }
  body.admin-console .table-scroll > .table td { white-space: nowrap; }
  body.admin-console .table-scroll > .table td .tag,
  body.admin-console .table-scroll > .table td span { white-space: nowrap; }

  /* 分页：页码一行横滑，避免折成两三行占掉半屏 */
  body.admin-console .pager { margin-top: 10px; }
  body.admin-console .pager-nav {
    width: 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  body.admin-console .pager-nav::-webkit-scrollbar { display: none; }
  body.admin-console .pager-btn { flex: 0 0 auto; height: 34px; }

  /* ===== 卡片管理：表格 → 逐条卡片 ===== */
  body.admin-console #tab-items .table-scroll { overflow: visible; }
  body.admin-console #tab-items .table { min-width: 0; }
  body.admin-console #tab-items .table thead { display: none; }
  body.admin-console #tab-items .table,
  body.admin-console #tab-items .table tbody { display: block; width: 100%; }
  body.admin-console #tab-items .table tr {
    display: grid;
    grid-template-columns: 26px 38px minmax(0, 1fr) auto;
    grid-template-areas:
      "chk ico title title"
      "url url url url"
      "desc desc desc desc"
      "grp grp open open"
      "act act act act";
    align-items: center;
    column-gap: 9px;
    row-gap: 7px;
    padding: 10px 2px 12px;
    border-bottom: 1px solid var(--edge-weak);
  }
  body.admin-console #tab-items .table td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
  }
  body.admin-console #tab-items .table td[colspan] { grid-column: 1 / -1; text-align: center; }
  body.admin-console #tab-items .table td:nth-child(1) { grid-area: chk; }
  body.admin-console #tab-items .table td:nth-child(2) { grid-area: ico; }
  body.admin-console #tab-items .table td:nth-child(3) { grid-area: title; min-width: 0; max-width: none; font-weight: 600; }
  body.admin-console #tab-items .table td:nth-child(3) > div {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.admin-console #tab-items .table td:nth-child(4) {
    grid-area: url;
    max-width: none !important;
    font-size: 12px;
    color: var(--text-muted);
  }
  body.admin-console #tab-items .table td:nth-child(5) {
    grid-area: desc;
    max-width: none;
    font-size: 12px;
    color: var(--text-muted);
    white-space: normal;
  }
  body.admin-console #tab-items .table td:nth-child(6) { grid-area: grp; }
  body.admin-console #tab-items .table td:nth-child(7) {
    grid-area: open;
    text-align: right;
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
  }
  body.admin-console #tab-items .table td:nth-child(8) { grid-area: act; }
  body.admin-console #tab-items .table .actions { flex-wrap: wrap; gap: 6px; }
  body.admin-console #tab-items .table .actions .btn {
    flex: 1 1 72px;
    height: 34px;
    padding: 0 8px;
    font-size: 12.5px;
  }
  body.admin-console #tab-items .table .item-check,
  body.admin-console #tab-items .table #itemsCheckAll { width: 18px; height: 18px; }

  /* ===== 分组管理：表格 → 逐条卡片（拖拽把手保留） ===== */
  body.admin-console #tab-groups .table-scroll { overflow: visible; }
  body.admin-console #tab-groups .table { min-width: 0; }
  body.admin-console #tab-groups .table thead { display: none; }
  body.admin-console #tab-groups .table,
  body.admin-console #tab-groups .table tbody { display: block; width: 100%; }
  body.admin-console #tab-groups .table tr {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) auto;
    grid-template-areas:
      "drag name name"
      "desc desc desc"
      "count count vis"
      "act act act";
    align-items: center;
    column-gap: 8px;
    row-gap: 6px;
    padding: 10px 2px 12px;
    border-bottom: 1px solid var(--edge-weak);
  }
  body.admin-console #tab-groups .table tr.row-collapsed { display: none; }
  body.admin-console #tab-groups .table td {
    display: block;
    padding: 0;
    border: 0;
    min-width: 0;
    white-space: normal;
  }
  body.admin-console #tab-groups .table td[colspan] { grid-column: 1 / -1; text-align: center; }
  body.admin-console #tab-groups .table td:nth-child(1) { grid-area: drag; }
  body.admin-console #tab-groups .table td:nth-child(2) { grid-area: name; overflow: hidden; }
  body.admin-console #tab-groups .table td:nth-child(3) {
    grid-area: desc;
    font-size: 12px;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
  }
  body.admin-console #tab-groups .table td:nth-child(4) {
    grid-area: count;
    font-size: 12px;
    color: var(--text-muted);
  }
  body.admin-console #tab-groups .table td:nth-child(4)::before { content: '卡片 '; }
  body.admin-console #tab-groups .table td:nth-child(4) b,
  body.admin-console #tab-groups .table td:nth-child(4) { font-weight: 400; }
  body.admin-console #tab-groups .table td:nth-child(5) {
    grid-area: vis;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
  }
  body.admin-console #tab-groups .table td:nth-child(6) { grid-area: act; }
  body.admin-console #tab-groups .table .actions { flex-wrap: wrap; gap: 6px; }
  body.admin-console #tab-groups .table .actions .btn {
    flex: 1 1 64px;
    height: 34px;
    padding: 0 8px;
    font-size: 12.5px;
  }
  body.admin-console #tab-groups .table .g-table-name { max-width: 100%; }
  body.admin-console #tab-groups .table .drag-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 34px;
    padding: 0;
  }
  body.admin-console #groupsTbody tr.row-child .g-table-name { padding-left: 16px; }
  body.admin-console #groupsTbody tr.row-child .g-table-name::before { left: 4px; }
}

/* ---------- 平板 / 窄桌面：操作列不再被压窄（否则 6 个按钮竖排把行高撑到 200+） ---------- */
@media (min-width: 641px) and (max-width: 1100px) {
  body.admin-console #tab-items .table td:nth-child(8),
  body.admin-console #tab-groups .table td:nth-child(6) {
    width: 1%;
    white-space: nowrap;
  }
  body.admin-console #tab-items .table .actions,
  body.admin-console #tab-groups .table .actions {
    flex-wrap: nowrap;
    justify-content: flex-end;
  }
  body.admin-console #tab-items .table .actions .btn,
  body.admin-console #tab-groups .table .actions .btn {
    flex: 0 0 auto;
    height: 30px;
    padding: 0 9px;
    font-size: 12px;
  }
  /* 标题 / 名称列保底：不足时交给表格横向滑动，避免挤成一字一行 */
  body.admin-console #tab-items .table td:nth-child(3) { min-width: 120px; }
  body.admin-console #tab-groups .table td:nth-child(2) { white-space: nowrap; }
  body.admin-console #tab-groups .table td:nth-child(3) { min-width: 132px; }
}

/* ============================================================
   登录页：只跟随后端皮肤（aurora / neon / element），与前台主题无关
   ============================================================ */
body.login-body[data-admin-skin] {
  background-color: var(--page-bg);
  background-image: var(--glow-a), var(--glow-b);
  background-attachment: fixed;
  color: var(--text);
}

body.login-body[data-admin-skin] .style-fx { display: none; }

body.login-body[data-admin-skin] .login-card {
  background: var(--surface-2);
  border: 1px solid var(--edge);
  box-shadow: var(--raised-lg);
}

/* ============================================================
   工作台：审计日志 + 剪藏动态 + 快捷操作（四列一行）
   ============================================================ */
.dash-grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.clip-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 10px;
}
.clip-stat {
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--edge);
}
.clip-stat b {
  display: block;
  font-size: 18px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.clip-stat span {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.clip-stat.unread b { color: var(--accent); }

/* 覆盖率条 */
.clip-meters {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}
.clip-meter .cm-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  color: var(--text-muted);
}
.clip-meter .cm-track {
  height: 4px;
  margin-top: 4px;
  border-radius: 99px;
  background: var(--edge-weak);
  overflow: hidden;
}
.clip-meter .cm-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 99px;
  background: var(--accent);
  transition: width 500ms ease;
}

/* 分组 / 标签 / 接入方式 */
.clip-extra { margin-bottom: 8px; }
.clip-hint-title {
  margin: 0 0 5px;
  font-size: 11px;
  color: var(--text-muted);
}
.clip-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.clip-chip {
  max-width: 100%;
  padding: 2px 8px;
  border-radius: 7px;
  border: 1px solid var(--edge);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.clip-chip b {
  margin-left: 4px;
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.clip-entry {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
  font-size: 11.5px;
  color: var(--text-muted);
}
.clip-entry b {
  flex: 0 0 86px;
  color: var(--text);
  font-weight: 600;
}
.clip-entry span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.recent-ico.unread {
  background: var(--accent);
  color: #fff;
}
.recent-tag.on {
  color: var(--accent);
  border-color: var(--accent-soft);
  background: var(--accent-soft);
}

@media (max-width: 1100px) {
  .dash-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 单列时 20 条会撑高卡片，超出部分内部滚动 */
  .audit-preview { max-height: 340px; overflow-y: auto; }
}
@media (max-width: 760px) {
  .dash-grid-4 { grid-template-columns: 1fr; }
  .dash-grid-4 .dash-card.span-2 { grid-column: auto; }
}

/* ============================================================
   卡片管理：三视图（列表 / 网格 / 双栏主从）
   ============================================================ */
body.admin-console .seg {
  display: inline-flex;
  border: 1px solid var(--edge);
  border-radius: 9px;
  overflow: hidden;
  background: var(--card-bg);
}
body.admin-console .seg-btn {
  border: 0;
  background: transparent;
  height: 30px;
  padding: 0 11px;
  font: inherit;
  font-size: 12.5px;
  color: var(--text-muted);
  cursor: pointer;
}
body.admin-console .seg-btn + .seg-btn { border-left: 1px solid var(--edge); }
body.admin-console .seg-btn:hover { color: var(--text); }
body.admin-console .seg-btn.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

body.admin-console .items-empty {
  padding: 30px 12px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
body.admin-console .bulk-bar .bulk-all {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ---------- 双栏右侧卡片行 ---------- */
body.admin-console .icard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 8px;
  border-radius: 10px;
}
body.admin-console .icard:hover { background: var(--hover-bg); }
body.admin-console .icard.is-hidden,
body.admin-console .igcard.is-hidden { opacity: .62; }
body.admin-console .icard-chk { flex: 0 0 auto; display: flex; align-items: center; }
body.admin-console .icard-ico,
body.admin-console .igcard-ico { width: 34px; height: 34px; font-size: 13px; border-radius: 9px; }
body.admin-console .icard-main { flex: 1; min-width: 0; }
body.admin-console .icard-t { display: flex; align-items: center; gap: 8px; min-width: 0; }
body.admin-console .icard-name {
  font-weight: 600;
  font-size: 13.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.admin-console .icard-open {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--edge);
  border-radius: 999px;
  padding: 0 6px;
}
body.admin-console .icard-d {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.admin-console .icard-acts {
  position: relative;
  flex: 0 0 auto;
  display: flex;
  gap: 6px;
}
body.admin-console .icard-acts .btn { height: 28px; padding: 0 10px; font-size: 12px; }

body.admin-console .icard-menu {
  position: absolute;
  right: 0;
  top: 34px;
  z-index: 30;
  min-width: 132px;
  display: none;
  padding: 5px;
  background: var(--card-bg);
  border: 1px solid var(--edge);
  border-radius: 10px;
  box-shadow: 0 10px 28px rgba(10, 16, 32, .16);
}
body.admin-console .icard-menu.open { display: block; }
body.admin-console .icard-menu button {
  display: block;
  width: 100%;
  padding: 7px 9px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12.5px;
  text-align: left;
  cursor: pointer;
}
body.admin-console .icard-menu button:hover { background: var(--hover-bg); }
body.admin-console .icard-menu button.del { color: var(--color-danger, #e8463a); }
body.admin-console .icard-menu hr { border: 0; border-top: 1px solid var(--edge-weak); margin: 4px 2px; }

/* ---------- 网格视图 ---------- */
body.admin-console .igrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin-top: 6px;
}
body.admin-console .igcard {
  position: relative;
  padding: 16px 10px 12px;
  border: 1px solid var(--edge);
  border-radius: 14px;
  background: var(--card-bg);
  text-align: center;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
body.admin-console .igcard:hover { border-color: var(--accent); box-shadow: 0 8px 20px rgba(10, 16, 32, .10); }
body.admin-console .igcard-ico { width: 42px; height: 42px; font-size: 15px; border-radius: 11px; margin: 0 auto 8px; }
body.admin-console .igcard-t {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.admin-console .igcard-u {
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.admin-console .igcard-g {
  display: inline-block;
  max-width: 100%;
  margin-top: 7px;
  padding: 0 7px;
  font-size: 11px;
  color: var(--text-muted);
  border: 1px solid var(--edge);
  border-radius: 999px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.admin-console .igcard-hid {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 0 6px;
  font-size: 10.5px;
  color: #a26400;
  background: rgba(239, 170, 23, .18);
  border-radius: 999px;
}
body.admin-console .igcard-chk { position: absolute; top: 8px; left: 9px; display: none; }
body.admin-console .igcard:hover .igcard-chk,
body.admin-console .igcard-chk:has(input:checked) { display: block; }
body.admin-console .igcard-ov {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  background: var(--card-bg);
  opacity: 0;
  transition: opacity 150ms ease;
}
body.admin-console .igcard:hover .igcard-ov { opacity: .95; }
body.admin-console .igcard-ov .btn { height: 28px; padding: 0 10px; font-size: 12px; }
body.admin-console .igcard .icard-menu { top: 46px; right: 8px; }

/* ---------- 双栏主从 ---------- */
body.admin-console .items-split { display: flex; gap: 14px; align-items: stretch; }
body.admin-console .items-tree {
  flex: 0 0 214px;
  width: 214px;
  align-self: stretch;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 150px);
  overflow: auto;
  padding: 8px;
  border: 1px solid var(--edge);
  border-radius: 12px;
  background: var(--card-bg);
}
body.admin-console .itree-toggle {
  flex: 0 0 auto;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 2px;
}
body.admin-console .itree-node:hover .itree-toggle { color: var(--accent); }
body.admin-console .itree-node {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
}
body.admin-console .itree-node:hover { background: var(--hover-bg); }
body.admin-console .itree-node.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
body.admin-console .itree-car { flex: 0 0 10px; font-size: 9px; color: var(--text-muted); }
body.admin-console .itree-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
body.admin-console .itree-cnt { font-size: 11px; color: var(--text-muted); }
body.admin-console .itree-node.child { padding-left: 34px; font-size: 12.5px; }
body.admin-console .items-split-main { flex: 1; min-width: 0; }
body.admin-console .isplit-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
body.admin-console .isplit-head b { font-size: 14px; }
body.admin-console .isplit-head span { font-size: 11.5px; color: var(--text-muted); }

@media (max-width: 1100px) {
  body.admin-console .icard-acts .btn { padding: 0 8px; font-size: 11.5px; }
}
@media (max-width: 900px) {
  body.admin-console .items-split { flex-direction: column; }
  body.admin-console .items-tree { position: static; flex: 0 0 auto; width: 100%; max-height: 220px; }
}
@media (max-width: 640px) {
  body.admin-console .icard { flex-wrap: wrap; }
  body.admin-console .icard-acts { flex-wrap: wrap; justify-content: flex-end; width: 100%; }
  body.admin-console .icard-open { display: none; }
  body.admin-console .igrid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); }
  body.admin-console .seg-btn { padding: 0 9px; font-size: 12px; }
}
