/* ============================================================
   货代邮件监控 · Web 版样式
   ============================================================ */
:root {
  --bg: #f4f6fa;
  --card: #ffffff;
  --border: #e6eaf0;
  --border-strong: #d8dfe9;
  --ink: #0f172a;
  --text: #1f2937;
  --muted: #6b7280;
  --faint: #94a3b8;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar: #0f172a;
  --sidebar-2: #131f34;
  --green: #059669;
  --amber: #d97706;
  --red: #dc2626;
  --teal: #0d9488;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 8px 24px rgba(15, 23, 42, .08);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, .18);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei UI", "Microsoft YaHei",
    "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }
h1, h2, h3, h4 { margin: 0; color: var(--ink); font-weight: 700; }
p { margin: 0; }
ul, ol, dl, dd { margin: 0; padding: 0; list-style: none; }
.mono { font-family: "Cascadia Mono", Consolas, "Courier New", monospace; font-size: 12.5px; }
.muted { color: var(--muted); }
.block { display: block; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.ico { flex: none; vertical-align: -3px; }

/* ---------------- 布局 ---------------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: none;
  background: var(--sidebar);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  padding: 18px 14px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 6px 18px;
  color: #fff;
}
.brand-logo {
  display: inline-flex; width: 36px; height: 36px; flex: none;
  align-items: center; justify-content: center;
  background: #fff; border-radius: 9px; padding: 3px;
  box-shadow: 0 1px 3px rgba(2, 6, 23, .18);
}
.brand-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 14.5px; letter-spacing: .3px; }
.brand-text small { color: #64748b; font-size: 10.5px; letter-spacing: .4px; }

.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-label {
  color: #475569;
  font-size: 11px;
  letter-spacing: 1.4px;
  padding: 14px 12px 6px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: #94a3b8;
  font-size: 13.5px;
  position: relative;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sidebar-2); color: #e2e8f0; }
.nav-item.active { background: linear-gradient(90deg, rgba(37, 99, 235, .28), rgba(37, 99, 235, .08)); color: #fff; font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 3px; background: #60a5fa;
}
.nav-badge {
  margin-left: auto; background: #dc2626; color: #fff; font-style: normal;
  font-size: 11px; font-weight: 600; min-width: 20px; height: 19px; padding: 0 6px;
  border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
}

.sidebar-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #1e293b; }
.me { display: flex; gap: 9px; align-items: center; padding: 4px 4px 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center;
}
.avatar-sm { width: 26px; height: 26px; font-size: 12px; margin-right: 8px; vertical-align: middle; }
.me-text { display: flex; flex-direction: column; min-width: 0; }
.me-text strong { color: #e2e8f0; font-size: 13px; font-weight: 600; }
.me-text small { color: #64748b; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-actions { display: flex; gap: 6px; }
.side-actions .btn { flex: 1; justify-content: center; }
.sidebar .btn-ghost {
  background: #172033; border-color: #253148; color: #cbd5e1;
}
.sidebar .btn-ghost:hover { background: #1e2a40; color: #fff; }
.copyright { color: #68758c; font-size: 10.5px; text-align: center; margin-top: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 74px; flex: none;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  position: sticky; top: 0; z-index: 20;
}
.topbar-title h1 { font-size: 18px; letter-spacing: -.2px; }
.topbar-title p { color: var(--muted); font-size: 12px; margin-top: 1px; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.content { padding: 22px 26px 40px; max-width: 1440px; width: 100%; margin: 0 auto; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 34px; padding: 0 14px;
  border-radius: 9px; border: 1px solid transparent;
  font-size: 13px; font-weight: 500; font-family: inherit;
  cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
  background: #fff;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-ghost { background: #fff; border-color: var(--border-strong); color: #334155; }
.btn-ghost:hover { background: #f8fafc; border-color: #c2ccda; color: var(--ink); }
.btn-danger { background: #fff; border-color: #fca5a5; color: var(--red); }
.btn-danger:hover { background: #fef2f2; color: #b91c1c; }
.btn-sm { height: 29px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-block { width: 100%; justify-content: center; height: 40px; font-size: 14px; }
.icon-btn {
  border: none; background: transparent; color: var(--faint); cursor: pointer;
  width: 30px; height: 30px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center;
}
.icon-btn:hover { background: #f1f5f9; color: #475569; }
.inline-form { display: inline-flex; margin: 0; }

/* ---------------- 卡片 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  box-shadow: var(--shadow-sm);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.card-head h3 { font-size: 14.5px; }
.card-head p { color: var(--muted); font-size: 11.5px; margin-top: 2px; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
}
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; }
.kpi-red::before { background: #dc2626; }
.kpi-amber::before { background: #d97706; }
.kpi-blue::before { background: #2563eb; }
.kpi-teal::before { background: #0d9488; }
.kpi-top { display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: 12px; }
.kpi strong { display: block; font-size: 30px; line-height: 1.25; color: var(--ink); letter-spacing: -.5px; margin: 6px 0 2px; }
.kpi small { color: var(--faint); font-size: 11.5px; }
.kpi-link {
  display: block; color: inherit; text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.kpi-link:hover {
  border-color: #bfdbfe; transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, .14); color: inherit;
}
.kpi-link:focus-visible { outline: 2px solid #2563eb; outline-offset: 2px; }
.kpi-go {
  position: absolute; right: 16px; bottom: 12px; font-size: 11px; color: #cbd5e1;
  letter-spacing: .3px; transition: color .15s ease, transform .15s ease;
}
.kpi-link:hover .kpi-go { color: var(--primary); transform: translateX(2px); }
.kpi-link .kpi-top svg { opacity: .7; }
.quick-filter {
  display: flex; align-items: center; gap: 8px;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8;
  border-radius: 10px; padding: 9px 13px; font-size: 12.5px; margin-bottom: 13px;
}
.quick-filter a { margin-left: auto; font-weight: 600; color: var(--primary); }
.kpi-red strong { color: #dc2626; }
.kpi-amber strong { color: #d97706; }
.kpi-blue strong { color: #2563eb; }
.kpi-teal strong { color: #0d9488; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; margin: 0 -18px; padding: 0 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table thead th {
  text-align: left; color: var(--muted); font-weight: 600; font-size: 11.5px;
  letter-spacing: .3px; padding: 9px 10px; background: #f8fafc;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table thead th:first-child { border-radius: 8px 0 0 8px; }
.table thead th:last-child { border-radius: 0 8px 8px 0; }
.table tbody td { padding: 11px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table-hover tbody tr:hover { background: #fbfcfe; }
.subject-cell { max-width: 520px; }
.subject-link { color: var(--ink); font-weight: 600; display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom; }
.subject-link:hover { color: var(--primary); }
.subject-cell small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sender { font-size: 12.5px; }

/* ---------------- 标记 ---------------- */
.chip {
  display: inline-flex; align-items: center; height: 21px; padding: 0 9px;
  border-radius: 11px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent;
}
.lv-urgent { color: #b91c1c; background: #fef2f2; border-color: #fecaca; }
.lv-important { color: #c2410c; background: #fff7ed; border-color: #fed7aa; }
.lv-normal { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.lv-ref { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }

.badge {
  display: inline-flex; align-items: center; height: 21px; padding: 0 9px;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-done { color: #047857; background: #ecfdf5; }
.badge-todo { color: #b45309; background: #fffbeb; }
.badge-live { color: #047857; background: #ecfdf5; }
.badge-off { color: #64748b; background: #f1f5f9; }
.badge-admin { color: #6d28d9; background: #f5f3ff; }
.badge-user { color: #1d4ed8; background: #eff6ff; }
.badge-xs { height: 18px; font-size: 10.5px; padding: 0 6px; margin-left: 4px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px;
  background: #f1f5f9; color: #475569; border-radius: 5px; font-size: 11px;
}
.tag-hit { background: #fef3c7; color: #92400e; }
.tag-more { background: #e2e8f0; color: #334155; }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 11px; border-radius: 13px; font-size: 12px; font-weight: 600; }
.pill-muted { background: #f1f5f9; color: #64748b; }

/* ---------------- 排行 / 状态列表 ---------------- */
.bars { display: flex; flex-direction: column; gap: 9px; }
.bar-row { display: grid; grid-template-columns: 96px 1fr 30px; align-items: center; gap: 9px; }
.bar-label { font-size: 12px; color: #334155; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 8px; background: #eef2f7; border-radius: 5px; overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, #60a5fa, #2563eb); }
.bar-num { font-size: 12px; color: var(--muted); text-align: right; }

.sync-list { display: flex; flex-direction: column; gap: 10px; }
.sync-list li { display: flex; align-items: center; gap: 9px; }
.sync-name { display: flex; flex-direction: column; font-size: 12.5px; color: #334155; min-width: 0; }
.sync-name small { color: var(--faint); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sync-state { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.sync-state .err { color: var(--red); }
.dot, .status-dot { width: 8px; height: 8px; border-radius: 50%; background: #cbd5e1; flex: none; }
.dot-ok, .status-dot.ok { background: #10b981; }
.dot-err, .status-dot.err { background: #ef4444; }
.dot-off, .status-dot:not(.ok):not(.err) { background: #cbd5e1; }

.log-mini { display: flex; flex-direction: column; gap: 7px; }
.log-mini li {
  display: grid; grid-template-columns: 82px 74px minmax(0, 1fr); gap: 8px;
  font-size: 12px; color: #334155; align-items: baseline; min-width: 0; overflow: hidden;
}
.log-mini small {
  min-width: 0; max-width: 100%; text-align: right; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- 筛选栏 / 分页 ---------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 14px; }
.filters select, .filters input[type="search"] {
  height: 34px; border: 1px solid var(--border-strong); border-radius: 9px;
  background: #fff; padding: 0 10px; font-size: 13px; color: var(--text); font-family: inherit;
  outline: none;
}
.filters select:focus, .filters input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.filter-search {
  display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 11px;
  border: 1px solid var(--border-strong); border-radius: 9px; background: #fff;
  color: var(--faint); min-width: 250px;
}
.filter-search input { border: none; outline: none; flex: 1; font-size: 13px; height: 30px; background: transparent; color: var(--text); }
.filter-search:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: #334155; cursor: pointer; }
.check input { width: 15px; height: 15px; accent-color: var(--primary); }
.check-line { margin-top: 8px; }

.pager { display: flex; align-items: center; gap: 5px; margin-top: 14px; flex-wrap: wrap; }
.page-btn {
  min-width: 30px; height: 30px; padding: 0 9px; border-radius: 7px;
  border: 1px solid var(--border-strong); background: #fff; color: #334155;
  font-size: 12.5px; display: inline-flex; align-items: center; justify-content: center;
}
.page-btn:hover { background: #f8fafc; }
.page-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.page-btn.disabled { pointer-events: none; opacity: .45; }
.page-info { color: var(--faint); font-size: 12px; margin-left: 6px; }

/* ---------------- 空状态 / 提示 ---------------- */
.empty { text-align: center; padding: 46px 16px; color: var(--faint); }
.empty.small { padding: 24px 10px; }
.empty p { color: #475569; font-weight: 600; margin: 8px 0 3px; }
.empty small { color: var(--faint); font-size: 12px; display: block; }
.empty h2 { margin-top: 10px; }
.error-page { padding: 70px 16px; }
.error-actions { display: flex; gap: 8px; justify-content: center; margin-top: 18px; }

.notice {
  display: flex; gap: 10px; align-items: flex-start;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 12px;
  padding: 12px 16px; color: #92400e; font-size: 12px; margin-top: 14px;
}
.notice strong { color: #78350f; }
.notice-warn { margin: 0 0 14px; }

/* ---------------- 弹窗 ---------------- */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: flex-start; justify-content: center;
  padding: 6vh 16px; z-index: 100; overflow-y: auto;
  backdrop-filter: blur(2px);
}
.modal.open { display: flex; }
.modal-card {
  background: #fff; border-radius: 16px; width: 520px; max-width: 100%;
  box-shadow: var(--shadow-lg); animation: pop .18s ease-out;
}
.modal-sm { width: 420px; }
.modal-lg { width: 680px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15.5px; }
.modal-body { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 20px; border-top: 1px solid var(--border); background: #fbfcfe;
  border-radius: 0 0 16px 16px;
}

/* ---------------- 表单 ---------------- */
.field { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: #475569; font-weight: 600; }
.field > span { font-size: 12.5px; }
.field input, .field select, .field textarea {
  border: 1px solid var(--border-strong); border-radius: 9px; padding: 8px 11px;
  font-size: 13.5px; font-family: inherit; color: var(--text); background: #fff;
  outline: none; font-weight: 400; width: 100%;
}
.field textarea { resize: vertical; line-height: 1.7; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid.form-3 { grid-template-columns: 1.4fr .7fr 1fr; align-items: end; }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }
.hint { color: var(--faint); font-size: 11.5px; }

/* ---------------- Toast ---------------- */
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 200; }
.toast {
  display: flex; align-items: center; gap: 10px; min-width: 240px; max-width: 420px;
  padding: 11px 13px; border-radius: 10px; box-shadow: var(--shadow);
  font-size: 13px; background: #fff; border-left: 4px solid var(--primary);
  animation: slide .2s ease-out;
}
.toast button { border: none; background: none; color: var(--faint); font-size: 16px; cursor: pointer; margin-left: auto; }
.toast-ok { border-left-color: #10b981; }
.toast-err { border-left-color: #ef4444; color: #991b1b; }
@keyframes slide { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- 登录页 ---------------- */
.login-body { background: #f4f6fa; }
.login-wrap { display: grid; grid-template-columns: 1.15fr 1fr; min-height: 100vh; }
.login-hero {
  position: relative; overflow: hidden; color: #e2e8f0;
  background: radial-gradient(1200px 600px at 10% 0%, #1e3a8a 0%, #0f172a 55%, #0b1220 100%);
  padding: 40px 52px; display: flex; flex-direction: column;
}
.login-hero::after {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(148, 163, 184, .16) 1px, transparent 1px);
  background-size: 22px 22px; opacity: .35; pointer-events: none;
}
.hero-top { display: flex; align-items: center; gap: 12px; color: #fff; }
.hero-top div { display: flex; flex-direction: column; line-height: 1.25; }
.hero-top strong { font-size: 15px; }
.hero-top small { color: #64748b; font-size: 11px; letter-spacing: .5px; }
.hero-copy { margin: auto 0; max-width: 460px; position: relative; z-index: 1; }
.hero-copy h1 { color: #fff; font-size: 38px; line-height: 1.25; letter-spacing: -.8px; }
.hero-sub { color: #94a3b8; font-size: 14px; margin-top: 16px; line-height: 1.8; }
.hero-list { display: flex; flex-direction: column; gap: 11px; margin-top: 26px; }
.hero-list li { display: flex; align-items: center; gap: 9px; color: #cbd5e1; font-size: 13px; }
.hero-list svg { color: #60a5fa; }
.hero-foot { color: #8b9ab0; font-size: 11.5px; position: relative; z-index: 1; }

.login-panel { display: flex; align-items: center; justify-content: center; padding: 30px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 24px; letter-spacing: -.4px; }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 22px; }
.login-card .field { margin-bottom: 14px; }
.login-card .field input { height: 42px; font-size: 14px; }
.login-hint { text-align: center; color: var(--faint); font-size: 12px; margin-top: 16px; }
.alert { border-radius: 9px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 14px; }
.alert-err { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-ok { background: #ecfdf5; border: 1px solid #a7f3d0; color: #047857; }

/* ---------------- 邮件详情 ---------------- */
.mail-card { max-width: 1000px; }
.mail-head { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
.mail-title h2 { font-size: 19px; line-height: 1.45; letter-spacing: -.2px; }
.mail-meta { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 9px; color: var(--muted); font-size: 12px; }
.mail-meta span { display: inline-flex; align-items: center; gap: 5px; }
.small-note { font-size: 11.5px; }
.mail-action { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex: none; }
.hit-panel { margin-top: 16px; background: #f8fafc; border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; }
.hit-panel.hit-none { color: var(--muted); font-size: 12.5px; }
.hit-title { font-size: 12px; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.hit-list { display: flex; flex-direction: column; gap: 8px; }
.hit-item { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.hit-item small { margin-left: auto; }
.mail-body-head {
  display: flex; justify-content: space-between; align-items: center;
  margin: 18px 0 8px; padding-top: 14px; border-top: 1px solid var(--border);
  font-size: 12.5px; font-weight: 600; color: #334155;
}
.mail-body-wrap { background: #fcfdff; border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; }
.mail-body {
  font-family: inherit; font-size: 13.5px; line-height: 1.9; color: #1f2937;
  white-space: pre-wrap; word-break: break-word; margin: 0;
}
.mail-body mark { background: #fef08a; color: #78350f; font-weight: 600; padding: 0 1px; border-radius: 2px; }
.marker-card { margin-top: 16px; max-width: 1000px; }
.marker-card h3 { font-size: 13.5px; margin-bottom: 10px; }
.marker-list { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.marker-list li { display: flex; align-items: center; gap: 8px; }
.marker-list li .muted:last-child { margin-left: auto; }

/* ---------------- 邮箱卡片 ---------------- */
.box-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(400px, 1fr)); gap: 14px; }
.box-card { display: flex; flex-direction: column; gap: 10px; }
.box-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.box-head h3 { font-size: 15px; }
.box-head p { font-size: 11.5px; margin-top: 2px; }
.box-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 14px; font-size: 12px; }
.box-facts div { display: flex; gap: 8px; }
.box-facts dt { color: var(--faint); min-width: 60px; }
.box-facts dd { color: #334155; margin: 0; }
.box-status { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); background: #f8fafc; border-radius: 8px; padding: 7px 10px; }
.err-text { color: #b91c1c; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.box-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; }

/* ---------------- 日志 ---------------- */
.act { font-size: 12.5px; color: #334155; }
.act-mark { color: #047857; font-weight: 600; }
.act-warn { color: #b45309; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .grid-2 { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .sidebar { width: 76px; padding: 16px 8px; }
  .brand-text, .nav-label, .nav-item span, .me-text, .copyright, .side-actions .btn span { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .brand { justify-content: center; }
  .me { justify-content: center; }
  .side-actions { flex-direction: column; }
  .login-wrap { grid-template-columns: 1fr; }
  .login-hero { display: none; }
  .content { padding: 16px; }
  .topbar { padding: 0 16px; }
  .box-grid { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .form-grid, .form-grid.form-3 { grid-template-columns: 1fr; }
  .filters { gap: 6px; }
  .filter-search { min-width: 100%; }
  .topbar-actions .btn span { display: none; }
}

/* ---------------- 批量处理 / 已导出·已转发·已读 ---------------- */

.filters .inline-field {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  padding: 0 10px; height: 36px; font-size: 12.5px; color: #475569;
}
.filters .inline-field input[type="date"],
.filters .inline-field input[type="datetime-local"] {
  border: 0; outline: 0; background: transparent; font: inherit; color: #0f172a;
  font-family: "Consolas", monospace;
}
.batch-summary {
  display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap;
  font-size: 12.5px; color: #334155;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
  padding: 9px 13px; margin-top: 4px;
}
.batch-summary strong { font-size: 15px; color: var(--primary); }

.batch-actions {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px; margin-bottom: 16px;
}
.action-card { display: flex; flex-direction: column; gap: 9px; }
.action-card h3 { font-size: 14px; }
.action-card p { font-size: 12px; color: var(--muted); line-height: 1.65; min-height: 58px; }
.action-card form { display: flex; flex-direction: column; gap: 9px; margin-top: auto; }
.action-card .btn { justify-content: center; }
.action-card .btn[disabled] { opacity: .5; cursor: not-allowed; }
.action-icon {
  width: 38px; height: 38px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
}
.action-blue { background: #eff6ff; color: #2563eb; }
.action-teal { background: #ecfdf5; color: #0d9488; }
.action-purple { background: #f5f3ff; color: #7c3aed; }
.action-note { font-size: 11px; color: #94a3b8; }

.input-text {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 9px;
  font: inherit; font-size: 12.5px; color: #0f172a; background: #fff;
}
.input-text:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); outline: 0; }

.form-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 14px; }

.export-result { border-color: #bfdbfe; background: #f8fbff; }

.flag-row { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 5px; }
.flag {
  display: inline-flex; align-items: center; height: 19px; padding: 0 7px;
  border-radius: 6px; font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.flag-export { color: #1d4ed8; background: #eff6ff; }
.flag-forward { color: #0f766e; background: #ecfdf5; }
.flag-read { color: #6d28d9; background: #f5f3ff; }

.timeline { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.timeline li {
  display: flex; align-items: center; gap: 10px; font-size: 12px;
  padding: 7px 10px; background: #f8fafc; border-radius: 8px;
}

@media (max-width: 1180px) {
  .batch-actions { grid-template-columns: 1fr; }
  .action-card p { min-height: 0; }
}


/* ---------------- 多 SMTP 账号 ---------------- */
.smtp-editor { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 10px; }
.smtp-editor > summary {
  cursor: pointer; font-size: 13px; font-weight: 600; color: var(--primary);
  padding: 6px 0; list-style: none;
}
.smtp-editor > summary::-webkit-details-marker { display: none; }
.smtp-editor > summary::before { content: '▸ '; font-size: 11px; }
.smtp-editor[open] > summary::before { content: '▾ '; }
.smtp-editor[open] > summary { margin-bottom: 12px; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.row-actions form { margin: 0; }
textarea.input-text { height: auto; padding: 8px 11px; line-height: 1.6; resize: vertical; }
