/* ============================================================
   PRISM Component Library
   Built on tokens.css — every class references semantic tokens.
   Aesthetic: "Cyberpunk Lightbox"
   — Near-black canvas, indigo accent, white CTA
   — Glassmorphism on chrome, solid surfaces on data
   — Single-color radial glows, hairline borders, subtle shadows
   — Inter (UI, ss03) + Geist Mono (code/metrics)
   — Cinematic motion with staggered reveals
   ============================================================ */

/* ═══════════════ Reset & Base ═══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh-normal);
  background: var(--bg-canvas);
  color: var(--text-primary);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: var(--tracking-normal);
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01", "ss03";
}

/* —— Ambient background: indigo radial glow + grid mesh —— */
body::before {
  content: "";
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 1200px 700px at 15% -10%, var(--glow-indigo), transparent 55%),
    radial-gradient(ellipse 900px 500px at 90% 110%, var(--glow-indigo-soft), transparent 55%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: "";
  position: fixed; inset: 0;
  background-image:
    linear-gradient(var(--white-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--white-3) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, black 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.hidden { display: none !important; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select, button { font-family: inherit; font-size: inherit; }
a { color: var(--accent); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--accent-hover); }

code {
  background: var(--bg-surface-2);
  padding: 2px 6px;
  border-radius: var(--r-xs);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  color: var(--indigo-700);
  border: 1px solid var(--border-subtle);
}

::selection { background: var(--accent-solid); color: #fff; }

/* ═══════════════ Scrollbar ═══════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--white-10);
  border-radius: var(--r-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background: var(--white-20); background-clip: padding-box; }

/* ═══════════════ SVG Icons ═══════════════ */
.ic {
  width: 18px; height: 18px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ic-sm { width: 15px; height: 15px; stroke-width: 1.5; }
.ic-lg { width: 22px; height: 22px; stroke-width: 1.5; }
.ic-xs { width: 12px; height: 12px; stroke-width: 1.5; }
.ic-spin { animation: spin 1s linear infinite; }

/* ═══════════════ Login Screen ═══════════════ */
.login-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-canvas);
  z-index: var(--z-modal);
}
.login-screen::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 900px 600px at 30% 25%, var(--glow-indigo), transparent 50%),
    radial-gradient(ellipse 700px 400px at 75% 75%, var(--glow-indigo-soft), transparent 50%);
  pointer-events: none;
}
.login-screen::after {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(var(--white-3) 1px, transparent 1px),
    linear-gradient(90deg, var(--white-3) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse at center, black 15%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at center, black 15%, transparent 70%);
  pointer-events: none;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 420px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  padding: 44px 38px 34px;
  text-align: center;
  box-shadow: var(--shadow-lg), var(--shadow-inset);
  animation: loginRise var(--t-cinema) var(--ease-expo);
}

.login-logo {
  display: inline-flex;
  align-items: center; justify-content: center;
  width: 56px; height: 56px;
  border-radius: var(--r-xl);
  background: var(--accent);
  box-shadow: 0 0 32px var(--accent-glow), var(--shadow-sm);
  margin-bottom: 8px;
}
.login-logo svg { width: 28px; height: 28px; stroke: #fff; stroke-width: 1.5; }

.login-card h1 {
  margin: 16px 0 4px;
  font-size: var(--fs-2xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
}
.login-sub {
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  margin-bottom: 32px;
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}
.login-card label {
  display: block; text-align: left;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin: 16px 0 6px;
  letter-spacing: var(--tracking-wide);
  font-weight: 500;
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-default);
  background: var(--bg-deep);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
  font-size: var(--fs-md);
}
.login-card input:hover { border-color: var(--border-strong); }
.login-card input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-faint), 0 0 16px var(--accent-glow);
  background: var(--gray-20);
}
.login-card input::placeholder { color: var(--text-disabled); }
.login-card .btn-primary {
  width: 100%;
  margin-top: 26px;
  padding: 13px;
  font-size: var(--fs-md);
}
.login-hint {
  margin-top: 20px;
  font-size: var(--fs-sm);
  color: var(--text-disabled);
  line-height: var(--lh-relaxed);
}
.login-hint b { color: var(--text-secondary); font-weight: 500; }
.error-text {
  color: var(--danger-text);
  font-size: var(--fs-sm);
  min-height: 18px;
  margin-top: 12px;
  font-family: var(--font-mono);
}

/* ═══════════════ App Layout ═══════════════ */
.app {
  display: flex;
  height: 100vh;
  overflow: hidden;
  position: relative;
  z-index: var(--z-base);
}

/* —— Sidebar (glassmorphism, collapsible) —— */
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  backdrop-filter: blur(var(--sidebar-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--sidebar-blur)) saturate(var(--glass-saturate));
  border-right: 1px solid var(--sidebar-border);
  display: flex; flex-direction: column;
  padding: 16px 10px 12px;
  position: relative;
  flex-shrink: 0;
  transition: width var(--t-base);
}

/* —— Collapsed sidebar (icon-only rail) —— */
.sidebar.collapsed {
  width: var(--sidebar-collapsed);
  padding: 16px 6px 12px;
}
.sidebar.collapsed .brand-text,
.sidebar.collapsed .side-section-title,
.sidebar.collapsed .whoami { display: none; }
.sidebar.collapsed .brand { justify-content: center; padding: 4px 0 14px; }
.sidebar.collapsed #nav a {
  padding: 10px;
  justify-content: center;
  font-size: 0;
  gap: 0;
}
.sidebar.collapsed #nav a .ic { width: 20px; height: 20px; }
.sidebar.collapsed #nav a.active::before { left: -6px; }
.sidebar.collapsed .sidebar-foot #logoutBtn .lbl { display: none; }
.sidebar.collapsed .sidebar-foot #logoutBtn {
  justify-content: center;
  padding: 10px;
}

.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 4px 8px 18px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 6px;
}
.brand-icon {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  border-radius: var(--r-lg);
  background: var(--accent);
  box-shadow: 0 0 16px var(--accent-glow);
  flex-shrink: 0;
}
.brand-icon svg { width: 18px; height: 18px; stroke: #fff; stroke-width: 1.5; fill: none; }
.brand-text {
  font-weight: 600;
  font-size: var(--fs-lg);
  line-height: 1.15;
  letter-spacing: var(--tracking-tight);
  display: flex; flex-direction: column;
}
.brand-text small {
  font-size: var(--fs-2xs);
  color: var(--text-tertiary);
  font-weight: 400;
  letter-spacing: var(--tracking-wide);
  font-family: var(--font-mono);
  margin-top: 1px;
}

.side-section-title {
  font-size: var(--fs-2xs);
  color: var(--text-faint);
  letter-spacing: var(--tracking-wider);
  margin: 18px 8px 6px;
  font-family: var(--font-mono);
  font-weight: 500;
  text-transform: uppercase;
}

#nav {
  display: flex; flex-direction: column;
  gap: 1px;
  flex: 1; overflow-y: auto;
  padding-right: 2px;
}
#nav a {
  padding: var(--nav-padding);
  border-radius: var(--nav-radius);
  color: var(--text-tertiary);
  font-size: var(--fs-base);
  text-decoration: none;
  transition: all var(--t-fast);
  cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  position: relative;
  letter-spacing: var(--tracking-normal);
}
#nav a:hover {
  background: var(--white-4);
  color: var(--text-secondary);
}
#nav a.active {
  background: var(--accent-subtle);
  color: var(--text-primary);
}
#nav a.active::before {
  content: "";
  position: absolute; left: -10px; top: 25%; bottom: 25%;
  width: 2px;
  background: var(--accent);
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px var(--accent-glow);
}
#nav a .ic { color: var(--text-faint); transition: color var(--t-fast); }
#nav a:hover .ic { color: var(--text-tertiary); }
#nav a.active .ic { color: var(--accent-hover); }

.sidebar-foot {
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}
.whoami {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-bottom: 10px;
  font-family: var(--font-mono);
  padding: 0 8px;
  display: flex; align-items: center; gap: 6px;
}
.whoami::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 6px var(--success);
}

/* —— Main area —— */
.main {
  flex: 1;
  display: flex; flex-direction: column;
  overflow: hidden;
  min-width: 0;
}
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 var(--content-pad);
  border-bottom: 1px solid var(--topbar-border);
  background: var(--topbar-bg);
  backdrop-filter: blur(var(--topbar-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--topbar-blur)) saturate(var(--glass-saturate));
  flex-shrink: 0;
}
.topbar-left {
  display: flex; align-items: center; gap: 12px;
  min-width: 0;
}
.btn-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  color: var(--text-tertiary);
  transition: all var(--t-fast);
  flex-shrink: 0;
}
.btn-icon:hover {
  background: var(--white-6);
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.btn-icon:active { transform: scale(0.95); }
.btn-icon .ic-sm { transition: transform var(--t-base); }
.sidebar.collapsed ~ .main .btn-icon .ic-sm { transform: rotate(180deg); }
.topbar-title {
  font-size: var(--fs-lg);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}
.save-state {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

/* 本地工作者状态徽章 */
.lw-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: var(--fs-xs);
  font-weight: 500;
  cursor: default;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.lw-badge.lw-on {
  background: rgba(52, 211, 153, 0.12);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.3);
}
.lw-badge.lw-on svg { color: #34d399; }
.lw-badge.lw-off {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.lw-badge.lw-off svg { color: #f59e0b; }

/* ==================== 本地工作者面板 ==================== */

/* 状态卡片 */
.lw-panel-status {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  border-radius: 16px;
  margin-bottom: 20px;
  border: 1px solid;
}
.lw-panel-status.lw-ok {
  background: rgba(52, 211, 153, 0.08);
  border-color: rgba(52, 211, 153, 0.25);
}
.lw-panel-status.lw-warn {
  background: rgba(245, 158, 11, 0.08);
  border-color: rgba(245, 158, 11, 0.25);
}
.lw-status-icon {
  flex-shrink: 0;
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.lw-ok .lw-status-icon { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.lw-warn .lw-status-icon { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.lw-status-body h3 { font-size: 16px; margin-bottom: 6px; }
.lw-ok .lw-status-body h3 { color: #34d399; }
.lw-warn .lw-status-body h3 { color: #f59e0b; }
.lw-status-body p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

/* 架构图 */
.lw-arch-diagram {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 24px 16px;
  flex-wrap: wrap;
}
.lw-arch-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 28px;
  border-radius: 16px;
  border: 1px solid var(--border-subtle);
  min-width: 180px;
  text-align: center;
}
.lw-arch-local {
  background: rgba(94, 106, 210, 0.08);
  border-color: rgba(94, 106, 210, 0.25);
}
.lw-arch-server {
  background: rgba(20, 184, 166, 0.08);
  border-color: rgba(20, 184, 166, 0.25);
}
.lw-arch-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
}
.lw-arch-local .lw-arch-icon { background: rgba(94, 106, 210, 0.15); color: #5e6ad2; }
.lw-arch-server .lw-arch-icon { background: rgba(20, 184, 166, 0.15); color: #14b8a6; }
.lw-arch-title { font-weight: 600; font-size: 14px; }
.lw-arch-desc { font-size: 12px; color: var(--text-tertiary); line-height: 1.6; }
.lw-arch-arrow {
  font-size: 12px;
  color: var(--text-tertiary);
  letter-spacing: 1px;
  font-weight: 500;
}

/* 步骤卡片 */
.lw-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.lw-step {
  display: flex;
  gap: 16px;
  padding: 16px 20px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}
.lw-step-num {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px;
}
.lw-step-body { flex: 1; }
.lw-step-title { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.lw-step-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
.lw-cmd-box {
  margin-top: 8px;
  padding: 10px 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
}
.lw-cmd-box code { color: #5e6ad2; }

/* 快速测试区域 */
.lw-quick-test {
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
}

/* 一键启动区域 */
.lw-oneclick-zone {
  padding: 24px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(94, 106, 210, 0.08), rgba(20, 184, 166, 0.06));
  border: 1px solid rgba(94, 106, 210, 0.2);
  text-align: center;
  margin-bottom: 20px;
}
.lw-oneclick-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.lw-oneclick-title svg { color: var(--accent); }
.lw-oneclick-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 20px;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}
.lw-btn-big {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 12px;
  text-decoration: none;
  min-height: 52px;
}
.lw-oneclick-hint {
  margin-top: 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  line-height: 1.6;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
}

/* 分割线 */
.lw-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20px 0;
}
.lw-divider::before,
.lw-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border-subtle);
}
.lw-divider span {
  padding: 0 16px;
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
}

/* ═══════════════ 本地工作者紧凑条（嵌入代理池页面） ═══════════════ */

.lw-compact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-radius: 12px;
  margin-bottom: 20px;
  gap: 16px;
}
.lw-compact-off {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.lw-compact-on {
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.2);
}
.lw-compact-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.lw-compact-icon { color: #f59e0b; flex-shrink: 0; }
.lw-compact-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #34d399;
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.6);
  animation: lwDotPulse 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes lwDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
.lw-compact-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.lw-compact-sub {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 2px;
}
.lw-compact-right {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

/* —— 下载启动器按钮（未连接时醒目显示） —— */
.lw-download-btn {
  padding: 10px 22px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(94, 106, 210, 0.35);
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.lw-download-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(94, 106, 210, 0.45);
  color: #fff;
}
.lw-download-btn:active {
  transform: translateY(0);
}

/* —— 帮助提示行 —— */
.lw-help-row {
  margin: -12px 0 20px 0;
  padding: 10px 20px;
  background: rgba(245, 158, 11, 0.04);
  border-radius: 0 0 12px 12px;
  font-size: 13px;
  color: var(--text-tertiary);
  line-height: 1.6;
}
.lw-help-row code {
  background: rgba(0,0,0,0.08);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12px;
}
.lw-help-row a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* —— 发送进度区（嵌入代理池页面） —— */
.lw-send-box {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.lw-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
}
.lw-progress-top span:last-child {
  font-family: var(--font-mono);
  font-size: 18px;
  color: var(--accent);
}
.lw-progress-stats {
  display: flex;
  gap: 24px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-secondary);
}
.lw-progress-stats b {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
}
.lw-progress-stats b.success { color: #34d399; }
.lw-progress-stats b.danger { color: #f87171; }
.lw-stop-btn {
  margin-top: 12px;
  padding: 8px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 13px;
}

/* —— 运行日志 —— */
.lw-log-box { margin-bottom: 20px; }
.lw-log-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.lw-log-box .console {
  max-height: 180px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.6;
}

/* ═══════════════ 代理卡片网格 ═══════════════ */
.px-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 900px) {
  .px-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .px-grid { grid-template-columns: 1fr; }
}
.px-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: 14px;
  padding: 16px;
  transition: all 0.2s var(--ease-out);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.px-card:hover {
  border-color: var(--border-focus);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}
.px-card-off {
  opacity: 0.6;
}
.px-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.px-card-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.px-card-host {
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.px-card-test {
  min-height: 24px;
  display: flex;
  align-items: center;
}
.px-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.content {
  flex: 1; overflow: auto;
  padding: var(--sp-7) var(--content-pad);
  background: var(--bg-canvas);
  width: 100%;
}
/* Staggered content reveal — cinematic */
.content > * {
  animation: rise var(--t-page) var(--ease-out) backwards;
}
.content > *:nth-child(1) { animation-delay: 0.02s; }
.content > *:nth-child(2) { animation-delay: 0.06s; }
.content > *:nth-child(3) { animation-delay: 0.10s; }
.content > *:nth-child(4) { animation-delay: 0.14s; }
.content > *:nth-child(5) { animation-delay: 0.18s; }
.content > *:nth-child(6) { animation-delay: 0.22s; }
.content > *:nth-child(7) { animation-delay: 0.26s; }
.content > *:nth-child(8) { animation-delay: 0.30s; }

/* ═══════════════ Cards ═══════════════ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--card-radius);
  padding: var(--card-padding);
  margin-bottom: var(--sp-5);
  position: relative;
  transition: border-color var(--t-base), box-shadow var(--t-base);
}
.card:hover {
  border-color: var(--border-default);
  box-shadow: var(--card-shadow-hover);
}

/* Glass card variant (hero, featured) */
.card.glass {
  background: var(--glass-card-bg);
  backdrop-filter: blur(var(--glass-card-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-card-blur)) saturate(var(--glass-saturate));
  border-color: var(--glass-card-border);
  box-shadow: var(--shadow-md), var(--shadow-inset);
}

.card h2 {
  font-size: var(--fs-lg);
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: var(--tracking-tight);
  display: flex; align-items: center; gap: 8px;
}
.card .desc {
  color: var(--text-tertiary);
  font-size: var(--fs-base);
  margin-bottom: var(--sp-5);
  line-height: var(--lh-relaxed);
}
.card .desc code { margin: 0 2px; }

/* ═══════════════ Grid ═══════════════ */
.grid { display: grid; gap: var(--sp-3); }
.cols-2 { grid-template-columns: 1fr 1fr; }
.cols-3 { grid-template-columns: repeat(3, 1fr); }
.cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 960px) { .cols-2, .cols-3, .cols-4 { grid-template-columns: 1fr; } }

/* ═══════════════ Forms ═══════════════ */
label.fld {
  display: block;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  margin: var(--sp-4) 0 var(--sp-2);
  letter-spacing: var(--tracking-wide);
  font-weight: 500;
}
input.in, textarea.in, select.in {
  width: 100%;
  padding: var(--input-padding);
  border-radius: var(--input-radius);
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--t-base), box-shadow var(--t-base), background var(--t-base);
  font-size: var(--fs-base);
}
input.in:hover, textarea.in:hover, select.in:hover {
  border-color: var(--border-strong);
}
input.in:focus, textarea.in:focus, select.in:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-faint), 0 0 12px var(--accent-glow);
  background: var(--gray-20);
}
input.in::placeholder, textarea.in::placeholder { color: var(--text-disabled); }
textarea.in {
  min-height: 130px; resize: vertical;
  line-height: var(--lh-relaxed);
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}
select.in {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23626276' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 34px;
  cursor: pointer;
}

.hint {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-top: var(--sp-2);
  line-height: var(--lh-relaxed);
}
.hint code { margin: 0 2px; }
.hint b { color: var(--text-secondary); font-weight: 500; }

/* ═══════════════ Buttons ═══════════════ */
/* Primary: White bg + black text (Raycast signature CTA) */
.btn-primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  border: 1px solid var(--cta-bg);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: var(--tracking-normal);
  transition: background var(--t-fast), transform var(--t-instant), box-shadow var(--t-base);
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--btn-height);
}
.btn-primary:hover {
  background: var(--cta-bg-hover);
  box-shadow: var(--shadow-sm), var(--shadow-inset);
}
.btn-primary:active {
  background: var(--cta-bg-active);
  transform: scale(0.98);
}
.btn-primary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Ghost: transparent with hairline border */
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-default);
  color: var(--text-tertiary);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  font-size: var(--fs-sm);
  transition: all var(--t-fast);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--btn-height);
}
.btn-ghost:hover {
  border-color: var(--border-strong);
  color: var(--text-secondary);
  background: var(--white-4);
}

/* Accent button (indigo) */
.btn-accent {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  font-size: var(--fs-md);
  font-weight: 500;
  transition: all var(--t-fast);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--btn-height);
}
.btn-accent:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: 0 0 20px var(--accent-glow);
}

/* Small button */
.btn-sm {
  padding: 7px 12px;
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
  border: 1px solid var(--border-default);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  transition: all var(--t-fast);
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-sm:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
  background: var(--white-6);
}

/* Danger button */
.btn-danger {
  background: var(--danger-bg);
  border: 1px solid var(--danger-border);
  color: var(--danger-text);
  padding: var(--btn-padding);
  border-radius: var(--btn-radius);
  font-size: var(--fs-md);
  font-weight: 500;
  letter-spacing: var(--tracking-normal);
  transition: all var(--t-fast);
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--btn-height);
}
.btn-danger:hover {
  background: rgba(244,63,94,0.12);
  border-color: var(--danger);
  color: var(--rose-400);
  box-shadow: 0 0 12px rgba(244,63,94,0.15);
}
.btn-danger:active {
  transform: scale(0.98);
  background: rgba(244,63,94,0.18);
}
.btn-danger:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-row {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: var(--sp-5);
}

/* ═══════════════ Toggle Switch ═══════════════ */
.switch {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  font-size: var(--fs-base);
  color: var(--text-secondary);
  user-select: none;
}
.switch input { display: none; }
.switch .track {
  width: 36px; height: 20px;
  border-radius: var(--r-pill);
  background: var(--bg-surface-3);
  border: 1px solid var(--border-default);
  position: relative;
  transition: all var(--t-base);
  flex-shrink: 0;
}
.switch .track::after {
  content: "";
  position: absolute;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text-tertiary);
  top: 2px; left: 2px;
  transition: all var(--t-base);
}
.switch input:checked + .track {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 12px var(--accent-glow);
}
.switch input:checked + .track::after {
  left: 19px;
  background: #fff;
}
.switch:hover .track { border-color: var(--border-strong); }

/* ═══════════════ Badges ═══════════════ */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  font-family: var(--font-mono);
}
.badge.ok   { background: var(--success-bg); color: var(--success-text); border: 1px solid var(--success-border); }
.badge.warn { background: var(--warning-bg); color: var(--warning-text); border: 1px solid var(--warning-border); }
.badge.err  { background: var(--danger-bg);  color: var(--danger-text);  border: 1px solid var(--danger-border); }
.badge.mut  { background: var(--white-6); color: var(--text-tertiary); border: 1px solid var(--border-subtle); }

/* ═══════════════ Stat Cards ═══════════════ */
.stat {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  position: relative;
  transition: border-color var(--t-base), box-shadow var(--t-base), transform var(--t-base);
  overflow: hidden;
}
.stat::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-glow), transparent);
  opacity: 0;
  transition: opacity var(--t-base);
}
.stat:hover {
  border-color: var(--border-default);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.stat:hover::before { opacity: 1; }
.stat .num {
  font-size: 28px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: var(--tracking-tight);
  font-variant-numeric: tabular-nums;
}
.stat .lbl {
  color: var(--text-tertiary);
  font-size: var(--fs-xs);
  margin-top: 6px;
  letter-spacing: var(--tracking-wide);
  font-family: var(--font-mono);
}

/* ═══════════════ Tables ═══════════════ */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
th, td {
  text-align: left;
  padding: 11px 13px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
}
th {
  color: var(--text-tertiary);
  font-weight: 500;
  font-size: var(--fs-xs);
  letter-spacing: var(--tracking-wider);
  background: var(--bg-elevated);
  font-family: var(--font-mono);
  position: sticky; top: 0;
  z-index: var(--z-base);
  text-transform: uppercase;
}
tbody tr {
  transition: background var(--t-fast);
}
tbody tr:hover {
  background: var(--white-3);
}
.tbl-wrap {
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  max-height: 480px;
}

/* ═══════════════ Progress Bar ═══════════════ */
.progress {
  height: 8px;
  background: var(--bg-surface-2);
  border-radius: var(--r-pill);
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  position: relative;
}
.progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--indigo-700));
  transition: width 0.5s var(--ease-out);
  position: relative;
  border-radius: var(--r-pill);
}
.progress > i::after {
  content: "";
  position: absolute; right: 0; top: 0; bottom: 0;
  width: 24px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3));
  border-radius: var(--r-pill);
}
.pr-num {
  font-size: var(--fs-base);
  color: var(--text-secondary);
  margin-top: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.pr-who {
  font-size: var(--fs-sm);
  color: var(--text-disabled);
  margin-top: 4px;
  font-family: var(--font-mono);
}

/* ═══════════════ Console / Log ═══════════════ */
.console {
  background: var(--bg-deep);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px;
  height: 320px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.7;
  position: relative;
}
.console::before {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent 0px,
    transparent 2px,
    var(--white-3) 2px,
    var(--white-3) 4px
  );
  pointer-events: none;
  border-radius: var(--r-md);
}
.console .l-info  { color: var(--indigo-700); }
.console .l-warn  { color: var(--warning-text); }
.console .l-error { color: var(--danger-text); }
.console .l-t     { color: var(--text-faint); }

/* ═══════════════ Send Task Module ═══════════════ */
/* —— Status indicator —— */
.send-status {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  font-weight: 500;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
}
.send-status.idle {
  background: var(--white-6);
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
}
.send-status.running {
  background: rgba(16,185,129,0.10);
  color: var(--success);
  border: 1px solid rgba(16,185,129,0.25);
}
.send-status.running::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--success);
  animation: pulse 1.5s var(--ease-in-out) infinite;
}
.send-status.stopped {
  background: var(--danger-bg);
  color: var(--danger-text);
  border: 1px solid var(--danger-border);
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px var(--success); }
  50% { opacity: 0.5; box-shadow: 0 0 2px var(--success); }
}

/* —— Send stats grid —— */
.send-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  overflow: hidden;
  margin: 16px 0;
}
.send-stat {
  background: var(--bg-surface);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.send-stat-label {
  font-size: var(--fs-2xs);
  color: var(--text-faint);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}
.send-stat-value {
  font-size: var(--fs-xl);
  font-weight: 600;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  letter-spacing: var(--tracking-tight);
}
.send-stat-value.success { color: var(--success); }
.send-stat-value.danger  { color: var(--danger-text); }

/* —— Progress section —— */
.send-progress {
  margin: 16px 0;
}
.send-progress-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
}
.send-progress-label {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.send-progress-pct {
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* —— Button group —— */
.send-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border-subtle);
}
.send-actions .btn-primary,
.send-actions .btn-danger {
  flex: 1;
  min-width: 140px;
}
.send-actions .btn-danger svg {
  width: 16px; height: 16px;
}

/* —— 发送模式选择卡片 —— */
.send-mode-grid {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.send-mode-card {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 18px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
}
.send-mode-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.send-mode-card:hover {
  border-color: var(--border-default);
  transform: translateY(-1px);
}
.send-mode-card.selected {
  border-color: var(--accent);
  background: rgba(94,106,210,0.08);
  box-shadow: 0 0 16px rgba(94,106,210,0.12);
}
.send-mode-card.selected .send-mode-icon {
  color: var(--accent);
}
.send-mode-card.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.send-mode-card.disabled:hover {
  transform: none;
  border-color: var(--border-subtle);
}
.send-mode-icon {
  color: var(--text-tertiary);
  margin-bottom: 8px;
  transition: color var(--t-base);
}
.send-mode-title {
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.send-mode-desc {
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  line-height: 1.5;
}

/* —— Send meta info —— */
.send-meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  margin-top: 10px;
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}
.send-meta-item {
  display: flex; align-items: center; gap: 6px;
}
.send-meta-item svg {
  width: 14px; height: 14px;
  color: var(--text-faint);
}

/* ═══════════════ Toast ═══════════════ */
.toast {
  position: fixed;
  bottom: 32px; left: 50%;
  transform: translateX(-50%);
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-strong);
  padding: 13px 22px;
  border-radius: var(--r-lg);
  font-size: var(--fs-md);
  z-index: var(--z-toast);
  box-shadow: var(--shadow-lg), var(--shadow-inset);
  animation: toastIn 0.3s var(--ease-out);
}

/* ═══════════════ Chips ═══════════════ */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  font-size: var(--fs-sm);
  cursor: pointer;
  color: var(--accent-hover);
  font-family: var(--font-mono);
  transition: all var(--t-fast);
}
.chip:hover {
  border-color: var(--accent-muted);
  background: var(--accent-faint);
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ═══════════════ Attachments ═══════════════ */
.attach {
  display: flex; align-items: center; gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 9px 12px;
  font-size: var(--fs-base);
  margin-top: 6px;
  transition: border-color var(--t-fast);
}
.attach:hover { border-color: var(--border-default); }
.attach .x {
  margin-left: auto;
  color: var(--danger);
  cursor: pointer;
  font-size: var(--fs-md);
  transition: opacity var(--t-fast);
  opacity: 0.7;
}
.attach .x:hover { opacity: 1; }

/* ═══════════════ Security Results ═══════════════ */
.sec-result { display: flex; flex-direction: column; gap: 8px; }
.sec-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 13px 15px;
  transition: border-color var(--t-fast), background var(--t-fast);
}
.sec-item:hover { border-color: var(--border-default); background: var(--bg-surface-2); }
.sec-item .ic { font-size: 18px; flex-shrink: 0; width: 20px; height: 20px; display: inline-flex; align-items: center; justify-content: center; }
.sec-item .body { flex: 1; min-width: 0; }
.sec-item .body .t { font-size: var(--fs-base); }
.sec-item .body .m { font-size: var(--fs-sm); color: var(--text-tertiary); margin-top: 2px; word-break: break-all; }

.title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}

/* ═══════════════ Modal ═══════════════ */
.modal {
  position: fixed; inset: 0;
  z-index: var(--z-modal);
  display: flex; align-items: center; justify-content: center;
}
.modal-mask {
  position: absolute; inset: 0;
  background: rgba(8,8,12,0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-box {
  position: relative;
  width: min(760px, 92vw);
  max-height: 88vh;
  overflow: auto;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-xl);
  padding: 26px 28px;
  box-shadow: var(--shadow-xl), var(--shadow-inset);
  animation: modalIn 0.3s var(--ease-out);
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.modal-head h3 {
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: var(--tracking-tight);
}
.modal-body .desc {
  color: var(--text-tertiary);
  font-size: var(--fs-base);
  margin-bottom: 16px;
}
.modal-body h4 {
  font-size: var(--fs-md);
  margin: 0;
}
.ev-name { font-size: var(--fs-base); font-weight: 600; }
.ev-id {
  font-size: var(--fs-xs);
  color: var(--text-disabled);
  margin-top: 2px;
  word-break: break-all;
  font-family: var(--font-mono);
}

/* ═══════════════ Page Banner ═══════════════ */
.page-banner {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
  padding: 14px 16px;
  margin-bottom: var(--sp-5);
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.page-banner .b-ic {
  width: 20px; height: 20px;
  flex-shrink: 0;
  color: var(--accent-hover);
  display: flex; align-items: center; justify-content: center;
}
.page-banner .b-t {
  font-size: var(--fs-md);
  font-weight: 600;
  margin-bottom: 3px;
  letter-spacing: var(--tracking-tight);
}
.page-banner .b-d {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  line-height: var(--lh-relaxed);
}

/* ═══════════════ Empty State ═══════════════ */
.empty {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-tertiary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-md);
}
.empty .e-ic {
  margin-bottom: 10px;
  color: var(--text-faint);
  opacity: 0.6;
}
.empty .e-ic svg { width: 32px; height: 32px; stroke-width: 1.2; }
.empty .e-t {
  font-size: var(--fs-md);
  margin-bottom: 4px;
  color: var(--text-primary);
}
.empty .e-d { font-size: var(--fs-sm); }

/* ═══════════════ Wizard Steps ═══════════════ */
.wizard {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-saturate));
  border: 1px solid var(--border-glass);
  border-radius: var(--r-2xl);
  padding: var(--sp-6);
  margin-bottom: var(--sp-5);
  position: relative;
  box-shadow: var(--shadow-md), var(--shadow-inset);
}
.wizard h2 { margin: 0 0 16px; }

.steps { display: flex; gap: 8px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 150px;
  display: flex; gap: 12px; align-items: center;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--t-base);
  position: relative;
}
.step:hover {
  transform: translateY(-1px);
}
/* 已完成 — 淡绿色卡片 */
.step.done {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.25);
}
.step.done:hover {
  background: rgba(16,185,129,0.12);
  border-color: rgba(16,185,129,0.35);
}
/* 未完成 — 淡红色卡片 */
.step.todo {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
}
.step.todo:hover {
  background: rgba(239,68,68,0.1);
  border-color: rgba(239,68,68,0.3);
}
/* 进行中 — 蓝色卡片 */
.step.active {
  background: rgba(94,106,210,0.1);
  border-color: rgba(94,106,210,0.3);
  box-shadow: 0 0 16px rgba(94,106,210,0.15);
}
.step.active:hover {
  background: rgba(94,106,210,0.14);
  border-color: rgba(94,106,210,0.4);
}
.step .s-t { font-size: var(--fs-base); font-weight: 600; }
.step .s-d { font-size: var(--fs-xs); color: var(--text-tertiary); margin-top: 2px; }
.step .s-state {
  margin-left: auto;
  font-size: var(--fs-xs);
  font-family: var(--font-mono);
  letter-spacing: var(--tracking-wide);
}
.step.done .s-state { color: #34d399; }
.step.todo .s-state { color: #f87171; }
.step.active .s-state { color: var(--accent-hover); }

/* ═══════════════ Callout ═══════════════ */
.callout {
  border-radius: var(--r-md);
  padding: 13px 15px;
  font-size: var(--fs-sm);
  line-height: var(--lh-relaxed);
  margin-top: var(--sp-4);
  border: 1px solid;
  display: flex; gap: 10px; align-items: flex-start;
}
.callout.info {
  background: var(--accent-faint);
  border-color: var(--accent-muted);
  color: var(--indigo-800);
}
.callout.warn {
  background: var(--warning-bg);
  border-color: var(--warning-border);
  color: var(--warning-text);
}
.callout.ok {
  background: var(--success-bg);
  border-color: var(--success-border);
  color: var(--success-text);
}

/* ═══════════════ Tip ═══════════════ */
.tip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-xs);
  color: var(--text-tertiary);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xs);
  padding: 2px 8px;
  margin-left: 6px;
}
.tip b { color: var(--accent-hover); }

/* ═══════════════ Keyframes ═══════════════ */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes loginRise {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ═══════════════ Responsive ═══════════════ */
@media (max-width: 768px) {
  :root { --sidebar-w: 52px; --content-pad: 16px; }
  .sidebar { padding: 14px 4px 10px; }
  .brand-text, .side-section-title, .whoami { display: none; }
  .brand { justify-content: center; padding: 4px 0 14px; }
  #nav a { padding: 10px; justify-content: center; font-size: 0; }
  #nav a .ic { width: 20px; height: 20px; }
  .sidebar-foot { display: none; }
  .topbar { padding: 0 16px; }
  .topbar-title { font-size: var(--fs-md); }
}

/* ═══════════════ Focus visible (a11y) ═══════════════ */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
}

/* ═══════════════ Account Selection Cards (发信邮箱选择) ═══════════════ */
.acc-sel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.acc-sel-card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all var(--t-fast);
  position: relative;
}
.acc-sel-card:hover {
  border-color: var(--border-default);
  background: var(--bg-surface-2);
}
.acc-sel-card.selected {
  border-color: var(--accent);
  background: rgba(94,106,210,0.06);
  box-shadow: 0 0 12px rgba(94,106,210,0.08);
}
.acc-sel-card.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.acc-sel-card input[type="checkbox"] {
  margin-top: 3px;
  width: 18px; height: 18px;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}
.acc-sel-info { flex: 1; min-width: 0; }
.acc-sel-name {
  font-size: var(--fs-base);
  font-weight: 600;
  margin-bottom: 2px;
}
.acc-sel-email {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  font-family: var(--font-mono);
  margin-bottom: 4px;
  word-break: break-all;
}
.acc-sel-meta {
  font-size: var(--fs-xs);
  color: var(--text-faint);
}
.acc-sel-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.acc-sel-count {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  margin-left: auto;
}
.acc-sel-count b { color: var(--accent-hover); font-size: var(--fs-base); }
.empty-hint {
  padding: 16px;
  color: var(--text-tertiary);
  font-size: var(--fs-sm);
  text-align: center;
  border: 1px dashed var(--border-default);
  border-radius: var(--r-md);
}

/* ═══════════════ Filter Chips (收件人筛选) ═══════════════ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.filter-chip:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.filter-chip.active {
  background: rgba(94,106,210,0.12);
  border-color: var(--accent);
  color: var(--accent-hover);
  font-weight: 500;
}
.filter-section-title {
  font-size: var(--fs-xs);
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  margin-top: 14px;
  margin-bottom: 2px;
  font-family: var(--font-mono);
}
.filter-result {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
}
.filter-result b {
  color: var(--accent-hover);
  font-size: var(--fs-md);
  font-weight: 600;
}

/* ═══════════════ Email Preview (邮件预览) ═══════════════ */
.preview-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 10px 14px;
  background: var(--bg-surface);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
}
.preview-device-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  border: 1px solid var(--border-subtle);
  background: var(--bg-elevated);
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
  cursor: pointer;
  transition: all var(--t-fast);
}
.preview-device-btn:hover {
  border-color: var(--border-default);
  color: var(--text-secondary);
}
.preview-device-btn.active {
  background: rgba(94,106,210,0.12);
  border-color: var(--accent);
  color: var(--accent-hover);
}
.preview-subject-label {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--text-faint);
}
.preview-stage {
  display: flex;
  justify-content: center;
  padding: 20px;
  background: var(--bg-deep);
  border-radius: var(--r-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
}
.preview-device-frame {
  width: 100%;
  max-width: 600px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,0.2);
  transition: max-width var(--t-base);
}
.preview-device-frame.mobile-frame {
  max-width: 375px;
  border-radius: 24px;
  border: 8px solid #1a1a2e;
  padding: 0;
}

/* ═══════════════ Pre-send Checklist (发送前检查) ═══════════════ */
.checklist-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}
.checklist-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 500;
  border: 1px solid;
  transition: all var(--t-fast);
}
.checklist-item.checked {
  background: rgba(16,185,129,0.08);
  border-color: rgba(16,185,129,0.3);
  color: #34d399;
}
.checklist-item.unchecked {
  background: rgba(239,68,68,0.06);
  border-color: rgba(239,68,68,0.2);
  color: #f87171;
}
.checklist-item svg { width: 14px; height: 14px; }

/* ═══════════════ Summary Cards (发送确认摘要) ═══════════════ */
.summary-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.summary-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.summary-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface);
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
  color: var(--text-secondary);
  word-break: break-all;
}
.summary-item svg {
  width: 14px; height: 14px;
  color: var(--text-faint);
  flex-shrink: 0;
}
.summary-item-big {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 12px 14px;
  background: var(--bg-surface);
  border-radius: var(--r-md);
}
.summary-item-big .big-num {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent-hover);
  font-family: var(--font-mono);
  line-height: 1;
}
.summary-item-big .big-label {
  font-size: var(--fs-sm);
  color: var(--text-tertiary);
}

/* ═══════════════ Reduced motion ═══════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .sidebar, .topbar, .wizard, .toast, .card.glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--bg-elevated);
  }
}
