:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --sidebar-bg: #0f2544;
  --sidebar-hover: #1a3a63;
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --shadow: 0 1px 3px rgba(15, 37, 68, 0.08), 0 1px 2px rgba(15, 37, 68, 0.06);
  --shadow-lg: 0 10px 25px rgba(15, 37, 68, 0.12);
}

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

body {
  font-family: "Segoe UI", "Microsoft YaHei", -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  position: relative;
  overflow: hidden;
}

.login-wrap::before,
.login-wrap::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.login-wrap::before {
  width: 480px;
  height: 480px;
  top: -180px;
  right: -120px;
}

.login-wrap::after {
  width: 360px;
  height: 360px;
  bottom: -160px;
  left: -100px;
}

.login-card {
  position: relative;
  z-index: 1;
  width: 400px;
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  padding: 44px 40px;
}

.login-logo {
  width: 60px;
  height: 60px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  color: #fff;
  font-size: 28px;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.login-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
}

.login-subtitle {
  text-align: center;
  color: var(--text-muted);
  margin: 6px 0 30px;
  font-size: 13px;
}

.form-group {
  margin-bottom: 18px;
}

.form-group label {
  display: block;
  margin-bottom: 7px;
  font-weight: 500;
  color: var(--text);
  font-size: 13px;
}

.form-input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  transition: all 0.2s;
  background: #f8fafc;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.btn {
  cursor: pointer;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-block {
  width: 100%;
  padding: 12px;
  font-size: 15px;
}

.btn-secondary {
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: #f8fafc;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
}

.login-error {
  background: #fef2f2;
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 16px;
  display: none;
}

.login-tip {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  margin-top: 20px;
}

/* ---------- 主布局 ---------- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 230px;
  background: var(--sidebar-bg);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  padding: 22px 24px;
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand .logo-box {
  width: 34px;
  height: 34px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sidebar-menu {
  padding: 16px 12px;
  flex: 1;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 9px;
  cursor: pointer;
  margin-bottom: 4px;
  transition: all 0.2s;
  font-size: 14px;
}

.menu-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.menu-item.active {
  background: var(--primary);
  color: #fff;
}

.menu-item .icon {
  font-size: 18px;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar {
  height: 62px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 600;
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--text-muted);
}

.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.content {
  padding: 26px 28px;
  flex: 1;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 22px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.blue { background: #dbeafe; }
.stat-icon.green { background: #dcfce7; }
.stat-icon.purple { background: #ede9fe; }
.stat-icon.orange { background: #ffedd5; }

.stat-info .num {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.stat-info .label {
  color: var(--text-muted);
  font-size: 13px;
  margin-top: 2px;
}

/* ---------- 卡片/图表 ---------- */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px 22px;
  margin-bottom: 20px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.chart-box {
  height: 300px;
}

/* ---------- 实时任务与 Cloak 槽位 ---------- */
.runtime-card {
  padding: 0;
  overflow: hidden;
}

.runtime-card-header {
  min-height: 72px;
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--border);
}

.runtime-card-title {
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.runtime-live-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #64748b;
  font-size: 12px;
  font-weight: 500;
}

.runtime-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.runtime-live-state.busy { background: #dcfce7; color: #15803d; }
.runtime-live-state.queued { background: #fff7ed; color: #c2410c; }
.runtime-live-state.error { background: #fee2e2; color: #b91c1c; }

.runtime-updated,
.runtime-task-count {
  color: var(--text-muted);
  font-size: 12px;
}

.runtime-task-count {
  white-space: nowrap;
}

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

.runtime-slot {
  min-width: 0;
  padding: 16px 22px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  border-right: 1px solid var(--border);
}

.runtime-slot:last-child { border-right: 0; }
.runtime-slot span { color: var(--text-muted); font-size: 12px; }
.runtime-slot strong { font-size: 22px; line-height: 1; }

.runtime-meter {
  height: 4px;
  background: #e2e8f0;
  overflow: hidden;
}

.runtime-meter span {
  display: block;
  width: 0;
  height: 100%;
  background: #2563eb;
  transition: width .25s ease, background .25s ease;
}

.runtime-meter span.high { background: #d97706; }
.runtime-meter span.full { background: #dc2626; }

.runtime-table-wrap { overflow-x: auto; }
.runtime-table { min-width: 720px; }
.runtime-table.is-empty { min-width: 0; }
.runtime-table th { background: #f8fafc; }
.runtime-table td { vertical-align: middle; }

.runtime-task-type {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 4px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.runtime-target {
  display: block;
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-stage {
  display: block;
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.runtime-slot-state { color: #475569; font-size: 12px; white-space: nowrap; }
.runtime-slot-state.using { color: #15803d; font-weight: 600; }
.runtime-slot-state.waiting { color: #c2410c; font-weight: 600; }
.runtime-elapsed { color: #475569; font-variant-numeric: tabular-nums; white-space: nowrap; }
.runtime-empty { color: var(--text-muted); text-align: center; padding: 30px 16px !important; }

/* ---------- 工具栏 ---------- */
.toolbar {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar .form-input,
.toolbar select {
  width: auto;
  min-width: 150px;
}

select.form-input {
  cursor: pointer;
}

.toolbar-spacer {
  flex: 1;
}

.account-active-batches {
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.account-active-batches[hidden] {
  display: none;
}

.account-active-batches-header {
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.account-active-batches-header .card-title {
  margin: 0;
  font-size: 14px;
}

.account-active-batches-count {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.account-active-batch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.account-active-batch-row:last-child {
  border-bottom: 0;
}

.account-active-batch-main {
  min-width: 0;
}

.account-active-batch-title,
.account-active-batch-meta,
.account-active-batch-stats {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.account-active-batch-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.account-active-batch-id {
  color: var(--text-muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
}

.account-active-batch-meta,
.account-active-batch-stats {
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-active-batch-meta {
  margin-top: 3px;
}

.account-active-batch-stats {
  margin-top: 4px;
}

.account-active-batch-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: #dbeafe;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
}

.account-active-batch-status.cancelling {
  background: #fef3c7;
  color: #b45309;
}

.account-active-batch-progress {
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.account-active-batch-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--primary);
  transition: width .25s ease;
}

.account-active-batch-action {
  flex: 0 0 auto;
}

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

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

th, td {
  padding: 13px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fafc;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
}

.badge-plan-Free { background: #f1f5f9; color: #475569; }
.badge-plan-Plus { background: #dbeafe; color: #1d4ed8; }
.badge-plan-Pro { background: #ede9fe; color: #7c3aed; }
.badge-plan-Team { background: #fef3c7; color: #b45309; }

.badge-status-正常 { background: #dcfce7; color: #16a34a; }
.badge-status-部分完成 { background: #fef3c7; color: #b45309; }
.badge-status-待验证 { background: #fff7ed; color: #c2410c; }
.form-group.is-disabled { opacity: .58; }
.badge-status-已封禁 { background: #fee2e2; color: #dc2626; }
.badge-status-已过期 { background: #fef3c7; color: #d97706; }
.badge-status-未检测 { background: #f1f5f9; color: #64748b; }
.badge-mfa-enabled { background: #dcfce7; color: #15803d; }
.badge-mfa-pending { background: #fef3c7; color: #b45309; }
.badge-mfa-disabled { background: #f1f5f9; color: #64748b; }
.badge-account-gmail { background: #eef2ff; color: #4338ca; }
.badge-account-vmail { background: #ecfdf5; color: #047857; }
.badge-account-smsbower { background: #fff7ed; color: #c2410c; }
.badge-account-herosms { background: #eff6ff; color: #1d4ed8; }

/* 代理状态徽章 */
.badge-status-可用 { background: #dcfce7; color: #16a34a; }
.badge-status-不可用 { background: #fee2e2; color: #dc2626; }

/* 提链结果徽章 */
.badge-lg-success { background: #dcfce7; color: #16a34a; }
.badge-lg-done { background: #dcfce7; color: #16a34a; }
.badge-lg-blocked { background: #fef3c7; color: #d97706; }
.badge-lg-expired { background: #fef3c7; color: #d97706; }
.badge-lg-failed { background: #fee2e2; color: #dc2626; }
.badge-lg-error { background: #fee2e2; color: #dc2626; }
.badge-lg-cancelled { background: #fee2e2; color: #dc2626; }
.badge-lg-running { background: #dbeafe; color: #2563eb; }
.badge-lg-queued { background: #e0e7ff; color: #4f46e5; }
.badge-lg-skipped { background: #f1f5f9; color: #64748b; }
.badge-lg-pending { background: #f1f5f9; color: #64748b; }

/* 提链字段小字提示(如出口代理是否需要) */
.lg-sub-hint { font-size: 11px; font-weight: 400; color: var(--text-muted); }

/* 国家代理组：账号检测、批量提链和定时探测均可按代码或中文国家名搜索。 */
.lg-search-select-native { display: none !important; }
.lg-search-select { position: relative; width: 100%; }
.toolbar > .lg-search-select {
  flex: 0 1 320px;
  width: 320px;
  min-width: 240px;
}
.toolbar > .lg-search-select .form-input {
  width: 100%;
  min-width: 0;
}
.lg-search-select::after {
  content: "⌄";
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-54%);
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1;
  pointer-events: none;
}
.lg-search-select-input {
  padding-right: 34px;
  cursor: text;
}
.lg-search-select-popup {
  position: absolute;
  z-index: 80;
  top: calc(100% + 5px);
  left: 0;
  right: 0;
  max-height: 286px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.16);
}
.lg-search-select-popup[hidden] { display: none; }
.lg-search-select-option {
  display: block;
  width: 100%;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.lg-search-select-option:hover,
.lg-search-select-option.active {
  background: #eff6ff;
  color: var(--primary);
}
.lg-search-select-option[aria-selected="true"] {
  font-weight: 600;
}
.lg-search-select-empty {
  padding: 18px 10px;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

/* 提链进度条 */
.lg-progress {
  height: 6px; background: #e2e8f0; border-radius: 4px; overflow: hidden;
}
.lg-progress-bar {
  height: 100%; background: var(--primary, #2563eb);
  border-radius: 4px; transition: width 0.4s ease; width: 0;
}
.lg-progress-bar.active {
  background: linear-gradient(90deg, #3b82f6, #60a5fa, #3b82f6);
  background-size: 200% 100%; animation: lg-flow 1.2s linear infinite;
}
@keyframes lg-flow { from { background-position: 200% 0; } to { background-position: 0 0; } }
.lg-progress-text { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* 批量提链参数表单:一行 5 列,窄屏自动回落 */
.linkgen-form {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px 18px;
}
.linkgen-form .form-group {
  margin-bottom: 0;
  min-width: 0;
}
@media (max-width: 1280px) {
  .linkgen-form { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .linkgen-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .linkgen-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
  .linkgen-form { grid-template-columns: 1fr; }
}

.pwd-cell {
  cursor: pointer;
  color: var(--text-muted);
  font-family: monospace;
  user-select: none;
}

/* 操作列:保持 <td> 为正常表格单元格(不要用 flex,否则会脱离列网格导致错位),
   按钮改为行内排列并用间距分隔 */
.row-actions {
  white-space: nowrap;
}

.row-actions .link-btn {
  margin-right: 14px;
}

.row-actions .link-btn:last-child {
  margin-right: 0;
}

.link-btn {
  cursor: pointer;
  color: var(--primary);
  background: none;
  border: none;
  font-size: 13px;
  padding: 0;
}

.link-btn.danger { color: var(--danger); }
.link-btn:hover { text-decoration: underline; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
}

.pagination-info {
  color: var(--text-muted);
  font-size: 13px;
}

.pagination-actions,
.page-size-control {
  display: flex;
  align-items: center;
}

.pagination-actions {
  gap: 12px;
}

.page-size-control {
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

.page-size-select {
  height: 32px;
  min-width: 64px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
}

.page-size-select:focus {
  border-color: var(--primary);
  outline: none;
}

.pagination-btns {
  display: flex;
  gap: 6px;
}

.page-btn {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-mask.show {
  display: flex;
}

.modal {
  background: #fff;
  border-radius: 14px;
  width: 540px;
  max-width: 92vw;
  max-height: 88vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 16px;
}

.modal-close {
  cursor: pointer;
  font-size: 22px;
  color: var(--text-muted);
  background: none;
  border: none;
  line-height: 1;
}

.modal-body {
  padding: 22px 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.vmail-register-modal { width: 560px; }
.vmail-register-grid {
  display: grid;
  grid-template-columns: minmax(120px, 160px) minmax(0, 1fr);
  gap: 16px;
}
.vmail-register-status {
  min-height: 20px;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.5;
}
.vmail-register-status.error { color: var(--danger); }
.vmail-register-status.ok { color: var(--success); }
.vmail-register-status.warning { color: var(--warning); }
.sms-country-picker { display: grid; gap: 8px; }
.at-delay-toggle { min-height: 38px; }
.input-with-unit { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.input-with-unit > span { color: var(--text-muted); font-size: 13px; white-space: nowrap; }
.vmail-create-modal { width: 760px; }
.vmail-create-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; gap: 18px; align-items: stretch; }
.vmail-create-main { min-width: 0; }
.vmail-acquire-at-check { margin-top: 14px; color: var(--text); }
.vmail-at-panel { border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; padding: 14px; }
.vmail-at-panel-title { margin-bottom: 12px; color: var(--text); font-size: 13px; font-weight: 600; }

textarea.form-input {
  resize: vertical;
  font-family: monospace;
  line-height: 1.6;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.tab {
  padding: 10px 16px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 14px;
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 500;
}

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

.hint {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  margin-bottom: 14px;
  line-height: 1.6;
}

.import-result {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  display: none;
}

.import-result.success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
}

/* ---------- 提示条 ---------- */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 11px 22px;
  border-radius: 9px;
  font-size: 14px;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  top: 30px;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 40px;
}

.checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .chart-row { grid-template-columns: 1fr; }
  .runtime-slot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .runtime-slot:nth-child(2) { border-right: 0; }
  .runtime-slot:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .runtime-card-header { align-items: flex-start; }
}

@media (max-width: 520px) {
  .runtime-card-header { flex-direction: column; gap: 6px; }
  .runtime-slot { padding: 14px 16px; }
  .runtime-slot strong { font-size: 19px; }
}

/* 批量开通:模式切换 */
.ac-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.ac-mode {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ac-mode.active {
  border-color: var(--primary);
  background: rgba(37, 99, 235, 0.06);
}
.ac-mode input { accent-color: var(--primary); }
.ac-mode span { display: flex; flex-direction: column; }
.ac-mode b { font-size: 14px; }
.ac-mode small { color: var(--text-muted); font-size: 12px; }

.account-export-modal .ac-mode { border-radius: 8px; }
.account-export-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 16px;
}
.account-export-field {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  color: var(--text);
  cursor: pointer;
}
.account-export-field input { accent-color: var(--primary); }
#exportTxtFields[hidden] { display: none; }

/* 批量开通:临时浏览器实时画面 */
.ac-browser-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.ac-browser-screen-wrap {
  background: #0b1020;
  border-radius: 8px;
  overflow: hidden;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ac-browser-screen {
  width: 100%;
  display: block;
  cursor: crosshair;
}

@media (max-width: 720px) {
  .ac-mode-switch { grid-template-columns: 1fr; }
  .account-export-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* 批量提链:单次/定时 标签页 */
.lg-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  border-bottom: 2px solid var(--border, #e2e8f0);
}
.lg-tab {
  background: none;
  border: none;
  padding: 10px 20px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.lg-tab:hover { color: var(--primary); }
.lg-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ---------- 系统设置 / 实时日志 ---------- */
.settings-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  align-items: start;
}
.settings-card { margin-bottom: 0; }
.settings-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.settings-subtitle { color: var(--text-muted); font-size: 12px; line-height: 1.55; margin-top: 3px; }
.settings-state {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}
.settings-state.ok { background: #dcfce7; color: #166534; }
.settings-state.warn { background: #fef3c7; color: #92400e; }
.settings-form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.settings-span-2 { grid-column: 1 / -1; }
.settings-provider-block { padding: 14px; border: 1px solid var(--border); border-radius: 10px; background: #f8fafc; }
.settings-provider-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.settings-provider-block > .hint { margin: 10px 0 0; overflow-wrap: anywhere; }
.settings-inline-checks { display: flex; gap: 20px; flex-wrap: wrap; }
.settings-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-muted); cursor: pointer; }
.settings-check input { accent-color: var(--primary); }
.sms-register-security-options { grid-column: 1 / -1; }
.account-security-field { display: flex; align-items: center; gap: 8px; }
.account-security-field .form-input { flex: 1; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.account-totp-code-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 9px; }
.account-totp-code-actions code { min-width: 72px; font-size: 18px; font-weight: 700; letter-spacing: 2px; color: var(--primary); }
.settings-secret-clear { margin-top: 7px; color: var(--danger); }
.settings-actions { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 18px; }
.settings-action-status { color: var(--text-muted); font-size: 12px; }
.settings-save-bar { margin-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.settings-save-actions { display: flex; align-items: center; gap: 14px; }
#settingsSavedState { color: var(--success); font-size: 13px; }
.log-page-card { min-height: calc(100vh - 150px); }
.log-connection { display: inline-flex; align-items: center; gap: 7px; color: var(--text-muted); font-size: 12px; }
.log-conn-dot { width: 9px; height: 9px; border-radius: 50%; background: #94a3b8; box-shadow: 0 0 0 3px rgba(148,163,184,.18); }
.log-conn-dot.ok { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.16); }
.log-conn-dot.error { background: #ef4444; box-shadow: 0 0 0 3px rgba(239,68,68,.16); }
.log-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.log-toolbar select { width: 130px; }
.log-toolbar input[type="text"], .log-toolbar > input.form-input { max-width: 320px; }
.realtime-log-view {
  height: calc(100vh - 265px);
  min-height: 420px;
  overflow: auto;
  background: #07111f;
  color: #cbd5e1;
  border: 1px solid #1e293b;
  border-radius: 10px;
  padding: 12px 14px;
  font: 12px/1.65 Consolas, "Cascadia Code", monospace;
}
.realtime-log-empty { color: #64748b; text-align: center; padding: 50px 0; }
.realtime-log-line { display: grid; grid-template-columns: 78px 58px minmax(90px, 150px) 1fr; gap: 8px; padding: 3px 0; border-bottom: 1px solid rgba(148,163,184,.06); }
.realtime-log-time { color: #64748b; }
.realtime-log-scope { color: #7dd3fc; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.realtime-log-level { font-weight: 700; }
.realtime-log-level.debug { color: #94a3b8; }
.realtime-log-level.info { color: #60a5fa; }
.realtime-log-level.ok { color: #4ade80; }
.realtime-log-level.warn { color: #fbbf24; }
.realtime-log-level.error { color: #f87171; }
.realtime-log-message { color: #e2e8f0; white-space: pre-wrap; word-break: break-word; }
@media (max-width: 1100px) { .settings-layout { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .settings-form-grid { grid-template-columns: 1fr; }
  .settings-span-2 { grid-column: auto; }
  .settings-save-bar { align-items: flex-start; flex-direction: column; }
  .realtime-log-line { grid-template-columns: 66px 50px 1fr; }
  .realtime-log-message { grid-column: 1 / -1; padding-left: 0; }
}

@media (max-width: 720px) {
  .layout { display: block; }
  .sidebar { width: 100%; min-height: 0; }
  .sidebar-brand { padding: 10px 14px; font-size: 15px; }
  .sidebar-brand .logo-box { width: 30px; height: 30px; font-size: 15px; }
  .sidebar-menu { display: flex; gap: 4px; padding: 8px; overflow-x: auto; scrollbar-width: thin; }
  .menu-item { flex: 0 0 auto; gap: 7px; margin: 0; padding: 9px 11px; font-size: 13px; }
  .menu-item .icon { font-size: 15px; }
  .main { width: 100%; }
  .topbar { height: 54px; padding: 0 14px; }
  .topbar-user { gap: 8px; font-size: 12px; }
  .content { padding: 14px; }
  .toolbar { flex-wrap: wrap; }
  .account-active-batch-row { grid-template-columns: 1fr; gap: 10px; }
  .account-active-batch-action { justify-self: start; }
  .settings-section-head { flex-direction: column; gap: 8px; }
  .settings-actions { align-items: stretch; flex-direction: column; }
  .settings-actions .btn { width: 100%; }
}

@media (max-width: 600px) {
  .vmail-register-grid { grid-template-columns: 1fr; gap: 10px; }
  .vmail-create-layout { grid-template-columns: 1fr; }
  .vmail-register-modal .modal-body { padding: 18px; }
  .vmail-register-modal .modal-footer { padding: 14px 18px; }
}

/* 卡池 */
.card-pool-security-hint {
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 13px;
}
.card-pool-table table { min-width: 1180px; }
.card-pool-address { max-width: 280px; line-height: 1.45; white-space: normal; }
.card-pool-last-error { color: var(--danger); font-size: 11px; max-width: 220px; white-space: normal; }
.card-pool-last-ok { color: var(--success); font-size: 11px; }
.modal-wide { width: min(920px, calc(100vw - 32px)); max-width: 920px; }
.card-edit-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.card-edit-span-2 { grid-column: span 2; }
@media (max-width: 760px) {
  .card-edit-grid { grid-template-columns: 1fr; }
  .card-edit-span-2 { grid-column: auto; }
}
