/* ──────────────────────────────────────────────────────────────
   CX Auto - 全局样式
   设计语言：深色玻璃态 + 紫色主题 + 圆润卡片
────────────────────────────────────────────────────────────── */

:root {
  --bg: #0f0f13;
  --bg2: #16161e;
  --surface: #1e1e2a;
  --surface2: #252535;
  --surface3: #2e2e40;
  --border: rgba(255,255,255,0.07);
  --border2: rgba(255,255,255,0.12);

  --primary: #6366f1;
  --primary-hover: #7c7ff5;
  --primary-glow: rgba(99,102,241,0.35);
  --secondary: #8b5cf6;
  --accent: #06b6d4;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;

  --text: #e8e8f0;
  --text-muted: #8888aa;
  --text-faint: #555568;

  --sidebar-width: 240px;
  --topbar-height: 60px;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.3);

  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-hover); }

/* ── 应用布局 ─────────────────────────────────────────────── */
.app-body {
  display: flex;
  height: 100vh;
  overflow: hidden;
}

/* ── 侧边栏 ──────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0;
  z-index: 100;
  transition: width var(--transition), transform var(--transition);
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.logo-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 13px;
  flex-shrink: 0;
}

.logo-text {
  font-weight: 700;
  font-size: 16px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-toggle, .topbar-toggle {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}
.sidebar-toggle:hover, .topbar-toggle:hover {
  background: var(--surface3); color: var(--text);
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
  margin-bottom: 2px;
}

.nav-item:hover {
  background: var(--surface2);
  color: var(--text);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99,102,241,0.2), rgba(139,92,246,0.15));
  color: var(--primary);
  border: 1px solid rgba(99,102,241,0.3);
}

.nav-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.nav-icon svg { width: 18px; height: 18px; }

.nav-label { font-size: 13.5px; }

.nav-badge {
  margin-left: auto;
  background: var(--danger);
  color: white;
  font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 10px;
  min-width: 18px; text-align: center;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}

.user-info { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }

.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 13px;
  flex-shrink: 0;
}

.user-meta { min-width: 0; }
.user-name { font-weight: 600; font-size: 13px; truncate: ellipsis; white-space: nowrap; overflow: hidden; }
.user-role { font-size: 11px; color: var(--text-muted); }

.logout-btn {
  color: var(--text-muted);
  padding: 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  display: flex;
}
.logout-btn:hover { color: var(--danger); background: rgba(239,68,68,0.1); }
.logout-label { font-size: .8rem; white-space: nowrap; overflow: hidden;
  transition: opacity var(--transition), max-width var(--transition); }
.sidebar.collapsed .logout-label { max-width: 0; opacity: 0; }

/* ── 主内容区 ────────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  height: 100vh;
  display: flex; flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;  /* iOS 顺滑滚动 */
  transition: margin-left var(--transition);
}

.topbar {
  height: var(--topbar-height);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center;
  padding: 0 20px;
  justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
}

.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-right { display: flex; align-items: center; gap: 8px; }

.page-title {
  font-size: 16px; font-weight: 600;
  color: var(--text);
}

.page-content {
  flex: 1;
  padding: 24px;
  max-width: 1200px;
}

/* ── 按钮 ────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: none; outline: none;
  transition: all var(--transition);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px var(--primary-glow);
  color: white;
}
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: var(--surface2);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--surface3); color: var(--text); }

.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.icon-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 6px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center;
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--surface3); color: var(--text); }
.icon-btn-danger:hover { background: rgba(239,68,68,0.1); color: var(--danger); }

/* ── 卡片 ────────────────────────────────────────────────── */
.dash-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.dash-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}

.dash-card-header h3 {
  font-size: 15px; font-weight: 600;
}

.mt-4 { margin-top: 20px; }

/* ── Flash 消息 ──────────────────────────────────────────── */
.flash-container {
  padding: 0 24px;
  margin-top: 12px;
}

.flash {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-radius: var(--radius-sm);
  margin-bottom: 8px; font-size: 13.5px;
}

.flash-success { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.flash-danger  { background: rgba(239,68,68,0.15);  color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.flash-warning { background: rgba(245,158,11,0.15); color: #fcd34d; border: 1px solid rgba(245,158,11,0.3); }
.flash-info    { background: rgba(59,130,246,0.15); color: #93c5fd; border: 1px solid rgba(59,130,246,0.3); }

.flash-close {
  background: none; border: none; cursor: pointer;
  color: inherit; font-size: 16px; opacity: 0.7;
}
.flash-close:hover { opacity: 1; }

/* ── 统计卡片 ────────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  position: relative; overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

.stat-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  opacity: 0; transition: opacity var(--transition);
}
.stat-card:hover::before { opacity: 1; }

.stat-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }

.stat-icon-blue   { background: rgba(99,102,241,0.15); color: var(--primary); }
.stat-icon-green  { background: rgba(16,185,129,0.15); color: var(--success); }
.stat-icon-purple { background: rgba(139,92,246,0.15); color: var(--secondary); }
.stat-icon-orange { background: rgba(245,158,11,0.15); color: var(--warning); }

.stat-value {
  font-size: 28px; font-weight: 700;
  line-height: 1.2; letter-spacing: -0.5px;
}

.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ── 欢迎 Banner ─────────────────────────────────────────── */
.welcome-banner {
  background: linear-gradient(135deg, rgba(99,102,241,0.15), rgba(139,92,246,0.1));
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
}

.welcome-text h2 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.welcome-text p  { color: var(--text-muted); font-size: 13.5px; }

.welcome-lottie { width: 80px; height: 80px; flex-shrink: 0; }

/* ── Dashboard 双栏 ──────────────────────────────────────── */
.dash-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

/* ── 账号列表 ────────────────────────────────────────────── */
.account-list { padding: 8px 0; }

.account-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.account-item:last-child { border-bottom: none; }
.account-item:hover { background: var(--surface2); }

.account-avatar {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 12px;
  flex-shrink: 0;
}

.account-info { flex: 1; min-width: 0; }
.account-phone { font-weight: 600; font-size: 13.5px; }
.account-features { display: flex; gap: 4px; margin-top: 3px; }

.feat-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px; font-weight: 500;
}
.feat-checkin { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.feat-study   { background: rgba(99,102,241,0.2); color: #a5b4fc; }
.feat-work    { background: rgba(245,158,11,0.2); color: #fcd34d; }

.account-status { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.status-valid   .status-dot, .status-dot.status-valid   { background: var(--success); box-shadow: 0 0 6px var(--success); }
.status-invalid .status-dot, .status-dot.status-invalid { background: var(--danger); }
.status-unknown .status-dot, .status-dot.status-unknown { background: var(--text-faint); }
.status-text { font-size: 12px; color: var(--text-muted); }

/* ── 通知列表 ────────────────────────────────────────────── */
.notif-list { padding: 4px 0; }

.notif-item {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 10px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: var(--surface2); }
.notif-unread { background: rgba(99,102,241,0.06); }

.notif-icon-wrap {
  width: 28px; height: 28px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; margin-top: 1px;
}
.notif-icon-checkin_ok, .notif-icon-study_ok { background: rgba(16,185,129,0.15); color: var(--success); }
.notif-icon-checkin_fail { background: rgba(239,68,68,0.15); color: var(--danger); }
.notif-icon-work_remind, .notif-icon-exam_remind { background: rgba(245,158,11,0.15); color: var(--warning); }

.notif-body { flex: 1; min-width: 0; }
.notif-title { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notif-time  { font-size: 11px; color: var(--text-faint); margin-top: 2px; }

/* ── 任务表格 ────────────────────────────────────────────── */
.task-table-wrap { overflow-x: auto; }

.task-table {
  width: 100%; border-collapse: collapse;
}

.task-table th, .task-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.task-table th {
  font-size: 11.5px; font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  background: var(--surface2);
}

.task-table tbody tr {
  transition: background var(--transition);
}
.task-table tbody tr:hover { background: var(--surface2); }
.task-table tbody tr:last-child td { border-bottom: none; }

.empty-td { text-align: center; padding: 40px; color: var(--text-muted); }

.type-badge {
  display: inline-block;
  padding: 3px 8px; border-radius: 5px;
  font-size: 12px; font-weight: 600;
}
.type-checkin { background: rgba(16,185,129,0.15);  color: #6ee7b7; }
.type-study   { background: rgba(99,102,241,0.15);  color: #a5b4fc; }
.type-work    { background: rgba(245,158,11,0.15);  color: #fcd34d; }
.type-exam    { background: rgba(59,130,246,0.15);  color: #93c5fd; }
.type-answer  { background: rgba(139,92,246,0.15);  color: #c4b5fd; }

.status-badge {
  display: inline-block;
  padding: 3px 8px; border-radius: 5px;
  font-size: 12px; font-weight: 600;
}
.status-success  { background: rgba(16,185,129,0.15); color: #6ee7b7; }
.status-failed   { background: rgba(239,68,68,0.15);  color: #fca5a5; }
.status-running  { background: rgba(59,130,246,0.15); color: #93c5fd; }
.status-pending  { background: rgba(100,100,120,0.2); color: var(--text-muted); }
.status-skipped  { background: rgba(100,100,120,0.15); color: var(--text-faint); }

.course-name, .result-msg { color: var(--text-muted); font-size: 13px; }
.task-time  { color: var(--text-faint); font-size: 12px; white-space: nowrap; }
.mono { font-family: 'Courier New', monospace; font-size: 12.5px; }

/* ── 账号卡片网格 ─────────────────────────────────────────── */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.acct-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.acct-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border2);
}

.acct-card-header {
  padding: 16px;
  display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid var(--border);
}

.acct-avatar-wrap { position: relative; flex-shrink: 0; }
.acct-avatar {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 13px;
}
.acct-status-dot {
  position: absolute; bottom: -1px; right: -1px;
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--surface);
}
.acct-status-dot.status-valid   { background: var(--success); }
.acct-status-dot.status-invalid { background: var(--danger); }
.acct-status-dot.status-unknown { background: var(--text-faint); }

.acct-basic { flex: 1; min-width: 0; }
.acct-phone { font-weight: 600; font-size: 14px; }
.acct-school { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.acct-actions { display: flex; gap: 2px; }

.acct-session-info {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}
.session-status-row { display: flex; justify-content: space-between; align-items: center; }
.session-label { font-size: 12px; color: var(--text-muted); }
.session-val { font-size: 12.5px; font-weight: 500; }
.session-valid   { color: var(--success); }
.session-invalid { color: var(--danger); }
.session-unknown { color: var(--text-muted); }
.session-time { font-size: 11px; color: var(--text-faint); margin-top: 3px; }

.acct-features {
  padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.feat-toggle {
  display: flex; align-items: center; justify-content: space-between;
}

.feat-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text);
}
.feat-emoji { font-size: 15px; }

/* ── Toggle 开关 ─────────────────────────────────────────── */
.toggle-switch {
  position: relative; display: inline-block;
  width: 40px; height: 22px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: var(--surface3);
  border-radius: 22px;
  transition: background 0.25s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px; height: 16px; border-radius: 50%;
  left: 3px; bottom: 3px;
  background: var(--text-muted);
  transition: transform 0.25s, background 0.25s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--primary); }
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(18px);
  background: white;
}

/* ── 表单组件 ────────────────────────────────────────────── */
.form-page {
  display: flex; justify-content: center;
  padding: 20px 0;
}

.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 540px;
  overflow: hidden;
}

/* ── 绑定方式 Tab ──────────────────────────────────────────── */
.bind-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  gap: 4px;
}
.bind-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  transition: color .2s, border-color .2s;
  white-space: nowrap;
}
.bind-tab:hover { color: var(--text); }
.bind-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── Cookie 导入提示框 ─────────────────────────────────────── */
.tip-box {
  background: rgba(99,102,241,.08);
  border: 1px solid rgba(99,102,241,.25);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
}
.tip-title { font-weight: 600; margin-bottom: 8px; color: var(--accent); }
.tip-steps { margin: 0; padding-left: 18px; color: var(--text-muted); line-height: 1.8; }
.tip-steps code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 12px;
  color: var(--text);
}
.tip-steps kbd {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 11px;
  color: var(--text);
}
.form-textarea {
  resize: vertical;
  min-height: 90px;
  font-size: 12px;
  font-family: monospace;
  line-height: 1.5;
}

.form-card-header {
  padding: 24px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: flex-start; gap: 16px;
  background: linear-gradient(135deg, rgba(99,102,241,0.08), rgba(139,92,246,0.06));
}

.form-card-header h2 { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.form-card-header p  { font-size: 13px; color: var(--text-muted); }

.form-icon {
  width: 48px; height: 48px; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}

.form-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}
.form-section:last-of-type { border-bottom: none; }

.form-section-title {
  font-size: 12px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.8px; color: var(--text-muted);
  margin-bottom: 16px;
}

.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

.form-label {
  display: block; margin-bottom: 6px;
  font-size: 13px; font-weight: 500; color: var(--text);
}

.form-input {
  width: 100%; padding: 10px 14px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 14px;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.form-input-sm { width: 120px; }

.form-hint { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; display: block; }

.input-wrap { position: relative; }
.input-eye {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 16px;
}

.form-actions {
  padding: 20px 24px;
  display: flex; justify-content: flex-end; gap: 10px;
  border-top: 1px solid var(--border);
}

.mt-3 { margin-top: 12px; }

/* ── Toggle 行表单 ───────────────────────────────────────── */
.toggle-list { display: flex; flex-direction: column; gap: 10px; }

.toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.toggle-row:last-child { border-bottom: none; }

.toggle-info { display: flex; align-items: center; gap: 10px; }
.toggle-emoji { font-size: 18px; }
.toggle-name { font-size: 14px; font-weight: 500; }
.toggle-desc { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

/* ── 分页 ────────────────────────────────────────────────── */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border);
}
.page-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: 13px; transition: all var(--transition);
}
.page-btn:hover { background: var(--surface3); color: var(--text); }
.page-info { font-size: 13px; color: var(--text-muted); }

/* ── 空状态 ─────────────────────────────────────────────── */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 20px; text-align: center; gap: 12px;
  color: var(--text-muted);
}
.empty-state-sm {
  text-align: center; padding: 20px; color: var(--text-faint);
  font-size: 13px;
}
.empty-page-state {
  display: flex; flex-direction: column; align-items: center;
  padding: 60px 20px; gap: 12px; text-align: center;
}
.empty-page-state h3 { font-size: 18px; font-weight: 600; }
.empty-page-state p  { color: var(--text-muted); font-size: 13.5px; }

/* ── 通知抽屉 ────────────────────────────────────────────── */
.notif-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none; opacity: 0;
  transition: opacity var(--transition);
}
.notif-overlay.show { display: block; opacity: 1; }

.notif-drawer {
  position: fixed; right: 0; top: 0; bottom: 0;
  width: 360px;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex; flex-direction: column;
  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.4);
}
.notif-drawer.open { transform: translateX(0); }

.notif-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.notif-drawer-header h3 { font-size: 15px; font-weight: 600; }

.notif-drawer-body {
  flex: 1; overflow-y: auto; padding: 8px 0;
}

.notif-drawer-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  display: flex; justify-content: space-between; gap: 8px;
}

.notif-btn { position: relative; }
.badge-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--danger);
}

/* ── 筛选栏 ─────────────────────────────────────────────── */
.filter-bar { display: flex; gap: 8px; }
.form-select-sm {
  padding: 5px 10px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  color: var(--text); font-size: 13px;
  outline: none; cursor: pointer;
}
.form-select-sm:focus { border-color: var(--primary); }

/* ── Section Header ──────────────────────────────────────── */
.section-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 20px;
}
.section-header h2 { font-size: 18px; font-weight: 700; }
.section-sub { font-size: 13px; color: var(--text-muted); margin-top: 3px; }

/* ── 通知完整列表 ────────────────────────────────────────── */
.notif-full-list { padding: 8px 0; }

.notif-full-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}
.notif-full-item:last-child { border-bottom: none; }
.notif-full-item:hover { background: var(--surface2); }

.notif-full-icon { font-size: 22px; margin-top: 2px; flex-shrink: 0; }
.notif-full-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.notif-full-content { font-size: 13px; color: var(--text-muted); white-space: pre-line; }
.notif-full-time { font-size: 11.5px; color: var(--text-faint); margin-top: 6px; }

/* ── 日志 ────────────────────────────────────────────────── */
.logs-wrap {
  padding: 8px 0;
  font-family: 'Courier New', monospace;
  font-size: 12.5px;
}

.log-line {
  display: flex; align-items: baseline; gap: 10px;
  padding: 5px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}
.log-line:hover { background: var(--surface2); }

.log-time { color: var(--text-faint); flex-shrink: 0; font-size: 11.5px; }

.log-level-badge {
  padding: 0px 5px; border-radius: 3px;
  font-size: 10px; font-weight: 700; flex-shrink: 0;
}
.log-info    .log-level-badge { background: rgba(59,130,246,0.2); color: #93c5fd; }
.log-success .log-level-badge { background: rgba(16,185,129,0.2); color: #6ee7b7; }
.log-warning .log-level-badge { background: rgba(245,158,11,0.2); color: #fcd34d; }
.log-error   .log-level-badge { background: rgba(239,68,68,0.2);  color: #fca5a5; }

.log-msg { color: var(--text); flex: 1; }

/* ── 认证页面 ─────────────────────────────────────────────── */
.auth-body {
  background: var(--bg);
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
}

.auth-container {
  display: flex;
  width: 100%; max-width: 900px; min-height: 560px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
}

.auth-panel {
  flex: 1;
  background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  padding: 40px;
  display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.auth-panel::before {
  content: '';
  position: absolute; top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle at 40% 40%, rgba(255,255,255,0.12) 0%, transparent 60%);
}

.auth-panel-content {
  position: relative; z-index: 1; text-align: center;
}

.auth-lottie { width: 100px; height: 100px; margin: 0 auto 20px; }

.auth-panel-title {
  font-size: 28px; font-weight: 800; color: white; margin-bottom: 8px;
}
.auth-panel-sub {
  font-size: 14px; color: rgba(255,255,255,0.8); line-height: 1.7; margin-bottom: 28px;
}

.auth-features { display: flex; flex-direction: column; gap: 10px; }
.auth-feat {
  background: rgba(255,255,255,0.12);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 13.5px; color: white;
  display: flex; align-items: center; gap: 8px;
  backdrop-filter: blur(8px);
}
.auth-feat span { font-size: 16px; }

.auth-form-wrap {
  width: 380px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  padding: 40px;
}

.auth-card { width: 100%; }

.auth-title {
  font-size: 22px; font-weight: 700; margin-bottom: 6px;
}
.auth-subtitle { font-size: 13.5px; color: var(--text-muted); margin-bottom: 24px; }

.auth-form { display: flex; flex-direction: column; gap: 14px; }

.form-row {
  display: flex; align-items: center; justify-content: space-between;
}
.check-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
}

.auth-switch {
  text-align: center; margin-top: 16px;
  font-size: 13px; color: var(--text-muted);
}

/* ── Loading ────────────────────────────────────────────── */
.loading-dots { display: flex; justify-content: center; gap: 6px; padding: 24px; }
.loading-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary); opacity: 0.4;
  animation: loadPulse 1.2s ease-in-out infinite;
}
.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes loadPulse { 0%,80%,100% { opacity:0.2; transform:scale(0.8); } 40% { opacity:1; transform:scale(1); } }

.btn-spinner {
  width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── 侧边栏遮罩（移动端点击关闭） ───────────────────────── */
.sidebar-mask {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity var(--transition);
}
@media (max-width: 768px) {
  .sidebar-mask { display: block; pointer-events: none; }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
}

/* ── 响应式 ─────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .dash-grid { grid-template-columns: 1fr; }
  .auth-panel { display: none; }
  .auth-container { max-width: 400px; }
  .auth-form-wrap { width: 100%; padding: 30px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .page-content { padding: 16px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}






