/* ==================== 启动画面 ==================== */
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-splash);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

.splash-screen.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  animation: splash-fade-in 0.6s ease;
}

@keyframes splash-fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.splash-logo {
  margin-bottom: 24px;
}

.splash-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  border-radius: 20px;
  font-size: 40px;
  font-weight: 700;
  color: #fff;
  box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4);
  animation: splash-pulse 2s ease-in-out infinite;
}

@keyframes splash-pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 8px 32px rgba(99, 102, 241, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 12px 40px rgba(99, 102, 241, 0.6); }
}

.splash-title {
  font-size: 36px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 8px;
  letter-spacing: 2px;
}

.splash-subtitle {
  font-size: 14px;
  color: #94a3b8;
  margin: 0 0 32px;
  letter-spacing: 1px;
}

.splash-loader {
  margin-bottom: 16px;
}

.splash-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.splash-status {
  font-size: 13px;
  color: #64748b;
  margin: 0;
}

/* 卡密验证表单 */
.license-form {
  margin-top: 24px;
  width: 100%;
  max-width: 360px;
  animation: splash-fade-in 0.4s ease;
}

.license-input-group {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.license-input-group input {
  flex: 1;
  height: 42px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
}

.license-input-group input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.12);
}

.license-input-group input::placeholder {
  color: #64748b;
}

.license-input-group .btn {
  height: 42px;
  padding: 0 20px;
  white-space: nowrap;
}

.license-info {
  margin-bottom: 12px;
}

.license-hwid {
  display: inline-block;
  font-size: 11px;
  color: #64748b;
  font-family: monospace;
  cursor: pointer;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  transition: all 0.2s;
}

.license-hwid:hover {
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.license-error {
  color: #ef4444;
  font-size: 13px;
  margin: 8px 0;
  padding: 8px 12px;
  background: rgba(239, 68, 68, 0.1);
  border-radius: 6px;
}

.license-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.license-links a {
  color: #94a3b8;
  font-size: 12px;
  text-decoration: none;
  transition: color 0.2s;
}

.license-links a:hover {
  color: var(--accent);
}

.license-links .divider {
  color: #475569;
}

/* 验证成功状态 */
.license-success {
  margin-top: 24px;
  text-align: center;
  animation: splash-fade-in 0.4s ease;
}

.license-success .success-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  background: linear-gradient(135deg, #10b981, #059669);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #fff;
}

.license-success .success-msg {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 4px;
}

.license-success .success-expire {
  color: #64748b;
  font-size: 13px;
  margin: 0;
}

.license-remaining {
  margin-top: 10px;
}

.days-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.days-badge.days-permanent {
  background: rgba(99, 102, 241, 0.15);
  color: #a5b4fc;
}

.days-badge.days-safe {
  background: rgba(16, 185, 129, 0.15);
  color: #6ee7b7;
}

.days-badge.days-warning {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  animation: pulse-warning 2s ease-in-out infinite;
}

.days-badge.days-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  animation: pulse-danger 1.5s ease-in-out infinite;
}

.days-badge.days-expired {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
}

@keyframes pulse-warning {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

@keyframes pulse-danger {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: var(--z-loading);
  backdrop-filter: blur(4px);
}

.loading-overlay.active {
  display: flex;
}

.loading-content {
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 32px 48px;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: loading-pop 0.3s ease;
}

@keyframes loading-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border, #e2e8f0);
  border-top-color: var(--accent, #6366f1);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 16px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-size: 15px;
  color: var(--text-primary, #1e293b);
  font-weight: 500;
  margin-bottom: 8px;
}

.loading-subtext {
  font-size: 13px;
  color: var(--text-muted, #94a3b8);
}

/* 按钮内加载动画 */
.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 8px;
}

/* Toast 提示 */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--text-primary, #1e293b);
  color: #fff;
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 14px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  z-index: var(--z-toast);
  animation: toast-in 0.3s ease;
}

.toast.success { background: var(--success, #10b981); }
.toast.error { background: var(--danger, #ef4444); }
.toast.warning { background: #f59e0b; }

@keyframes toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
:root {
  --z-context-menu: 9000;
  --z-modal-base: 10000;
  --z-modal-child: 10020;
  --z-modal-confirm: 10030;
  --z-modal-login-code: 10040;
  --z-loading: 10100;
  --z-toast: 10110;
  --z-splash: 10200;
  --bg: #f0f2f5;
  --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
  --sidebar-hover: #334155;
  --sidebar-active: rgba(99, 102, 241, 0.15);
  --card-bg: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: #e0e7ff;
  --success: #10b981;
  --success-light: #d1fae5;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 12px 40px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==================== 基础重置 ==================== */
* { box-sizing: border-box; margin: 0; padding: 0; scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ==================== 布局容器 ==================== */
.app-container {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  min-height: 0;
}

/* ==================== 侧边栏 ==================== */
.sidebar {
  background: var(--sidebar-bg);
  color: #fff;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, var(--accent), #a855f7);
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.logo-version {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
  font-weight: 500;
}

.dev-badge {
  font-size: 9px;
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  padding: 1px 6px;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.5px;
  vertical-align: middle;
  margin-left: 4px;
}

.dev-badge:empty {
  display: none;
}

/* 导航 */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

/* 侧边栏滚动条样式 */
.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.25);
}

.nav-group {
  margin-bottom: 4px;
}

/* 任务总览置顶样式 */
.nav-dashboard {
  margin-bottom: 0;
}

.nav-dashboard .nav-item {
  font-weight: 600;
  color: rgba(255,255,255,0.9);
}

.nav-divider {
  height: 1px;
  margin: 8px 16px;
  background: rgba(255,255,255,0.08);
}

.nav-group-title {
  padding: 8px 20px 4px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255,255,255,0.35);
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 9px 20px;
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 13.5px;
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
  position: relative;
}

.nav-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 0;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
  transition: height 0.2s;
}

.nav-item:hover {
  background: rgba(255,255,255,0.04);
  color: rgba(255,255,255,0.9);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-item.active::before {
  height: 24px;
}

.nav-icon { font-size: 18px; width: 22px; text-align: center; }
.nav-label { flex: 1; font-weight: 500; }

/* 侧边栏底部 */
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 侧边栏授权状态 */
.sidebar-license {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.license-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.license-dot.safe {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
}

.license-dot.warning {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
  animation: pulse-warning 2s ease-in-out infinite;
}

.license-dot.danger {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
  animation: pulse-danger 1.5s ease-in-out infinite;
}

.license-dot.expired {
  background: #dc2626;
  box-shadow: 0 0 6px rgba(220, 38, 38, 0.5);
}

.license-days-text {
  font-variant-numeric: tabular-nums;
}

/* 侧边栏信息行（端口/模式） */
.sidebar-info {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  font-family: 'SF Mono', 'Cascadia Code', monospace;
}

.sidebar-info span:not(:empty)::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  margin-right: 6px;
  vertical-align: middle;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.status-dot.offline { background: var(--danger); box-shadow: 0 0 8px rgba(239, 68, 68, 0.5); }

/* ==================== 主内容区 ==================== */
.main-content {
  display: flex;
  flex-direction: column;
  height: 100vh;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

/* 顶部栏 */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 28px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.panel-title { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
.panel-desc { color: var(--text-secondary); font-size: 13px; margin-top: 3px; }

.topbar-right { display: flex; gap: 10px; }

.btn-icon {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  cursor: pointer;
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: var(--transition);
}

.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }

/* 内容区 */
.content-area {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  scrollbar-width: thin !important;
  scrollbar-color: rgba(148,163,184,0.3) transparent !important;
}
.content-area::-webkit-scrollbar { display: block !important; width: 6px !important; }
.content-area::-webkit-scrollbar-track { background: transparent !important; }
.content-area::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.3) !important; border-radius: 3px !important; }
.content-area::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.5) !important; }

/* ==================== 面板 ==================== */
.panel { display: none; flex-direction: column; gap: 12px; max-width: 100%; overflow: visible; flex: 1; min-height: 0; }
.panel.active { display: flex; }

/* ==================== 卡片 ==================== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  border: 1px solid rgba(0,0,0,0.02);
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-desc {
  color: var(--text-secondary);
  font-size: 12px;
  margin-top: 2px;
}

/* ==================== 标签页 ==================== */
.panel-tabs {
  display: flex;
  gap: 4px;
  background: #f8fafc;
  padding: 4px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tab {
  flex: 1;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.tab:hover { color: var(--text-primary); background: rgba(0,0,0,0.03); }
.tab.active { background: var(--card-bg); color: var(--accent); box-shadow: var(--shadow-sm); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ==================== 表单 ==================== */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 8px;
}

.form-group:last-child { margin-bottom: 0; }

.form-group label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-group .hint {
  font-weight: normal;
  color: var(--text-muted);
}

.hint-warning {
  color: #f59e0b !important;
  font-weight: 500;
}

/* 帖子标题预览 */
.post-title-preview {
  font-size: 11px;
  color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  padding: 1px 6px;
  border-radius: 3px;
  white-space: nowrap;
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.atc-post-title-preview {
  font-size: 10px;
  color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

.proxy-format-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.proxy-format-hint summary {
  cursor: pointer;
  color: var(--text-secondary);
  user-select: none;
}

.proxy-format-hint .format-examples {
  margin-top: 8px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-family: monospace;
}

.proxy-format-hint .format-examples p {
  margin: 4px 0;
}

.proxy-format-hint .format-examples pre {
  margin: 8px 0;
  padding: 8px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 11px;
  overflow-x: auto;
}

.proxy-format-hint .format-examples .note {
  margin-top: 8px;
  color: var(--text-secondary);
  font-size: 11px;
}

/* 代理管理新样式 */
.proxy-manager {
  margin-top: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
}

.proxy-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.proxy-header h4 {
  margin: 0;
  font-size: 13px;
  color: var(--text-primary);
}

.proxy-form {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
}

.proxy-form-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.proxy-chain-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
}

.checkbox-label input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.chain-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 12px;
}

.proxy-chain-fields {
  margin-top: 8px;
}

.proxy-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.proxy-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.proxy-empty {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.proxy-card {
  display: flex;
  align-items: center;
  padding: 12px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  gap: 12px;
}

.proxy-card-info {
  flex: 1;
  min-width: 0;
}

.proxy-card-name {
  font-weight: 500;
  font-size: 13px;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.proxy-card-detail {
  font-size: 12px;
  color: var(--text-muted);
  font-family: monospace;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.proxy-card-chain {
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
}

.proxy-assigned-list {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}
.proxy-assigned-label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-right: 2px;
}
.proxy-assigned-none {
  color: var(--text-muted);
  font-style: italic;
}
.proxy-assigned-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
  background: #eef2ff;
  color: var(--accent);
  border: 1px solid #c7d2fe;
}

/* ATC PostBot 帖子集成 */
.atc-postbot-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.atc-postbot-section > input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
}
.atc-postbot-bar {
  display: flex;
  gap: 6px;
}
.atc-post-create {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.atc-post-list {
  max-height: 120px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.atc-post-list::-webkit-scrollbar { display: block; width: 4px; }
.atc-post-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.atc-post-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
  font-size: 12px;
}
.atc-post-item:last-child {
  border-bottom: none;
}
.atc-post-item:hover {
  background: var(--bg-hover);
}
.atc-post-item.selected {
  background: var(--accent-light);
  color: var(--accent);
}
.atc-post-code {
  font-family: monospace;
  font-weight: 600;
  color: var(--accent);
  min-width: 60px;
}
.atc-post-preview {
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  cursor: pointer;
}
.atc-post-delete {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  border-radius: 4px;
  opacity: 0.5;
  transition: opacity 0.15s, background 0.15s;
  flex-shrink: 0;
}
.atc-post-delete:hover {
  opacity: 1;
  background: rgba(255, 80, 80, 0.15);
}

.proxy-card-actions {
  display: flex;
  gap: 4px;
}

.proxy-card-actions button {
  padding: 4px 8px;
  font-size: 11px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: opacity 0.2s;
}

.proxy-card-actions button:hover {
  opacity: 0.8;
}

.proxy-card-actions .test-btn {
  background: var(--accent);
  color: white;
}

.proxy-card-actions .delete-btn {
  background: var(--danger);
  color: white;
}

.proxy-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.proxy-status.online { background: var(--success); }
.proxy-status.offline { background: var(--danger); }
.proxy-status.testing { background: var(--warning); animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group { flex: 1; }
.form-group.flex-2 { flex: 2; }
.form-group.flex-1 { flex: 1; }

input, select, textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--card-bg);
  color: var(--text-primary);
  transition: var(--transition);
  font-family: inherit;
}

input::placeholder, textarea::placeholder {
  color: var(--text-muted);
}

input:hover, select:hover, textarea:hover {
  border-color: #cbd5e1;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

textarea { min-height: 100px; resize: vertical; }

.input-with-btn { display: flex; gap: 10px; }
.input-with-btn input { flex: 1; }

/* ==================== 按钮 ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  color: var(--text-primary);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}

.btn.primary {
  background: linear-gradient(135deg, var(--accent), var(--accent-hover));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.btn.primary:hover {
  box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
  transform: translateY(-1px);
}

.btn.success { background: var(--success); color: #fff; border-color: var(--success); box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25); }
.btn.danger { background: linear-gradient(135deg, var(--danger), #dc2626); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25); }
.btn.danger:hover { box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35); transform: translateY(-1px); }
.btn.warning { background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; border-color: transparent; box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25); }
.btn.warning:hover { box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35); transform: translateY(-1px); }
.btn.warning:disabled { background: #4b5563; box-shadow: none; transform: none; cursor: not-allowed; opacity: 0.5; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
.btn.btn-sm { padding: 5px 10px; font-size: 11px; border-radius: var(--radius-sm); }
.btn.btn-lg { padding: 12px 28px; font-size: 14px; border-radius: var(--radius-md); font-weight: 600; }
.btn.btn-icon { padding: 6px; min-width: 32px; }

/* 操作按钮组 */
.action-bar {
  background: var(--bg-primary);
  padding: 10px 0 0;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.action-bar .btn { 
  min-width: 150px;
  padding: 12px 24px;
  font-size: 14px;
  font-weight: 600;
}

.action-bar .btn.primary {
  min-width: 150px;
  padding: 12px 24px;
  font-size: 14px;
}

/* 工具栏（无 border-top，左对齐） */
.toolbar-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* 选择操作栏（无 border-top，小按钮不受 action-bar 影响） */
.select-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

/* 图标按钮 */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-size: 16px;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.btn-icon-sm { background: none; border: none; cursor: pointer; padding: 6px; font-size: 14px; opacity: 0.6; border-radius: var(--radius-sm); }
.btn-icon-sm:hover { opacity: 1; background: var(--bg-hover); }

/* ==================== 开关 ==================== */
.switch {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  position: relative;
}

.switch input { display: none; }

.switch span {
  width: 44px;
  height: 24px;
  background: #e2e8f0;
  border-radius: 12px;
  position: relative;
  transition: var(--transition);
}

.switch span::after {
  content: '';
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  position: absolute;
  top: 2px;
  left: 2px;
  transition: var(--transition);
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ==================== 多选切换 ==================== */
.toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  padding: 8px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.toggle:hover { border-color: var(--accent); background: var(--accent-light); }
.toggle input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--accent); }
.toggle:has(input:checked) { border-color: var(--accent); background: var(--accent-light); }
.toggle-group { display: flex; flex-wrap: wrap; gap: 10px; }

/* ==================== 表格 ==================== */
.table-wrapper {
  overflow-x: auto;
  margin-top: 8px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th, .data-table td {
  padding: 12px 14px;
  text-align: left;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 11px;
  text-transform: uppercase;
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
  position: sticky;
  top: 0;
  z-index: 1;
}

.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: #f1f5f9; }
.data-table tbody tr:last-child td { border-bottom: none; }

.empty-state {
  display: none;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
  font-size: 12px;
}

.selected-count { font-size: 13px; color: var(--text-secondary); }
.selected-count strong { color: var(--accent); }

/* ==================== 工具栏 ==================== */
.toolbar-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  margin-top: 10px;
}

.toolbar-left, .toolbar-right { display: flex; gap: 6px; }
.mobile-page-select-all {
  display: inline-flex;
  min-height: 38px;
  padding: 0 10px;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}
.mobile-page-select-all input { margin: 0; accent-color: var(--accent); }
@media (min-width: 769px) {
  .mobile-page-select-all { display: none; }
}
.toolbar-row.compact { padding: 6px 0; margin-top: 4px; }
.toolbar-row.compact .search-input { padding: 5px 10px; min-width: 180px; font-size: 12px; }

.card-actions { display: flex; gap: 8px; }
.search-input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text); font-size: 12px; }
.search-input:focus { outline: none; border-color: var(--primary); }

.account-name { font-weight: 600; color: var(--text); }
.text-muted { color: var(--text-muted); font-size: 12px; }
.actions { display: flex; gap: 4px; }
.btn-icon-sm { background: none; border: none; cursor: pointer; padding: 4px; font-size: 14px; opacity: 0.6; }
.btn-icon-sm:hover { opacity: 1; }
.note-cell {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
}

/* ====== 控制台紧凑表格 ====== */
.console-table th,
.console-table td {
  padding: 4px 8px;
  font-size: 12px;
}
.console-table th {
  font-size: 10px;
  letter-spacing: 0.3px;
  padding: 5px 8px;
}
.console-table tbody tr {
  /* 分割线由每个 td 统一绘制；避免 tr 边框与非 table-cell 子项错位。 */
  border-bottom: 0;
}
.console-table tbody tr:last-child td { border-bottom: none; }
.console-table tbody tr:hover {
  background: #eef2ff;
}
.console-table tbody tr.selected {
  background: #e0e7ff;
}
.console-table .row-num {
  text-align: center;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 500;
  width: 38px;
  padding: 4px 4px;
  white-space: nowrap;
}

/* 拖拽排序手柄 */
.drag-handle { cursor: grab; user-select: none; }
.drag-handle:active { cursor: grabbing; }
.drag-grip {
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0;
  transition: opacity 0.15s;
  letter-spacing: -2px;
}
.console-table tbody tr:hover .drag-grip { opacity: 0.6; }
.console-table tbody tr:hover .drag-grip:hover { opacity: 1; }

/* 拖拽状态 */
tr.dragging { opacity: 0.4; }
tr.drag-over-top { box-shadow: inset 0 2px 0 0 #6366f1; }
tr.drag-over-bottom { box-shadow: inset 0 -2px 0 0 #6366f1; }

/* 账号信息紧凑堆叠 */
.acct-info {
  display: flex;
  flex-direction: column;
  gap: 0px;
}
.acct-name {
  font-weight: 600;
  font-size: 12px;
  color: var(--text);
  line-height: 1.25;
}
.acct-sub {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.25;
  white-space: nowrap;
}

.login-time-cell {
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* 分组标签 */
.acct-group-tag {
  display: inline-block;
  padding: 1px 5px;
  margin: 1px 1px;
  border-radius: 8px;
  background: #e8f0fe;
  color: #1a73e8;
  font-size: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.acct-no-group {
  color: var(--text-muted);
  font-size: 10px;
}
.group-cell {
  max-width: 100px;
  line-height: 1.4;
}

.account-group-filter {
  min-width: 132px;
  height: 34px;
  padding: 0 28px 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 12px;
}

@media (max-width: 768px) {
  .account-group-filter {
    flex: 1 1 132px;
    min-width: 0;
  }
}

/* 状态行内点 */
.status-dot-inline {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: baseline;
  flex-shrink: 0;
}
.dot-green { background: #22c55e; box-shadow: 0 0 4px rgba(34,197,94,0.5); }
.dot-yellow { background: #f59e0b; box-shadow: 0 0 4px rgba(245,158,11,0.5); }
.dot-red { background: #ef4444; box-shadow: 0 0 4px rgba(239,68,68,0.5); }
.dot-purple { background: #a855f7; box-shadow: 0 0 4px rgba(168,85,247,0.5); }
.dot-orange { background: #f97316; box-shadow: 0 0 4px rgba(249,115,22,0.5); }
.dot-gray { background: #9ca3af; }

/* 严重异常行高亮 */
tr.row-critical {
  animation: row-pulse 2s ease-in-out infinite;
}
@keyframes row-pulse {
  0%, 100% { background: rgba(239, 68, 68, 0.05); }
  50% { background: rgba(239, 68, 68, 0.15); }
}

/* 设备列 */
.device-cell {
  font-size: 11px;
  color: var(--text-secondary);
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 操作按钮列 */
.action-cell {
  /* td 在桌面端必须保持 table-cell，才能与整行分割线对齐。 */
  display: table-cell;
  padding-top: 4px;
  padding-bottom: 4px;
  white-space: nowrap;
  min-width: 160px;
  vertical-align: middle;
}
.action-cell > * {
  margin-right: 4px;
  vertical-align: middle;
}
.action-cell > *:last-child {
  margin-right: 0;
}
.action-cell .btn-icon-sm {
  width: 26px;
  height: 26px;
  min-width: 26px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  opacity: 0.5;
  flex-shrink: 0;
}
.action-cell .btn-icon-sm:hover {
  opacity: 1;
  background: var(--hover-bg);
}
.console-table tbody tr:hover .action-cell .btn-icon-sm {
  opacity: 0.8;
}
.console-table tbody tr:hover .action-cell .btn-icon-sm:hover {
  opacity: 1;
  background: var(--hover-bg);
  transform: scale(1.1);
}
.act-delete:hover { color: var(--danger) !important; background: #fef2f2 !important; }
.bio-cell {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.uptime-cell {
  font-size: 12px;
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
}
.proxy-cell { white-space: nowrap; }
.proxy-tag {
  display: inline-block;
  padding: 3px 10px;
  font-size: 11px;
  font-family: "SF Mono", "Fira Code", monospace;
  border-radius: 6px;
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34,197,94,0.15);
  cursor: default;
  user-select: none;
  font-weight: 500;
}
.proxy-none { color: var(--text-secondary, #aaa); font-size: 12px; }


.schedule-input { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.schedule-input input[type="datetime-local"] { padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text); }
.schedule-fields { padding: 0 4px; }
.schedule-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.schedule-field { display: flex; flex-direction: column; gap: 3px; }
.schedule-label { font-size: 11px; color: var(--text-secondary); }
.schedule-field input[type="datetime-local"] { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text); font-size: 13px; }
.schedule-interval { display: flex; align-items: center; gap: 6px; }
.schedule-interval input[type="number"] { padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg-input); color: var(--text); font-size: 13px; text-align: center; }

.post-code-input { display: flex; align-items: center; border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.post-code-input .prefix { background: var(--bg-secondary); padding: 8px 12px; color: var(--primary); font-weight: 500; border-right: 1px solid var(--border); }
.post-code-input input { border: none; flex: 1; padding: 8px 12px; background: transparent; }
.post-code-input input:focus { outline: none; }

.info-tip { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ==================== 右键菜单 ==================== */
.context-menu {
  position: fixed;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 4px 0;
  min-width: 150px;
  z-index: var(--z-context-menu);
}
.context-item {
  padding: 8px 16px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.context-item:hover { background: var(--bg-hover); }
.context-item.danger { color: var(--error); }
.context-divider { height: 1px; background: var(--border); margin: 4px 0; }
.context-item.has-submenu { position: relative; }
.submenu {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 4px 0;
  min-width: 140px;
}
.context-item.has-submenu:hover .submenu { display: block; }
.submenu .context-item { padding: 8px 16px; font-size: 13px; }
.submenu-arrow { font-size: 10px; color: var(--text-muted); }

#accountsBody tr.long-press-active {
  background: var(--bg-hover);
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.proxy-route-modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  width: min(420px, 100%);
  margin-top: 8px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
}

.proxy-route-option {
  min-width: 0;
  cursor: pointer;
}

.proxy-route-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.proxy-route-option span {
  display: block;
  min-height: 32px;
  padding: 7px 10px;
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
}

.proxy-route-option input:checked + span {
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.proxy-route-option input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

@media (max-width: 768px), (pointer: coarse) {
  .context-menu.touch-open {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: max(12px, env(safe-area-inset-bottom));
    min-width: 0;
    padding: 6px;
    border-radius: 8px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.28);
  }
  .context-menu.touch-open .context-item {
    min-height: 44px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 14px;
    touch-action: manipulation;
  }
  .context-menu.touch-open .context-item:active {
    background: var(--bg-hover);
  }
}

/* ==================== 弹窗 ==================== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-base);
}
.modal.show {
  display: flex;
}
.modal-content {
  background: var(--bg-primary);
  border-radius: 12px;
  width: clamp(360px, 35vw, 460px);
  max-width: 90%;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close { background: none; border: none; font-size: 24px; cursor: pointer; color: var(--text-muted); }
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,0.25) transparent; }
.modal-body::-webkit-scrollbar { display: block; width: 4px; }
.modal-body::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.modal-footer { padding: 16px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* 任务提交弹窗 */
#taskSubmitModal .modal-content {
  width: clamp(380px, 45vw, 560px);
  max-height: 85vh;
}

/* ==================== 卡密状态解释弹窗 ==================== */
.lm-overlay {
  background: rgba(15, 23, 42, 0.75);
  backdrop-filter: blur(4px);
}

.lm-modal {
  animation: lm-slide-in 0.25s ease;
}

@keyframes lm-slide-in {
  from { transform: translateY(-20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.lm-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 20px 16px;
  border-bottom: none;
}

.lm-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.lm-icon {
  font-size: 20px;
  line-height: 1;
}

.lm-icon-success { background: rgba(16, 185, 129, 0.15); }
.lm-icon-success .lm-icon { color: #10b981; }

.lm-icon-error { background: rgba(239, 68, 68, 0.15); }
.lm-icon-error .lm-icon { color: #ef4444; }

.lm-icon-expired { background: rgba(239, 68, 68, 0.12); }
.lm-icon-expired .lm-icon { color: #f87171; font-size: 22px; }

.lm-icon-banned { background: rgba(239, 68, 68, 0.2); }
.lm-icon-banned .lm-icon { color: #dc2626; }

.lm-icon-warning { background: rgba(245, 158, 11, 0.15); }
.lm-icon-warning .lm-icon { color: #f59e0b; }

.lm-icon-info { background: rgba(59, 130, 246, 0.12); }
.lm-icon-info .lm-icon { color: #3b82f6; }

.lm-title {
  margin: 0 !important;
  font-size: 17px;
  font-weight: 600;
  flex: 1;
}

.lm-body {
  padding: 4px 20px 20px;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
}

/* 通用弹窗动画（不影响 confirmModal） */
.modal:not(#confirmModal) .modal-content {
  transform: scale(0.95); opacity: 0;
}
.modal:not(#confirmModal).show .modal-content { transform: scale(1); opacity: 1; }

.task-submit-account {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; margin-bottom: 14px;
  background: var(--bg-secondary); border-radius: 8px; font-size: 13px;
}
.task-submit-account .acct-icon { font-size: 18px; }
.task-submit-account .acct-name { font-weight: 600; }
.task-submit-form { display: flex; flex-direction: column; gap: 12px; }
.task-submit-form .form-group { display: flex; flex-direction: column; gap: 4px; }
.task-submit-form .form-group label { font-size: 12px; color: var(--text-secondary); font-weight: 500; }
.task-submit-form textarea {
  min-height: 56px; max-height: 180px; font-size: 13px;
  resize: vertical; transition: min-height 0.15s ease;
}
.task-submit-form textarea:focus { min-height: 90px; }
/* 弹窗内群组库选择器 */
.task-lib-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.task-lib-count {
  font-size: 12px;
  color: var(--text-muted);
}
.task-lib-count.has-selection {
  color: var(--accent);
  font-weight: 600;
}
.task-lib-panel {
  margin-top: 0 !important;
}
.task-groups-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  scrollbar-width: thin;
}
.task-groups-list::-webkit-scrollbar { display: block; width: 4px; }
.task-groups-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.task-submit-form input[type="text"],
.task-submit-form input[type="number"] { font-size: 13px; }
.task-submit-form .range-input { display: flex; align-items: center; gap: 6px; }
.task-submit-form .range-input input { width: 64px; text-align: center; }
.task-submit-form .range-input span { color: var(--text-muted); font-size: 12px; }
.task-submit-form .checkbox-label {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; font-size: 13px; font-weight: 500;
}
.task-submit-status {
  font-size: 13px; margin-top: 10px; min-height: 20px;
  padding: 6px 10px; border-radius: 6px; transition: all 0.2s;
}
.task-submit-status:empty { padding: 0; margin: 0; }
.task-submit-status.error { color: var(--error); background: rgba(239,68,68,0.08); }
.task-submit-status.success { color: var(--success); background: rgba(16,185,129,0.08); }

/* 任务提交 - 分区标题 */
.task-submit-section-title {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  padding: 8px 0 4px; margin-top: 4px;
  border-bottom: 1px solid var(--border);
}

/* 任务提交 - select */
.task-submit-form select {
  font-size: 13px; padding: 6px 8px; border: 1px solid var(--border);
  border-radius: 6px; background: var(--bg-input); color: var(--text);
}

/* 任务提交 - 摘要卡片 */
.task-summary-card {
  background: var(--bg-secondary); border-radius: 8px;
  padding: 12px; margin-top: 8px; border: 1px solid var(--border);
}
.task-summary-title {
  font-size: 13px; font-weight: 600; margin-bottom: 8px;
  color: var(--text-primary);
}
.task-summary-table { width: 100%; border-collapse: collapse; }
.task-summary-table td {
  padding: 4px 8px; font-size: 12px; border: none;
}
.task-summary-table td:first-child { color: var(--text-muted); width: 80px; }
.task-summary-table td:last-child { color: var(--text); }
.task-summary-warnings { padding-top: 8px !important; }
.task-summary-warn {
  font-size: 11px; color: #e65100; padding: 2px 0;
}
.task-summary-hint {
  text-align: center; font-size: 11px; color: var(--text-muted);
  margin-top: 8px;
}

/* 任务提交 - 状态消息 */
.task-submit-error {
  color: var(--error); font-size: 13px;
}
.task-submit-success {
  color: var(--success); font-size: 13px; line-height: 1.6;
}
.task-submit-success small { font-size: 11px; color: var(--text-muted); }
.task-submit-loading {
  color: var(--accent); font-size: 13px;
}

/* 最近配置 */
.recent-configs {
  margin-top: 8px; padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.recent-configs-title {
  font-size: 11px; color: var(--text-muted); margin-bottom: 4px;
}
.recent-config-item {
  font-size: 11px; padding: 4px 8px; cursor: pointer;
  border-radius: 4px; color: var(--accent); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
  transition: background 0.15s;
}
.recent-config-item:hover {
  background: var(--accent-light, #e0e7ff);
}

/* 确认按钮 warning 态 */
.task-submit-status.success { color: var(--success); background: rgba(34,197,94,0.08); }

/* ==================== 任务状态 ==================== */
.task-status {
  padding: 5px 12px;
  background: #f1f5f9;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
  transition: all 0.3s ease;
}
.task-status.running {
  background: #dbeafe;
  color: #1d4ed8;
}
.task-status.completed {
  background: #dcfce7;
  color: #16a34a;
}
.task-status.failed {
  background: #fee2e2;
  color: #dc2626;
}
.task-status.paused {
  background: #fef3c7;
  color: #d97706;
}

/* ==================== 全局状态栏 ==================== */
.global-status-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 16px;
  background: #1e293b;
  border-radius: 8px;
  margin: 12px 0;
  font-size: 12px;
  color: #94a3b8;
  min-height: 36px;
}
.status-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.status-bar-title {
  font-weight: 600;
  color: #cbd5e1;
}
.status-bar-count {
  background: #334155;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  color: #cbd5e1;
}
.status-bar-count.active {
  background: #1d4ed8;
  color: #fff;
}
.status-bar-tasks {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  overflow-x: auto;
  white-space: nowrap;
}
.status-bar-tasks::-webkit-scrollbar { height: 0; }
.status-bar-empty {
  color: #cbd5e1;
  font-style: italic;
  font-size: 12px;
}
.status-bar-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  background: #334155;
  color: #94a3b8;
}
.status-bar-tag.running {
  background: #1e3a5f;
  color: #60a5fa;
}
.status-bar-tag .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.status-bar-tag.running .dot {
  animation: pulse-dot 1.5s infinite;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
.status-bar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.status-bar-stat {
  font-size: 11px;
}
.status-bar-stat.success { color: #4ade80; }
.status-bar-stat.skipped { color: #facc15; }
.status-bar-stat.silent-deleted { color: #fb923c; }
.status-bar-stat.failed { color: #f87171; }

.auto-save-tag {
  font-size: 11px;
  color: var(--success);
  background: var(--success-light);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 500;
}

/* ==================== 进度条 ==================== */
.progress-bar {
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
  margin: 14px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #a855f7);
  width: 0%;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 5px;
}

.progress-stats {
  display: flex;
  gap: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.progress-stats strong { color: var(--accent); font-weight: 600; }

/* ==================== 日志区域 ==================== */
.log-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  padding: 12px 28px;
  flex-shrink: 0;
  max-height: 140px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.log-footer::-webkit-scrollbar { display: block; width: 4px; }
.log-footer::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }

.log-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.log-title { font-size: 13px; font-weight: 600; }

.log-actions { display: flex; gap: 8px; }
.log-actions .btn {
  transition: all 0.15s;
  border: 1px solid transparent;
}
.log-actions .btn:hover {
  background: var(--bg-secondary);
  border-color: var(--border);
}

.log-footer pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
  user-select: text;
  cursor: text;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.log-footer pre::-webkit-scrollbar { display: block; width: 4px; }
.log-footer pre::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.log-footer pre span { display: block; line-height: 1.5; }
.log-footer pre .log-success { color: #4ade80; }
.log-footer pre .log-error { color: #f87171; }
.log-footer pre .log-warning { color: #fbbf24; }
.log-footer pre .log-info { color: #94a3b8; }

/* 日志终端标签 */
.log-tabs {
  display: flex;
  gap: 2px;
  margin-left: 12px;
  background: var(--bg-secondary, #1e293b);
  border-radius: 6px;
  padding: 2px;
}
.log-tab {
  font-size: 11px;
  padding: 3px 10px;
  border: none;
  background: transparent;
  color: var(--text-muted, #94a3b8);
  cursor: pointer;
  border-radius: 4px;
  transition: all 0.15s;
  font-weight: 500;
}
.log-tab:hover { color: var(--text-primary, #e2e8f0); }
.log-tab.active {
  background: var(--primary, #6366f1);
  color: #fff;
}
/* 账号过滤下拉 */
.log-account-filter {
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid var(--border, #334155);
  border-radius: 4px;
  background: var(--card-bg, #1e293b);
  color: var(--text-primary, #e2e8f0);
  max-width: 180px;
}
/* 异常日志高亮背景 */
.log-footer pre .log-line-error {
  background: rgba(239,68,68,0.15);
  color: #fca5a5;
  padding: 1px 4px;
  border-radius: 2px;
}
.log-footer pre .log-line-warning {
  background: rgba(245,158,11,0.12);
  color: #fcd34d;
  padding: 1px 4px;
  border-radius: 2px;
}

.log-entry { color: #e2e8f0; padding: 4px 0; border-bottom: 1px solid #334155; }
.log-entry:last-child { border-bottom: none; }
.log-entry.success { color: #4ade80; }
.log-entry.error { color: #f87171; }

/* ==================== 星期选择器 ==================== */
.weekday-row { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }

.weekday {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.weekday input { width: 14px; height: 14px; cursor: pointer; }
.weekday:has(input:checked) { background: #dbeafe; border-color: var(--accent); color: var(--accent); }

/* ==================== 区间输入 ==================== */
.range-input { display: flex; align-items: flex-end; gap: 6px; }
.range-input input { width: 80px; }
.range-input .range-sep { color: var(--text-muted); font-size: 13px; padding-bottom: 6px; }
.range-field { display: flex; flex-direction: column; gap: 2px; }
.range-label { font-size: 10px; color: var(--text-muted); font-weight: 500; }

/* ==================== 模式选择器 ==================== */
.mode-selector { display: flex; gap: 8px; flex-wrap: wrap; }
.mode-option { cursor: pointer; }
.mode-option input { display: none; }
.mode-label {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  transition: all 0.2s;
  background: var(--bg-secondary);
}
.mode-option input:checked + .mode-label {
  border-color: var(--primary);
  background: var(--primary-bg);
  color: var(--primary);
}

/* ==================== 配置网格 ==================== */
.config-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.form-group.full { grid-column: 1 / -1; }

/* ==================== 切换网格 ==================== */
.toggle-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin: 16px 0;
}

/* ==================== 提示信息 ==================== */
.info-tip {
  padding: 10px 12px;
  background: #eff6ff;
  color: #1e40af;
  border-radius: 6px;
  font-size: 13px;
  margin: 16px 0;
}

/* ==================== AI结果 ==================== */
.ai-result {
  margin-top: 16px;
  padding: 16px;
  background: #f8faff;
  border-radius: 8px;
}

.ai-result h4 { margin: 0 0 12px; font-size: 13px; color: var(--text-secondary); }

.ai-result pre {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 6px;
  font-size: 13px;
  white-space: pre-wrap;
  margin: 0 0 12px;
}

/* ==================== 定时任务列表 ==================== */
.schedule-list { display: flex; flex-direction: column; gap: 8px; }

/* ==================== 结果列表 ==================== */
.results-list { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }

.result-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: #f8faff;
  border-radius: 6px;
  font-size: 13px;
}

.result-checkbox { flex-shrink: 0; margin-top: 2px; }
.result-main { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; }
.result-main a { color: var(--primary); font-weight: 500; }
.result-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--text-secondary); font-size: 12px; margin-top: 4px; }
.results-summary { padding: 6px 12px; background: #1e293b; color: #94a3b8; border-radius: 6px 6px 0 0; font-size: 12px; margin-top: 12px; }

.badge { display: inline-block; padding: 2px 7px; border-radius: 5px; font-size: 10px; font-weight: 600; line-height: 1.4; background: #e2e8f0; color: #475569; letter-spacing: 0.02em; }
.badge-success { background: #dcfce7; color: #15803d; border: 1px solid rgba(22,163,74,0.2); }
.badge-error { background: #fee2e2; color: #b91c1c; border: 1px solid rgba(220,38,38,0.15); }
.badge-info { background: #dbeafe; color: #1d4ed8; border: 1px solid rgba(29,78,216,0.15); }
.badge-warning { background: #fef3c7; color: #b45309; border: 1px solid rgba(217,119,6,0.15); }
.badge-muted { background: #f1f5f9; color: #64748b; border: 1px solid rgba(100,116,139,0.1); }
.spam-badge { font-size: 9px; padding: 1px 5px; margin-left: 4px; vertical-align: middle; cursor: help; }

.account-state-stack {
  display: flex;
  min-width: 104px;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.account-main-state,
.account-spam-state {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.account-spam-state {
  color: #64748b;
  font-size: 10px;
  line-height: 1.2;
}

.account-spam-state > span {
  padding: 1px 4px;
  border-radius: 3px;
  background: #e2e8f0;
  color: #475569;
  font-size: 9px;
  font-weight: 700;
}

.account-spam-state.normal { color: #15803d; }
.account-spam-state.restricted { color: #b45309; font-weight: 600; }
.account-spam-state.appealing { color: #2563eb; font-weight: 600; }
.account-spam-state.error { color: #dc2626; }

.account-device-state {
  display: block;
  max-width: 190px;
  overflow: hidden;
  color: #64748b;
  font-size: 9px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: help;
}
.account-device-state.stable { color: #0f766e; }
.account-device-state.legacy { color: #a16207; }
.account-device-state.invalid { color: #dc2626; font-weight: 600; }

/* ==================== 已选标签 ==================== */
.selected-tags {
  padding: 8px 12px;
  background: #f8faff;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  min-height: 38px;
}

/* ==================== Toast提示 ==================== */
#toast {
  position: fixed;
  right: 28px;
  bottom: 170px;
  padding: 12px 24px 12px 18px;
  background: var(--bg-card, #1e293b);
  color: #fff;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transform: translateY(10px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--z-toast);
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  border-left: 4px solid transparent;
  max-width: 380px;
}

#toast.show { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; }
#toast.success { border-left-color: var(--success, #10b981); }
#toast.error { border-left-color: var(--danger, #ef4444); background: #1a1015; }
#toast.warning { border-left-color: #f59e0b; }
#toast.info { border-left-color: var(--primary, #6366f1); }

/* ==================== 模态框 ==================== */
#confirmModal.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal-confirm);
  animation: fadeIn 0.2s ease;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

#confirmModal.modal.show { display: flex; }

#confirmModal .modal-content {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

#confirmModal .modal-content h3 { font-size: 17px; margin-bottom: 10px; font-weight: 600; }
#confirmModal .modal-content p { color: var(--text-secondary); margin-bottom: 24px; line-height: 1.6; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

/* 启动模式选择器 */
.mode-radio { transition: border-color 0.15s, background 0.15s; }
.mode-radio:hover { border-color: var(--primary) !important; background: rgba(99,102,241,0.04); }
.mode-radio:has(input:checked) { border-color: var(--primary) !important; background: rgba(99,102,241,0.08); box-shadow: 0 0 0 1px var(--primary); }

:root {
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius: 12px;
  --accent: #6366f1;
  --accent-hover: #4f46e5;
  --accent-light: rgba(99, 102, 241, 0.1);
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --success: #10b981;
  --danger: #ef4444;
  --transition: all 0.2s ease;
}

/* ==================== 登录弹窗标签页 ==================== */
.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.login-tab {
  flex: 1;
  padding: 12px 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  user-select: none;
}

.login-tab:hover {
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.login-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.login-panel {
  display: none;
  animation: fadeIn 0.25s ease;
}

.login-panel.active {
  display: block;
}

.code-input-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.code-input-row input {
  flex: 1;
  letter-spacing: 4px;
  font-size: 16px;
  text-align: center;
}

.login-status {
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  min-height: 20px;
  transition: var(--transition);
}

.login-status:empty {
  display: none;
}

.supplier-config-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.supplier-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: -2px 0 14px;
}

.supplier-state {
  min-width: 0;
  margin-left: auto;
  color: var(--text-muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.sku-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sku-label-row label {
  margin-bottom: 0;
}

.sku-meta {
  min-height: 18px;
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.supplier-extra {
  margin: 4px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.supplier-extra summary {
  cursor: pointer;
  user-select: none;
}

.supplier-extra textarea {
  width: 100%;
  margin-top: 8px;
  resize: vertical;
}

.supplier-protocol-config {
  margin: 2px 0 14px;
  color: var(--text-secondary);
  font-size: 12px;
}

.supplier-protocol-config summary {
  cursor: pointer;
  user-select: none;
}

.supplier-protocol-config textarea {
  width: 100%;
  min-height: 132px;
  margin-top: 8px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
}

.supplier-order-result {
  margin: 10px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
}

.supplier-order-result[hidden] {
  display: none;
}

#supplierCodeGroup[hidden],
#supplierPasswordGroup[hidden] {
  display: none !important;
}

.supplier-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  font-size: 12px;
}

.supplier-order-head span {
  min-width: 0;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}

.supplier-order-result select {
  width: 100%;
}

/* 拖拽上传区域 */
.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  background: var(--bg-secondary);
}

.drop-zone:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  transform: scale(1.01);
}

.drop-zone-text {
  color: var(--text-muted);
  font-size: 14px;
}

.import-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.import-progress .progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.import-progress .progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 3px;
  transition: width 0.3s ease;
  width: 0%;
}

/* ==================== 响应式 ==================== */

/* 汉堡菜单按钮（默认隐藏，移动端显示） */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card-bg);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: var(--transition);
}
.hamburger-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text, #334155);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.hamburger-btn:hover { border-color: var(--accent); }

/* 侧边栏遮罩（默认隐藏） */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.sidebar-overlay.active {
  display: block;
  opacity: 1;
}

/* ===== 平板 + 小屏幕 ===== */
@media (max-width: 1024px) {
  /* 布局：侧边栏变为抽屉 */
  .app-container { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    width: 240px;
    height: 100vh;
    z-index: 1000;
    transition: left 0.3s ease;
    box-shadow: none;
  }
  .sidebar.open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,0.3);
  }

  /* 显示汉堡菜单 */
  .hamburger-btn { display: flex; }

  /* 侧边栏打开时汉堡动画 */
  .sidebar.open ~ .sidebar-overlay ~ .main-content .hamburger-btn span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .sidebar.open ~ .sidebar-overlay ~ .main-content .hamburger-btn span:nth-child(2) {
    opacity: 0;
  }
  .sidebar.open ~ .sidebar-overlay ~ .main-content .hamburger-btn span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* 配置网格单列 */
  .config-grid { grid-template-columns: 1fr; }

  /* 内容区缩小间距 */
  .topbar { padding: 14px 16px; gap: 10px; }
  .content-area { padding: 16px; }
  .panel-title { font-size: 17px; }
  .panel-desc { font-size: 12px; }
}

/* ===== 手机 ===== */
@media (max-width: 768px) {
  /* 表单行垂直排列 */
  .form-row { flex-direction: column; }
  .toolbar-row { flex-direction: column; gap: 10px; align-items: stretch; }
  .toolbar-left, .toolbar-right { flex-wrap: wrap; gap: 6px; }
  .weekday-row { flex-wrap: wrap; }
  .btn-group { flex-direction: column; }

  /* 卡片头部：标题和操作按钮垂直堆叠 */
  .card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-actions { flex-wrap: wrap; width: 100%; }
  .card-actions .btn { flex: 1; min-width: 0; text-align: center; font-size: 12px; }

  /* 内容区进一步缩小间距 */
  .topbar { padding: 10px 12px; }
  .content-area { padding: 12px; }
  .card { padding: 12px; }

  /* 弹窗全宽 */
  .modal-content {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
    max-height: 90vh;
    border-radius: 10px;
  }
  #taskSubmitModal .modal-content {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  /* 表格字体缩小 */
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 6px; }

  /* 任务卡片 */
  .task-card { padding: 10px 12px; }
  .task-card-header { flex-wrap: wrap; }

  /* 全局状态栏 */
  .global-status-bar {
    flex-direction: column;
    gap: 6px;
    padding: 8px 12px;
  }
  .status-bar-left, .status-bar-right {
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
    justify-content: flex-start;
  }
  .status-bar-tasks {
    width: 100%;
    max-height: 60px;
    overflow-y: auto;
  }

  /* 日志终端 */
  .log-footer {
    max-height: 180px;
  }
  .log-content {
    font-size: 11px;
    max-height: 120px;
  }

  /* 模板卡片单列布局 */
  .templates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* 任务提交表单 */
  .task-submit-account { flex-direction: column; align-items: flex-start; }

  /* 广告词生成器弹窗 */
  .ag-modal-content {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  /* 新建任务面板 */
  .nt-panel-toolbar {
    flex-direction: column;
    gap: 10px;
    align-items: stretch;
  }
  .nt-panel-toolbar .btn {
    text-align: center;
  }

  /* 按钮尺寸调整 */
  .btn { font-size: 12px; padding: 6px 12px; }
  .btn.btn-sm { font-size: 11px; padding: 4px 8px; }
  .btn.btn-lg { font-size: 14px; padding: 10px 16px; }

  /* 输入框和选择器 */
  input[type="text"], input[type="number"], input[type="password"],
  select, textarea {
    font-size: 14px; /* 防止 iOS 自动缩放 */
  }

  /* 搜索框 */
  .search-input { width: 100%; min-width: 0; }

  /* 配置网格 */
  .config-grid { grid-template-columns: 1fr; }
  .toggle-grid { grid-template-columns: 1fr; }

  /* 账号统计栏 */
  .account-stats-bar { padding: 6px 8px; }
  .stats-tab { font-size: 11px; padding: 4px 8px; }

  /* 操作按钮栏 */
  .action-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
  }
  .action-bar .btn { flex: 1 1 calc(50% - 4px); min-width: 0; text-align: center; }

  /* 开关组 */
  .toggle-group {
    flex-direction: column;
    gap: 6px;
  }
  .toggle {
    padding: 8px 10px;
    font-size: 12.5px;
    width: 100%;
    box-sizing: border-box;
  }
  .toggle-group > div[style*="inline-flex"] {
    display: flex !important;
    width: 100%;
    margin-left: 0 !important;
    margin-top: 4px;
  }
  .toggle-group > div[style*="inline-flex"] select,
  .toggle-group > div[style*="inline-flex"] input {
    flex: 1;
    width: auto !important;
    min-width: 0;
  }

  /* 日志终端 */
  .log-footer {
    padding: 8px 12px;
    max-height: 200px;
  }
  .log-tabs {
    flex-wrap: wrap;
    margin-left: 0;
  }
  .log-tab {
    font-size: 10px;
    padding: 3px 7px;
  }
  .log-header {
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
  }
  .log-footer pre {
    font-size: 11px;
    padding: 8px 10px;
  }

/* ── 代理管理 ── */
  .proxy-form-grid {
    grid-template-columns: 1fr !important;
  }
  .proxy-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .proxy-form-actions {
    flex-direction: column;
  }
  .proxy-form-actions .btn { width: 100%; }
  .chain-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── 批量操作按钮 ── */
  .batch-actions-bar {
    gap: 4px;
  }
  .btn-batch {
    font-size: 11px;
    padding: 3px 6px;
  }
  .batch-sep { display: none; }
  .selected-count-badge {
    font-size: 10px;
    padding: 2px 6px;
  }

  /* ── 群组库 ── */
  .group-toolbar {
    flex-direction: column;
    align-items: stretch;
  }
  .group-toolbar > .search-input {
    flex: 1 1 100%;
    min-width: 0;
  }
  .group-cat-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .group-cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab {
    white-space: nowrap;
    font-size: 11px;
    flex-shrink: 0;
  }
  .group-batch-bar {
    flex-wrap: wrap;
    gap: 6px;
  }
  .group-batch-bar .btn {
    flex: 1 1 auto;
    font-size: 11px;
  }

  /* ── 批量退群面板 ── */
  .toolbar-bar {
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
  }
  .toolbar-bar > div[style*="flex"] {
    flex-wrap: wrap !important;
  }
  .toolbar-bar select {
    width: auto !important;
    min-width: 70px;
  }
  .select-bar {
    flex-wrap: wrap;
  }
  .leave-group-list {
    max-height: 200px;
    overflow-y: auto;
  }

  /* ── 新建任务向导 ── */
  .wizard-steps {
    padding: 10px 12px 0;
  }
  .wizard-step-label {
    font-size: 12px;
  }
  .wizard-step-num {
    width: 22px;
    height: 22px;
    font-size: 12px;
  }
  .wizard-body {
    padding: 12px 14px;
  }

  /* ── 账号表格移动端优化 ── */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .console-table th,
  .console-table td {
    white-space: nowrap;
  }

  /* ── 账号统计标签滚动 ── */
  .stats-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .stats-tabs::-webkit-scrollbar { display: none; }
  .stats-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .stats-extras {
    flex-wrap: wrap;
    gap: 4px;
  }

  /* ── 广告词生成器弹窗 ── */
  .ag-modal {
    max-width: calc(100% - 24px);
    padding: 16px;
  }
  .ag-row {
    grid-template-columns: 1fr;
  }

  /* ── 采集结果列表 ── */
  .scraper-results-list {
    max-height: 200px;
  }
  .scraper-results-list .result-item {
    font-size: 12px;
    flex-wrap: wrap;
  }

  /* ── 登录弹窗 ── */
  .login-tabs {
    flex-direction: column;
    gap: 4px;
  }
  .login-tab {
    text-align: center;
  }
  .code-input-row {
    flex-direction: column;
    gap: 8px;
  }
  .supplier-config-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .supplier-toolbar,
  .supplier-order-head {
    align-items: stretch;
    flex-direction: column;
  }
  .supplier-state {
    margin-left: 0;
  }

  /* ── 头像编辑 ── */
  .avatar-edit-panel {
    max-width: 100%;
    overflow: hidden;
  }
  .avatar-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* ── 账号选择弹窗 ── */
  .account-picker-modal {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }
  .picker-group-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .picker-group-tabs::-webkit-scrollbar { display: none; }
  .picker-tab {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* ── 分组管理弹窗 ── */
  .group-manager-modal {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }
  .group-create-row {
    flex-direction: column;
    gap: 6px;
  }
  .group-create-row input,
  .group-create-row .search-input {
    width: 100%;
  }
  .group-manager-item {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 10px;
  }

  /* ── ATC批量配置弹窗 ── */
  .atc-batch-modal {
    width: calc(100% - 24px) !important;
    max-width: calc(100% - 24px) !important;
  }

  /* ── 密码修改区域 ── */
  .password-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  /* ── 表单行内联元素 ── */
  .form-group .inline-input-group {
    flex-direction: column;
    gap: 6px;
  }
  .inline-input-group .btn {
    width: 100%;
  }

  /* ── YesCaptcha 配置行 ── */
  .form-group div[style*="display:flex"][style*="gap:8px"] {
    flex-wrap: wrap;
  }
}

/* ===== 极小屏幕 ===== */
@media (max-width: 420px) {
  .topbar { padding: 8px 10px; }
  .content-area { padding: 8px; }
  .card { padding: 10px; }
  .panel-title { font-size: 15px; }
  .panel-desc { display: none; }
  .sidebar-header { padding: 16px 14px; }
  .logo-title { font-size: 15px; }
  .nav-item { padding: 10px 14px; font-size: 13px; }
  .btn { font-size: 11px; padding: 5px 10px; }
  .data-table { font-size: 11px; }
  .data-table th, .data-table td { padding: 6px 4px; }
  .stats-tab { font-size: 10px; padding: 3px 6px; }
  .btn-batch { font-size: 10px; padding: 2px 5px; }
  .log-footer { max-height: 160px; }
  .action-bar .btn { flex: 1 1 100%; }
}

/* ==================== 账号任务分配栏 ==================== */
.account-task-bar {
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: border-color 0.2s;
}

.account-task-bar.has-accounts {
  border-color: var(--accent);
  background: var(--accent-light);
}

.account-task-bar.task-running {
  border-color: #3b82f6;
  background: #eff6ff;
}

.atb-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.atb-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.atb-count {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--border);
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.atb-count.active {
  background: var(--accent);
  color: #fff;
}

.atb-select-btn {
  margin-left: auto;
  padding: 4px 12px !important;
  font-size: 11.5px !important;
}

.atb-accounts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.atb-accounts:empty {
  display: none;
}

.atb-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-primary);
  transition: all 0.15s;
}

.atb-chip:hover {
  border-color: var(--accent);
}

.atb-chip .chip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.atb-chip .chip-dot.normal { background: var(--success); }
.atb-chip .chip-dot.frozen { background: var(--warning); }
.atb-chip .chip-dot.banned { background: var(--danger); }
.atb-chip .chip-dot.login_required { background: #a855f7; }
.atb-chip .chip-dot.error { background: #f97316; }
.atb-chip .chip-dot.unknown { background: var(--text-muted); }

.atb-chip .chip-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
}

.atb-chip .chip-status {
  font-size: 11px;
  color: var(--text-muted);
}

.atb-chip.chip-running {
  border-color: #3b82f6;
  background: #dbeafe;
}

.atb-chip.chip-running .chip-dot {
  background: #3b82f6;
  animation: pulse-dot 1.5s infinite;
}

.atb-chip.chip-done {
  border-color: var(--success);
  background: #dcfce7;
}

.atb-chip.chip-error {
  border-color: var(--danger);
  background: #fee2e2;
}

.atb-empty {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-muted);
  font-style: italic;
}

.atb-accounts:not(:empty) + .atb-empty {
  display: none;
}

/* 逐账号进度追踪 */
.atb-progress {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.atb-progress-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
}

.atb-progress-item .prog-session {
  font-weight: 500;
  min-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.atb-progress-item .prog-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.atb-progress-item .prog-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.atb-progress-item .prog-bar-fill.success { background: var(--success); }
.atb-progress-item .prog-bar-fill.error { background: var(--danger); }

.atb-progress-item .prog-stats {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  min-width: 70px;
  text-align: right;
}

.atb-progress-item .prog-status-badge {
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.prog-status-badge.running { background: #dbeafe; color: #1d4ed8; }
.prog-status-badge.done { background: #dcfce7; color: #16a34a; }
.prog-status-badge.failed { background: #fee2e2; color: #dc2626; }
.prog-status-badge.idle { background: #f1f5f9; color: #64748b; }

/* ==================== 账号任务进度芯片 ==================== */

.acct-task-cell {
  padding: 4px 8px;
  min-width: 190px;
  max-width: 230px;
  white-space: normal;
  text-align: left;
}

.acct-ar-cell {
  padding: 4px 8px;
  min-width: 50px;
  text-align: center;
}

.ar-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  font-size: 14px;
}

.ar-badge.active {
  background: #dcfce7;
  animation: ar-pulse 3s ease-in-out infinite;
}

.chat-automation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  flex: 0 0 auto;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  border: 1px solid transparent;
}

.chat-automation-badge > span:first-child { font-size: 13px; }
.chat-automation-badge-text { white-space: nowrap; }

.chat-automation-badge.connected {
  color: #166534;
  background: #dcfce7;
  border-color: #86efac;
}

.chat-automation-badge.connecting,
.chat-automation-badge.pending {
  color: #92400e;
  background: #fef3c7;
  border-color: #fcd34d;
}

.chat-automation-badge.paused {
  color: #475569;
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.chat-automation-badge.error {
  color: #b91c1c;
  background: #fee2e2;
  border-color: #fca5a5;
}

/* ==================== ChatBot 自动聊天 ==================== */
.chatbot-modal-content {
  width: min(520px, calc(100vw - 28px));
  border: 1px solid rgba(99, 102, 241, 0.18);
  overflow: hidden;
}

.chatbot-modal .modal-header {
  background: linear-gradient(135deg, #eef2ff 0%, #faf5ff 100%);
}

.chatbot-modal .modal-header h3 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #312e81;
}

.chatbot-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px;
  border: 1px solid #c7d2fe;
  border-radius: 10px;
  color: #3730a3;
  background: #eef2ff;
  font-size: 12px;
  font-weight: 600;
}

.chatbot-flow span {
  padding: 3px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.78);
}

.chatbot-flow b { color: #818cf8; font-size: 14px; }

.chatbot-desc {
  margin: 10px 1px;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
  line-height: 1.65;
}

.chatbot-account-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 25px;
  padding: 9px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 9px;
  background: var(--bg-secondary, #f8fafc);
}

.chatbot-account-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  max-width: 150px;
  padding: 3px 7px;
  overflow: hidden;
  border: 1px solid #dbeafe;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 11px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-account-chip-more { color: #475569; border-color: #e2e8f0; background: #f8fafc; }

.chatbot-current {
  min-height: 18px;
  margin: 7px 2px 16px;
  color: var(--text-secondary, #64748b);
  font-size: 12px;
}

.chatbot-enabled-toggle {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  cursor: pointer;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  background: var(--bg-secondary, #f8fafc);
}

.chatbot-enabled-toggle input { position: absolute; opacity: 0; pointer-events: none; }

.chatbot-toggle-ui {
  position: relative;
  flex: 0 0 34px;
  width: 34px;
  height: 20px;
  margin-top: 1px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background .18s ease;
}

.chatbot-toggle-ui::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .25);
  content: "";
  transition: transform .18s ease;
}

.chatbot-enabled-toggle input:checked + .chatbot-toggle-ui { background: #4f46e5; }
.chatbot-enabled-toggle input:checked + .chatbot-toggle-ui::after { transform: translateX(14px); }
.chatbot-enabled-toggle input:focus-visible + .chatbot-toggle-ui { outline: 2px solid #818cf8; outline-offset: 2px; }
.chatbot-enabled-toggle strong,
.chatbot-enabled-toggle small { display: block; }
.chatbot-enabled-toggle strong { color: var(--text-primary, #0f172a); font-size: 13px; }
.chatbot-enabled-toggle small { margin-top: 3px; color: var(--text-secondary, #64748b); font-size: 11px; line-height: 1.4; }

.chatbot-username-input {
  display: flex;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--border, #cbd5e1);
  border-radius: 8px;
  background: var(--bg-primary, #fff);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.chatbot-username-input:focus-within { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .12); }
.chatbot-username-input > span { padding: 0 0 0 11px; color: #64748b; font-weight: 700; }
.chatbot-username-input input { width: 100%; min-width: 0; padding: 9px 10px 9px 3px; border: 0; outline: 0; background: transparent; color: var(--text-primary, #0f172a); }
.chatbot-username-input input:disabled { cursor: not-allowed; color: #94a3b8; }

.chatbot-field-hint {
  margin: 6px 1px 0;
  color: var(--text-secondary, #64748b);
  font-size: 11px;
  line-height: 1.5;
}

.chatbot-field-hint.is-disabled { opacity: .58; }

.chatbot-form-error {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid #fecaca;
  border-radius: 7px;
  color: #b91c1c;
  background: #fef2f2;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 520px) {
  .chat-automation-badge-text { display: none; }
  .chat-automation-badge { width: 24px; padding: 0; }
  .chatbot-flow { justify-content: flex-start; font-size: 11px; }
  .chatbot-account-chip { max-width: 118px; }
}

@keyframes ar-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.acct-task-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 3px 8px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  font-size: 11px;
  margin-bottom: 3px;
  transition: opacity 0.5s ease;
}

.acct-task-chip.running { border-left: 2px solid var(--accent, #6366f1); }
.acct-task-chip.completed { border-left: 2px solid var(--success, #22c55e); background: #f0fdf4; }
.acct-task-chip.failed { border-left: 2px solid var(--danger, #ef4444); background: #fef2f2; }
.acct-task-chip.partial { border-left: 2px solid #d97706; background: #fffbeb; }
.acct-task-chip.cancelled, .acct-task-chip.skipped { border-left: 2px solid #71717a; background: #fafafa; }

.acct-chip-header {
  display: flex;
  align-items: center;
  gap: 4px;
}

.acct-chip-icon { font-size: 12px; }
.acct-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary, #475569);
  font-weight: 600;
}
.acct-chip-metrics {
  display: flex;
  align-items: center;
  gap: 7px;
  line-height: 1.2;
}
.acct-chip-success { color: var(--success, #22c55e); font-weight: 600; }
.acct-chip-failed { color: var(--danger, #ef4444); font-weight: 600; }
.acct-chip-skipped { color: #a16207; font-weight: 600; }
.acct-chip-silent { color: #c2410c; font-weight: 600; }
.acct-chip-progress { color: var(--text-muted, #94a3b8); margin-left: auto; }
.acct-chip-done { color: var(--text-secondary, #64748b); margin-left: auto; font-weight: 500; }

.acct-prog-bar {
  height: 3px;
  background: var(--border, #e2e8f0);
  border-radius: 2px;
  overflow: hidden;
}

.acct-prog-bar-fill {
  height: 100%;
  background: var(--accent, #6366f1);
  border-radius: 2px;
  transition: width 0.4s ease;
}

.acct-prog-bar-fill.success { background: var(--success, #22c55e); }
.acct-prog-bar-fill.error { background: var(--danger, #ef4444); }

.acct-task-chip-more {
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  padding: 2px 8px;
  text-align: center;
}

/* ==================== 队列排队徽章（账号行） ==================== */
.queue-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  margin-top: 2px;
  background: var(--bg-secondary, #f8fafc);
  border: 1px dashed var(--border, #e2e8f0);
  border-radius: 4px;
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  transition: border-color 0.15s;
}
.queue-badge:hover {
  border-color: var(--accent, #6366f1);
}
.queue-position {
  font-weight: 600;
  color: var(--accent, #6366f1);
  min-width: 18px;
}
.queue-icon {
  flex-shrink: 0;
}
.queue-label {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 80px;
}
.queue-status {
  font-size: 10px;
  opacity: 0.7;
}
.queue-cancel-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted, #94a3b8);
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  opacity: 0;
  transition: opacity 0.15s, color 0.15s;
}
.queue-badge:hover .queue-cancel-btn {
  opacity: 1;
}
.task-card .queue-cancel-btn {
  opacity: 1;
}
.queue-cancel-btn:hover {
  color: var(--danger, #ef4444);
}

/* 排队位置徽章（仪表板卡片内） */
.queue-position-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent, #6366f1);
  background: rgba(99, 102, 241, 0.1);
  border-radius: 10px;
  padding: 1px 8px;
}

/* 队列卡片样式 */
.task-card.queued {
  border-left: 3px dashed var(--border, #e2e8f0);
  opacity: 0.85;
}
.task-card.queued:hover {
  opacity: 1;
  border-left-color: var(--accent, #6366f1);
}

/* 排队描述文字 */
.queue-desc {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}

/* 排队数量徽章 */
.count-badge {
  font-size: 11px;
  font-weight: 600;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent, #6366f1);
  border-radius: 10px;
  padding: 0 6px;
  margin-left: 6px;
  line-height: 18px;
  display: inline-block;
}

/* "任务中" 筛选标签的脉冲指示器 */
.stats-tab.has-running::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #6366f1);
  margin-right: 4px;
  animation: pulse-dot 1.5s infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ==================== 任务中心面板布局 ==================== */
.nt-panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding: 0 2px;
}
.nt-panel-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #1e293b);
  margin: 0;
}
.nt-templates-card,
.nt-progress-card,
.nt-history-card {
  margin-top: 16px;
}

#newtask {
  flex-direction: column;
}
#newtask .nt-panel-toolbar { order: 0; }
#newtask .nt-progress-card {
  order: 1;
  margin-top: 0;
}
#newtask .task-launchpad {
  order: 2;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #dce3e8);
}
#newtask .nt-templates-card { order: 3; }
#newtask .nt-history-card { order: 4; }

.task-launchpad {
  padding: 2px 0 0;
}
.task-launchpad-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 0 0 10px;
  padding-left: 10px;
  border-left: 3px solid var(--primary, #2563eb);
}
.task-launchpad-heading h3 {
  margin: 0;
  color: var(--text-primary, #1e293b);
  font-size: 14px;
  font-weight: 700;
}
.task-launchpad-heading p {
  margin: 3px 0 0;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}
.task-tools-heading {
  margin-top: 24px;
  border-left-color: #0f766e;
}
.task-entry-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.task-tool-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.task-entry-card {
  --entry-tone: #2563eb;
  display: flex;
  min-width: 0;
  min-height: 86px;
  align-items: center;
  gap: 9px;
  padding: 11px;
  border: 1px solid var(--border, #dce3e8);
  border-left: 3px solid var(--entry-tone);
  border-radius: 6px;
  background: var(--bg-card, #fff);
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.task-entry-card:hover,
.task-entry-card:focus-visible {
  border-color: var(--entry-tone);
  background: color-mix(in srgb, var(--bg-card, #fff) 95%, var(--entry-tone) 5%);
  box-shadow: 0 2px 7px rgba(15, 23, 42, .09);
  outline: none;
}
#newtask .nt-progress-card .card-header {
  margin-bottom: 10px;
}
#newtask .nt-templates-card,
#newtask .nt-history-card {
  border-color: var(--border, #dce3e8);
  box-shadow: none;
}
.task-entry-icon {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  place-items: center;
  border-radius: 6px;
  background: color-mix(in srgb, var(--entry-tone) 12%, #fff);
  font-size: 17px;
}
.task-entry-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.task-entry-copy strong {
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-entry-copy small {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-muted, #64748b);
  font-size: 10px;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.task-entry-arrow {
  margin-left: auto;
  color: var(--entry-tone);
  font-size: 16px;
}
.tone-blue { --entry-tone: #2563eb; }
.tone-teal { --entry-tone: #0f766e; }
.tone-red { --entry-tone: #dc2626; }
.tone-amber { --entry-tone: #b45309; }
.tone-violet { --entry-tone: #7c3aed; }
.tone-green { --entry-tone: #15803d; }
.tone-cyan { --entry-tone: #0e7490; }
.tone-pink { --entry-tone: #be185d; }
.tone-slate { --entry-tone: #475569; }
.tone-orange { --entry-tone: #c2410c; }
.tone-indigo { --entry-tone: #4338ca; }
/* 可折叠标题 */
.section-subtitle.collapsible,
.card-header.collapsible {
  cursor: pointer;
  user-select: none;
}
.section-subtitle.collapsible:hover,
.card-header.collapsible:hover {
  opacity: 0.8;
}
.collapse-arrow {
  display: inline-block;
  font-size: 12px;
  transition: transform 0.2s;
  color: var(--text-muted, #94a3b8);
  margin-left: 4px;
}
.collapse-arrow.expanded {
  transform: rotate(90deg);
}
/* 折叠体 */
.collapsed {
  display: none;
}

/* ==================== 任务总览仪表盘 ==================== */
.task-overview {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 9px 0 11px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  color: var(--text-secondary, #64748b);
  font-size: 12px;
}
.task-status.partial { color: #a16207; background: #fef3c7; }
.task-status.cancelled, .task-status.skipped { color: #52525b; background: #f4f4f5; }
.task-overview strong { color: var(--text-primary, #1e293b); font-size: 14px; }
.task-overview .success strong { color: var(--success, #16a34a); }
.task-overview .skipped strong { color: #ca8a04; }
.task-overview .failed strong { color: var(--danger, #dc2626); }

.section-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.section-subtitle:first-child { margin-top: 0; }

.task-list {
  max-height: 400px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.task-list::-webkit-scrollbar { display: block; width: 4px; }
.task-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.task-list:empty + .empty-state { display: block; }
.task-list:not(:empty) + .empty-state { display: none; }

.task-card {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  padding: 12px 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.task-card:hover {
  border-color: var(--accent, #6366f1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.task-card.running { border-left: 3px solid var(--accent, #6366f1); }
.task-card.completed { border-left: 3px solid var(--success, #22c55e); opacity: 0.85; }
.task-card.failed { border-left: 3px solid var(--danger, #ef4444); opacity: 0.85; }
.task-card.partial { border-left: 3px solid #d97706; opacity: 0.9; }
.task-card.cancelled, .task-card.skipped { border-left: 3px solid #71717a; opacity: 0.85; }

.task-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.task-type-icon { font-size: 16px; flex-shrink: 0; }
.task-type-label { font-weight: 600; font-size: 13px; color: var(--text-primary, #1e293b); }
.task-session {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.task-status-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  font-weight: 500;
}
.task-status-badge.running { background: #dbeafe; color: #1d4ed8; }
.task-status-badge.completed { background: #dcfce7; color: #16a34a; }
.task-status-badge.failed { background: #fee2e2; color: #dc2626; }
.task-status-badge.partial { background: #fef3c7; color: #a16207; }
.task-status-badge.cancelled, .task-status-badge.skipped { background: #f4f4f5; color: #52525b; }

.task-progress-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.task-progress-bar {
  flex: 1;
  height: 6px;
  background: var(--border, #e2e8f0);
  border-radius: 3px;
  overflow: hidden;
}
.task-progress-fill {
  height: 100%;
  background: var(--accent, #6366f1);
  border-radius: 3px;
  transition: width 0.4s ease;
}
.task-progress-fill.success { background: var(--success, #22c55e); }
.task-progress-fill.error { background: var(--danger, #ef4444); }
.task-progress-text {
  font-size: 12px;
  color: var(--text-secondary, #64748b);
  white-space: nowrap;
  min-width: 40px;
  text-align: right;
}

.task-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
}
.task-stat.success { color: var(--success, #22c55e); }
.task-stat.skipped { color: #facc15; }
.task-stat.silent-deleted { color: #fb923c; }
.task-stat.failed { color: var(--danger, #ef4444); }
.task-stat.total-info { color: var(--text-muted, #94a3b8); font-weight: 500; }
.task-stat-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted, #94a3b8);
  background: rgba(100, 116, 139, 0.08);
  border-radius: 4px;
  padding: 1px 6px;
  letter-spacing: 0.5px;
}
.task-group-stats {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border, #e2e8f0);
}
.task-start-time { color: var(--text-muted, #94a3b8); margin-left: auto; }

.task-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}
.task-stop-btn { font-size: 11.5px !important; padding: 3px 10px !important; }

/* ==================== 批量操作工具栏 ==================== */
.selected-count-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--border, #e2e8f0);
  color: var(--text-muted, #94a3b8);
  transition: all 0.2s;
  white-space: nowrap;
  font-weight: 500;
}
.selected-count-badge.active {
  background: var(--accent, #6366f1);
  color: #fff;
}

/* 批量操作按钮栏 */
.batch-actions-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.batch-sep {
  width: 1px;
  height: 18px;
  background: var(--border, #e2e8f0);
  margin: 0 4px;
  flex-shrink: 0;
}
.btn-batch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 6px;
  background: var(--card-bg, #fff);
  color: var(--text-primary, #1e293b);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s, border-color 0.12s, box-shadow 0.12s;
}
.btn-batch:hover {
  background: var(--bg-hover, #f1f5f9);
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 1px rgba(99,102,241,0.15);
}
.btn-batch.danger {
  color: var(--danger, #ef4444);
}
.btn-batch.danger:hover {
  background: rgba(239,68,68,0.06);
  border-color: var(--danger, #ef4444);
}

/* 姓名输入行 */
.name-row {
  display: flex;
  gap: 8px;
}
.name-row input {
  flex: 1;
  min-width: 0;
}

/* 密码修改区域 */
.password-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.password-section input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-input, var(--bg-card));
  color: var(--text-primary);
}
.password-section input:focus {
  border-color: var(--accent);
  outline: none;
}
.password-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  padding: 4px 0 0;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 16px;
}
.radio-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-right: 16px;
  font-size: 13px;
  cursor: pointer;
}

/* ==================== 账号选择弹窗 ==================== */
.account-picker-modal {
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.account-picker-modal .modal-body {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.picker-group-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.picker-tab {
  padding: 5px 12px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: transparent;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  white-space: nowrap;
}
.picker-tab:hover { border-color: var(--accent); color: var(--accent); }
.picker-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.picker-tab.add-group-tab {
  border-style: dashed;
  opacity: 0.7;
}
.picker-tab.add-group-tab:hover { opacity: 1; }
.picker-tab .tab-count {
  display: inline-block;
  margin-left: 4px;
  font-size: 10px;
  opacity: 0.7;
}

.picker-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.picker-toolbar .search-input { flex: 1; }
.picker-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  color: var(--text-secondary);
}

.picker-account-list {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 180px;
  max-height: 340px;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.picker-account-list::-webkit-scrollbar { display: block; width: 4px; }
.picker-account-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.picker-account-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
.picker-account-item:last-child { border-bottom: none; }
.picker-account-item:hover { background: var(--accent-light); }
.picker-account-item.selected { background: var(--accent-light); }
.picker-account-item.unavailable {
  cursor: default;
  background: #f8fafc;
  opacity: 0.72;
}
.picker-account-item.unavailable:hover { background: #f8fafc; }
.picker-account-item.unavailable .picker-account-meta { color: #b45309; }
.picker-account-item input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}
.picker-account-info {
  flex: 1;
  min-width: 0;
}
.picker-account-name {
  font-size: 13px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.picker-account-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.picker-account-status {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}
.picker-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.picker-status-dot.normal { background: var(--success); }
.picker-status-dot.frozen { background: #f59e0b; }
.picker-status-dot.banned { background: var(--danger); }
.picker-status-dot.login_required { background: #a855f7; }
.picker-status-dot.error { background: #f97316; }
.picker-status-dot.unknown { background: var(--text-muted); }
.picker-status-dot.busy { background: var(--accent); }

.picker-footer-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}
.picker-empty {
  text-align: center;
  padding: 30px;
  color: var(--text-muted);
  font-size: 13px;
}

/* ==================== ATC 批量配置弹窗 ==================== */
.atc-batch-modal {
  max-width: 620px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}
.atc-batch-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding: 16px;
}
.atc-batch-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.atc-batch-summary-bar {
  padding: 8px 12px;
  margin-bottom: 10px;
  border-radius: var(--radius-md, 8px);
  background: var(--bg-secondary, #f8f8f8);
  font-size: 13px;
  color: var(--text-secondary, #475569);
}
.atc-batch-card {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-secondary);
  overflow: hidden;
  transition: var(--transition);
}
.atc-batch-card:hover {
  border-color: var(--accent-light, var(--accent));
}
.atc-batch-card.expanded {
  border-color: var(--accent);
}
.atc-batch-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  cursor: pointer;
  user-select: none;
}
.atc-batch-card-header:hover {
  background: var(--bg-tertiary, rgba(0,0,0,0.03));
}
.atc-batch-card-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.atc-batch-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.atc-batch-status-dot.configured { background: #22c55e; }
.atc-batch-status-dot.unconfigured { background: #f59e0b; }
.atc-batch-card-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.atc-batch-card-phone {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-left: 6px;
}
.atc-batch-summary {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  padding-left: 8px;
  white-space: nowrap;
}
.atc-batch-card-arrow {
  font-size: 10px;
  color: var(--text-muted);
  margin-left: 8px;
  transition: transform 0.2s;
}
.atc-batch-card.expanded .atc-batch-card-arrow {
  transform: rotate(180deg);
}
.atc-batch-card-body {
  display: none;
  padding: 0 14px 14px;
  border-top: 1px solid var(--border);
}
.atc-batch-card.expanded .atc-batch-card-body {
  display: block;
}
.atc-batch-card-body .form-group {
  margin-bottom: 10px;
}
.atc-batch-card-body label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.atc-batch-card-body textarea,
.atc-batch-card-body input[type="text"],
.atc-batch-card-body select {
  width: 100%;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: 8px;
}
.atc-batch-card-body textarea {
  min-height: 60px;
  resize: vertical;
}
.atc-batch-mode-direct,
.atc-batch-mode-forward,
.atc-batch-mode-post {
  transition: var(--transition);
}

/* ==================== 分组管理弹窗 ==================== */
.group-manager-modal {
  max-width: 500px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.group-manager-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.group-create-row {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}
.group-create-row .search-input { flex: 1; }

.group-manager-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.group-manager-item {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}
.group-manager-item:hover { border-color: var(--accent); }
.group-manager-item .group-name {
  flex: 1;
  font-size: 13px;
  font-weight: 500;
}
.group-manager-item .group-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-right: 8px;
}
.group-manager-item .group-actions {
  display: flex;
  gap: 4px;
}
.group-manager-item .group-actions button {
  padding: 3px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: transparent;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}
.group-manager-item .group-actions button:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.group-manager-item .group-actions button.danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

/* 分组编辑成员弹窗 */
.group-edit-modal {
  max-width: 460px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
}
.group-edit-modal .modal-body {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
}
.group-edit-account {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.group-edit-account:last-child { border-bottom: none; }
.group-edit-account input[type="checkbox"] {
  accent-color: var(--accent);
}

/* ====== 系统配置中心 ====== */
.settings-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 10px;
  padding: 3px;
  overflow-x: auto;
  position: sticky;
  top: 0;
  z-index: 30;
  flex-shrink: 0;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  box-shadow: 0 6px 10px -10px rgba(15, 23, 42, 0.45);
  scrollbar-width: none;
}
.settings-tabs::-webkit-scrollbar { display: none; }
.settings-tab {
  flex: 1 0 auto;
  min-width: 104px;
  padding: 7px 14px;
  border: 0;
  border-radius: calc(var(--radius) - 2px);
  background: transparent;
  color: var(--text-secondary);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.settings-tab:hover { color: var(--text-primary); }
.settings-tab.active {
  background: var(--card-bg);
  color: var(--accent);
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.settings-panel { display: none; }
.settings-panel.active { display: block; }
.settings-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

@media (max-width: 768px) {
  .settings-tabs { overflow-x: visible; }
  .settings-tab {
    flex: 1 1 25%;
    min-width: 0;
    padding: 7px 5px;
    font-size: 12px;
  }
}

/* 分组管理 - 创建行 */
.group-create-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 6px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.group-create-row input {
  flex: 1;
}

/* 分组管理列表 */
.group-manager-list {
  max-height: 500px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.group-manager-list::-webkit-scrollbar { display: block; width: 4px; }
.group-manager-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.group-manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  background: var(--card-bg);
  transition: all 0.15s;
}
.group-manager-item:hover {
  border-color: var(--accent);
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.group-manager-item .group-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.group-manager-item .group-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}
.group-manager-item .group-count {
  font-size: 12px;
  color: var(--text-muted);
}
.group-manager-item .group-stats {
  display: flex;
  gap: 6px;
  font-size: 11px;
  flex-wrap: wrap;
}
.group-manager-item .group-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.group-manager-item .group-actions button {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.group-manager-item .group-actions button:hover {
  background: var(--hover-bg);
  border-color: var(--accent);
  color: var(--text-primary);
}
.group-manager-item .group-actions button.danger {
  color: var(--danger);
  border-color: var(--danger);
}
.group-manager-item .group-actions button.danger:hover {
  background: var(--danger);
  color: #fff;
}
.g-stat { padding: 1px 6px; border-radius: 10px; }
.g-stat.ok { background: #e6f7e6; color: #2e7d32; }
.g-stat.warn { background: #fff3e0; color: #e65100; }
.g-stat.err { background: #fce4ec; color: #c62828; }
.g-stat.muted { background: #f3f3f3; color: #888; }

/* 代理管理 - 默认代理区块 */
.proxy-default-section {
  padding-bottom: 8px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-subtitle {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 8px 0;
}

/* ====== 账号状态统计栏 ====== */
.account-stats-bar {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
  gap: 4px;
  flex-wrap: wrap;
}
.stats-tabs {
  display: flex;
  gap: 3px;
  flex-wrap: wrap;
}
.stats-tab {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.stats-tab:hover {
  background: var(--hover-bg);
  border-color: var(--accent);
}
.stats-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.stats-tab span {
  display: inline-block;
  min-width: 16px;
  text-align: center;
  font-size: 11px;
  opacity: 0.85;
}

/* 统计附加信息 */
.stats-extras {
  display: flex;
  gap: 8px;
  margin-left: auto;
  align-items: center;
}
.stat-extra {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}
.stat-extra span {
  font-weight: 600;
  color: var(--text-secondary);
}
/* 可排序列 */
.data-table th.sortable {
  cursor: pointer;
  user-select: none;
  position: relative;
  padding-right: 18px;
}
.data-table th.sortable::after {
  content: '⇅';
  position: absolute;
  right: 4px;
  opacity: 0.3;
  font-size: 11px;
}
.data-table th.sortable.asc::after { content: '↑'; opacity: 0.7; }
.data-table th.sortable.desc::after { content: '↓'; opacity: 0.7; }

/* ====== 分组管理增强样式 ====== */
.group-manager-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.group-manager-item:last-child { border-bottom: none; }
.group-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 0;
}
.group-stats {
  display: inline-flex;
  gap: 4px;
  margin-left: 4px;
}
.g-stat {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  line-height: 1.4;
}
.g-stat.ok { background: #dcfce7; color: #16a34a; }
.g-stat.warn { background: #fef3c7; color: #d97706; }
.g-stat.err { background: #fee2e2; color: #dc2626; }
.g-stat.muted { background: #f1f5f9; color: #64748b; }

.group-manager-item .group-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.account-pool-strip {
  display: grid;
  grid-template-columns: auto auto minmax(100px, 1fr) 28px;
  align-items: center;
  gap: 16px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  background: #f7faf9;
  color: var(--text-secondary);
  font-size: 12px;
}

.pool-strip-state,
.pool-strip-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.pool-strip-metrics {
  gap: 14px;
}

.pool-strip-metrics span + span {
  padding-left: 14px;
  border-left: 1px solid var(--border);
}

.pool-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.pool-status-dot.active { background: #16a34a; }
.pool-status-dot.running { background: #0284c7; }
.pool-status-dot.error { background: #dc2626; }

.pool-level {
  height: 5px;
  overflow: hidden;
  border-radius: 3px;
  background: #dfe7e5;
}

.pool-level span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: #16866f;
  transition: width 0.2s ease;
}

.account-pool-modal-content {
  width: min(820px, calc(100vw - 32px));
  max-width: 820px;
  max-height: min(860px, calc(100vh - 32px));
}

.account-pool-modal-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pool-modal-runtime {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.pool-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pool-summary-grid > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px 12px;
}

.pool-summary-grid > div + div {
  border-left: 1px solid var(--border);
}

.pool-summary-grid span {
  color: var(--text-muted);
  font-size: 11px;
}

.pool-summary-grid strong {
  color: var(--text);
  font-size: 18px;
}

.pool-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  border-bottom: 1px solid var(--border);
}

.pool-section-heading h4 {
  font-size: 13px;
  font-weight: 600;
}

.pool-settings {
  border-bottom: 1px solid var(--border);
}

.pool-settings > summary {
  min-height: 34px;
  padding: 8px 2px;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.pool-settings-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 2px 0 12px;
}

.pool-config-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.pool-supplier-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(130px, .7fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.pool-supplier-grid .form-group { margin: 0; }
.pool-supplier-grid .btn { min-height: 36px; }
.pool-supplier-wide { grid-column: span 2; }
.pool-supplier-grid .supplier-protocol-config { grid-column: 1 / -1; margin-bottom: 0; }

.pool-config-grid .form-group {
  margin: 0;
}

.pool-config-wide {
  grid-column: span 2;
}

.pool-check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}

.pool-check-option input[type="checkbox"] {
  flex: 0 0 14px;
  width: 14px;
  height: 14px;
}

.pool-intake-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: 10px;
}

.pool-intake-grid .form-group { margin: 0; }

.pool-intake-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.pool-intake-batch { min-width: 0; }

.pool-pipeline-list,
.pool-event-list,
.pool-order-list {
  max-height: 170px;
  overflow: auto;
  border-bottom: 1px solid var(--border);
}

.pool-pipeline-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 92px minmax(160px, 1.5fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 7px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.pool-pipeline-row:first-child { border-top: 0; }
.pool-pipeline-label { min-width: 0; overflow-wrap: anywhere; }
.pool-pipeline-error { min-width: 0; color: #b45309; overflow-wrap: anywhere; }
.pool-pipeline-actions { display: flex; justify-content: flex-end; gap: 6px; }

.pool-entry-state {
  color: var(--text-secondary);
  font-weight: 600;
}

.pool-entry-state.accepted { color: #15803d; }
.pool-entry-state.failed { color: #b91c1c; }
.pool-entry-state.waiting_code,
.pool-entry-state.waiting_credentials,
.pool-entry-state.waiting_assignment { color: #0369a1; }

.pool-code-editor {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.pool-code-editor[hidden] { display: none; }

.pool-order-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(170px, 1fr) minmax(130px, .75fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 8px 4px;
  border-top: 1px solid var(--border);
  font-size: 12px;
}

.pool-order-row:first-child { border-top: 0; }
.pool-order-identifiers,
.pool-order-product,
.pool-order-updated { display: grid; min-width: 0; gap: 3px; }
.pool-order-identifiers strong,
.pool-order-product strong { overflow-wrap: anywhere; }
.pool-order-identifiers span,
.pool-order-product span,
.pool-order-updated small { color: var(--text-muted); }
.pool-order-product .pool-order-error { color: #b91c1c; overflow-wrap: anywhere; }
.pool-order-actions { display: flex; justify-content: flex-end; gap: 6px; }
.pool-order-state { font-weight: 600; }
.pool-order-state.pending { color: #0369a1; }
.pool-order-state.delivered { color: #15803d; }
.pool-order-state.failed { color: #b91c1c; }

.pool-order-detail {
  padding: 10px 0 2px;
  border-bottom: 1px solid var(--border);
}

.pool-order-detail[hidden] { display: none; }
.pool-order-detail-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pool-order-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 14px;
  padding: 10px 0;
}
.pool-order-detail-meta span { display: grid; gap: 2px; color: var(--text-muted); font-size: 11px; }
.pool-order-detail-meta strong { color: var(--text); font-size: 12px; overflow-wrap: anywhere; }
.pool-order-json {
  max-height: 280px;
  margin: 0 0 10px;
  padding: 10px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font: 11px/1.55 ui-monospace, SFMono-Regular, Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.pool-event-row {
  display: grid;
  grid-template-columns: 138px 58px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 4px;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
}

.pool-event-row:first-child { border-top: 0; }
.pool-event-row .error { color: #b91c1c; }
.pool-event-row .success { color: #15803d; }
.pool-empty { padding: 14px 4px; color: var(--text-muted); font-size: 12px; text-align: center; }

@media (max-width: 720px) {
  .account-pool-strip {
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 8px;
  }
  .pool-strip-metrics {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: space-between;
    white-space: normal;
  }
  .pool-level { grid-column: 1 / -1; }
  .account-pool-modal-content {
    width: 100vw;
    max-width: 100vw;
    max-height: 100vh;
  }
  .pool-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pool-summary-grid > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
  .pool-summary-grid > div:nth-child(4) { border-top: 1px solid var(--border); }
  .pool-config-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pool-supplier-grid { grid-template-columns: 1fr; }
  .pool-intake-grid { grid-template-columns: 1fr; }
  .pool-supplier-wide { grid-column: auto; }
  .pool-config-wide { grid-column: 1 / -1; }
  .pool-pipeline-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .pool-pipeline-error { grid-column: 1 / -1; }
  .pool-code-editor { grid-template-columns: 1fr 1fr; }
  .pool-event-row { grid-template-columns: 1fr; gap: 2px; }
  .pool-order-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pool-order-product,
  .pool-order-updated { grid-column: 1; }
  .pool-order-actions { grid-column: 2; grid-row: 1 / span 3; }
  .pool-order-detail-meta { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-pool-modal-content .modal-footer {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .account-pool-modal-content .modal-footer .btn {
    min-width: 0;
    width: 100%;
  }
}

.wiz-group-execution {
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--hover-bg);
  font-size: 12px;
  cursor: pointer;
}

.wiz-group-execution input {
  flex: 0 0 auto;
}

@media (max-width: 768px) {
  .group-manager-item {
    align-items: flex-start;
    flex-direction: column;
  }
  .group-manager-item .group-actions {
    justify-content: flex-start;
    width: 100%;
  }
}

/* 分组标签健康指示点 */
.tab-health-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-left: 4px;
  vertical-align: middle;
}

/* ====== 任务分配预览 ====== */
.dist-preview { padding: 4px 0; }
.dist-summary {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.dist-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.dist-row:last-child { border-bottom: none; }
.dist-name {
  min-width: 70px;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dist-badge { flex-shrink: 0; }
.dist-bar-wrap {
  flex: 1;
  height: 6px;
  background: var(--hover-bg);
  border-radius: 3px;
  overflow: hidden;
  min-width: 40px;
}
.dist-bar {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.3s;
}
.dist-count {
  min-width: 60px;
  text-align: right;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.dist-conflict {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 6px;
  font-size: 12px;
}
.conflict-icon { font-size: 14px; }
.conflict-tag {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #fef3c7;
  color: #d97706;
  white-space: nowrap;
}
.dist-row.conflict { opacity: 0.75; }

/* ====== 头像上传 ====== */
.avatar-upload-section {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.avatar-preview-wrap {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid var(--border);
  flex-shrink: 0;
}
.avatar-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--hover-bg);
  font-size: 28px;
}
.avatar-preview-wrap canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.avatar-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
.avatar-preview-wrap:hover .avatar-overlay { opacity: 1; }

.avatar-edit-panel {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.avatar-crop-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.avatar-crop-container canvas {
  border-radius: 50%;
  border: 2px solid var(--border);
  width: 200px;
  height: 200px;
  object-fit: cover;
}
.avatar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}
.avatar-controls label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.avatar-controls input[type="range"] {
  width: 100px;
  accent-color: var(--accent);
}

.group-avatar-upload-section {
  align-items: flex-start;
  padding-top: 4px;
}

.group-avatar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.group-avatar-actions .hint {
  flex-basis: 100%;
  margin-top: 2px;
}

.group-avatar-edit-panel {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  background: var(--hover-bg);
}

/* ==================== 群组管理 ==================== */
.group-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.group-toolbar > .search-input {
  flex: 0 0 180px;
  min-width: 120px;
  padding: 5px 10px;
  font-size: 13px;
}
.group-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  flex: 1;
  min-width: 0;
  align-items: center;
}
.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  line-height: 1.4;
}
.cat-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}
.cat-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.cat-tab span {
  font-size: 11px;
  opacity: 0.8;
}
.cat-manage-btn {
  border-style: dashed;
  color: var(--accent) !important;
  font-weight: 600;
}
.cat-manage-btn:hover {
  background: var(--accent) !important;
  color: #fff !important;
  border-style: solid;
}

/* 群组表格 */
.group-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.group-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.group-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--text-secondary);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.group-table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.group-table .gtg tr:last-child td {
  border-bottom: none;
}
.group-table .gtg-row:hover {
  background: rgba(99, 102, 241, 0.04);
}
.group-table .check-col {
  width: 36px;
  text-align: center;
}
.group-table .action-col {
  width: 80px;
  text-align: center;
}
.table-pagination {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 4px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.table-pagination[hidden] {
  display: none;
}
.pagination-actions {
  display: grid;
  grid-template-columns: 30px minmax(70px, auto) 30px;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.pagination-actions .btn-icon-sm {
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  opacity: 1;
}
.pagination-actions .btn-icon-sm:disabled {
  cursor: default;
  opacity: 0.35;
}
.picker-pagination {
  padding: 8px 2px 0;
  border-top: 1px solid var(--border);
}
.group-link-cell .group-link {
  color: var(--accent);
  text-decoration: none;
  font-family: monospace;
  font-size: 12px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
}
.group-link:hover {
  text-decoration: underline;
}
.group-cat-tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
}
.group-date-cell {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.group-cat-cell {
  white-space: nowrap;
}
.group-cat-tag {
  display: inline-block;
  padding: 2px 10px;
  font-size: 11px;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.group-cat-tag:hover {
  background: rgba(99, 102, 241, 0.2);
}
.gtg {
  border-bottom: 1px solid var(--border);
}
.gtg:last-of-type {
  border-bottom: none;
}
.gtg-header {
  cursor: pointer;
  user-select: none;
}
.gtg-header td {
  background: rgba(99, 102, 241, 0.04) !important;
  padding: 8px 12px;
}
.gtg-header:hover td {
  background: rgba(99, 102, 241, 0.08) !important;
}
.gtg-cat-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
.gtg-arrow {
  font-size: 10px;
  color: var(--text-muted);
  display: inline-block;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.gtg.expanded .gtg-arrow {
  transform: rotate(90deg);
}
.gtg-cat-check {
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
}
.gtg-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.gtg-cat-count {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  background: var(--border);
  border-radius: 10px;
  padding: 0 6px;
  line-height: 18px;
  flex-shrink: 0;
}
.gtg-row {
  display: none;
}
.gtg.expanded .gtg-row {
  display: table-row;
}
.gtg-row td {
  padding-left: 20px;
}
.gtg-row td.check-col {
  padding-left: 12px;
}
.btn-icon-sm {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.btn-icon-sm:hover {
  opacity: 1;
}

/* 群组库：分类区块与可扫描列表行。 */
.group-library-wrap {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  background: var(--card-bg, #fff);
}
.group-library-list {
  display: grid;
  min-width: 0;
}
.group-library-list:empty { display: none; }
.group-library-wrap:has(.group-library-list:empty) { border: 0; }
.group-library-wrap .empty-state { margin: 0; }
.group-library-list .gtg {
  min-width: 0;
  border-bottom: 1px solid var(--border);
}
.group-library-list .gtg:last-child { border-bottom: 0; }
.group-library-list .gtg-header {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  min-height: 40px;
  padding: 0 10px;
  background: color-mix(in srgb, var(--bg-muted, #f8fafc) 72%, var(--card-bg, #fff));
}
.gtg-selection,
.group-row-selection {
  display: grid;
  place-items: center;
  width: 26px;
  height: 28px;
}
.gtg-selection input,
.group-row-selection input { accent-color: var(--accent); }
.gtg-toggle {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  min-height: 40px;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}
.gtg-toggle:hover .gtg-cat-name { color: var(--accent); }
.group-library-list .gtg-arrow {
  color: var(--text-muted);
  font-size: 10px;
  transition: transform 0.15s ease;
}
.group-library-list .gtg.expanded .gtg-arrow { transform: rotate(90deg); }
.group-library-list .gtg-cat-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-library-list .gtg-cat-count {
  min-width: 22px;
  padding: 1px 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg, #fff);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 17px;
  text-align: center;
}
.gtg-selection-count {
  min-width: 38px;
  color: var(--accent);
  font-size: 11px;
  text-align: right;
}
.group-library-list .gtg-body { display: none; }
.group-library-list .gtg.expanded .gtg-body { display: grid; }
.group-library-list .gtg-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 10px;
  padding: 10px;
  border-top: 1px solid var(--border);
}
.group-library-list .gtg-row:hover { background: color-mix(in srgb, var(--hover-bg, #f8fafc) 80%, transparent); }
.group-library-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}
.group-library-title {
  overflow: hidden;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.group-library-list .group-link {
  display: block;
  overflow: hidden;
  max-width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: copy;
}
.group-library-list .group-link:hover { color: var(--accent); text-decoration: none; }
.group-row-actions {
  display: flex;
  align-items: center;
  gap: 3px;
}
.group-row-actions .btn-icon-sm {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 4px;
}
.group-row-actions .group-move-btn:hover,
.group-row-actions .group-edit-btn:hover {
  background: var(--bg-muted, #f1f5f9);
  color: var(--accent);
}
.group-row-actions .group-del-btn:hover {
  background: #fef2f2;
  color: var(--danger);
}

/* 群组采集结果：标题与来源信息分层，便于批量筛选后保存。 */
.scraper-results-list .result-item-detailed {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
}
.scraper-results-list .result-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}
.scraper-results-list .result-copy strong,
.scraper-results-list .result-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scraper-results-list .result-copy small { color: var(--text-muted); font-size: 11px; }
.scraper-results-list .result-quality {
  min-width: 28px;
  padding: 2px 5px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}

/* 批量操作栏 */
.group-batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-top: 10px;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 8px;
  border: 1px solid var(--border);
}
.group-batch-bar span {
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
}

/* 分类管理列表 */
.category-manage-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 250px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.category-manage-list::-webkit-scrollbar { display: block; width: 4px; }
.category-manage-list::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.cat-manage-item {
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-card);
}
.cat-manage-item .cat-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 500;
  font-size: 13px;
}
.cat-manage-item .cat-count {
  font-size: 12px;
  color: var(--text-secondary);
}
.cat-manage-item .cat-actions {
  display: flex;
  gap: 4px;
}

/* 内联输入组 */
.inline-input-group {
  display: flex;
  gap: 8px;
}
.inline-input-group input {
  flex: 1;
}
.input-with-btn {
  position: relative;
}
.input-with-btn input {
  width: 100%;
}

/* 群发面板内已保存群组 — 可折叠分类 */
.saved-groups-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px;
  margin-bottom: 8px;
  scrollbar-width: thin;
}
.saved-groups-list::-webkit-scrollbar { display: block; width: 4px; }
.saved-groups-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.sg-category {
  margin-bottom: 4px;
  border-radius: 4px;
}
.sg-cat-header {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  transition: background 0.15s ease;
}
.sg-cat-header:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}
.sg-cat-arrow {
  font-size: 10px;
  color: var(--text-muted);
  display: inline-block;
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.sg-category.expanded .sg-cat-arrow {
  transform: rotate(90deg);
}
.sg-cat-select-all {
  accent-color: var(--accent);
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.sg-cat-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-primary);
}
.sg-cat-count {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--border);
  border-radius: 10px;
  padding: 1px 8px;
  line-height: 18px;
  flex-shrink: 0;
}
.sg-cat-body {
  display: none;
  padding: 2px 0 2px 24px;
}
.sg-category.expanded .sg-cat-body {
  display: block;
}
.saved-group-item {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 4px;
  font-size: 13px;
}
.saved-group-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-group-item:hover {
  background: rgba(99, 102, 241, 0.06);
}
.saved-group-item input[type="checkbox"] {
  accent-color: var(--accent);
  margin: 0;
}

/* 加群面板 — 群组库选择器 */
.join-lib-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}
.join-lib-count {
  font-size: 12px;
  color: var(--text-muted);
}
.join-lib-count.has-selection {
  color: var(--accent);
  font-weight: 600;
}

/* 添加到群组库按钮（用于采集结果等面板） */
.save-to-library-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.save-to-library-btn:hover {
  background: var(--accent);
  color: #fff;
}

/* 标签内小按钮（从群组库加载等） */
.btn-link-sm {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  font-size: 11px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  margin-left: 8px;
  transition: all 0.15s;
  vertical-align: middle;
}
.btn-link-sm:hover {
  background: var(--accent);
  color: #fff;
}

/* 采集结果列表 */
.scraper-results-list {
  margin-top: 12px;
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px;
}
.scraper-results-list .result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 10px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.scraper-results-list .result-item > span:not(.result-link) {
  min-width: 0;
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.scraper-results-list .result-item:last-child {
  border-bottom: none;
}
.scraper-results-list .result-item:hover {
  background: rgba(99, 102, 241, 0.04);
}

/* PostBot 帖子管理 */
.post-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.post-toolbar-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.post-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.post-selected-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  font-size: 11px;
  font-family: monospace;
  font-weight: 600;
  border-radius: 10px;
  background: rgba(99, 102, 241, 0.12);
  color: var(--accent, #6366f1);
}
.post-selected-badge::before {
  content: "\2713";
  font-size: 10px;
}

/* 群组权限限制标签 */
.restriction-badges {
  display: inline-flex;
  gap: 3px;
  flex-wrap: wrap;
  vertical-align: middle;
  margin-left: 4px;
}

.restriction-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  padding: 2px 5px;
  border-radius: 3px;
  white-space: nowrap;
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.restriction-badge.banned {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.3);
}

.restriction-badge.restricted {
  background: rgba(251, 146, 60, 0.15);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.3);
}

.restriction-badge.ok {
  background: rgba(74, 222, 128, 0.12);
  color: #4ade80;
  border-color: rgba(74, 222, 128, 0.25);
}

/* ── 退群面板群组列表 ── */
.leave-group-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  max-height: clamp(280px, 48vh, 560px);
  padding: 8px;
  overflow-x: hidden !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(100,116,139,0.45) transparent;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.leave-group-list:focus-visible { outline: 2px solid var(--accent, #6366f1); outline-offset: 2px; }
.leave-group-list::-webkit-scrollbar { display: block; width: 8px; }
.leave-group-list::-webkit-scrollbar-track { background: transparent; }
.leave-group-list::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,0.4);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}
.leave-group-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100,116,139,0.65);
  border: 2px solid transparent;
  background-clip: padding-box;
}
.leave-group-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background 0.15s;
  cursor: pointer;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.leave-group-item + .leave-group-item { border-top: 1px solid rgba(148,163,184,0.08); }
.leave-group-item:hover { background: var(--bg-secondary, #f1f5f9); }
.leave-group-item > input[type="checkbox"] { flex-shrink: 0; accent-color: var(--accent, #6366f1); width: 16px; height: 16px; }
.leave-group-icon { font-size: 15px; flex-shrink: 0; width: 20px; text-align: center; }
.leave-group-info { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.leave-group-title { font-weight: 500; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #1e293b; }
.leave-group-link { font-size: 11px; color: #94a3b8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 按账号分组 */
.leave-account-section {
  /* 保持每个账号区块的自然高度，超出部分交给外层列表滚动，避免后面的账号被压缩裁切。 */
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  margin-bottom: 6px;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
}
.leave-account-header {
  display: flex; align-items: center; gap: 8px;
  min-height: 42px;
  min-width: 0;
  width: 100%;
  padding: 10px 12px; cursor: pointer;
  background: var(--accent-light, #eef2ff); font-size: 13px; font-weight: 600;
  user-select: none; border-bottom: 1px solid transparent;
  overflow: hidden;
}
.leave-account-header[aria-expanded="true"] { border-bottom-color: var(--border, #e2e8f0); }
.leave-account-header:hover { filter: brightness(0.97); }
.leave-account-toggle {
  font-size: 12px; color: var(--text-secondary, #64748b);
  width: 16px; text-align: center; flex-shrink: 0; transition: transform 0.2s;
}
.leave-account-name {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 13px;
}
.leave-account-count {
  font-size: 11px; font-weight: 500; color: var(--accent, #6366f1);
  background: rgba(99,102,241,0.08); padding: 2px 8px; border-radius: 10px;
  white-space: nowrap; flex-shrink: 0;
}
.leave-account-all {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 400; cursor: pointer;
  color: var(--text-secondary, #64748b); white-space: nowrap; flex-shrink: 0;
}
.leave-account-all input { flex-shrink: 0; accent-color: var(--accent); }
.leave-account-body {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 4px 8px;
  box-sizing: border-box;
}
.leave-account-body.collapsed { display: none; }

#leave,
#leave .card,
#leave .toolbar-bar,
#leave .select-bar,
#leave .form-row,
#leave .action-bar {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* 可选择/可筛选列表统一限制在所属卡片或弹窗内。 */
.picker-account-list,
.group-manager-list,
.group-member-list,
.category-manage-list,
.saved-groups-list,
.scraper-results-list,
.task-list,
.wiz-acct-list {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  box-sizing: border-box;
}

.task-log {
  background: var(--bg-primary, #0f172a);
  color: var(--text-primary, #e2e8f0);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 12px;
  font-family: "SF Mono", "Fira Code", monospace;
  max-height: 180px;
  overflow-y: auto;
  line-height: 1.6;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.task-log::-webkit-scrollbar { display: block; width: 4px; }
.task-log::-webkit-scrollbar-track { background: transparent; }
.task-log::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.task-log::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.45); }

.task-log .log-success { color: #4ade80; }
.task-log .log-error { color: #f87171; }
.task-log .log-warning { color: #fbbf24; }
.task-log .log-info { color: #94a3b8; }

.backend-log-content {
  width: 100%;
  height: 60vh;
  overflow-y: auto;
  overflow-x: auto;
  background: #0a0e17;
  color: #c8d6e5;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", "Consolas", monospace;
  font-size: 12px;
  line-height: 1.65;
  padding: 12px 16px;
  margin: 0;
  white-space: pre;
  tab-size: 4;
  border: none;
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(148,163,184,0.25) transparent;
}
.backend-log-content::-webkit-scrollbar { display: block; width: 5px; height: 5px; }
.backend-log-content::-webkit-scrollbar-track { background: transparent; }
.backend-log-content::-webkit-scrollbar-thumb { background: rgba(148,163,184,0.25); border-radius: 2px; }
.backend-log-content::-webkit-scrollbar-thumb:hover { background: rgba(148,163,184,0.45); }

.backend-log-content .log-line-error {
  color: #f87171;
  background: rgba(248, 113, 113, 0.06);
}

.backend-log-content .log-line-warning {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.04);
}

.backend-log-content .log-line-info {
  color: #c8d6e5;
}

.backend-log-content mark.log-highlight {
  background: rgba(250, 204, 21, 0.35);
  color: #fef9c3;
  border-radius: 2px;
  padding: 0 2px;
}

.backend-log-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  background: var(--bg-secondary, #1e293b);
  border-top: 1px solid var(--border-color, #334155);
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

.log-file-info {
  font-family: monospace;
}

.log-match-info {
  color: var(--accent, #6366f1);
  font-weight: 500;
}

/* ==================== 结构化终端日志 ==================== */
.log-footer {
  padding: 10px 20px 12px;
  max-height: 230px;
  overflow: hidden;
}

.log-header {
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}

.log-title {
  white-space: nowrap;
}

.log-actions {
  align-items: center;
  margin-left: auto;
  min-width: 0;
}

.log-visible-count {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.terminal-log-search {
  width: 150px;
  min-width: 90px;
  height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg);
  color: var(--text-primary);
  font: inherit;
  font-size: 11px;
}

.terminal-log-search:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(99, 102, 241, 0.12);
}

.terminal-log-stream {
  height: 154px;
  overflow: auto;
  background: #10151d;
  color: #d9e2ec;
  border: 1px solid #283241;
  border-radius: 6px;
  font-family: "SF Mono", "Fira Code", "Cascadia Code", Consolas, monospace;
  font-size: 12px;
  line-height: 1.45;
  scrollbar-width: thin !important;
  scrollbar-color: #42526a transparent !important;
}

.terminal-log-stream::-webkit-scrollbar,
.backend-log-content::-webkit-scrollbar {
  display: block;
  width: 7px;
  height: 7px;
}

.terminal-log-stream::-webkit-scrollbar-thumb,
.backend-log-content::-webkit-scrollbar-thumb {
  background: #42526a;
  border-radius: 4px;
}

.terminal-log-row {
  display: grid;
  grid-template-columns: 74px 46px minmax(100px, 180px) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 29px;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.terminal-log-row:last-child {
  border-bottom: 0;
}

.terminal-log-row:hover,
.backend-log-row:hover {
  background: rgba(148, 163, 184, 0.08);
}

.terminal-log-time,
.backend-log-time {
  color: #7f8ea3;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.backend-log-time {
  display: flex;
  gap: 7px;
}

.terminal-log-level,
.backend-log-level {
  display: inline-flex;
  justify-content: center;
  min-width: 42px;
  padding: 1px 4px;
  border-radius: 3px;
  background: #263244;
  color: #b8c5d6;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
}

.terminal-log-source,
.backend-log-source {
  overflow: hidden;
  color: #93a7be;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-log-operation { display: none; }

.terminal-log-message,
.backend-log-message {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #d9e2ec;
  white-space: pre-wrap;
}

.terminal-log-row.log-error,
.backend-log-row.log-error {
  background: rgba(239, 68, 68, 0.09);
}

.terminal-log-row.log-warning,
.backend-log-row.log-warning {
  background: rgba(245, 158, 11, 0.07);
}

.log-error .terminal-log-level,
.log-error .backend-log-level {
  background: #7f1d1d;
  color: #fecaca;
}

.log-warning .terminal-log-level,
.log-warning .backend-log-level {
  background: #713f12;
  color: #fde68a;
}

.log-success .terminal-log-level {
  background: #14532d;
  color: #bbf7d0;
}

.terminal-log-empty {
  display: grid;
  height: 100%;
  place-items: center;
  color: #718096;
}

.backend-log-content {
  height: min(64vh, 680px);
  padding: 0;
  white-space: normal;
}

.backend-log-row {
  display: grid;
  grid-template-columns: 138px 64px minmax(130px, 220px) minmax(0, 1fr);
  gap: 10px;
  min-height: 30px;
  padding: 5px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

.backend-log-level {
  min-width: 60px;
}

.backend-log-row.log-trace {
  grid-template-columns: 1fr;
  padding-left: 288px;
  color: #8fa1b6;
}

/* ==================== 移动端布局收口 ==================== */
@media (max-width: 768px) {
  body,
  .app-container,
  .main-content {
    height: 100dvh;
  }

  .topbar {
    min-height: 58px;
    padding: 8px 10px;
  }

  .topbar-left {
    min-width: 0;
    flex: 1;
  }

  .panel-title {
    overflow: hidden;
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .panel-desc {
    overflow: hidden;
    max-width: 60vw;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .content-area {
    padding: 10px;
    overscroll-behavior: contain;
  }

  .card {
    border-radius: 6px;
    box-shadow: var(--shadow-sm);
  }

  .modal {
    align-items: flex-end;
  }

  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94dvh;
    border-radius: 8px 8px 0 0 !important;
  }

  .global-status-bar {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    min-height: 38px;
    padding: 6px 10px;
  }

  .status-bar-left,
  .status-bar-right,
  .status-bar-tasks {
    flex: 0 0 auto;
    width: auto;
    max-height: none;
    flex-wrap: nowrap;
  }

  .log-footer {
    max-height: 218px;
    padding: 7px 8px 8px;
  }

  .log-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 8px;
  }

  .log-tabs {
    justify-self: end;
    min-width: 0;
    flex-wrap: nowrap;
  }

  .log-actions {
    grid-column: 1 / -1;
    width: 100%;
    gap: 5px;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .terminal-log-search {
    flex: 1 1 140px;
    width: auto;
  }

  .log-actions .btn {
    white-space: nowrap;
  }

  .terminal-log-stream {
    height: 125px;
    font-size: 11px;
  }

  .terminal-log-row {
    grid-template-columns: 58px 40px minmax(0, 1fr);
    gap: 6px;
    padding: 5px 7px;
  }

  .terminal-log-source {
    display: none;
  }

  .terminal-log-operation {
    display: inline;
    color: #93a7be;
    font-weight: 600;
  }

  .terminal-log-level {
    width: 100%;
    min-width: 0;
  }

  .terminal-log-message {
    line-height: 1.45;
  }

  .backend-log-content {
    height: 64dvh;
    font-size: 11px;
  }

  .backend-log-row {
    grid-template-columns: 58px 62px minmax(0, 1fr);
    gap: 8px;
    padding: 6px 8px;
  }

  .backend-log-time {
    display: block;
  }

  .backend-log-date { display: none; }
  .backend-log-level {
    width: 100%;
    min-width: 0;
  }

  .backend-log-source {
    display: none;
  }

  .backend-log-row.log-trace {
    grid-template-columns: 1fr;
    padding-left: 144px;
  }

  .backend-log-footer {
    gap: 8px;
  }

  .log-file-info {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 420px) {
  .panel-desc,
  .log-visible-count {
    display: none;
  }

  .content-area {
    padding: 8px 6px;
  }

  .log-footer {
    max-height: 218px;
  }

  .terminal-log-stream {
    height: 104px;
  }

  .backend-log-row.log-trace {
    padding-left: 8px;
  }
}

/* ==================== 任务模板 ==================== */
.templates-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  padding: 12px 0;
}

.template-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  padding: 14px 16px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.template-card:hover {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.08);
}
.template-card.invalid {
  border-color: rgba(220, 38, 38, 0.45);
}
.template-card.invalid:hover { border-color: var(--danger, #dc2626); }
.tpl-last-result {
  display: inline-block;
  margin-top: 3px;
  font-weight: 600;
}
.tpl-last-result.success { color: var(--success, #16a34a); }
.tpl-last-result.failed { color: var(--danger, #dc2626); }
.tpl-last-result.warning { color: #a16207; }
.tpl-last-result.muted { color: #52525b; }

.template-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.template-card-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #1e293b);
}

.template-card-type {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #64748b);
}

.template-card-meta {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  margin-bottom: 10px;
}

.template-card-accounts {
  margin-bottom: 10px;
  font-size: 12px;
}

.tpl-acct-empty {
  color: var(--text-muted, #94a3b8);
  font-size: 11px;
}

.tpl-acct-label {
  font-weight: 600;
  color: var(--text-secondary, #64748b);
  font-size: 11px;
}

.tpl-acct-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.tpl-acct-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg-muted, #f1f5f9);
  font-size: 11px;
  color: var(--text-secondary, #475569);
  white-space: nowrap;
}
.tpl-acct-chip.configured {
  background: rgba(34, 197, 94, 0.1);
  color: var(--success, #16a34a);
}

.tpl-acct-chip .chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tpl-acct-chip .chip-dot.normal { background: var(--success); }
.tpl-acct-chip .chip-dot.frozen { background: var(--warning); }
.tpl-acct-chip .chip-dot.banned { background: var(--danger); }
.tpl-acct-chip .chip-dot.login_required { background: #a855f7; }
.tpl-acct-chip .chip-dot.error { background: #f97316; }
.tpl-acct-chip .chip-dot.unknown { background: var(--text-muted); }

.tpl-acct-empty {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  padding: 4px 0;
}

.template-card-actions {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.template-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 1 1 auto;
  min-width: 0;
  gap: 6px;
}

.template-primary-actions .btn {
  width: 100%;
  font-size: 12px;
  padding: 5px 10px;
}

.template-primary-actions .tpl-launch-btn,
.template-primary-actions .tpl-atc-btn {
  grid-column: 1 / -1;
}

.template-utility-actions {
  display: grid;
  grid-auto-rows: minmax(30px, 1fr);
  flex: 0 0 30px;
  width: 30px;
  gap: 6px;
}

.template-utility-actions .template-quick-icon {
  width: 30px;
  min-width: 30px;
  padding-left: 0;
  padding-right: 0;
}

/* ── 模板卡片运行中状态 ── */
.template-card.has-running {
  border-color: var(--primary, #6366f1);
  box-shadow: 0 0 0 1px rgba(99, 102, 241, 0.2);
}
.tpl-running-badge {
  display: inline-block;
  font-size: 11px;
  color: #22c55e;
  animation: pulse-running 2s ease-in-out infinite;
}
@keyframes pulse-running {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.tpl-running-section {
  margin: 6px 0;
  padding: 8px;
  background: rgba(99, 102, 241, 0.06);
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.15);
}
.tpl-running-progress {
  position: relative;
  height: 20px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}
.tpl-running-bar {
  position: absolute;
  top: 0; left: 0; bottom: 0;
  background: linear-gradient(90deg, #6366f1, #818cf8);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.tpl-running-text {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-primary, #e2e8f0);
}
.tpl-running-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.tpl-running-controls .btn {
  font-size: 11px;
  padding: 3px 8px;
  flex: none;
}
.tpl-runtime-utility {
  display: inline-flex;
  gap: 4px;
  margin-left: auto;
}
.tpl-runtime-utility .btn {
  min-width: 28px;
  padding-left: 6px;
  padding-right: 6px;
}
.tpl-queued-section {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0;
  padding: 8px;
  border: 1px solid rgba(161, 98, 7, 0.3);
  background: rgba(234, 179, 8, 0.08);
  border-radius: 6px;
}
.tpl-queued-summary {
  color: #854d0e;
  font-size: 12px;
  font-weight: 600;
}
.template-card.has-queued {
  border-color: rgba(161, 98, 7, 0.45);
}
.template-sync-status {
  min-height: 20px;
  color: var(--text-muted, #64748b);
  font-size: 12px;
}
.template-sync-status.loading { color: var(--text-muted, #64748b); }
.template-sync-status.ready { color: var(--success, #16a34a); }
.template-sync-status.error { color: var(--danger, #dc2626); }
.template-refresh-btn {
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
}
.task-card.template-task-focus {
  outline: 2px solid var(--primary, #6366f1);
  outline-offset: 2px;
}

.empty-hint {
  font-size: 12px;
  margin-top: 8px;
  color: var(--text-muted, #94a3b8);
}

.wizard-empty-btn {
  margin-top: 16px;
  font-size: 16px;
  padding: 12px 32px;
}

/* ==================== 新建任务向导 ==================== */
.wizard-modal {
  max-width: 680px;
  width: 95vw;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}

.wizard-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 12px 20px 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 6px;
  opacity: 0.45;
  transition: opacity 0.2s;
}

.wizard-step.active,
.wizard-step.done {
  opacity: 1;
}

.wizard-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--bg-muted, #f1f5f9);
  color: var(--text-muted, #64748b);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
}

.wizard-step.active .wizard-step-num {
  background: var(--primary, #6366f1);
  color: #fff;
}

.wizard-step.done .wizard-step-num {
  background: #10b981;
  color: #fff;
}

.wizard-step-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary, #1e293b);
}

.wizard-step-line {
  width: 40px;
  height: 2px;
  background: var(--border, #e2e8f0);
  margin: 0 8px;
}

.wizard-hint {
  text-align: center;
  color: var(--text-muted, #64748b);
  margin-bottom: 16px;
  font-size: 14px;
}

/* 类型选择卡片 */
.wizard-type-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.wizard-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 20px 12px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}

.wizard-type-card:hover {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.04);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.wizard-type-card.selected {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 2px var(--primary, #6366f1);
}

.wizard-type-icon {
  font-size: 32px;
  line-height: 1;
}

.wizard-type-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary, #1e293b);
}

.wizard-type-desc {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
}

/* 向导表单 */
#wizardFormContainer .task-submit-section-title {
  font-size: 13px;
  font-weight: 600;
  margin: 12px 0 8px;
  color: var(--text-primary, #1e293b);
}

#wizardFormContainer .form-group {
  margin-bottom: 10px;
}

#wizardFormContainer textarea {
  min-height: 60px;
}

/* 向导底部按钮 */
.wizard-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-footer-spacer {
  flex: 1;
}

@media (max-width: 600px) {
  .task-entry-grid,
  .task-tool-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .task-entry-card {
    min-height: 76px;
    padding: 9px;
    gap: 7px;
  }
  .task-entry-copy strong { font-size: 11px; }
  .task-entry-copy small { font-size: 9px; }
  .task-entry-arrow { display: none; }
  .wizard-type-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 向导内嵌账号选择区 ===== */
.wiz-acct-section {
  margin-top: 16px;
  border-top: 1px solid var(--border, #e2e8f0);
  padding-top: 12px;
}
.wiz-acct-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.wiz-acct-count {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
}
.wiz-acct-groups {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.wiz-acct-group-tab {
  padding: 3px 10px;
  border-radius: 12px;
  border: 1px solid var(--border, #e2e8f0);
  background: transparent;
  color: var(--text-muted, #64748b);
  font-size: 11px;
  cursor: pointer;
  transition: all .15s;
}
.wiz-acct-group-tab:hover {
  border-color: var(--primary, #6366f1);
  color: var(--primary, #6366f1);
}
.wiz-acct-group-tab.active {
  background: var(--primary, #6366f1);
  border-color: var(--primary, #6366f1);
  color: #fff;
}
.wiz-acct-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.wiz-acct-item {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 0;
  max-width: 100%;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  background: var(--bg-card, #fff);
  font-size: 12px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.wiz-acct-item:hover {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.04);
}
.wiz-acct-item:has(.wiz-acct-cb:checked) {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.08);
}
.wiz-acct-cb {
  width: 14px;
  height: 14px;
  accent-color: var(--primary, #6366f1);
}
.wiz-acct-dot {
  font-size: 10px;
  line-height: 1;
}
.wiz-acct-name {
  min-width: 0;
  overflow: hidden;
  font-weight: 500;
  color: var(--text, #1e293b);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wiz-acct-item.unavailable {
  cursor: default;
  border-color: #e5e7eb;
  background: #f8fafc;
  opacity: 0.76;
}
.wiz-acct-item.unavailable:hover {
  border-color: #e5e7eb;
  background: #f8fafc;
}
.wiz-acct-reason {
  max-width: 180px;
  overflow: hidden;
  color: #b45309;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.wiz-acct-reason.busy { color: #0369a1; }
.wiz-acct-phone {
  min-width: 0;
  overflow: hidden;
  font-size: 10px;
  color: var(--text-muted, #94a3b8);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-xs {
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 4px;
}

/* ===== 验证码弹窗 ===== */
#loginCodeModal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-login-code);
  align-items: center;
  justify-content: center;
}
#loginCodeModal.show {
  display: flex;
}
.login-code-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
}
.login-code-popup {
  position: relative;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  padding: 28px 32px;
  min-width: 320px;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  text-align: center;
  animation: lcp-pop .2s ease-out;
}
@keyframes lcp-pop {
  from { transform: scale(0.9); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.lcp-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 12px;
}
.lcp-icon {
  font-size: 22px;
}
.lcp-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #1e293b);
}
.lcp-account {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin-bottom: 20px;
}
.lcp-acct-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, #334155);
}
.lcp-acct-phone {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
}
.lcp-code-box {
  background: var(--primary, #6366f1);
  border-radius: 12px;
  padding: 16px 20px;
  cursor: pointer;
  transition: transform .1s, box-shadow .1s;
  user-select: none;
}
.lcp-code-box:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
}
.lcp-code-box:active {
  transform: scale(0.98);
}
.lcp-code {
  display: block;
  font-size: 36px;
  font-weight: 700;
  letter-spacing: 8px;
  color: #fff;
  font-family: 'Consolas', 'Courier New', monospace;
}
.lcp-copy-hint {
  display: block;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}
.lcp-time {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  margin-top: 14px;
}
.lcp-close-btn {
  margin-top: 16px;
  width: 100%;
  padding: 10px;
  font-size: 14px;
}

/* ===== 广告词生成器 Modal ===== */
.ag-overlay {
  position: fixed; inset: 0; z-index: var(--z-modal-child);
  background: rgba(15, 23, 42, 0.48); backdrop-filter: blur(4px);
  display: flex; align-items: flex-start; justify-content: center;
  overflow-y: auto; padding: 24px 12px;
}
.ag-modal {
  width: 100%; max-width: 580px; padding: 22px;
  border: 1px solid #dbe3e7; border-radius: 12px;
  background: #fff; color: #1e293b;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25); animation: fadeIn 0.2s ease-out;
}
.ag-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; }
.ag-header h2 { font-size: 18px; color: #1e293b; margin: 0; }
.ag-close { width: 36px; height: 36px; padding: 0; border: none; border-radius: 50%; background: #f1f5f7; color: #52616a; font-size: 22px; cursor: pointer; }
.ag-close:hover { background: #e7edf0; color: #17212b; }
.ag-body { display: flex; flex-direction: column; gap: 14px; }
.ag-section label { display: block; font-size: 13px; font-weight: 600; color: #40515b; margin-bottom: 8px; }
.ag-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ag-field label { display: block; font-size: 13px; font-weight: 600; color: #40515b; margin-bottom: 6px; }
.ag-field input, .ag-field select {
  width: 100%; padding: 9px 12px; background: #f8fafb;
  border: 1px solid #d8e1e5; border-radius: 8px;
  color: #1e293b; font-size: 13px; outline: none;
}
.ag-field input:focus, .ag-field select:focus { border-color: #229ed9; box-shadow: 0 0 0 2px rgba(34,158,217,0.14); }
.ag-field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
.ag-field select option { background: #fff; color: #1e293b; }
/* 类目网格 */
.ag-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 8px; }
.ag-cat-btn {
  display: flex; min-height: 72px; padding: 10px 6px; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px solid #dce4e8; border-radius: 8px; background: #f8fafb;
  color: #52616a; cursor: pointer; transition: all 0.2s;
}
.ag-cat-btn:hover { background: #eef6fa; border-color: #9ecfe5; }
.ag-cat-btn.active { background: #e3f3fa; border-color: #229ed9; color: #0f6f98; box-shadow: inset 0 0 0 1px #229ed9; }
.ag-cat-icon { font-size: 22px; }
.ag-cat-name { font-size: 11px; font-weight: 600; }
/* 风格标签 */
.ag-style-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ag-style-tag {
  min-height: 34px; padding: 6px 13px; border: 1px solid #d8e1e5; border-radius: 17px;
  background: #fff; color: #52616a; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.ag-style-tag:hover { background: #eef6fa; color: #0f6f98; }
.ag-style-tag.active { background: #229ed9; border-color: #229ed9; color: #fff; font-weight: 600; }
/* 生成按钮 */
.ag-generate {
  width: 100%; padding: 13px; margin-top: 6px;
  background: #168bc3;
  border: none; border-radius: 10px; color: #fff; font-size: 16px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; letter-spacing: 0;
}
.ag-generate:hover { background: #117caf; box-shadow: 0 5px 16px rgba(22,139,195,0.24); }
.ag-generate:active { transform: translateY(0); }
/* 结果区域 */
.ag-results-header { display: flex; justify-content: space-between; align-items: center; margin: 18px 0 12px; }
.ag-results-header h3 { font-size: 16px; color: #1e293b; margin: 0; }
.ag-regen {
  background: #f8fafb; border: 1px solid #d8e1e5;
  border-radius: 17px; padding: 6px 14px; color: #52616a; font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.ag-regen:hover { background: #edf3f6; color: #17212b; }
.ag-result-card {
  background: #f8fafb; border: 1px solid #dce4e8;
  border-radius: 8px; padding: 14px; margin-bottom: 9px; transition: all 0.2s; animation: fadeIn 0.3s ease-out;
}
.ag-result-card:hover { border-color: #9ecfe5; box-shadow: 0 3px 10px rgba(15,23,42,0.08); }
.ag-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ag-card-num { font-size: 11px; font-weight: 700; color: #0f6f98; background: #e3f3fa; padding: 2px 8px; border-radius: 8px; }
.ag-copy-btn {
  background: #fff; border: 1px solid #d8e1e5;
  border-radius: 6px; padding: 4px 10px; color: #52616a; font-size: 12px; cursor: pointer; transition: all 0.2s;
}
.ag-copy-btn:hover { background: #edf3f6; color: #17212b; }
.ag-card-body { margin-bottom: 10px; color: #1e293b; font-size: 16px; font-weight: 600; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-insert-btn {
  background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); border-radius: 6px;
  padding: 5px 12px; color: #10b981; font-size: 12px; cursor: pointer; transition: all 0.2s; width: 100%;
}
.ag-insert-btn:hover { background: rgba(16,185,129,0.25); }
.ag-insert-all {
  width: 100%; padding: 11px; margin-top: 10px;
  background: linear-gradient(135deg, #10b981, #059669);
  border: none; border-radius: 10px; color: #fff; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s;
}
.ag-insert-all:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(16,185,129,0.4); }
/* 广告词生成按钮 (嵌入表单) */
.ag-trigger-btn {
  background: linear-gradient(135deg, #ff6b6b, #ff8e53); border: none; border-radius: 6px;
  padding: 4px 10px; color: #fff; font-size: 11px; font-weight: 600; cursor: pointer;
  margin-left: 8px; vertical-align: middle; transition: all 0.2s;
}
.ag-trigger-btn:hover { transform: translateY(-1px); box-shadow: 0 3px 10px rgba(255,107,107,0.4); }

/* ==================== 全局移动端应用结构 ==================== */
.mobile-bottom-nav,
.mobile-console-btn { display: none; }
.mobile-console-btn svg { width: 18px; height: 18px; }

@media (max-width: 768px) {
  body { overflow: hidden; }
  .main-content { width: 100%; min-width: 0; }
  .topbar {
    min-height: 52px;
    padding: 6px 9px;
    background: #fff;
    box-shadow: 0 1px 0 rgba(148, 163, 184, 0.2);
  }
  .hamburger-btn,
  .topbar .btn-icon { width: 38px; height: 38px; border-radius: 8px; }
  .topbar-left { overflow: hidden; }
  .panel-title { font-size: 16px; letter-spacing: 0; }
  .panel-desc { max-width: 52vw; font-size: 10.5px; }
  .topbar-right { gap: 5px; }
  .mobile-console-btn { display: grid; }

  .content-area {
    padding: 10px 9px;
    overflow-y: auto;
    overflow-x: hidden;
    background: #f3f6f8;
    scroll-padding-bottom: 72px;
  }
  .panel { gap: 9px; }
  .content-area > .panel { min-height: 100%; flex: 0 0 auto; overflow: visible; }
  .panel > .card {
    padding: 12px;
    border: 1px solid #e2e8ec;
    border-radius: 8px;
    box-shadow: none;
  }
  .card-header {
    min-height: 36px;
    flex-direction: row;
    align-items: center;
    gap: 8px;
  }
  .card-title { min-width: 0; font-size: 14px; }
  .card-actions { width: auto; margin-left: auto; flex-wrap: nowrap; }
  .card-actions .btn { flex: 0 0 auto; min-height: 32px; white-space: nowrap; }
  .section-subtitle { font-size: 12px; }

  input[type="text"], input[type="number"], input[type="password"], input[type="search"],
  select, textarea {
    min-height: 42px;
    padding: 9px 11px;
    border-radius: 7px;
    font-size: 16px;
  }
  textarea { min-height: 92px; line-height: 1.45; }
  .form-group { min-width: 0; margin-bottom: 9px; }
  .form-group label { font-size: 11.5px; }
  .form-group .hint { font-size: 9.5px; }
  .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .form-row .form-group { width: auto; }
  .config-grid { gap: 8px; }
  .toggle-grid,
  .toggle-group { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .toggle { min-height: 42px; padding: 8px 9px; }
  .toggle-group > div[style*="inline-flex"] { grid-column: 1 / -1; }

  .btn { min-height: 38px; border-radius: 7px; }
  .btn.btn-sm { min-height: 32px; padding: 5px 9px; }
  .btn.btn-lg { min-height: 44px; }
  .action-bar {
    position: sticky;
    bottom: -10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin: 12px -12px -12px;
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #dfe5e8;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
  }
  .action-bar .btn { width: 100%; min-width: 0; }
  .action-bar .btn.primary,
  .action-bar .btn.btn-lg { grid-column: span 1; }

  .global-status-bar {
    min-height: 32px;
    max-height: 32px;
    padding: 4px 9px;
    gap: 8px;
    border-radius: 0;
    overflow-x: auto;
    background: #182437;
  }
  .status-bar-title { display: none; }
  .status-bar-count,
  .status-bar-empty,
  .status-bar-stat { font-size: 9.5px; white-space: nowrap; }
  .status-bar-right { margin-left: auto; }

  .log-footer { display: none; }
  body.mobile-console-open .log-footer {
    position: fixed;
    right: 0;
    bottom: calc(58px + env(safe-area-inset-bottom));
    left: 0;
    z-index: 1100;
    display: flex;
    max-height: 56dvh;
    padding: 10px;
    border-top: 1px solid #334155;
    background: #0d1624;
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.28);
  }
  body.mobile-console-open .mobile-console-btn { border-color: #7aa2f7; color: #2563eb; background: #eef4ff; }
  body.mobile-console-open .terminal-log-stream { height: 32dvh; }

  .mobile-bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(58px + env(safe-area-inset-bottom));
    padding: 3px 3px env(safe-area-inset-bottom);
    border-top: 1px solid #dce3e7;
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -3px 14px rgba(15, 23, 42, 0.06);
  }
  .mobile-bottom-nav button {
    display: flex;
    min-width: 0;
    min-height: 50px;
    padding: 4px 2px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #7a8992;
    font-size: 9.5px;
  }
  .mobile-bottom-nav svg { width: 20px; height: 20px; }
  .mobile-bottom-nav button.active { color: #168bc3; }
  .mobile-bottom-nav button.active svg { stroke-width: 2.4; }
  .modal { padding: 0; }
  .modal-content {
    width: 100% !important;
    max-width: 100% !important;
    max-height: 94dvh;
    border-radius: 10px 10px 0 0 !important;
  }
  .modal-header { min-height: 52px; padding: 11px 14px; }
  .modal-body { padding: 14px; }
  .modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 2;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #fff;
  }

  /* 账号管理：桌面表格转为完整信息卡列表。 */
  #accounts { width: 100%; min-width: 0; overflow: hidden; }
  #accounts .card { width: calc(100vw - 20px); max-width: calc(100vw - 20px); min-width: 0; overflow: hidden; box-sizing: border-box; }
  #accounts .account-stats-bar { margin-inline: -2px; padding: 6px 0; }
  #accounts .stats-extras { padding-top: 5px; border-top: 1px solid #edf0f2; }
  #accounts .toolbar-row { gap: 7px; }
  #accounts .toolbar-left {
    display: grid;
    width: calc(100vw - 46px);
    max-width: calc(100vw - 46px);
    min-width: 0;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px;
  }
  #accounts .toolbar-left .search-input { width: 100%; min-width: 0; grid-column: 1 / -1; }
  #accounts .account-group-filter { width: 100%; min-width: 0; }
  .mobile-page-select-all {
    display: inline-flex;
    min-height: 38px;
    padding: 0 10px;
    align-items: center;
    gap: 6px;
    border: 1px solid #dfe5e8;
    border-radius: 6px;
    background: #fff;
    color: #52616a;
    font-size: 11px;
    white-space: nowrap;
  }
  .mobile-page-select-all input { margin: 0; accent-color: var(--accent); }
  #accounts .toolbar-right { width: 100%; min-width: 0; }
  #accounts .batch-actions-bar {
    width: 100%;
    padding-bottom: 3px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #accounts .batch-actions-bar::-webkit-scrollbar { display: none; }
  #accounts .btn-batch { min-height: 32px; flex: 0 0 auto; padding: 4px 8px; }
  #accounts .table-wrapper { overflow: visible; }
  #accounts .console-table,
  #accounts .console-table tbody { display: block; width: 100%; min-width: 0; }
  #accounts .console-table thead { display: none; }
  #accounts .console-table tbody { display: grid; gap: 8px; }
  #accounts .console-table tr {
    position: relative;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid #dfe5e8;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  }
  #accounts .console-table td {
    display: flex;
    min-width: 0;
    min-height: 34px;
    padding: 5px 0;
    align-items: center;
    gap: 6px;
    border: 0;
    overflow: hidden;
    white-space: normal;
  }
  #accounts .console-table td::before { flex: 0 0 auto; color: #94a0a7; font-size: 9px; }
  #accounts .console-table td:nth-child(1) { position: absolute; top: 7px; right: 9px; width: auto; min-height: 24px; color: #a0aab0; }
  #accounts .console-table td:nth-child(2) { position: absolute; top: 9px; left: 9px; width: auto; min-height: 24px; }
  #accounts .console-table td:nth-child(3) { grid-column: 1 / -1; min-height: 52px; padding: 2px 40px 7px 30px; border-bottom: 1px solid #edf0f2; }
  #accounts .console-table td:nth-child(4)::before { content: "分组"; }
  #accounts .console-table td:nth-child(5)::before { content: "状态"; }
  #accounts .console-table td:nth-child(6)::before { content: "登录时长"; }
  #accounts .console-table td:nth-child(7)::before { content: "备注"; }
  #accounts .console-table td:nth-child(8) { grid-column: 1 / -1; }
  #accounts .console-table td:nth-child(8)::before { content: "任务进度"; }
  #accounts .console-table td:nth-child(9)::before { content: "代理"; }
  #accounts .console-table td:nth-child(10) { grid-column: 1 / -1; justify-content: flex-end; min-height: 40px; padding-top: 7px; border-top: 1px solid #edf0f2; overflow: visible; }
  #accounts .console-table .acct-info,
  #accounts .console-table .acct-name,
  #accounts .console-table .acct-sub { min-width: 0; max-width: 100%; }
  #accounts .console-table .action-cell { flex-wrap: wrap; }
  #accounts .console-table tr { touch-action: pan-y; }
  #accounts button,
  #accounts input,
  #accounts select,
  #accounts label { touch-action: manipulation; }
  #accounts .stats-tab,
  #accounts .btn-batch,
  #accounts .mobile-page-select-all,
  #accounts .console-table .action-cell,
  #accounts .console-table .action-cell button,
  #accounts .console-table td:nth-child(2) input {
    position: relative;
    z-index: 2;
  }
  #accounts .console-table .action-cell { gap: 6px; }
  #accounts .console-table .btn-icon-sm { width: 38px; height: 38px; flex: 0 0 38px; }

  /* 群组库在手机上使用可扫描的行卡片。 */
  #groups { width: 100%; min-width: 0; overflow: hidden; }
  #groups .card { width: calc(100vw - 20px); max-width: calc(100vw - 20px); min-width: 0; overflow: hidden; box-sizing: border-box; }
  #groups .card-header { flex-wrap: wrap; gap: 8px; }
  #groups .card-actions { max-width: 100%; flex-wrap: wrap; }
  #groups .group-toolbar { gap: 7px; }
  #groups .group-toolbar > .search-input { width: 100%; min-height: 42px; flex: 0 0 auto; }
  #groups .group-cat-tabs { width: 100%; max-width: 100%; }
  #groups .group-table-wrap { overflow: visible; }
  #groups .group-table,
  #groups .group-table tbody { display: block; width: 100%; }
  #groups .group-table thead { display: none; }
  #groups .group-table tbody { display: grid; gap: 7px; }
  #groups .group-table tr { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; padding: 9px; border: 1px solid #e0e6e9; border-radius: 8px; background: #fff; }
  #groups .group-table .gtg-row { display: none; }
  #groups .group-table .gtg.expanded .gtg-row { display: grid; }
  #groups .group-table td { padding: 3px; border: 0; }
  #groups .group-table td:nth-child(2) { min-width: 0; }
  #groups .group-table td:nth-child(3) { grid-column: 2; color: #74838b; font-size: 10.5px; }
  #groups .group-table td:nth-child(4) { grid-column: 3; grid-row: 1 / span 2; }
  #groups .table-pagination { position: relative; display: block; width: 100%; min-width: 0; height: 38px; overflow: hidden; }
  #groups .table-pagination > span { display: inline-block; padding-top: 8px; }
  #groups .pagination-actions { position: absolute; top: 3px; left: 96px; grid-template-columns: 30px 52px 30px; }
  #groups .group-batch-bar { position: sticky; bottom: -10px; z-index: 20; margin: 8px -12px -12px; padding: 9px 12px; background: #fff; }

  /* 配置和工具页使用紧凑的两列表单。 */
  #config .form-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #config .form-row > .form-group { padding: 8px; border-radius: 7px; background: #f7f9fa; }
  #config .form-row .switch { margin-top: auto; }
  #member .form-row,
  #scraper .form-row,
  #channelMover .form-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #member .card,
  #scraper .card,
  #channelMover .card,
  #leave .card { overflow: visible; }
  #member .scraper-results-list,
  #scraper .scraper-results-list { max-height: 44dvh; }
  #channelMover .card > div[style*="margin-top:8px"] { max-height: 130px; padding: 9px !important; overflow-y: auto; font-size: 10px !important; }
  #leave .toolbar-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
  #leave .toolbar-bar > * { min-width: 0; margin-left: 0 !important; }
  #leave .toolbar-bar > div[style*="display:flex"] { display: grid !important; grid-template-columns: auto minmax(0, 1fr); }
  #leave .toolbar-bar select { width: 100% !important; min-height: 36px; }
  #leave #leaveGroupCount { grid-column: 1 / -1; text-align: right; }
  #leave .select-bar { gap: 6px; }
  #leave .leave-group-list { max-height: 48dvh; }
  #leave .leave-group-item { min-height: 50px; padding: 9px 7px; }
  #leave .action-bar .btn:last-child { grid-column: 1 / -1; }

  .proxy-header { flex-direction: row; align-items: center; }
  .proxy-header > div { display: flex !important; margin-left: auto; gap: 5px !important; }
  .proxy-card { align-items: flex-start; gap: 8px; padding: 10px; }
  .proxy-card-actions { flex-wrap: wrap; justify-content: flex-end; }
  .proxy-form-actions { position: sticky; bottom: -12px; z-index: 10; flex-direction: row; padding: 9px 0; background: #fff; }
  .proxy-form-actions .btn { width: auto; flex: 1; }

  /* 任务中心和向导 */
  #newtask .nt-panel-toolbar { position: sticky; top: -10px; z-index: 25; margin: -10px -9px 0; padding: 9px; flex-direction: row; align-items: center; border-bottom: 1px solid #dde4e8; background: rgba(243, 246, 248, 0.96); backdrop-filter: blur(10px); }
  #newtask .nt-panel-title { font-size: 16px; }
  #newtask .nt-panel-toolbar .btn { width: auto; margin-left: auto; }
  #newtask .task-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; }
  #newtask .task-overview > span { padding: 7px 4px; border-radius: 6px; background: #f5f7f8; text-align: center; }
  #newtask .nt-templates-card { padding: 0; border: 0; background: transparent; }
  #newtask .nt-templates-card > .card-header { padding: 0 2px 7px; }
  #newtask .nt-templates-card > .templates-list { gap: 8px; }
  #scraper > .action-bar {
    display: flex;
    margin: 0 -9px;
    padding: 8px 9px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  #scraper > .action-bar::-webkit-scrollbar { display: none; }
  #scraper > .action-bar .btn { width: auto; min-width: 104px; flex: 0 0 auto; }
  #scraper > .action-bar + .action-bar { position: static; margin-top: 8px; border: 0; background: transparent; backdrop-filter: none; }
  #taskWizardModal .wizard-modal { height: 94dvh; }
  .wizard-steps { overflow-x: auto; scrollbar-width: none; }
  .wizard-step { min-width: 92px; }
  .wizard-body { padding: 12px; }
  .wizard-type-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .wizard-type-card { min-height: 82px; padding: 10px; }
  .wiz-acct-groups { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .wiz-acct-group-tab { flex: 0 0 auto; }
  .wizard-footer { padding: 9px 12px calc(9px + env(safe-area-inset-bottom)); }
}

@media (max-width: 420px) {
  .content-area { padding-inline: 7px; }
  .panel > .card { padding: 10px; }
  .form-row,
  #member .form-row,
  #scraper .form-row,
  #channelMover .form-row { grid-template-columns: 1fr; }
  #config .form-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #config .form-row > .form-group { padding: 6px 4px; text-align: center; }
  #config .form-row > .form-group > label:first-child { min-height: 28px; }
  .toggle-grid,
  .toggle-group { grid-template-columns: 1fr; }
  #accounts .console-table tr { gap: 0 7px; padding: 9px; }
  #accounts .console-table td { font-size: 10.5px; }
  #accounts .console-table td:nth-child(13) { gap: 3px; }
  #accounts .console-table .btn-icon-sm { width: 36px; height: 36px; flex-basis: 36px; }
  .proxy-header { align-items: flex-start; flex-direction: column; }
  .proxy-header > div { width: 100%; margin-left: 0; }
  .proxy-header .btn { flex: 1; }
}

/* ==================== 现代应用外壳 ==================== */
.topbar .btn-icon svg {
  width: 18px;
  height: 18px;
}

.mobile-console-btn {
  display: grid;
}

.global-status-bar {
  min-height: 42px;
  margin: 0;
  padding: 7px 20px;
  border-top: 1px solid var(--border);
  border-radius: 0;
  background: #f8fafc;
  color: #64748b;
}

.global-status-bar .status-bar-title,
.global-status-bar .status-bar-empty {
  color: #64748b;
}

.global-status-bar .status-bar-count {
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #64748b;
}

.global-status-bar .status-bar-count.active {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.global-status-bar .status-bar-tag.running {
  background: #eaf2ff;
  color: #2563eb;
}

.global-status-bar .status-bar-stat.success { color: #15803d; }
.global-status-bar .status-bar-stat.skipped { color: #a16207; }
.global-status-bar .status-bar-stat.silent-deleted { color: #c2410c; }
.global-status-bar .status-bar-stat.failed { color: #dc2626; }

/* 日志默认收起，由顶栏终端按钮打开为检查器抽屉。 */
.log-footer {
  display: none;
}

body.mobile-console-open .log-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 240px;
  z-index: 1150;
  display: flex;
  max-height: min(430px, 56vh);
  padding: 14px 20px 18px;
  flex-direction: column;
  overflow: hidden;
  border-top: 1px solid #cbd5e1;
  background: #fff;
  box-shadow: 0 -18px 48px rgba(15, 23, 42, 0.16);
}

body.mobile-console-open .terminal-log-stream {
  height: min(300px, 40vh);
}

body.mobile-console-open .mobile-console-btn {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

/* 运行事件与应用文件日志共用同一个抽屉。 */
.log-header {
  flex: 0 0 auto;
  gap: 10px;
  margin-bottom: 10px;
}

.log-view-tabs {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 2px;
  border: 1px solid #dbe3eb;
  border-radius: 6px;
  background: #f1f5f9;
}

.log-view-tab {
  min-height: 26px;
  padding: 3px 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  font-size: 11px;
  font-weight: 600;
}

.log-view-tab:hover { color: #1e293b; }
.log-view-tab.active {
  background: #fff;
  color: #2563eb;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}

.log-actions[hidden],
.backend-log-content[hidden],
.backend-log-footer[hidden] { display: none !important; }

.log-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.log-compact-select,
.log-account-filter {
  width: auto;
  max-width: 160px;
  height: 28px;
  min-height: 28px;
  padding: 3px 26px 3px 8px;
  border: 1px solid #d5dee8;
  border-radius: 5px;
  background-color: #fff;
  color: #475569;
  font-size: 11px;
}

.log-tool-btn {
  display: grid;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  place-items: center;
  border-color: #d5dee8;
  border-radius: 5px;
  color: #64748b;
}

.log-tool-btn:hover {
  border-color: #b8c6d5;
  background: #f1f5f9;
  color: #1e293b;
}

.log-tool-btn svg { width: 14px; height: 14px; }
.log-close-btn { margin-left: 2px; }

.log-live-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #15803d;
  font-size: 11px;
  white-space: nowrap;
}

.log-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

body.mobile-console-open .terminal-log-stream,
body.mobile-console-open .backend-log-content {
  flex: 1 1 auto;
  width: 100%;
  height: min(300px, 40vh);
  min-height: 120px;
}

.backend-log-footer {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 7px 10px 0;
  border: 0;
  background: transparent;
}

@media (max-width: 768px) {
  body.mobile-console-open .log-footer { padding: 10px; }
  .log-header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 7px;
  }
  .log-view-tabs { justify-self: start; }
  .log-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    gap: 5px;
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .log-actions::-webkit-scrollbar { display: none; }
  .log-close-btn { grid-column: 3; grid-row: 1; }
  .terminal-log-search { flex: 1 0 120px; }
  .log-compact-select,
  .log-account-filter { flex: 0 0 auto; min-height: 28px; }
  #systemLogControls:not([hidden]) {
    display: grid;
    grid-template-columns: auto minmax(94px, 1fr) minmax(110px, 1fr) 28px 28px;
    overflow: visible;
  }
  #systemLogControls .log-live-status { grid-column: 1; grid-row: 1; }
  #systemLogControls #logLevelFilter { grid-column: 2; grid-row: 1; width: 100%; }
  #systemLogControls #logLineCount { grid-column: 3; grid-row: 1; width: 100%; }
  #systemLogControls #logSearchInput {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }
  #systemLogControls #downloadLogsBtn { grid-column: 4; grid-row: 1; }
  #systemLogControls #clearBackendLogsBtn { grid-column: 5; grid-row: 1; }
  body.mobile-console-open .terminal-log-stream,
  body.mobile-console-open .backend-log-content { height: 36dvh; }
}

@media (max-width: 420px) {
  .log-title { display: none; }
  .log-header { grid-template-columns: 1fr auto; }
  .log-close-btn { grid-column: 2; }
  .log-live-status { font-size: 10px; }
}

.mobile-nav-icon,
.mobile-nav-label {
  position: relative;
  z-index: 1;
}

.mobile-nav-badge {
  position: absolute;
  top: -6px;
  right: -10px;
  display: grid;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 9px;
  background: #dc2626;
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.mobile-nav-badge[hidden],
.mobile-more-heading { display: none; }

@media (max-width: 1024px) {
  body.mobile-console-open .log-footer { left: 0; }
}

@media (max-width: 768px) {
  .topbar {
    min-height: 58px;
    padding: 7px 12px 7px 16px;
    border-bottom: 1px solid #e8edf1;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: none;
    backdrop-filter: blur(16px);
  }

  .topbar .hamburger-btn { display: none; }
  .topbar-left { min-width: 0; }
  .panel-title { font-size: 17px; font-weight: 700; }
  .panel-desc { display: none; }
  .topbar-right { gap: 6px; }
  .topbar .btn-icon {
    width: 38px;
    height: 38px;
    border-color: transparent;
    border-radius: 50%;
    background: transparent;
    color: #425466;
  }
  .topbar .btn-icon:active { background: #edf2f5; }

  .content-area {
    padding: 12px 10px;
    scroll-padding-bottom: 84px;
    background: #f4f7f9;
  }

  .global-status-bar { display: none !important; }

  body.mobile-console-open .log-footer {
    right: 8px;
    bottom: calc(72px + env(safe-area-inset-bottom));
    left: 8px;
    max-height: min(64dvh, 520px);
    padding: 12px;
    border: 1px solid #d7e0e7;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 18px 60px rgba(15, 23, 42, 0.24);
  }
  body.mobile-console-open .terminal-log-stream { height: 36dvh; }

  .mobile-bottom-nav {
    position: relative;
    z-index: 1000;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(68px + env(safe-area-inset-bottom));
    padding: 4px 6px env(safe-area-inset-bottom);
    border-top: 1px solid rgba(203, 213, 225, 0.72);
    background: rgba(251, 253, 254, 0.97);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.07);
    backdrop-filter: blur(20px);
  }

  .mobile-bottom-nav button {
    position: relative;
    display: flex;
    min-width: 0;
    min-height: 60px;
    padding: 5px 2px 4px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #71808d;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-nav-icon {
    display: grid;
    width: 42px;
    height: 29px;
    place-items: center;
    border-radius: 15px;
    transition: background 160ms ease, color 160ms ease, transform 160ms ease;
  }

  .mobile-bottom-nav svg {
    width: 21px;
    height: 21px;
    stroke-width: 1.9;
  }

  .mobile-bottom-nav button.active,
  .mobile-bottom-nav button.menu-open {
    color: #087eae;
    font-weight: 650;
  }

  .mobile-bottom-nav button.active .mobile-nav-icon,
  .mobile-bottom-nav button.menu-open .mobile-nav-icon {
    background: #dff3fa;
  }

  .mobile-bottom-nav button:active .mobile-nav-icon { transform: scale(0.92); }

  /* “更多”在手机上是原生感底部功能面板，不再沿用桌面深色侧栏。 */
  .sidebar {
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(78dvh, 680px);
    z-index: 1201;
    border-radius: 16px 16px 0 0;
    background: #fff;
    color: #17212b;
    box-shadow: 0 -20px 60px rgba(15, 23, 42, 0.18);
    transform: translateY(105%);
    transition: transform 220ms cubic-bezier(.2, .8, .2, 1);
  }

  .sidebar.open {
    left: 0;
    transform: translateY(0);
  }

  .sidebar::before {
    content: '';
    position: absolute;
    top: 7px;
    left: 50%;
    width: 36px;
    height: 4px;
    border-radius: 2px;
    background: #d6dee4;
    transform: translateX(-50%);
  }

  .sidebar-header {
    padding: 21px 18px 12px;
    border-bottom: 1px solid #edf1f4;
  }

  .sidebar-header > .logo { display: none; }
  .mobile-more-heading {
    display: flex;
    min-height: 38px;
    align-items: center;
    justify-content: space-between;
  }
  .mobile-more-heading strong { font-size: 18px; }
  .mobile-more-close {
    display: grid;
    width: 36px;
    height: 36px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #f0f3f5;
    color: #43515c;
  }
  .mobile-more-close svg { width: 19px; height: 19px; }

  .sidebar-nav {
    padding: 10px 12px 16px;
    background: #fff;
  }

  .sidebar .nav-divider { display: none; }
  .sidebar .nav-dashboard,
  .sidebar .nav-item[data-panel="accounts"],
  .sidebar .nav-item[data-panel="businessPool"],
  .sidebar .nav-item[data-panel="warmupCenter"],
  .sidebar .nav-item[data-panel="cs"] { display: none; }
  .sidebar .nav-group {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    margin: 0 0 10px;
  }
  .sidebar .nav-group.nav-dashboard { display: none; }

  .sidebar .nav-group-title {
    grid-column: 1 / -1;
    padding: 4px 4px 2px;
    color: #84919c;
    font-size: 10px;
    letter-spacing: 0;
  }

  .sidebar .nav-item {
    min-height: 48px;
    padding: 9px 11px;
    gap: 9px;
    border: 1px solid #e6ebef;
    border-radius: 8px;
    background: #f8fafb;
    color: #41515e;
    font-size: 13px;
  }

  .sidebar .nav-item::before { display: none; }
  .sidebar .nav-item.active {
    border-color: #b9dfed;
    background: #eaf7fb;
    color: #087eae;
  }
  .sidebar .nav-icon { width: 22px; font-size: 17px; }

  .sidebar-footer {
    padding: 10px 16px calc(12px + env(safe-area-inset-bottom));
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid #edf1f4;
    background: #fff;
  }
  .sidebar-license,
  .sidebar-info,
  .sidebar .status-indicator { color: #778692; }

  .sidebar-overlay {
    z-index: 1200;
    background: rgba(15, 23, 42, 0.38);
    backdrop-filter: blur(3px);
  }

}

@media (max-width: 360px) {
  .mobile-bottom-nav { padding-inline: 2px; }
  .mobile-bottom-nav button { font-size: 10px; }
  .mobile-nav-icon { width: 38px; }
  .sidebar .nav-item { padding-inline: 8px; font-size: 12px; }
}

/* ==================== 账号分组管理渲染收口 ==================== */

/* ==================== 业务号池 ==================== */
#businessPool {
  min-width: 0;
  color: var(--text-primary);
}

.business-pool-toolbar {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 7px 7px 0 0;
  background: var(--card-bg);
}

.business-pool-create {
  display: grid;
  width: min(520px, 100%);
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.business-pool-create input { min-width: 0; }
.business-pool-toolbar-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }

.business-pool-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-inline: 1px solid var(--border);
  background: var(--card-bg);
}

.business-pool-summary > div {
  display: flex;
  min-width: 0;
  min-height: 66px;
  padding: 11px 14px;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  border-right: 1px solid var(--border);
}

.business-pool-summary > div:last-child { border-right: 0; }
.business-pool-summary span { color: var(--text-muted); font-size: 11px; }
.business-pool-summary strong { font-size: 20px; font-variant-numeric: tabular-nums; }

.business-procurement-strip {
  margin: 0;
  border-radius: 0;
  border-bottom: 0;
}

.business-pool-workspace {
  display: grid;
  min-width: 0;
  min-height: 520px;
  flex: 0 0 auto;
  grid-template-columns: minmax(230px, 290px) minmax(0, 1fr);
  border: 1px solid var(--border);
  border-radius: 0 0 7px 7px;
  background: var(--card-bg);
  overflow: hidden;
}

.business-pool-list-pane {
  min-width: 0;
  border-right: 1px solid var(--border);
  background: var(--bg-secondary);
}

.business-pool-pane-title {
  display: flex;
  min-height: 44px;
  padding: 0 13px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.business-pool-pane-title span { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.business-pool-list { max-height: 640px; overflow-y: auto; }

.business-pool-list-item {
  display: grid;
  width: 100%;
  min-width: 0;
  padding: 12px 13px;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 10px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.business-pool-list-item:hover { background: rgba(14, 165, 233, 0.06); }
.business-pool-list-item.active { background: rgba(14, 165, 233, 0.1); box-shadow: inset 3px 0 #0284c7; }
.business-pool-list-name { min-width: 0; overflow: hidden; font-size: 13px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.business-pool-list-health { width: 8px; height: 8px; margin-top: 4px; border-radius: 50%; background: #16a34a; }
.business-pool-list-health.warn { background: #d97706; }
.business-pool-list-health.empty { background: #94a3b8; }
.business-pool-list-meta { display: flex; min-width: 0; grid-column: 1 / -1; flex-wrap: wrap; gap: 5px 10px; color: var(--text-muted); font-size: 11px; }

.business-pool-detail { min-width: 0; background: var(--card-bg); }
.business-pool-empty { display: grid; min-height: 360px; padding: 30px; place-content: center; gap: 6px; color: var(--text-muted); text-align: center; }
.business-pool-empty strong { color: var(--text-secondary); font-size: 15px; }

.business-detail-header {
  display: flex;
  min-width: 0;
  min-height: 64px;
  padding: 12px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.business-detail-title { min-width: 0; }
.business-detail-title h3 { margin: 0; overflow: hidden; font-size: 17px; text-overflow: ellipsis; white-space: nowrap; }
.business-detail-title p { margin: 4px 0 0; color: var(--text-muted); font-size: 11px; }
.business-detail-actions { display: flex; flex: 0 0 auto; gap: 6px; }

.business-capacity-row {
  display: grid;
  padding: 14px 16px;
  grid-template-columns: minmax(120px, 180px) minmax(120px, 180px) auto;
  align-items: end;
  gap: 10px;
  border-bottom: 1px solid var(--border);
}

.business-capacity-row .form-group { margin: 0; }

.business-account-columns {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  border-bottom: 1px solid var(--border);
}

.business-account-column { min-width: 0; padding: 14px 16px; }
.business-account-column + .business-account-column { border-left: 1px solid var(--border); }
.business-section-head { display: flex; min-height: 32px; align-items: center; justify-content: space-between; gap: 8px; }
.business-section-head h4 { margin: 0; font-size: 13px; }
.business-section-head span { color: var(--text-muted); font-size: 11px; }
.business-section-tools { display: flex; min-width: 0; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; }
.business-section-tools input[type="search"] {
  width: min(150px, 42%);
  min-width: 90px;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
}
.business-section-tools .btn { min-height: 30px; padding: 4px 8px; font-size: 10px; white-space: nowrap; }
.business-account-list { display: flex; min-width: 0; flex-direction: column; }

.business-account-row {
  display: grid;
  min-width: 0;
  min-height: 48px;
  padding: 8px 0;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  border-top: 1px solid var(--border);
}
.business-account-row[hidden] { display: none; }
.business-account-row.health-unhealthy { background: rgba(220, 38, 38, 0.045); }
.business-account-row.health-unchecked { background: rgba(148, 163, 184, 0.045); }

.business-account-copy { min-width: 0; }
.business-account-copy strong,
.business-account-copy small { display: block; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.business-account-copy strong { font-size: 12px; }
.business-account-copy small { margin-top: 3px; color: var(--text-muted); font-size: 10px; }
.business-account-row .btn { min-height: 28px; padding: 4px 8px; font-size: 10px; }
.business-account-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; justify-content: flex-end; gap: 5px; }
.business-account-empty { padding: 16px 0; color: var(--text-muted); font-size: 11px; }

.business-account-detail-modal { width: min(660px, calc(100vw - 40px)); }
.business-account-detail-modal .modal-header > div { min-width: 0; }
.business-account-detail-modal .modal-header p { margin: 3px 0 0; color: var(--text-muted); font-size: 11px; }
.business-account-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 0 18px;
}
.business-account-detail-grid > div {
  min-width: 0;
  padding: 11px 10px;
  border-bottom: 1px solid var(--border);
}
.business-account-detail-grid span,
.business-account-detail-grid strong { display: block; min-width: 0; }
.business-account-detail-grid span { margin-bottom: 4px; color: var(--text-muted); font-size: 10px; }
.business-account-detail-grid strong { overflow-wrap: anywhere; color: var(--text-primary); font-size: 12px; font-weight: 550; }

.business-template-band {
  display: grid;
  min-width: 0;
  padding: 15px 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}

.business-template-copy { min-width: 0; }
.business-template-copy h4 { margin: 0 0 6px; font-size: 13px; }
.business-template-copy p { margin: 0; color: var(--text-muted); font-size: 11px; line-height: 1.6; overflow-wrap: anywhere; }
.business-template-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.business-settings-disclosure { border-bottom: 1px solid var(--border); }
.business-settings-disclosure > summary,
.business-advanced-disclosure > summary {
  display: grid;
  min-width: 0;
  align-items: center;
  cursor: pointer;
  list-style: none;
}
.business-settings-disclosure > summary::-webkit-details-marker,
.business-advanced-disclosure > summary::-webkit-details-marker { display: none; }
.business-settings-disclosure > summary {
  min-height: 58px;
  padding: 10px 16px;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  gap: 10px;
}
.business-settings-disclosure > summary:hover { background: var(--bg-secondary); }
.business-settings-disclosure > summary strong { font-size: 13px; }
.business-settings-disclosure > summary span,
.business-advanced-disclosure > summary span {
  color: var(--text-muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.business-settings-disclosure > summary::after,
.business-advanced-disclosure > summary::after {
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--text-muted);
  border-bottom: 1.5px solid var(--text-muted);
  content: "";
  transform: rotate(45deg);
  transition: transform .15s ease;
}
.business-settings-disclosure[open] > summary::after,
.business-advanced-disclosure[open] > summary::after { transform: rotate(225deg); }
.business-settings-disclosure[open] > summary { border-bottom: 1px solid var(--border); }
.business-settings-disclosure-body > .business-template-band:last-child { border-bottom: 0; }
.business-security-controls { display: grid; width: min(390px, 100%); grid-template-columns: minmax(150px, 1fr) auto; gap: 7px; }
.business-security-controls input { min-width: 0; }
.business-task-binding-controls {
  display: grid;
  width: min(520px, 100%);
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 7px;
}
.business-task-binding-controls select { min-width: 0; }
.business-task-binding-primary {
  background: color-mix(in srgb, var(--accent-light, #e0f2fe) 42%, var(--card-bg));
}
.group-child-modal .group-edit-modal.business-onboarding-modal {
  width: min(860px, calc(100vw - 40px)) !important;
  height: min(620px, calc(100dvh - 40px));
  max-height: min(620px, calc(100dvh - 40px));
}
.group-child-modal .business-onboarding-modal .modal-body { overflow-y: auto; }
.business-setup-steps {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}
.business-setup-steps button {
  position: relative;
  display: flex;
  min-width: 0;
  height: 54px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.business-setup-steps button::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: transparent;
  content: "";
}
.business-setup-steps button span {
  display: grid;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border-strong, var(--border));
  border-radius: 50%;
  place-items: center;
  font-size: 11px;
}
.business-setup-steps button.active { color: var(--text-primary); }
.business-setup-steps button.active::after { background: var(--accent); }
.business-setup-steps button.active span,
.business-setup-steps button.done span {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.business-setup-steps button:disabled { cursor: default; opacity: 0.55; }
.business-onboarding-step[hidden] { display: none !important; }
.business-onboarding-step { min-height: 100%; }
.business-onboarding-master,
.business-onboarding-section-head label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
}
.business-onboarding-master { padding-bottom: 14px; }
.business-onboarding-master input[type="checkbox"],
.business-onboarding-section-head input[type="checkbox"],
.business-onboarding-options input[type="checkbox"] {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}
.business-onboarding-section {
  padding: 15px 0;
  border-top: 1px solid var(--border);
}
.business-onboarding-section h4 { margin: 0 0 12px; font-size: 13px; }
.business-onboarding-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.business-onboarding-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
}
.business-onboarding-grid .form-group { min-width: 0; margin: 0; }
.business-onboarding-grid input,
.business-onboarding-grid select,
.business-onboarding-grid textarea { width: 100%; min-width: 0; }
.business-onboarding-wide { grid-column: span 2; }
.business-onboarding-full { grid-column: 1 / -1; }
.business-onboarding-fixed {
  display: grid;
  margin-bottom: 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border: 1px solid var(--border);
}
.business-onboarding-fixed span {
  min-width: 0;
  padding: 10px;
  color: var(--text-secondary);
  font-size: 11px;
  text-align: center;
}
.business-onboarding-fixed span + span { border-left: 1px solid var(--border); }
.business-onboarding-options { display: flex; margin-top: 4px; flex-wrap: wrap; gap: 18px; }
.business-onboarding-options label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.business-onboarding-options label span { white-space: nowrap; }
.business-onboarding-options input:disabled + span { color: var(--text-muted); }
.business-advanced-disclosure {
  margin-top: 16px;
  border-block: 1px solid var(--border);
}
.business-advanced-disclosure > summary {
  min-height: 44px;
  padding: 8px 2px;
  grid-template-columns: minmax(0, 1fr) auto 16px;
  gap: 10px;
}
.business-advanced-disclosure > summary:hover { color: var(--accent); }
.business-advanced-disclosure > summary strong { font-size: 12px; font-weight: 600; }
.business-advanced-disclosure-body { padding: 14px 0 2px; border-top: 1px solid var(--border); }
.business-onboarding-review {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.business-onboarding-review h4 { margin: 0 0 10px; font-size: 13px; }
.business-onboarding-review #businessOnboardingReview {
  display: grid;
  border-block: 1px solid var(--border);
}
.business-onboarding-review #businessOnboardingReview > div {
  display: grid;
  min-width: 0;
  padding: 10px 0;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 16px;
}
.business-onboarding-review #businessOnboardingReview > div + div { border-top: 1px solid var(--border); }
.business-onboarding-review span { color: var(--text-muted); font-size: 11px; }
.business-onboarding-review strong {
  min-width: 0;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  overflow-wrap: anywhere;
}
.business-onboarding-footer .business-step-count {
  margin-right: auto;
  color: var(--text-muted);
  font-size: 11px;
  align-self: center;
}
.business-onboarding-footer [hidden] { display: none !important; }

.business-pool-footer-actions { display: flex; padding: 14px 16px; flex-wrap: wrap; gap: 8px; }

/* ==================== 养号中心 ==================== */
#warmupCenter {
  min-width: 0;
  min-height: 100%;
  flex: 0 0 auto;
  color: var(--text-primary);
}

.warmup-center-toolbar {
  display: flex;
  min-width: 0;
  min-height: 62px;
  padding: 11px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 7px 7px 0 0;
  background: var(--card-bg);
}
.warmup-center-heading { display: grid; min-width: 0; gap: 3px; }
.warmup-center-heading strong { font-size: 14px; }
.warmup-center-heading span { color: var(--text-muted); font-size: 11px; }
.warmup-center-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }

.warmup-center-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-inline: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}
.warmup-center-summary > div {
  display: grid;
  min-width: 0;
  min-height: 70px;
  padding: 11px 14px;
  align-content: center;
  gap: 3px;
  border-right: 1px solid var(--border);
}
.warmup-center-summary > div:last-child { border-right: 0; }
.warmup-center-summary span { color: var(--text-muted); font-size: 11px; }
.warmup-center-summary strong { font-size: 22px; font-variant-numeric: tabular-nums; }

.warmup-failure-summary {
  display: flex;
  min-height: 38px;
  padding: 7px 14px;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 16px;
  border-bottom: 1px solid var(--border);
  background: #fff8f8;
}
.warmup-failure-summary[hidden] { display: none; }
.warmup-failure-summary span { display: inline-flex; align-items: center; gap: 6px; color: #9f2436; font-size: 11px; }
.warmup-failure-summary strong { font-weight: 550; }
.warmup-failure-summary b { min-width: 18px; font-variant-numeric: tabular-nums; text-align: right; }

.warmup-center-band {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-bg);
  overflow: hidden;
}
.warmup-center-band-head {
  display: flex;
  min-width: 0;
  min-height: 54px;
  padding: 10px 14px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}
.warmup-center-band-head > div:first-child { display: flex; min-width: 0; align-items: baseline; gap: 9px; }
.warmup-center-band-head h3 { margin: 0; font-size: 14px; }
.warmup-center-band-head span { color: var(--text-muted); font-size: 11px; }

.warmup-plan-row {
  display: grid;
  min-width: 0;
  min-height: 82px;
  padding: 12px 14px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 260px) auto;
  align-items: center;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}
.warmup-plan-row:last-child { border-bottom: 0; }
.warmup-plan-main,
.warmup-plan-accounts { min-width: 0; }
.warmup-plan-title { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 8px; }
.warmup-plan-title > strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.warmup-plan-main p { margin: 5px 0 0; color: var(--text-muted); font-size: 11px; overflow-wrap: anywhere; }
.warmup-plan-main .warmup-plan-error { color: #b42335; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warmup-plan-accounts { display: grid; gap: 3px; }
.warmup-plan-accounts span { color: var(--text-muted); font-size: 10px; }
.warmup-plan-accounts strong { overflow: hidden; font-size: 11px; font-weight: 550; text-overflow: ellipsis; white-space: nowrap; }
.warmup-plan-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }

.warmup-state {
  display: inline-flex;
  min-height: 22px;
  padding: 2px 7px;
  align-items: center;
  border: 1px solid #d8e0e7;
  border-radius: 4px;
  background: #f7f9fa;
  color: #64748b;
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.warmup-state.running { border-color: #a5d8ee; background: #ecf8fc; color: #087eae; }
.warmup-state.scheduled,
.warmup-state.done { border-color: #a7e0be; background: #effaf3; color: #16824b; }
.warmup-state.pending { border-color: #f0d18e; background: #fff9e8; color: #9a640c; }
.warmup-state.error { border-color: #efb4ba; background: #fff2f3; color: #b42335; }
.warmup-state.manual,
.warmup-state.idle { border-color: #d8e0e7; background: #f7f9fa; color: #64748b; }

.warmup-business-row {
  display: grid;
  min-width: 0;
  min-height: 70px;
  padding: 11px 14px;
  grid-template-columns: minmax(140px, 200px) minmax(280px, 1fr) minmax(180px, 260px) auto;
  align-items: center;
  gap: 14px;
  border-bottom: 1px solid var(--border);
}
.warmup-business-row:last-child { border-bottom: 0; }
.warmup-business-name { display: flex; min-width: 0; align-items: center; gap: 7px; }
.warmup-business-name > strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.warmup-business-metrics { display: flex; min-width: 0; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.warmup-business-metrics span { color: var(--text-muted); font-size: 11px; white-space: nowrap; }
.warmup-business-metrics strong { color: var(--text-primary); font-variant-numeric: tabular-nums; }
.warmup-business-metrics .error,
.warmup-business-metrics .error strong { color: #b42335; }
.warmup-business-schedule { min-width: 0; color: var(--text-secondary); font-size: 11px; overflow-wrap: anywhere; }

.warmup-account-band-head { align-items: center; }
.warmup-account-filters { display: grid !important; width: min(430px, 48%); grid-template-columns: 150px minmax(160px, 1fr); gap: 7px !important; }
.warmup-account-filters select,
.warmup-account-filters input { width: 100%; min-width: 0; min-height: 34px; font-size: 11px; }
.warmup-account-table-head,
.warmup-account-row {
  display: grid;
  min-width: 0;
  grid-template-columns: minmax(170px, 1.1fr) minmax(120px, .8fr) minmax(160px, 1fr) 90px minmax(140px, .8fr);
  align-items: center;
  gap: 12px;
}
.warmup-account-table-head {
  min-height: 38px;
  padding: 7px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-secondary);
  color: var(--text-muted);
  font-size: 10px;
}
.warmup-account-row { min-height: 62px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.warmup-account-row:last-child { border-bottom: 0; }
.warmup-account-row[hidden] { display: none; }
.warmup-account-name,
.warmup-account-status { display: grid; min-width: 0; gap: 3px; }
.warmup-account-name strong,
.warmup-account-name small,
.warmup-account-source,
.warmup-account-status small,
.warmup-account-last { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.warmup-account-name strong { font-size: 12px; }
.warmup-account-name small,
.warmup-account-status small { color: var(--text-muted); font-size: 10px; }
.warmup-account-source,
.warmup-account-last { color: var(--text-secondary); font-size: 11px; }
.warmup-account-status { justify-items: start; }
.warmup-account-retry { min-height: 26px; padding-inline: 7px; font-size: 10px; }
.warmup-account-cycles { font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.warmup-center-empty { display: grid; min-height: 86px; padding: 18px; place-content: center; gap: 3px; color: var(--text-muted); font-size: 11px; text-align: center; }
.warmup-center-empty strong { color: var(--text-secondary); font-size: 12px; }
.warmup-center-empty[hidden] { display: none; }

.wizard-warmup-preview {
  margin-top: 14px;
  padding: 11px 0 0;
  border-top: 1px solid var(--border);
}
.warmup-auto-actions {
  display: grid;
  margin-top: 12px;
  padding: 10px 0;
  gap: 8px;
  border-block: 1px solid var(--border);
}
.warmup-auto-actions label {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: 12px;
}
.warmup-auto-actions input[type="checkbox"] { flex: 0 0 auto; }
.warmup-auto-actions-grid {
  border-top: 0;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}
.warmup-auto-actions-grid label {
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) 72px;
  align-items: center;
}
.warmup-auto-actions-grid input[type="number"] {
  width: 100%;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--bg-input, transparent);
  color: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 520px) {
  .warmup-auto-actions-grid { grid-template-columns: minmax(0, 1fr); }
}
.wizard-warmup-preview header { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 12px; }
.wizard-warmup-preview header strong { font-size: 12px; }
.wizard-warmup-preview header span { color: var(--text-muted); font-size: 10px; }
.wizard-warmup-preview[data-state="warning"] header span,
.wizard-warmup-preview[data-state="error"] header span { color: #b42335; }
.wizard-warmup-preview-metrics {
  display: grid;
  margin-top: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-block: 1px solid var(--border);
}
.wizard-warmup-preview-metrics > div { display: grid; min-width: 0; padding: 8px 10px; gap: 2px; border-right: 1px solid var(--border); }
.wizard-warmup-preview-metrics > div:last-child { border-right: 0; }
.wizard-warmup-preview-metrics span { color: var(--text-muted); font-size: 9px; }
.wizard-warmup-preview-metrics strong { font-size: 16px; font-variant-numeric: tabular-nums; }
.wizard-warmup-preview p { margin: 7px 0 0; color: var(--text-muted); font-size: 10px; overflow-wrap: anywhere; }

.wizard-advanced-section { margin-top: 12px; border-block: 1px solid var(--border); }
.wizard-advanced-section > summary { display: flex; min-height: 42px; padding: 8px 2px; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; list-style: none; }
.wizard-advanced-section > summary::-webkit-details-marker { display: none; }
.wizard-advanced-section > summary strong { font-size: 11px; }
.wizard-advanced-section > summary span { color: var(--text-muted); font-size: 10px; }
.wizard-advanced-section > summary::after { content: "+"; color: var(--text-muted); font-size: 16px; }
.wizard-advanced-section[open] > summary::after { content: "−"; }
.wizard-advanced-section-body { padding: 2px 0 8px; }

#groupManagerModal .group-manager-modal {
  width: min(920px, calc(100vw - 40px)) !important;
  max-width: none !important;
  max-height: min(780px, calc(100dvh - 48px));
  overflow: hidden;
}

#groupManagerModal .modal-body {
  display: flex;
  min-height: 0;
  padding: 16px 18px;
  flex-direction: column;
  overflow: hidden;
}

#groupManagerModal .group-create-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
  padding: 0 0 12px;
}

#groupManagerModal .group-create-row .search-input {
  width: 100%;
  min-width: 0;
}

.group-manager-summary {
  min-height: 26px;
  padding: 2px 2px 8px;
  color: var(--text-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

#groupManagerModal .group-manager-list {
  display: flex;
  min-height: 0;
  max-height: none;
  padding: 2px 3px 2px 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 9px;
  overflow: auto;
}

#groupManagerModal .group-manager-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-width: 0;
  margin: 0;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--card-bg);
  box-shadow: none;
}

#groupManagerModal .group-manager-item:hover {
  border-color: #b8c5d2;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.05);
}

#groupManagerModal .group-info {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
  text-align: left;
}

#groupManagerModal .group-title-row {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 9px;
  justify-content: flex-start;
  text-align: left;
}

#groupManagerModal .group-name {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 650;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#groupManagerModal .group-count {
  flex: 0 0 auto;
  margin: 0;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

#groupManagerModal .group-meta,
#groupManagerModal .group-stats {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 5px;
  margin: 0;
  flex-wrap: wrap;
}

#groupManagerModal .group-fields,
#groupManagerModal .group-sync-time {
  display: inline-flex;
  min-height: 21px;
  align-items: center;
  line-height: 1.2;
}

#groupManagerModal .g-stat {
  display: inline-flex;
  min-height: 21px;
  padding: 2px 7px;
  align-items: center;
  border-radius: 5px;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

#groupManagerModal .g-stat.missing {
  background: #f3e8ff;
  color: #7e22ce;
}

#groupManagerModal .group-broadcast-state {
  display: inline-flex;
  min-height: 21px;
  padding: 2px 7px;
  align-items: center;
  border-radius: 5px;
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
}

#groupManagerModal .group-broadcast-state.configured { background: #dcfce7; color: #166534; }
#groupManagerModal .group-broadcast-state.unconfigured { background: #fef3c7; color: #92400e; }

#groupManagerModal .group-actions {
  display: grid;
  grid-template-columns: repeat(6, auto);
  gap: 6px;
  justify-content: end;
  width: auto;
  flex-wrap: nowrap;
}

#groupManagerModal .group-actions button {
  min-height: 32px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 11.5px;
  white-space: nowrap;
}

#groupManagerModal .group-actions button:hover:not(:disabled) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #1d4ed8;
}

#groupManagerModal .group-actions button:disabled {
  cursor: default;
  opacity: 0.45;
}

#groupManagerModal .group-actions button.danger {
  border-color: #fecaca;
  color: #dc2626;
}

.group-manager-empty,
.group-manager-loading {
  display: grid;
  min-height: 180px;
  padding: 24px;
  place-content: center;
  gap: 6px;
  color: var(--text-muted);
  text-align: center;
}

.group-manager-empty strong { color: var(--text-secondary); font-size: 14px; }
.group-manager-empty span { font-size: 12px; }

.group-child-modal { z-index: var(--z-modal-child); }

/* Confirm dialogs can be opened from a group child modal. Keep the shared
   confirmation layer above that editor and its backdrop. */
#confirmModal.modal { z-index: var(--z-modal-confirm); }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal-child);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
}

.voice-clip-manager-modal {
  width: min(420px, calc(100vw - 32px));
  max-height: min(80dvh, 720px);
  padding: 20px;
  overflow-y: auto;
  border-radius: 12px;
  background: var(--card-bg);
  box-sizing: border-box;
}

.group-child-modal .group-edit-modal {
  width: min(720px, calc(100vw - 40px)) !important;
  max-width: none !important;
  max-height: min(760px, calc(100dvh - 48px));
  overflow: hidden;
}

.group-child-modal .group-rename-modal {
  width: min(440px, calc(100vw - 40px)) !important;
  max-width: none !important;
}

.group-child-modal .modal-header h3 {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-edit-modal .modal-body {
  display: flex;
  min-height: 0;
  padding: 14px 16px;
  flex-direction: column;
  overflow: hidden;
}

.group-member-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding-bottom: 10px;
}

.group-member-toolbar input[type="search"] {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}

.group-member-select-all {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 6px;
  justify-content: flex-start;
  color: var(--text-secondary);
  font-size: 12px;
  white-space: nowrap;
}

.group-member-selected-count {
  color: var(--accent);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.group-member-filters {
  display: flex;
  gap: 6px;
  padding-bottom: 10px;
  overflow-x: auto;
}

.group-member-filters button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 4px 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.group-member-filters button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.group-member-filters button.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 600;
}

.group-member-filters span {
  color: inherit;
  font-variant-numeric: tabular-nums;
}

.group-member-list {
  min-height: 0;
  padding-right: 3px;
  flex: 1 1 auto;
  overflow: auto;
}

.group-edit-account {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 52px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.group-edit-account:hover { background: var(--hover-bg); }
.group-edit-account:has(input[type="checkbox"]:checked) { background: #f0f9ff; }
.group-edit-account[hidden] { display: none; }
.group-edit-account input { margin: 0; }

.group-member-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.group-member-copy strong,
.group-member-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.group-member-copy strong { color: var(--text-primary); font-size: 12.5px; }
.group-member-copy small { color: var(--text-muted); font-size: 10.5px; }

.group-member-state {
  display: flex;
  align-items: center;
  gap: 5px;
  justify-content: flex-end;
}

.group-member-source {
  display: inline-flex;
  align-items: center;
  height: 20px;
  padding: 0 5px;
  border: 1px solid #f59e0b;
  border-radius: 4px;
  color: #b45309;
  font-size: 11px;
  white-space: nowrap;
}

.group-member-role {
  display: inline-flex;
  height: 20px;
  padding: 0 6px;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-secondary);
  font-size: 11px;
  white-space: nowrap;
}
.group-member-role.active { border-color: #86efac; background: #f0fdf4; color: #15803d; }
.group-member-role.standby { border-color: #bfdbfe; background: #eff6ff; color: #1d4ed8; }

@media (max-width: 768px) {
  #groupManagerModal .group-manager-modal,
  .group-child-modal .group-edit-modal,
  .group-child-modal .group-rename-modal {
    width: calc(100vw - 16px) !important;
    max-height: calc(100dvh - 20px);
  }

  #groupManagerModal .modal-body { padding: 12px; }
  #groupManagerModal .group-create-row { grid-template-columns: minmax(0, 1fr) auto; }
  #groupManagerModal .group-manager-item { grid-template-columns: 1fr; gap: 11px; padding: 12px; }
  #groupManagerModal .group-name { white-space: normal; overflow-wrap: anywhere; }
  #groupManagerModal .group-title-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: start;
  }
  #groupManagerModal .group-actions {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    width: 100%;
  }
  #groupManagerModal .group-actions button {
    grid-column: span 2;
    width: 100%;
    padding-inline: 6px;
  }
  #groupManagerModal .group-actions button:nth-last-child(-n + 2) { grid-column: span 3; }

  .group-member-toolbar { grid-template-columns: 1fr auto; gap: 8px; }
  .group-member-toolbar input[type="search"] { grid-column: 1 / -1; }
  .group-member-select-all { justify-self: start; }
  .group-member-selected-count { justify-self: end; }
  .group-member-filters { margin-inline: -2px; }
  .group-edit-account { grid-template-columns: auto minmax(0, 1fr); }
  .group-member-state { grid-column: 2; justify-content: flex-start; }
}

@media (max-width: 420px) {
  #groupManagerModal .modal-header,
  #groupManagerModal .modal-footer,
  .group-child-modal .modal-header,
  .group-child-modal .modal-footer { padding-inline: 12px; }
  #groupManagerModal .group-actions { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* ==================== 分组统一资料与定向同步 ==================== */
#groupManagerModal .group-fields,
#groupManagerModal .group-sync-time {
  color: var(--text-muted);
  font-size: 10.5px;
  white-space: nowrap;
}

#groupManagerModal .group-fields {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

#groupManagerModal .group-sync-time { font-variant-numeric: tabular-nums; }

.group-child-modal .group-profile-modal { width: min(620px, calc(100vw - 40px)) !important; }
.group-profile-modal .modal-header > div,
.group-sync-modal .modal-header > div { min-width: 0; }
.group-profile-modal .modal-header p,
.group-sync-modal .modal-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
}

.group-profile-section {
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-secondary);
}

.group-profile-section-title { color: var(--text-primary); font-size: 12px; font-weight: 650; }
.group-profile-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}
.group-profile-field {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 12px;
}
.group-profile-field span { white-space: nowrap; }
.group-profile-field:has(input:checked) { border-color: #93c5fd; background: #eff6ff; color: #1d4ed8; }
.group-profile-field input { margin: 0; accent-color: var(--accent); }
.group-profile-help { margin: 8px 0 0; color: var(--text-muted); font-size: 11px; line-height: 1.5; }

.group-profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; margin-top: 13px; }
.group-profile-editor { position: relative; min-width: 0; margin: 0; }
.group-profile-editor-wide { grid-column: 1 / -1; }
.group-profile-editor.disabled { opacity: .48; }
.group-profile-editor input,
.group-profile-editor textarea { width: 100%; box-sizing: border-box; }
.required-mark { color: #dc2626; }
.group-profile-char-count { position: absolute; right: 8px; bottom: 7px; color: var(--text-muted); font-size: 10px; }

.group-child-modal .group-sync-modal { width: min(720px, calc(100vw - 40px)) !important; }
.group-sync-notice {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 10px;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 11px;
  line-height: 1.5;
}
.group-sync-notice strong { flex: 0 0 auto; font-size: 12px; }
.group-sync-toolbar { margin-bottom: 0; }
.group-sync-account.disabled { cursor: not-allowed; opacity: .62; }
.group-sync-account.disabled:hover { background: transparent; }
.group-sync-result { margin-top: 10px; border-top: 1px solid var(--border); }
.group-sync-result-summary { display: flex; gap: 10px; align-items: baseline; padding: 10px 2px 7px; font-size: 12px; }
.group-sync-result-summary.success { color: #166534; }
.group-sync-result-summary.warning { color: #92400e; }
.group-sync-result-summary.error { color: #991b1b; }
.group-sync-result-summary span { color: var(--text-secondary); font-size: 11px; }
.group-sync-result-list { max-height: 180px; overflow: auto; border: 1px solid var(--border); border-radius: 6px; }
.group-sync-result-row { display: grid; grid-template-columns: 20px minmax(100px, 160px) minmax(0, 1fr); gap: 8px; align-items: center; min-height: 32px; padding: 5px 9px; border-bottom: 1px solid var(--border); font-size: 11px; }
.group-sync-result-row:last-child { border-bottom: 0; }
.group-sync-result-row.success > span { color: #16a34a; font-weight: 700; }
.group-sync-result-row.error > span { color: #dc2626; font-weight: 700; }
.group-sync-result-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-sync-result-row small { overflow: hidden; color: var(--text-muted); text-overflow: ellipsis; white-space: nowrap; }

.group-child-modal .group-broadcast-modal { width: min(620px, calc(100vw - 40px)) !important; }
.group-broadcast-modal .modal-header > div { min-width: 0; }
.group-broadcast-modal .modal-header p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1.45;
}
.group-broadcast-modal .modal-body { overflow-y: auto; }
.group-broadcast-notice {
  display: flex;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 11px;
  line-height: 1.45;
}
.group-broadcast-notice strong { flex: 0 0 auto; font-size: 12px; }
.group-broadcast-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.group-broadcast-field { display: flex; min-width: 0; flex-direction: column; gap: 5px; color: var(--text-secondary); font-size: 12px; }
.group-broadcast-field input,
.group-broadcast-field select,
.group-broadcast-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-secondary);
  color: var(--text-primary);
  font: inherit;
  font-size: 12px;
}
.group-broadcast-field input,
.group-broadcast-field select { min-height: 34px; padding: 6px 9px; }
.group-broadcast-field textarea { min-height: 136px; padding: 8px 9px; line-height: 1.5; resize: vertical; }
.group-broadcast-direct { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--border); }
.group-broadcast-toggle { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 12px; cursor: pointer; }
.group-broadcast-toggle input { margin: 0; accent-color: var(--accent); }
.group-broadcast-generator { margin-top: 10px; }
.group-broadcast-messages { margin-top: 10px; }
.group-broadcast-post-fallback { margin-top: 10px; }
#groupBroadcastRandomGroup { margin-top: 8px; }
.group-broadcast-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.group-broadcast-footer > span { min-width: 0; color: var(--text-muted); font-size: 11px; }
.group-broadcast-footer > div { display: flex; flex: 0 0 auto; gap: 8px; }

@media (max-width: 768px) {
  .group-child-modal .group-profile-modal,
  .group-child-modal .group-sync-modal,
  .group-child-modal .group-broadcast-modal { width: calc(100vw - 16px) !important; }
  .group-profile-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #groupManagerModal .group-fields { max-width: 100%; }
  #groupManagerModal .group-sync-time { display: none; }
  .group-profile-form-grid { grid-template-columns: 1fr; }
  .group-profile-editor-wide { grid-column: auto; }
  .group-sync-notice { align-items: flex-start; flex-direction: column; gap: 2px; }
  .group-sync-result-row { grid-template-columns: 18px minmax(80px, 1fr); }
  .group-sync-result-row small { grid-column: 2; }
  .group-broadcast-grid { grid-template-columns: 1fr; }
  .group-broadcast-notice { align-items: flex-start; flex-direction: column; gap: 2px; }
  .group-broadcast-footer { align-items: stretch; flex-direction: column; }
  .group-broadcast-footer > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
  .group-broadcast-footer > div .btn { padding-inline: 5px; }
}
