/* ===================================
   ChatGPT 凭证管理系统 - 玻璃磨砂风格
   =================================== */

/* --- CSS 变量 --- */
:root {
  --bg-base: #eef1f6;
  --bg-gradient-1: #e8ecf3;
  --bg-gradient-2: #eceff5;

  --glass-bg: rgba(255, 255, 255, 0.82);
  --glass-bg-hover: rgba(255, 255, 255, 0.92);
  --glass-border: rgba(226, 232, 240, 0.95);
  --glass-border-hover: rgba(203, 213, 225, 0.95);
  --glass-shadow: rgba(15, 23, 42, 0.04);

  --accent: #3b5bdb;
  --accent-light: #4c6ef5;
  --accent-lighter: #a5b4fc;
  --accent-bg: rgba(59, 91, 219, 0.08);
  --accent-glow: rgba(59, 91, 219, 0.12);

  --accent-2: #0ea5e9;
  --accent-2-glow: rgba(14, 165, 233, 0.12);

  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --imap-color: #e11d48;
  --imap-bg: rgba(225, 29, 72, 0.08);
  --graph-color: #059669;
  --graph-bg: rgba(5, 150, 105, 0.08);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.08);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.08);
  --error: #ef4444;
  --error-bg: rgba(239, 68, 68, 0.08);

  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow-md: 0 4px 16px rgba(100, 120, 180, 0.1), 0 1px 4px rgba(0,0,0,0.04);
  --shadow-lg: 0 8px 32px rgba(100, 120, 180, 0.15), 0 2px 8px rgba(0,0,0,0.05);

  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 重置 --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 15px; -webkit-font-smoothing: auto; -moz-osx-font-smoothing: auto; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.55;
  letter-spacing: 0;
  font-weight: 400;
}

/* --- 动态背景 --- */
.bg-animation {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  z-index: 0; overflow: hidden; pointer-events: none;
  background: linear-gradient(160deg, #eef1f6 0%, #e9eef5 40%, #f1f4f8 100%);
}

.bg-orb {
  position: absolute; border-radius: 50%;
  filter: blur(120px); opacity: 0.28;
  animation: orbFloat 25s ease-in-out infinite;
}

.bg-orb-1 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(147, 197, 253, 0.5), transparent 70%);
  top: -15%; left: -10%;
}

.bg-orb-2 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(196, 181, 253, 0.4), transparent 70%);
  top: 40%; right: -10%;
  animation-delay: -8s;
}

.bg-orb-3 {
  width: 450px; height: 450px;
  background: radial-gradient(circle, rgba(165, 218, 255, 0.45), transparent 70%);
  bottom: -10%; left: 25%;
  animation-delay: -16s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.05); }
  50% { transform: translate(-25px, 25px) scale(0.95); }
  75% { transform: translate(20px, 40px) scale(1.03); }
}

/* --- 玻璃面板 --- */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(8px) saturate(1.05);
  -webkit-backdrop-filter: blur(8px) saturate(1.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
}

/* --- 容器 --- */
.app-container {
  position: relative; z-index: 1;
  max-width: 1680px; margin: 0 auto;
  padding: 20px; min-height: 100vh;
  display: flex; flex-direction: column; gap: 14px;
}

/* --- 顶部栏 --- */
.app-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 22px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(8px) saturate(1.05);
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.header-left { display: flex; align-items: center; gap: 12px; }
.header-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.proxy-mode-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.25);
}
.proxy-mode-pill.is-gateway {
  color: #0369a1;
  background: rgba(14, 165, 233, 0.12);
  border-color: rgba(14, 165, 233, 0.28);
}
.proxy-mode-pill.is-pool {
  color: #166534;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.28);
}
.header-actions .btn.active {
  color: var(--accent);
  background: rgba(37, 99, 235, 0.1);
  border-color: rgba(37, 99, 235, 0.28);
}
.gateway-form { display: flex; flex-direction: column; gap: 12px; }
.gateway-ports { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.gateway-status {
  font-size: 0.82rem;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.08);
}

/* ==================== 提链工作台 ==================== */
.link-workbench { display: flex; flex-direction: column; gap: 14px; }
.link-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 18px 20px;
}
.link-toolbar h3 { margin: 0 0 4px; font-size: 1rem; }
.link-toolbar-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.link-toolbar-actions .btn {
  font-size: 1.05rem;
  font-weight: 700;
  padding: 10px 16px;
  min-height: 44px;
}
.quota-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 1.05rem;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(148, 163, 184, 0.12);
  color: #64748b;
  min-height: 44px;
}
.quota-live b { font-variant-numeric: tabular-nums; font-size: 1.2rem; font-weight: 800; }
.quota-live.quota-ok {
  color: #166534;
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.28);
}
.quota-live.quota-warn {
  color: #92400e;
  background: rgba(245, 158, 11, 0.16);
  border-color: rgba(245, 158, 11, 0.32);
}
.quota-live.quota-danger {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.28);
}
.quota-live.quota-unknown {
  color: #64748b;
  background: rgba(148, 163, 184, 0.12);
}
.link-stats { display: grid; grid-template-columns: repeat(6, minmax(110px, 1fr)); gap: 10px; }
.link-table-wrapper { overflow-x: auto; }
/* 表格区：半透明毛玻璃 + overflow:hidden 会在 Chromium 里整片不绘制文字 */
.link-table-wrapper.solid-panel {
  background: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  /* 这两行是 Chromium 表格文字不绘制的修复，去掉又会空白 */
  isolation: isolate;
  transform: translateZ(0);
}
.link-table {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  transform: translateZ(0);
}
.link-table thead th {
  background: #ffffff !important;
  color: #475569 !important;
  font-weight: 600;
  font-size: 12px;
}
.link-table tbody td {
  background: #ffffff !important;
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  overflow: visible !important;
  font-weight: 400;
}
.link-table tbody tr.row-reviewed td {
  background: #f8fafc !important;
}
.link-table tbody .link-email-copy {
  color: #111827 !important;
  -webkit-text-fill-color: #111827 !important;
  font-weight: 500;
}
.link-table tbody .link-source,
.link-table tbody .cell-batch,
.link-table tbody .link-countdown {
  color: #64748b;
  -webkit-text-fill-color: #64748b;
  font-weight: 400;
}
.link-table tbody .link-status,
.link-table tbody .link-at {
  -webkit-text-fill-color: currentColor;
}
.btn.btn-muted-empty {
  opacity: 0.72;
  background: rgba(37, 99, 235, 0.45);
  border-color: transparent;
}
.btn.btn-action-locked,
.btn[data-action-locked="1"] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.35);
  pointer-events: none;
}
.link-load-more-row td {
  text-align: center;
  padding: 14px 12px !important;
  background: rgba(0, 0, 0, 0.015);
}
.link-load-more-btn { width: min(100%, 420px); }

/* 页面中右：一键回顶 */
.back-to-top {
  position: fixed;
  right: 18px;
  top: auto;
  bottom: 28px;
  transform: none;
  z-index: 40;
  min-width: 52px;
  padding: 12px 10px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.25;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.1);
  cursor: pointer;
  writing-mode: horizontal-tb;
}
.back-to-top:hover {
  background: #fff;
  border-color: rgba(37, 99, 235, 0.4);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.18);
}
.back-to-top[hidden] { display: none !important; }
@media (max-width: 900px) {
  .back-to-top {
    right: 12px;
    top: auto;
    bottom: 22px;
    transform: none;
    padding: 10px 12px;
  }
}
/* 固定列宽：状态文本在轮询中变化时不能让整张表重新排版 */
.link-table { width: 100%; min-width: 1840px; border-collapse: collapse; table-layout: fixed; }
.link-table th, .link-table td {
  padding: 10px 10px; text-align: left; vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.link-table th:last-child,
.link-table td:last-child {
  padding-right: 22px;
}
.link-table tbody tr { min-height: 68px; height: auto; }
.link-table th {
  position: sticky; top: 0; z-index: 1;
  color: var(--text-secondary); font-weight: 600;
  background: var(--surface);
}
.link-source { display: block; margin-top: 3px; color: var(--text-muted); font-size: 0.72rem; }
button.link-email-copy {
  display: inline;
  max-width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  word-break: break-all;
}
button.link-email-copy:hover { color: var(--accent); text-decoration: underline; }
.link-at, .link-status {
  display: inline-flex; align-items: center; white-space: nowrap;
  padding: 3px 8px; border-radius: 999px; font-size: 0.75rem;
}
.link-at.available { color: #166534; background: rgba(34, 197, 94, 0.12); }
.link-at.missing { color: #991b1b; background: rgba(239, 68, 68, 0.1); }
button.link-at-copy {
  border: none;
  cursor: pointer;
  font: inherit;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
button.link-at-copy:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
button.link-at-copy:active { transform: translateY(0); }
.link-status.status-ready { color: #1d4ed8; background: rgba(59, 130, 246, 0.12); }
.link-status.status-active { color: #92400e; background: rgba(245, 158, 11, 0.14); }
.link-status.status-completed { color: #166534; background: rgba(34, 197, 94, 0.14); }
.link-status.status-expired, .link-status.status-failed { color: #991b1b; background: rgba(239, 68, 68, 0.11); }
.link-status.status-business-completed { color: #6b21a8; background: rgba(168, 85, 247, 0.12); }
.link-status.status-no-at { color: #475569; background: rgba(100, 116, 139, 0.12); }
.link-status.status-plus-pending, .link-status.status-plus-running { color: #92400e; background: rgba(245, 158, 11, 0.14); }
.link-status.status-plus-plus_active { color: #166534; background: rgba(34, 197, 94, 0.14); }
.link-status.status-plus-free { color: #1d4ed8; background: rgba(59, 130, 246, 0.12); }
/* 复核过仍无订阅：代付没到账，是要处理的钱损，标红而非普通 free 蓝 */
.link-status.status-plus-free_confirmed,
.link-status.status-plus-session_invalid,
.link-status.status-plus-at_revoked,
.link-status.status-plus-failed,
.link-status.status-plus-error,
.link-status.status-plus-local_missing,
.link-status.status-plus-no_session_token,
.link-status.status-plus-check_failed,
.link-status.status-plus-suspected_banned,
.link-status.status-plus-agent_error { color: #991b1b; background: rgba(239, 68, 68, 0.11); }
.link-status.status-delivery-not_submitted { color: #475569; background: rgba(100, 116, 139, 0.12); }
.link-status.status-delivery-submitting,
.link-status.status-delivery-pending,
.link-status.status-delivery-processing { color: #92400e; background: rgba(245, 158, 11, 0.14); }
.link-status.status-delivery-succeeded,
.link-status.status-pay153-completed,
.link-status.status-pay153-otp { color: #166534; background: rgba(34, 197, 94, 0.14); }
.pay153-step.pay153-otp-done,
.pay153-step.pay153-otp-done b { color: #166534; }
.link-status.status-delivery-failed,
.link-status.status-pay153-failed { color: #991b1b; background: rgba(239, 68, 68, 0.11); }
.link-status.status-delivery-unknown { color: #9a3412; background: rgba(249, 115, 22, 0.14); }
.link-at, .link-status { max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-block; }
.link-table tr.row-reviewed .link-at,
.link-table tr.row-reviewed .link-status-extract {
  color: var(--text-muted) !important;
  background: rgba(148, 163, 184, 0.14) !important;
}
.link-table tr.row-reviewed .link-at-copy:hover { box-shadow: none; transform: none; }
.link-countdown { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.link-countdown.urgent { color: #dc2626; animation: badgePulse 1.2s infinite; }
.link-countdown.expired { color: var(--error); }
.link-result-url { display: block; max-width: 100%; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.link-result-url {
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  text-decoration: underline;
}
button.link-result-url:hover { color: var(--accent-hover, var(--accent)); }
.link-error-text { display: block; max-width: 100%; color: var(--error); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-source { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pay153-step {
  display: block;
  margin: 0 0 4px;
  color: var(--text);
  font-size: 0.78rem;
  line-height: 1.35;
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
}
.pay153-step b { font-weight: 600; }
.link-error-text.pay153-step { color: var(--error); }
.cell-email-wrap button.link-email-copy {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}
.link-section-bar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 12px;
  align-items: stretch;
  padding: 12px;
  margin-bottom: 14px;
}
.link-section-tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  min-height: 96px;
  padding: 14px 16px 14px 18px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(100, 120, 180, 0.08);
  cursor: pointer;
  text-align: left;
  transition: background .15s, color .15s, border-color .15s, box-shadow .15s, transform .15s;
  min-width: 0;
  overflow: hidden;
}
.link-section-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #94a3b8;
}
.link-section-tab[data-section="pending"]::before { background: #2563eb; }
.link-section-tab[data-section="awaiting"]::before { background: #0ea5e9; }
.link-section-tab[data-section="done"]::before { background: #10b981; }
.link-section-tab[data-section="sms"]::before { background: #8b5cf6; }
.link-section-tab[data-section="rebind"]::before { background: #0f766e; }
.link-section-tab[data-section="codex"]::before { background: #f59e0b; }
.link-section-tab[data-section="invalid"]::before { background: #ef4444; }
.link-section-tab[data-section="standby"]::before { background: #64748b; }
.link-section-tab[data-section="standby2"]::before { background: #0d9488; }
.link-section-tab[data-section="standby3"]::before { background: #7c3aed; }
.link-section-tab[data-section="standby4"]::before { background: #db2777; }
.link-section-tab[data-section="standby5"]::before { background: #ea580c; }
.link-section-tab[data-section="standby6"]::before { background: #0891b2; }
.link-section-tab[data-section="standby7"]::before { background: #4d7c0f; }
.link-section-tab[data-section^="standby"] .link-section-name,
.link-section-tab[data-section^="standby"] .link-section-sub {
  cursor: text;
}
.link-section-tab[data-section^="standby"] .link-section-sub {
  white-space: normal;
}
.link-section-name[contenteditable="true"],
.link-section-sub[contenteditable="true"] {
  outline: 2px solid #93c5fd;
  border-radius: 6px;
  padding: 0 4px;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
}
.link-section-tab:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-1px);
}
/* 当前栏目：实心蓝底，和白卡片一眼能分开 */
.link-section-tab.active {
  border-color: #1d4ed8;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(29, 78, 216, 0.45), 0 8px 18px rgba(37, 99, 235, 0.32);
}
.link-section-tab.active::before { background: #1e3a8a; width: 5px; }
.link-section-tab.active .link-section-kicker { color: rgba(255, 255, 255, 0.82); }
.link-section-tab.active .link-section-name { color: #fff; font-weight: 800; }
.link-section-tab.active .link-section-sub { color: #dbeafe; }
.link-section-tab.active .link-section-sub b { color: #fff; }
.link-section-tab.active .link-section-badge {
  background: #fff;
  color: #1d4ed8;
  border-color: #fff;
}
.link-section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1;
}
.link-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-width: 0;
}
.link-section-name {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-section-badge {
  flex: 0 0 auto;
  min-width: 2.2em;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: rgba(37, 99, 235, 0.1);
  color: #1d4ed8;
  font-size: 1.35rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  text-align: center;
}
.link-section-sub {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.link-section-sub b { font-weight: 800; color: inherit; }
@media (max-width: 1400px) {
  .link-section-bar { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
  .link-section-name { font-size: 1.08rem; }
  .link-section-badge { font-size: 1.2rem; }
}
@media (max-width: 1100px) {
  .link-section-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 800px) {
  .link-section-bar { grid-template-columns: 1fr; }
}

#smsInventoryPanel[hidden],
#rebindPoolPanel[hidden],
#codexSmsPanel[hidden],
#linkAccountsPanel[hidden],
#codexImportSetup[hidden],
.codex-workers-bar[hidden] { display: none !important; }
#smsInventoryPanel:not([hidden]) { display: block !important; }
.codex-config-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.codex-config-row .input { flex: 1; min-width: 180px; }
.codex-workers-bar {
  margin-bottom: 10px;
  padding-bottom: 4px;
}
.codex-workers-bar #codexRuntimeStatus {
  margin-right: auto;
  font-size: 0.9rem;
}
.codex-workers-bar #codexWorkersInput {
  flex: 0 0 auto;
  min-width: 80px;
  width: 80px;
}
.codex-smsbower-bar {
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  background: rgba(0,0,0,.12);
}
.codex-smsbower-bar #codexSmsbowerApiKey {
  flex: 1 1 280px;
  min-width: 220px;
  max-width: 420px;
}
.codex-smsbower-opts {
  margin-bottom: 10px;
}
.codex-smsbower-opts .input {
  flex: 0 0 72px;
  min-width: 72px;
  width: 72px;
}
#codexSmsbowerStatus {
  font-size: 0.9rem;
}
.codex-log-view {
  margin: 0;
  max-height: 220px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.codex-main-actions {
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.codex-main-actions-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  flex: 1 1 0;
  min-width: 0;
}
.codex-main-actions .btn {
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 16px;
  line-height: 1.3;
}
.codex-main-actions .input {
  font-size: 0.92rem;
  min-height: 40px;
  padding: 8px 12px;
}
.codex-table { min-width: 1320px; }
.codex-table .btn-small,
.codex-actions-cell .btn {
  font-size: 0.88rem;
  padding: 8px 12px;
}
.codex-actions-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.codex-status { font-weight: 600; }
.codex-status-pending { color: #64748b; }
.codex-status-running { color: #2563eb; }
.codex-status-success { color: #15803d; }
.codex-status-failed { color: #b91c1c; }
.codex-status-stopped { color: #b45309; }
.codex-status-deactivated { color: #94a3b8; }
.codex-status-imported { color: #475569; }
.codex-status-cell { line-height: 1.35; }
.codex-status-badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
  white-space: nowrap;
}
.codex-status-badge.is-success {
  color: #166534;
  background: rgba(34, 197, 94, 0.16);
  border: 1px solid rgba(34, 197, 94, 0.35);
}
.codex-status-badge.is-failed {
  color: #991b1b;
  background: rgba(239, 68, 68, 0.14);
  border: 1px solid rgba(239, 68, 68, 0.32);
}
.codex-status-timer {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 500;
  color: #64748b;
  font-variant-numeric: tabular-nums;
}
.codex-cred-warn {
  display: inline-block;
  margin-top: 2px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  cursor: help;
}
.codex-status-running .codex-status-timer { color: #2563eb; }
.codex-status-success .codex-status-timer { color: #15803d; }
.codex-status-failed .codex-status-timer { color: #b91c1c; }
.codex-phase {
  display: block;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 2px;
}
.codex-phase-msg {
  display: block;
  color: #64748b;
  font-size: 12px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.text-muted.ok { color: #15803d; }
.text-muted.warn { color: #b45309; }
.sms-import-panel {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
}
.sms-import-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.sms-import-head h4 { margin: 0 0 4px; font-size: 0.95rem; }
.sms-import-head .text-muted { margin: 0; font-size: 0.78rem; max-width: 720px; }
.sms-import-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.sms-import-actions .input { min-width: 180px; }
.sms-raw-input {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}
.sms-import-result { font-size: 0.8rem; }
.sms-table { min-width: 1280px; }
.sms-provider-url {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sms-provider-url a {
  color: #2563eb;
  text-decoration: none;
}
.sms-provider-url a:hover { text-decoration: underline; }
.sms-status-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.sms-bump-btn {
  padding: 2px 8px;
  font-size: 0.75rem;
  line-height: 1.4;
}
.sms-status-IMPORTED { color: #15803d; }
.sms-status-USED { color: #94a3b8; }
.sms-status-COOLING { color: #b45309; }
.sms-status-DISABLED { color: #b91c1c; }
.codex-sms-bound { color: #15803d; font-weight: 600; }
.codex-sms-unbound { color: #94a3b8; }
.trial-elig { font-weight: 600; }
.trial-yes { color: #15803d; }
.trial-no { color: #b91c1c; }
.trial-unknown { color: #94a3b8; font-weight: 500; }

.link-awaiting-actions {
  display: flex;
  align-items: center;
  gap: 6px 8px;
  padding: 8px 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.link-awaiting-actions[hidden] { display: none !important; }
.link-awaiting-actions > .text-muted { margin-right: 0; font-size: 0.8rem; }
#linkAwaitingActions .warehouse-auto-toggle {
  padding: 0 8px;
  min-height: 26px;
  font-size: 12px;
}
/* 下拉 + 执行按钮绑死，统一钉在栏目工具栏最右侧 */
.link-action-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  max-width: 100%;
}
.link-action-pair > .text-muted {
  margin-right: 0 !important;
  white-space: nowrap;
}
.link-action-pair > .input,
.link-action-pair > select {
  flex: 0 0 auto;
  width: auto;
  max-width: 240px;
  height: 26px;
  font-size: 12px;
  padding: 0 6px;
  line-height: 24px;
  box-sizing: border-box;
}
.link-move-out {
  margin-left: auto;
  flex: 0 0 auto;
  align-self: center;
}
.link-pending-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 8px;
  flex-wrap: wrap;
  min-height: 0;
}
.link-pending-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
#linkPendingActions > #lblAutoExtractPending {
  flex: 0 0 auto;
}
.link-pending-actions-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-start;
  flex: 1 1 0;
  min-width: 0;
  margin-left: 0;
}
.link-pending-stats {
  position: static;
  left: auto;
  top: auto;
  transform: none;
  flex: 0 1 auto;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: #0f172a;
  text-align: left;
  pointer-events: none;
  min-width: 0;
}
.link-pending-stats b { color: #16a34a; font-weight: 800; margin: 0 1px; font-size: 1.08em; }
.link-awaiting-actions .btn,
#linkPendingActions .btn {
  height: 26px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 500;
  line-height: 24px;
  white-space: nowrap;
  box-sizing: border-box;
}
#btnRefreshPendingLinks {
  margin-right: 0;
}
#linkPendingActions .warehouse-auto-toggle {
  padding: 0 8px;
  min-height: 26px;
  font-size: 12px;
}
@media (max-width: 1100px) {
  .link-pending-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .link-pending-stats {
    text-align: center;
    white-space: normal;
  }
  .link-pending-actions-group {
    justify-content: center;
    margin-left: 0;
  }
  .link-move-out {
    width: 100%;
    justify-content: flex-end;
    margin-left: 0;
  }
}

.link-row-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 100%;
  min-width: 0;
}
.plus-verify-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}
.plus-verify-cell .btn-small {
  padding: 3px 8px;
  font-size: 0.78rem;
  line-height: 1.25;
  white-space: nowrap;
}
.link-row-actions .btn { white-space: nowrap; box-shadow: none !important; }
.link-row-actions .btn-primary {
  background: #eff2ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}
.link-row-actions .btn-primary:hover {
  background: #e0e7ff;
  color: #312e81;
}

@media (max-width: 1100px) {
  .link-toolbar { align-items: flex-start; flex-direction: column; }
  .link-toolbar-actions { justify-content: flex-start; }
  .link-stats { grid-template-columns: repeat(3, 1fr); }
}

.app-icon {
  width: 42px; height: 42px; border-radius: 12px;
  background: linear-gradient(135deg, #3b82f6, #06b6d4);
  display: flex; align-items: center; justify-content: center;
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.app-title { font-size: 1.25rem; font-weight: 700; color: var(--text-primary); }
.app-subtitle { font-size: 0.75rem; color: var(--text-muted); font-weight: 400; margin-top: 1px; }

.open-source-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.62);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition-fast);
  box-shadow: 0 2px 10px rgba(100, 120, 180, 0.08);
}

.open-source-link:hover {
  transform: translateY(-1px);
  border-color: rgba(37, 99, 235, 0.18);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.12);
}

.open-source-link svg {
  flex: 0 0 auto;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.8); }
}

/* --- Tab 导航 --- */
.tab-nav {
  display: flex; gap: 4px; padding: 6px;
  overflow-x: auto;
}

.tab-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 20px; border: none;
  border-radius: 12px; background: transparent;
  color: var(--text-muted); font-family: inherit;
  font-size: 0.88rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap;
}

.tab-btn:hover { background: rgba(255, 255, 255, 0.5); color: var(--text-secondary); }

.tab-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 12px rgba(37, 99, 235, 0.25);
}

.tab-content { display: none; flex: 1; min-height: 0; }
.tab-content.active { display: flex; flex-direction: column; gap: 12px; animation: fadeInUp 0.3s ease; }
#tab-mail.tab-content.active {
  flex: none;
  min-height: auto;
}

/* --- Tab 1: 邮箱管理布局 --- */
.main-layout { display: flex; gap: 14px; flex: 1; min-height: 0; }
#tab-mail .main-layout {
  flex: none;
  min-height: auto;
  align-items: flex-start;
}

.sidebar {
  width: 360px; min-width: 360px;
  display: flex; flex-direction: column;
  padding: 16px; gap: 12px;
  height: fit-content;
  max-height: none;
  align-self: flex-start;
}

.panel-header { display: flex; align-items: center; justify-content: space-between; }

.panel-title {
  font-size: 0.88rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
}

.panel-title svg { opacity: 0.5; }

.content { flex: 1; display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* --- 搜索区 --- */
.account-search { position: relative; display: flex; align-items: center; }
.account-search-icon { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; }
.account-search-input {
  width: 100%; padding: 9px 12px 9px 36px;
  border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.68); color: var(--text-primary);
  font-family: inherit; font-size: 0.82rem;
  outline: none; transition: var(--transition-fast);
}
.account-search-input:focus {
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  background: rgba(255, 255, 255, 0.9);
}
.account-search-input::placeholder { color: var(--text-muted); }

/* --- Badge --- */
.badge {
  background: var(--accent-bg); color: var(--accent);
  padding: 2px 10px; border-radius: 20px;
  font-size: 0.72rem; font-weight: 600;
}
.badge-pulse { animation: badgePulse 0.6s ease; }
@keyframes badgePulse { 0% { transform: scale(1); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.badge-imap { background: var(--imap-bg); color: var(--imap-color); }
.badge-graph { background: var(--graph-bg); color: var(--graph-color); }
.badge-external { background: rgba(124, 58, 237, 0.08); color: #7c3aed; }

/* --- 按钮系统 --- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px; padding: 9px 18px;
  border-radius: var(--radius-sm); border: none;
  font-family: inherit; font-size: 0.82rem; font-weight: 500;
  cursor: pointer; transition: var(--transition);
  white-space: nowrap; outline: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: #4c6ef5;
  color: white;
  box-shadow: none;
}
.btn-primary:hover {
  background: #3b5bdb;
  box-shadow: none;
  transform: none;
}

.btn-accent {
  background: #0ea5e9;
  color: white;
  box-shadow: none;
}
.btn-accent:hover {
  background: #0284c7;
  box-shadow: none;
  transform: none;
}

.btn-success {
  background: #16a34a;
  color: #fff;
  border-color: #15803d;
  box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
  font-weight: 700;
}
.btn-success:hover {
  background: #15803d;
  color: #fff;
  border-color: #166534;
}

.btn-danger {
  background: #ef4444;
  color: white;
  box-shadow: none;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.8); color: var(--text-primary); }

.btn-full { width: 100%; }
.btn-small { padding: 6px 12px; font-size: 0.75rem; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }
.btn-danger-ghost {
  color: var(--error); border-color: rgba(239, 68, 68, 0.2);
  background: rgba(239, 68, 68, 0.04);
}
.btn-danger-ghost:hover { background: var(--error-bg); }

/* --- 邮箱列表 --- */
.import-section { display: flex; flex-direction: column; gap: 8px; }

.account-list {
  flex: none;
  overflow: visible;
  display: flex; flex-direction: column;
  gap: 5px; padding-right: 4px;
}
.account-list::-webkit-scrollbar { width: 4px; }
.account-list::-webkit-scrollbar-track { background: transparent; }
.account-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); border-radius: 4px; }

.select-all-wrapper {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px; font-size: 0.78rem;
  color: var(--text-muted); font-weight: 500;
}

.account-item {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 8px;
  background: rgba(255, 255, 255, 0.35);
  border: 1px solid transparent;
  cursor: pointer; transition: var(--transition-fast);
  animation: fadeInUp 0.3s ease both;
}
.account-item:hover { background: rgba(255, 255, 255, 0.6); border-color: rgba(0, 0, 0, 0.04); }
.account-item.selected { background: rgba(37, 99, 235, 0.06); border-color: rgba(37, 99, 235, 0.15); }
.account-item-new { animation: slideInHighlight 0.4s ease both; }
.account-item-removing { animation: fadeOutRemove 0.3s ease forwards; }

@keyframes slideInHighlight {
  0% { opacity: 0; transform: translateX(-20px); background: rgba(37, 99, 235, 0.15); }
  100% { opacity: 1; transform: translateX(0); background: rgba(255, 255, 255, 0.35); }
}
@keyframes fadeOutRemove {
  0% { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); height: 0; padding: 0; margin: 0; overflow: hidden; }
}

.account-checkbox {
  appearance: none; width: 16px; height: 16px;
  border: 1.5px solid var(--text-muted); border-radius: 5px;
  cursor: pointer; transition: var(--transition-fast);
  flex-shrink: 0; position: relative; background: white;
}
.account-checkbox:checked { background: var(--accent); border-color: var(--accent); }
.account-checkbox:checked::after {
  content: ''; position: absolute; top: 2px; left: 5px;
  width: 4px; height: 8px;
  border: solid white; border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

.account-email {
  font-size: 0.85rem; color: var(--text-primary); flex: 1;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.account-provider {
  flex-shrink: 0;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1.3;
}

.account-batch {
  margin-left: auto;
  flex-shrink: 0;
  color: var(--text-muted);
  font-size: 0.68rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.account-copy, .account-delete { opacity: 0; transition: var(--transition-fast); flex-shrink: 0; }
.account-item:hover .account-copy, .account-item:hover .account-delete { opacity: 0.5; }
.account-copy:hover, .account-delete:hover { opacity: 1 !important; }

.account-copy {
  width: 24px; height: 24px;
  background: rgba(37, 99, 235, 0.06); border: 1px solid rgba(37, 99, 235, 0.08);
  color: var(--accent); cursor: pointer; border-radius: 7px;
  display: inline-flex; align-items: center; justify-content: center;
}
.account-delete {
  background: none; border: none; color: var(--error);
  cursor: pointer; padding: 2px; border-radius: 4px;
}
.account-delete:hover { background: var(--error-bg); }

.sidebar-footer { border-top: 1px solid rgba(0, 0, 0, 0.05); padding-top: 12px; }

/* --- 搜索控制区 --- */
.control-panel { padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.control-row { display: flex; align-items: center; gap: 10px; }
.control-actions { justify-content: space-between; }
.flex-grow { flex: 1; }

.input-group { position: relative; display: flex; align-items: center; }
.input-icon { position: absolute; left: 12px; color: var(--text-muted); pointer-events: none; z-index: 1; }

.input {
  width: 100%; padding: 9px 14px 9px 38px;
  border-radius: 8px; border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.7); color: var(--text-primary);
  font-family: inherit; font-size: 0.82rem;
  outline: none; transition: var(--transition-fast);
}
.input:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.12); background: rgba(255, 255, 255, 0.9); }
.input::placeholder { color: var(--text-muted); }
#linkCdkInput, #momoPayCdkInput, #deliveryCdkInput {
  -webkit-text-security: none !important;
  text-security: none !important;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  letter-spacing: 0;
}

.select {
  padding-left: 14px; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 30px; cursor: pointer;
}
.input-narrow { width: 110px; min-width: 110px; }

.protocol-toggles { display: flex; gap: 8px; }
.toggle-label { cursor: pointer; }
.toggle-label input { display: none; }
.toggle-pill {
  display: inline-block; padding: 5px 14px;
  border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--text-muted); background: rgba(255, 255, 255, 0.5);
  transition: var(--transition-fast);
}
.toggle-label input:checked + .toggle-pill {
  border-color: rgba(37, 99, 235, 0.25); color: var(--accent);
  background: rgba(37, 99, 235, 0.06);
}
.action-buttons { display: flex; gap: 8px; }

/* --- 进度条 --- */
.progress-bar-container {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
  padding: 14px 18px; box-shadow: var(--shadow-sm);
  animation: fadeInUp 0.3s ease;
}
.progress-info { display: flex; justify-content: space-between; font-size: 0.78rem; margin-bottom: 10px; color: var(--text-secondary); font-weight: 500; }
.progress-track { width: 100%; height: 6px; background: rgba(0, 0, 0, 0.04); border-radius: 6px; overflow: hidden; }
.progress-fill {
  height: 100%; width: 0%;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  border-radius: 6px; transition: width 0.4s ease; position: relative;
}
.progress-fill::after {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}
.ss-proto-progress { min-width: 160px; max-width: 280px; }
.ss-proto-progress-head { display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.ss-proto-track { margin-top: 6px; height: 4px; }

@keyframes shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* --- 邮件结果 --- */
.results-section { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.results-header { display: none; align-items: center; justify-content: space-between; padding: 8px 4px; }
.results-header.visible { display: flex; }
.results-title {
  font-size: 0.88rem; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
  color: var(--text-secondary);
}
.results-meta { display: flex; gap: 8px; }

.email-list { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 4px 0; }
.email-list::-webkit-scrollbar { width: 4px; }
.email-list::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); border-radius: 4px; }

.email-card {
  padding: 14px 18px; border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  cursor: pointer; transition: var(--transition-fast);
  animation: fadeInUp 0.3s ease both;
}
.email-card:hover { background: rgba(255, 255, 255, 0.75); border-color: rgba(0, 0, 0, 0.06); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.email-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.email-from { font-size: 0.82rem; font-weight: 600; color: var(--text-primary); display: flex; align-items: center; gap: 8px; }
.email-date { font-size: 0.72rem; color: var(--text-muted); }
.email-subject { font-size: 0.88rem; font-weight: 500; color: var(--text-primary); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email-preview { font-size: 0.78rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.email-account-tag { font-size: 0.72rem; color: var(--text-muted); margin-top: 6px; }

.email-protocol {
  display: inline-block; padding: 1px 8px;
  border-radius: 10px; font-size: 0.65rem; font-weight: 700;
  text-transform: uppercase;
}
.email-protocol.imap { background: var(--imap-bg); color: var(--imap-color); }
.email-protocol.graph { background: var(--graph-bg); color: var(--graph-color); }
.email-protocol.cloudflare-temp-mail,
.email-protocol.cloud-mail {
  background: rgba(124, 58, 237, 0.08);
  color: #7c3aed;
}

/* --- Tab 2: 登录管理 --- */
.login-section { display: flex; flex-direction: column; gap: 12px; flex: 1; }

.login-mode-switch {
  display: inline-flex;
  align-self: flex-start;
  gap: 4px;
  padding: 4px;
}
.login-mode-btn {
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition-fast);
}
.login-mode-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: #fff;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.login-header {
  padding: 16px 22px;
}
.login-stats {
  display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 0.82rem; font-weight: 600; color: var(--text-muted);
}
.login-stats span { white-space: nowrap; }
.login-stats .count-value { font-weight: 700; color: var(--text-primary); }

.login-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 18px;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.concurrency-input {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.6);
  font-size: 0.78rem; color: var(--text-muted); font-weight: 600;
}
.concurrency-input input {
  width: 48px; border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 6px; padding: 4px 6px; text-align: center;
  font-family: inherit; font-size: 0.82rem; font-weight: 700;
  color: var(--accent); background: white; outline: none;
}
.concurrency-input input:focus { border-color: var(--accent-light); }

.export-group { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.export-select {
  padding: 6px 28px 6px 10px; border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06); background: white;
  font-family: inherit; font-size: 0.78rem; font-weight: 600;
  color: var(--text-secondary); outline: none; appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' xmlns='http://www.w3.org/2000/svg'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 8px center;
}

/* --- 登录表格 --- */
.login-table-wrapper {
  flex: 1; overflow: auto; border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.login-table-wrapper::-webkit-scrollbar { width: 4px; height: 4px; }
.login-table-wrapper::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.08); border-radius: 4px; }

.login-table {
  width: 100%; border-collapse: collapse; font-size: 0.82rem;
  min-width: 1280px;
}
.login-table th, .login-table td {
  padding: 10px 14px; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  white-space: nowrap;
}
.login-table th {
  position: sticky; top: 0; z-index: 2;
  background: rgba(248, 250, 252, 0.95); backdrop-filter: blur(8px);
  color: var(--text-muted); font-size: 0.72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.login-table tr:hover td { background: rgba(37, 99, 235, 0.02); }
.login-table td.cell-email { max-width: 200px; overflow: hidden; text-overflow: ellipsis; }
.login-table td.cell-email-wrap { max-width: 280px; white-space: normal; }
.email-with-stop {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.email-with-stop .cell-email {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.btn-stop-login {
  flex-shrink: 0;
  padding: 2px 8px !important;
  font-size: 0.7rem !important;
}
.btn-stop-login:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.login-table td.cell-flow {
  white-space: normal;
  min-width: 420px;
}
.login-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 2px;
}
.login-flow-step {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  background: #e5e7eb;
  color: #6b7280;
  border: 1px solid #d1d5db;
}
.login-flow-step.is-done {
  background: #dcfce7;
  color: #15803d;
  border-color: #86efac;
}
.login-flow-step.is-active {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}
.login-flow-step.is-failed {
  background: #fee2e2;
  color: #b91c1c;
  border-color: #fca5a5;
}
.login-flow-sep {
  width: 8px;
  height: 1px;
  background: #cbd5e1;
  display: inline-block;
  margin: 0 1px;
}
.login-table td.cell-proxy {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.74rem;
}
.login-table td.cell-profile {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-secondary);
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.74rem;
}
.login-table td.cell-error { max-width: 180px; overflow: hidden; text-overflow: ellipsis; color: var(--error); font-size: 0.75rem; }
.cell-register-country,
.cell-called-ip {
  font-size: 12px;
  white-space: nowrap;
}
.cell-called-ip {
  font-family: 'SF Mono', Consolas, monospace;
}
.cell-batch {
  font-size: 12px;
  line-height: 1.35;
  vertical-align: top;
}
.link-machine {
  margin-top: 4px;
  font-size: 11px;
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.1);
  border-radius: 4px;
  padding: 1px 6px;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.batch-2fa-tag {
  display: inline-block;
  margin-left: 6px;
  color: #10b981;
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  vertical-align: baseline;
}
.batch-credential-type {
  display: inline-block;
  color: #059669;
  font-weight: 700;
  font-size: 0.78rem;
}
.status-alive-ok { color: #059669; font-weight: 700; }
.status-alive-bad { color: #dc2626; font-weight: 700; }
.status-alive-warn { color: #d97706; font-weight: 650; }
.status-alive-mute { color: #94a3b8; }
.cell-registered-at {
  font-size: 12px;
  color: #334155;
  white-space: nowrap;
}
.login-table td.cell-error.error-account-deactivated {
  color: #b45309;
  font-weight: 700;
}

.status-cell {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 8px;
  font-size: 0.72rem; font-weight: 700;
}
.status-idle { background: rgba(148, 163, 184, 0.1); color: var(--text-muted); }
.status-logging { background: var(--warning-bg); color: var(--warning); }
.status-success { background: var(--success-bg); color: var(--success); }
.status-failed { background: var(--error-bg); color: var(--error); }

.spinner-small {
  width: 12px; height: 12px;
  border: 2px solid rgba(245, 158, 11, 0.2);
  border-top-color: var(--warning);
  border-radius: 50%; animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.login-progress {
  padding: 16px 20px; border-radius: var(--radius-lg);
  background: #0f172a; color: white;
}
.login-progress-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.login-progress-header h3 { font-size: 0.88rem; font-weight: 600; }
.login-progress-stats { font-size: 0.82rem; color: rgba(255,255,255,0.7); }
.login-progress-stats .highlight { color: white; font-size: 1.1rem; font-weight: 700; }
.login-progress-stats .success-count { color: #34d399; }
.login-progress-bar { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.1); overflow: hidden; }
.login-progress-fill {
  height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, #6366f1, #34d399);
  transition: width 0.5s ease;
}

/* --- Tab 3: 转换器 --- */
.converter-section { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; flex: 1; }
.converter-panel { display: flex; flex-direction: column; padding: 16px; gap: 12px; }
.converter-panel h3 { font-size: 0.92rem; font-weight: 600; color: var(--text-secondary); display: flex; align-items: center; gap: 8px; }

.format-selector {
  display: inline-flex; padding: 3px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 10px; background: rgba(255, 255, 255, 0.5);
}
.format-btn {
  padding: 7px 18px; border: none; border-radius: 8px;
  background: transparent; color: var(--text-muted);
  font-family: inherit; font-size: 0.78rem; font-weight: 700;
  cursor: pointer; transition: var(--transition-fast);
}
.format-btn.active {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white; box-shadow: 0 2px 8px rgba(37, 99, 235, 0.2);
}

.converter-textarea {
  flex: 1; width: 100%; min-height: 300px;
  resize: vertical; border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-sm); padding: 12px;
  background: rgba(255, 255, 255, 0.6); color: var(--text-primary);
  font-family: 'SF Mono', 'Fira Code', 'Cascadia Code', Consolas, monospace;
  font-size: 0.78rem; line-height: 1.55;
  outline: none; transition: var(--transition-fast);
}
.converter-textarea:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.converter-textarea[readonly] { background: rgba(248, 250, 252, 0.7); }

.stats-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat-card {
  padding: 12px; border-radius: var(--radius-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
  background: rgba(255, 255, 255, 0.4);
}
.stat-value {
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 1.2rem; font-weight: 800; color: var(--accent);
}
.stat-label { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.converter-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Tab 4: CPA 仓管 --- */
.warehouse-section { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.warehouse-panel { display: flex; flex-direction: column; gap: 14px; padding: 18px; flex: 1; min-height: 0; }
.warehouse-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; }
.warehouse-header h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); margin-bottom: 4px; }
.warehouse-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.warehouse-config { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.warehouse-input { padding-left: 14px; }
.warehouse-limit-group { min-width: 190px; }
.warehouse-limit-label {
  position: absolute;
  left: 12px;
  z-index: 1;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  pointer-events: none;
}
.warehouse-limit-input { padding-left: 104px; }
.warehouse-interval-group { min-width: 150px; }
.warehouse-interval-label {
  position: absolute;
  left: 12px;
  z-index: 1;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  pointer-events: none;
}
.warehouse-interval-input { padding-left: 82px; }
.warehouse-auto-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
}
.warehouse-auto-toggle input { display: none; }
.warehouse-toggle-track {
  width: 34px;
  height: 18px;
  border-radius: 999px;
  padding: 2px;
  background: rgba(148, 163, 184, 0.35);
  transition: var(--transition-fast);
}
.warehouse-toggle-thumb {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.2);
  transition: var(--transition-fast);
}
.warehouse-auto-toggle input:checked + .warehouse-toggle-track { background: var(--success); }
.warehouse-auto-toggle input:checked + .warehouse-toggle-track .warehouse-toggle-thumb { transform: translateX(16px); }
.warehouse-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(148, 163, 184, 0.12);
  color: var(--text-muted);
}
.warehouse-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}
.warehouse-status-pill.connected {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.18);
  color: var(--success);
}
.warehouse-status-pill.running {
  background: var(--warning-bg);
  border-color: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}
.warehouse-status-pill.running .warehouse-status-dot { animation: pulse 1.1s ease-in-out infinite; }
.warehouse-status-pill.error {
  background: var(--error-bg);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--error);
}
.warehouse-stats { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; }
.warehouse-workspace { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(340px, 0.65fr); gap: 12px; }
.warehouse-table-wrapper { min-height: 0; overflow: auto; border-radius: var(--radius-md); border: 1px solid rgba(0, 0, 0, 0.04); }
.warehouse-table { width: 100%; border-collapse: collapse; min-width: 860px; font-size: 0.82rem; }
.warehouse-table th, .warehouse-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid rgba(0, 0, 0, 0.04); white-space: nowrap; max-width: 320px; overflow: hidden; text-overflow: ellipsis; }
.warehouse-table th { position: sticky; top: 0; z-index: 2; background: rgba(248, 250, 252, 0.95); color: var(--text-muted); font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.warehouse-ok { color: var(--success); font-weight: 700; }
.warehouse-bad { color: var(--error); font-weight: 700; }
.warehouse-log-panel { border-radius: var(--radius-md); box-shadow: none; max-height: none; }

/* --- Tab 5: 库存接码 --- */
.inventory-section { display: flex; flex-direction: column; gap: 12px; flex: 1; min-height: 0; }
.inventory-import-panel,
.inventory-records-panel { display: flex; flex-direction: column; gap: 12px; padding: 18px; }
.inventory-form-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 1.2fr) minmax(220px, auto);
  gap: 10px;
  align-items: end;
}
.inventory-check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.58);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}
.inventory-raw-text { min-height: 170px; }
.inventory-import-result {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.inventory-result-summary {
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 700;
}
.inventory-result-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 6px;
}
.inventory-result-row {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(80px, 0.8fr) minmax(90px, 0.8fr);
  gap: 8px;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 0.76rem;
  background: rgba(255, 255, 255, 0.5);
}
.inventory-result-row.ok { color: var(--success); }
.inventory-result-row.bad { color: var(--error); }
.inventory-search-group { min-width: 260px; }
.inventory-table { min-width: 1080px; }
.inventory-toggle {
  border: none;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}
.inventory-toggle.on { background: var(--warning-bg); color: var(--warning); }
.inventory-toggle.off { background: var(--success-bg); color: var(--success); }
.inventory-code-value {
  border: none;
  border-radius: 8px;
  padding: 4px 10px;
  background: rgba(15, 23, 42, 0.08);
  color: var(--text-primary);
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.9rem;
  font-weight: 800;
  cursor: copy;
}
.inventory-code-meta {
  margin-left: 8px;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 700;
}

/* --- Tab 5: 日志 --- */
.log-section {
  flex: 1; min-height: 0; padding: 16px;
  background: #0f172a !important; border: 1px solid #1e293b !important;
  color: #e2e8f0; font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.78rem; overflow-y: auto;
  max-height: calc(100vh - 200px);
}
.log-section::-webkit-scrollbar { width: 4px; }
.log-section::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.1); border-radius: 4px; }

.log-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.log-header h3 { color: #94a3b8; font-size: 0.82rem; }
.log-clear-btn { color: rgba(255,255,255,0.5); border-color: rgba(255,255,255,0.1); }
.log-list { display: flex; flex-direction: column; gap: 2px; }

.log-entry {
  padding: 5px 0;
  display: grid;
  grid-template-columns: 76px 52px minmax(0, 1fr);
  gap: 10px;
  line-height: 1.45;
  border-bottom: 1px solid rgba(148, 163, 184, 0.06);
}
.log-time { color: #475569; min-width: 80px; flex-shrink: 0; }
.log-type {
  display: inline-block; padding: 0 6px;
  border-radius: 4px; font-size: 0.68rem; font-weight: 700;
  min-width: 44px; text-align: center; flex-shrink: 0;
}
.log-type.info { background: rgba(59, 130, 246, 0.2); color: #93c5fd; }
.log-type.success { background: rgba(16, 185, 129, 0.2); color: #6ee7b7; }
.log-type.warning { background: rgba(245, 158, 11, 0.2); color: #fcd34d; }
.log-type.error { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }
.log-message { color: #cbd5e1; word-break: break-all; }

/* --- 弹窗 --- */
.modal-overlay {
  position: fixed; top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
}
.modal-overlay.active { display: flex; }

.modal {
  width: 90%; max-width: 560px;
  padding: 0; animation: modalIn 0.25s ease;
}
.import-modal { max-width: 820px; max-height: 88vh; display: flex; flex-direction: column; }
.modal-large { max-width: 800px; max-height: 80vh; display: flex; flex-direction: column; }

@keyframes modalIn { 0% { opacity: 0; transform: scale(0.95) translateY(10px); } 100% { opacity: 1; transform: scale(1) translateY(0); } }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}
.modal-header h3 { font-size: 1rem; font-weight: 600; }
.modal-body { padding: 18px 22px; overflow-y: auto; }
.modal-footer {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  padding: 14px 22px; border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.btn-close {
  width: 32px; height: 32px; border: none;
  background: rgba(0, 0, 0, 0.04); border-radius: 8px;
  font-size: 1.2rem; cursor: pointer; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition-fast);
}
.btn-close:hover { background: rgba(0, 0, 0, 0.08); color: var(--text-primary); }

.modal-tip { font-size: 0.82rem; color: var(--text-secondary); margin-bottom: 10px; line-height: 1.5; }
.modal-tip code { background: rgba(37, 99, 235, 0.06); color: var(--accent); padding: 2px 6px; border-radius: 4px; font-size: 0.78rem; }
.import-format-tip { color: var(--text-primary); font-weight: 700; }
.import-provider-help {
  color: #334155;
  font-size: 0.8rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 8px;
  padding: 8px 10px;
}

.import-provider-top {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.import-provider-select-wrap { flex: 1; min-width: 220px; }
.import-provider-note {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
}
.mail-provider-panel {
  margin-bottom: 14px;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(37, 99, 235, 0.12);
  background: rgba(255, 255, 255, 0.5);
}
.provider-panel-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.provider-panel-title strong {
  display: block;
  color: var(--text-primary);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.provider-panel-title span {
  display: block;
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 600;
  margin-top: 2px;
}
.provider-panel-actions a {
  color: var(--accent);
  font-size: 0.76rem;
  font-weight: 700;
  text-decoration: none;
}
.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 12px;
}
.config-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  position: relative;
}
.config-field > span:first-child {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.config-input { padding-left: 12px; min-height: 38px; }
.secret-field .secret-input { padding-right: 40px; }
.secret-toggle {
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.secret-toggle:hover { background: rgba(37, 99, 235, 0.06); color: var(--accent); }
.provider-segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.06);
  background: rgba(255, 255, 255, 0.62);
}
.provider-segment label { cursor: pointer; }
.provider-segment input { display: none; }
.provider-segment span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 800;
  transition: var(--transition-fast);
}
.provider-segment input:checked + span {
  background: linear-gradient(135deg, #3b82f6, #2563eb);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.18);
}
.config-toggle-row {
  display: grid;
  grid-template-columns: auto 44px minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  min-height: 38px;
}
.config-toggle-row > span:first-child { grid-column: 1; }
.config-toggle-row em {
  color: var(--text-secondary);
  font-size: 0.72rem;
  font-weight: 600;
  font-style: normal;
}
.provider-toggle input { display: none; }
.provider-toggle-track {
  display: block;
  width: 36px;
  height: 20px;
  padding: 2px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.35);
  transition: var(--transition-fast);
}
.provider-toggle-thumb {
  display: block;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.22);
  transition: var(--transition-fast);
}
.provider-toggle input:checked + .provider-toggle-track { background: var(--success); }
.provider-toggle input:checked + .provider-toggle-track .provider-toggle-thumb { transform: translateX(16px); }
.domain-field { grid-column: 1 / -1; }
.domain-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.textarea {
  width: 100%; border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: var(--radius-sm); padding: 12px;
  background: rgba(255, 255, 255, 0.7); color: var(--text-primary);
  font-family: 'SF Mono', Consolas, monospace; font-size: 0.8rem;
  outline: none; resize: vertical; transition: var(--transition-fast);
  line-height: 1.5;
}
.textarea:focus { border-color: var(--accent-light); box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1); }
.textarea-error { border-color: var(--error) !important; }
.proxy-textarea { min-height: 170px; }
.import-textarea,
.fingerprint-import-textarea {
  width: 100%;
  min-height: 280px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
}
.ip-pool-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ip-pool-list {
  max-height: 180px;
  overflow-y: auto;
  border: 1px solid rgba(0, 0, 0, 0.06);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  padding: 8px;
}
.ip-pool-item {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.75);
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 6px;
  font-family: 'SF Mono', Consolas, monospace;
  font-size: 0.75rem;
}
.ip-pool-item:last-child { margin-bottom: 0; }
.ip-pool-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.76rem;
  padding: 12px 8px;
}

.import-preview {
  margin-top: 8px; padding: 8px 12px; border-radius: 8px;
  background: rgba(37, 99, 235, 0.04); font-size: 0.78rem;
  color: var(--text-secondary);
}
.preview-valid { color: var(--success); }
.preview-dup { color: var(--warning); }
.preview-error { color: var(--error); }
.preview-hint { color: var(--text-secondary); font-weight: 600; }

/* --- Toast --- */
.toast-container {
  position: fixed; top: 20px; right: 20px;
  z-index: 2000; display: flex; flex-direction: column; gap: 8px;
}

.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-lg);
  font-size: 0.82rem; font-weight: 500;
  animation: slideInRight 0.3s ease;
  cursor: pointer;
  max-width: 400px;
}

.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--error); }
.toast.warning { border-left: 3px solid var(--warning); }
.toast.info { border-left: 3px solid var(--accent); }
.toast-exit { animation: slideOutRight 0.3s ease forwards; }

@keyframes slideInRight { 0% { opacity: 0; transform: translateX(40px); } 100% { opacity: 1; transform: translateX(0); } }
@keyframes slideOutRight { 0% { opacity: 1; transform: translateX(0); } 100% { opacity: 0; transform: translateX(40px); } }
@keyframes fadeInUp { 0% { opacity: 0; transform: translateY(8px); } 100% { opacity: 1; transform: translateY(0); } }

/* --- 空状态 --- */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 40px 20px; color: var(--text-muted); gap: 6px; text-align: center;
}
.empty-state svg { opacity: 0.15; margin-bottom: 6px; }
.empty-state p { font-size: 0.82rem; }
.text-muted { color: var(--text-muted); font-size: 0.75rem; }

/* --- 骨架屏 --- */
.skeleton {
  background: linear-gradient(90deg, rgba(0,0,0,0.04) 25%, rgba(0,0,0,0.08) 50%, rgba(0,0,0,0.04) 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
  border-radius: var(--radius-md);
}
.skeleton-card { height: 100px; }
@keyframes skeletonShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* --- 按钮 spinner --- */
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* --- 成功横幅 --- */
.import-success-banner {
  position: fixed; top: -80px; left: 50%;
  transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 16px 28px; border-radius: 16px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white; font-weight: 600;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.35);
  transition: top 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 3000;
}
.import-success-banner.active { top: 24px; }
.import-success-banner.exit { top: -80px; }

/* --- 抖动动画 --- */
.shake { animation: shakeAnim 0.5s ease; }
@keyframes shakeAnim { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

/* --- 高亮侧边栏 --- */
.sidebar-highlight { animation: sidebarPulse 1.5s ease; }
@keyframes sidebarPulse { 0%, 100% { box-shadow: var(--shadow-md); } 50% { box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.2), var(--shadow-md); } }

/* --- 取件错误 --- */
.fetch-issues { margin: 2px 0 10px; padding: 12px 14px; border-radius: var(--radius-md); background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.18); }
.fetch-issues-title { display: flex; align-items: center; justify-content: space-between; font-size: 0.82rem; font-weight: 600; color: #92400e; margin-bottom: 8px; }

/* --- 响应式 --- */
@media (max-width: 1200px) {
  .main-layout { flex-direction: column; }
  .sidebar { width: 100%; min-width: auto; max-height: none; }
  .converter-section { grid-template-columns: 1fr; }
  .warehouse-workspace { grid-template-columns: 1fr; }
  .warehouse-log-panel { min-height: 260px; }
}

@media (max-width: 768px) {
  .app-container { padding: 12px; }
  .app-header { padding: 10px 16px; flex-wrap: wrap; gap: 8px; }
  .open-source-link { min-height: 34px; padding: 8px 10px; }
  .open-source-link span { display: none; }
  .tab-nav { padding: 4px; }
  .tab-btn { padding: 8px 14px; font-size: 0.8rem; }
  .control-row { flex-wrap: wrap; }
  .login-toolbar { flex-wrap: wrap; }
  .warehouse-header { flex-direction: column; }
  .warehouse-stats { grid-template-columns: repeat(2, 1fr); }
  .inventory-form-grid { grid-template-columns: 1fr; }
  .import-modal { width: 94%; }
  .import-provider-top { flex-direction: column; align-items: stretch; }
  .config-grid { grid-template-columns: 1fr; }
  .domain-control { grid-template-columns: 1fr; }
}
