/* ===== 全局变量 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: rgba(99, 102, 241, 0.1);
  --primary-grad: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --primary-grad-2: linear-gradient(135deg, #4f6ef7 0%, #7c3aed 100%);
  --primary-grad-3: linear-gradient(135deg, #818cf8 0%, #c084fc 100%);
  --danger: #ef4444;
  --danger-grad: linear-gradient(135deg, #f87171, #ef4444);
  --success: #10b981;
  --success-grad: linear-gradient(135deg, #34d399, #10b981);
  --warning-grad: linear-gradient(135deg, #fbbf24, #f59e0b);

  --bg: #eef1f8;
  --surface: rgba(255, 255, 255, 0.72);
  --surface-hover: rgba(255, 255, 255, 0.85);
  --surface-solid: #ffffff;
  --glass-border: rgba(255, 255, 255, 0.55);
  --border: rgba(226, 232, 240, 0.7);

  --text: #1e293b;
  --text-2: #64748b;
  --muted: #94a3b8;

  --shadow-sm: 0 2px 8px rgba(31, 37, 51, 0.05);
  --shadow: 0 8px 24px rgba(99, 102, 241, 0.08), 0 2px 8px rgba(31, 37, 51, 0.04);
  --shadow-lg: 0 24px 60px rgba(99, 102, 241, 0.18), 0 8px 24px rgba(31, 37, 51, 0.08);
  --shadow-glow: 0 0 0 4px rgba(99, 102, 241, 0.14);

  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;

  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

/* ===== 液态玻璃背景：流动的彩色光晕 ===== */
body::before {
  content: '';
  position: fixed;
  inset: -10%;
  background:
    radial-gradient(ellipse 55% 45% at 18% 28%, rgba(129, 140, 248, 0.42), transparent 60%),
    radial-gradient(ellipse 50% 40% at 82% 18%, rgba(244, 114, 182, 0.36), transparent 60%),
    radial-gradient(ellipse 55% 45% at 65% 82%, rgba(56, 189, 248, 0.38), transparent 60%),
    radial-gradient(ellipse 48% 40% at 28% 72%, rgba(167, 139, 250, 0.32), transparent 60%),
    radial-gradient(ellipse 40% 35% at 50% 50%, rgba(52, 211, 153, 0.18), transparent 60%);
  z-index: -2;
  animation: drift 28s ease-in-out infinite alternate;
  will-change: transform;
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 40%, rgba(238, 241, 248, 0.4) 100%);
  z-index: -1;
  pointer-events: none;
}

@keyframes drift {
  0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
  33%  { transform: translate(-2%, 3%) scale(1.06) rotate(2deg); }
  66%  { transform: translate(3%, -2%) scale(1.04) rotate(-2deg); }
  100% { transform: translate(-1%, 1%) scale(1.02) rotate(1deg); }
}

::selection {
  background: rgba(99, 102, 241, 0.25);
  color: var(--text);
}

/* 通用隐藏类（覆盖 display:flex 等基础样式） */
.hidden { display: none !important; }

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  animation: appIn 0.5s ease;
}

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

/* ===== 玻璃面板通用 ===== */
.glass {
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
}

/* ===== 顶部栏 ===== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  height: 62px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  z-index: 10;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset, var(--shadow-sm);
}

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

.logo {
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(99, 102, 241, 0.3));
  animation: floatIcon 4s ease-in-out infinite;
}

@keyframes floatIcon {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.header-title h1 {
  font-size: 19px;
  font-weight: 800;
  background: var(--primary-grad-2);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.3px;
  cursor: help;
  transition: opacity 0.35s ease, transform 0.35s ease, background-position 0.6s ease;
  animation: gradShift 6s ease infinite;
}

@keyframes gradShift {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.header-title h1.changing {
  opacity: 0;
  transform: translateY(-6px) scale(0.96);
}

.mode-tag {
  font-size: 11px;
  padding: 3px 9px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 20px;
  font-weight: 600;
  border: 1px solid rgba(99, 102, 241, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.header-actions {
  display: flex;
  gap: 8px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 15px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: var(--text);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.4) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.6s ease;
}

.btn:hover {
  background: var(--surface-hover);
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.btn:hover::before {
  transform: translateX(100%);
}

.btn:active {
  transform: translateY(0) scale(0.97);
}

.btn-primary {
  background: var(--primary-grad-2);
  background-size: 150% 150%;
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.35);
}

.btn-primary:hover {
  background: var(--primary-grad-2);
  background-size: 150% 150%;
  background-position: 100% 100%;
  box-shadow: 0 6px 22px rgba(99, 102, 241, 0.5);
  border-color: transparent;
}

.btn-danger {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
}

.btn-danger:hover {
  background: var(--danger-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(239, 68, 68, 0.35);
}

.btn-sm {
  padding: 7px 11px;
  font-size: 12px;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
}

/* ===== 主体 ===== */
.main {
  display: flex;
  flex: 1;
  overflow: hidden;
  padding: 14px;
  gap: 14px;
}

/* ===== 左：账号列表 ===== */
.sidebar {
  width: 286px;
  flex-shrink: 0;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideRight 0.4s ease;
}

@keyframes slideRight {
  from { opacity: 0; transform: translateX(-12px); }
  to { opacity: 1; transform: translateX(0); }
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}

.sidebar-header h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.badge {
  font-size: 11px;
  background: var(--primary-grad-2);
  color: #fff;
  padding: 2px 9px;
  border-radius: 20px;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(99, 102, 241, 0.3);
  min-width: 22px;
  text-align: center;
}

.sidebar-search {
  padding: 0 14px 10px;
}

.sidebar-search input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition);
}

.sidebar-search input:focus {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

/* ===== 统计卡片 ===== */
.stats-card {
  display: flex;
  margin: 0 14px 12px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.16), rgba(124, 58, 237, 0.12));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: var(--radius);
  padding: 13px 8px;
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.1), 0 1px 0 rgba(255, 255, 255, 0.5) inset;
  position: relative;
  overflow: hidden;
}

.stats-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(45deg, transparent 40%, rgba(255, 255, 255, 0.25) 50%, transparent 60%);
  animation: shimmer 6s linear infinite;
}

@keyframes shimmer {
  0% { transform: translate(-30%, -30%) rotate(0deg); }
  100% { transform: translate(30%, 30%) rotate(360deg); }
}

.stats-item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.stats-item + .stats-item {
  border-left: 1px solid rgba(99, 102, 241, 0.2);
}

.stats-value {
  font-size: 24px;
  font-weight: 800;
  background: var(--primary-grad-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  letter-spacing: -0.5px;
}

.stats-label {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 3px;
  font-weight: 500;
}

/* ===== 账号列表 ===== */
.account-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 10px 12px;
}

.account-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  margin-bottom: 6px;
  border-radius: var(--radius);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition);
  position: relative;
  animation: itemIn 0.3s ease backwards;
}

@keyframes itemIn {
  from { opacity: 0; transform: translateX(-8px); }
  to { opacity: 1; transform: translateX(0); }
}

.account-item:hover {
  background: rgba(255, 255, 255, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
  transform: translateX(3px);
}

.account-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(124, 58, 237, 0.08));
  border-color: rgba(99, 102, 241, 0.25);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.12);
}

.account-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  bottom: 12px;
  width: 3px;
  background: var(--primary-grad-2);
  border-radius: 0 3px 3px 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.5);
}

.account-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-grad-2);
  background-size: 200% 200%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 3px 10px rgba(99, 102, 241, 0.35);
  transition: all var(--transition);
}

.account-item:hover .account-avatar {
  background-position: 100% 100%;
  transform: scale(1.06);
}

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

.account-email {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.account-remark {
  font-size: 12px;
  color: var(--text-2);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-actions {
  display: none;
  gap: 2px;
  flex-shrink: 0;
}

.account-item:hover .account-actions {
  display: flex;
  animation: fadeIn 0.2s ease;
}

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

.icon-btn {
  width: 26px;
  height: 26px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}

.icon-btn:hover {
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary);
  transform: scale(1.1);
}

.icon-btn.danger:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

/* ===== 中：邮件区 ===== */
.mail-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: slideLeft 0.4s ease;
}

@keyframes slideLeft {
  from { opacity: 0; transform: translateX(12px); }
  to { opacity: 1; transform: translateX(0); }
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.4);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.account-bar-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.current-email {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--primary-grad-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  cursor: pointer;
  padding: 2px 6px;
  margin: -2px -6px;
  border-radius: 6px;
  transition: all 0.15s ease;
}

.current-email:hover {
  background: rgba(99, 102, 241, 0.12);
  -webkit-text-fill-color: var(--primary-dark);
}

.current-email:active {
  transform: scale(0.97);
}

.current-email.copied {
  background: var(--success-grad);
  -webkit-text-fill-color: transparent;
}

.current-remark {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 1px;
}

.mailbox-tabs {
  display: flex;
  gap: 4px;
  margin-left: auto;
  background: rgba(255, 255, 255, 0.4);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.tab {
  padding: 6px 13px;
  border: none;
  background: transparent;
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--transition);
}

.tab:hover {
  color: var(--primary);
  background: rgba(255, 255, 255, 0.5);
}

.tab.active {
  background: var(--primary-grad-2);
  color: #fff;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.mail-actions {
  display: flex;
  gap: 6px;
}

/* ===== 邮件列表 ===== */
.mail-list {
  flex: 1;
  overflow-y: auto;
}

.mail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.5);
  cursor: pointer;
  transition: all 0.18s ease;
  border-left: 3px solid transparent;
  position: relative;
  animation: mailIn 0.35s ease backwards;
}

@keyframes mailIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.mail-item:nth-child(1) { animation-delay: 0.02s; }
.mail-item:nth-child(2) { animation-delay: 0.05s; }
.mail-item:nth-child(3) { animation-delay: 0.08s; }
.mail-item:nth-child(4) { animation-delay: 0.11s; }
.mail-item:nth-child(5) { animation-delay: 0.14s; }
.mail-item:nth-child(6) { animation-delay: 0.17s; }
.mail-item:nth-child(7) { animation-delay: 0.2s; }
.mail-item:nth-child(8) { animation-delay: 0.23s; }

.mail-item:hover {
  background: rgba(255, 255, 255, 0.55);
  transform: translateX(3px);
}

.mail-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(124, 58, 237, 0.06));
  border-left-color: var(--primary);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.1);
}

.mail-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mail-subject {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.mail-date {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
  font-weight: 500;
}

.mail-from {
  font-size: 12px;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-preview {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-code-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  color: #b45309;
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  padding: 1px 7px;
  border-radius: 5px;
  margin-right: 4px;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 1px 3px rgba(245, 158, 11, 0.2);
  font-family: "SF Mono", Consolas, Monaco, monospace;
  letter-spacing: 0.5px;
}

/* ===== 空状态 ===== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  text-align: center;
  color: var(--text-2);
  padding: 20px;
  animation: fadeIn 0.4s ease;
}

.empty-state.small {
  height: auto;
  padding: 30px 10px;
}

.empty-icon {
  font-size: 46px;
  margin-bottom: 12px;
  opacity: 0.8;
  filter: drop-shadow(0 4px 8px rgba(99, 102, 241, 0.15));
  animation: floatIcon 3s ease-in-out infinite;
}

.empty-state p {
  font-size: 13px;
  margin-bottom: 4px;
}

.muted {
  color: var(--muted);
  font-size: 12px;
}

/* ===== 弹窗 ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(30, 41, 59, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  animation: modalFade 0.2s ease;
}

.modal.hidden {
  display: none;
}

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

.modal-content {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  width: 540px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg), 0 1px 0 rgba(255, 255, 255, 0.6) inset;
  animation: modalPop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content.small {
  width: 400px;
}

.modal-content.modal-large {
  width: 860px;
  max-width: 95vw;
  max-height: 90vh;
}

@keyframes modalPop {
  from { opacity: 0; transform: scale(0.9) translateY(24px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-header h3 {
  font-size: 15px;
  font-weight: 700;
  background: var(--primary-grad-2);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.modal-close {
  border: none;
  background: rgba(0, 0, 0, 0.04);
  font-size: 15px;
  cursor: pointer;
  color: var(--text-2);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
  transform: rotate(90deg);
}

.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-body textarea,
.modal-body input {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.6);
  transition: all var(--transition);
  resize: vertical;
}

.modal-body textarea {
  font-family: "SF Mono", Consolas, Monaco, monospace;
  font-size: 12px;
  line-height: 1.5;
}

.modal-body textarea:focus,
.modal-body input:focus {
  background: rgba(255, 255, 255, 0.95);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}

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

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

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
}

.modal-hint {
  font-size: 12px;
  color: var(--text-2);
  margin-bottom: 10px;
  line-height: 1.5;
}

.modal-hint code {
  background: var(--primary-light);
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
}

.import-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

#import-file-name {
  font-size: 12px;
}

.import-preview {
  font-size: 12px;
  margin-top: 8px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
}

.confirm-message {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

/* ===== 写邮件 ===== */
.compose-info {
  font-size: 12px;
  margin-bottom: 12px;
  padding: 9px 12px;
  background: var(--primary-light);
  border-radius: 8px;
  border: 1px solid rgba(99, 102, 241, 0.12);
}

.compose-type-toggle {
  display: flex;
  gap: 16px;
  margin-bottom: 6px;
}

.radio-label,
.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  margin: 0;
}

.radio-label input,
.checkbox-label input {
  margin: 0;
  accent-color: var(--primary);
}

/* ===== 邮件详情 ===== */
.detail-header {
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.detail-subject {
  font-size: 18px;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 14px;
  color: var(--text);
}

.detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: var(--text-2);
}

.detail-meta-row {
  display: flex;
  gap: 6px;
}

.detail-meta-label {
  color: var(--muted);
  flex-shrink: 0;
  min-width: 48px;
  font-weight: 600;
}

.detail-meta-value {
  word-break: break-all;
}

.code-banner {
  margin: 16px 22px 0;
  padding: 15px 17px;
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.18), rgba(245, 158, 11, 0.1));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: var(--radius);
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12);
  animation: codePulse 2s ease-in-out infinite;
}

@keyframes codePulse {
  0%, 100% { box-shadow: 0 4px 14px rgba(245, 158, 11, 0.12); }
  50% { box-shadow: 0 4px 20px rgba(245, 158, 11, 0.25); }
}

.code-banner-title {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  margin-bottom: 9px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.code-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.code-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.7);
  padding: 7px 13px;
  border-radius: 9px;
  border: 1px solid rgba(251, 191, 36, 0.4);
  transition: all var(--transition);
}

.code-item:hover {
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.2);
}

.code-number {
  font-size: 22px;
  font-weight: 800;
  background: var(--warning-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  letter-spacing: 2px;
}

.code-copy {
  border: none;
  background: var(--warning-grad);
  color: #fff;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 11px;
  cursor: pointer;
  font-weight: 700;
  transition: all 0.15s;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3);
}

.code-copy:hover {
  transform: scale(1.05);
  box-shadow: 0 3px 10px rgba(245, 158, 11, 0.45);
}

.code-copy:active {
  transform: scale(0.95);
}

.detail-body {
  padding: 16px 22px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text);
  word-break: break-word;
}

.detail-body iframe {
  width: 100%;
  min-height: 300px;
  border: none;
  border-radius: 8px;
}

.detail-body-text {
  white-space: pre-wrap;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 41, 59, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  z-index: 2000;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-width: 90vw;
}

.toast.hidden {
  display: none;
}

.toast.success {
  background: rgba(16, 185, 129, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
}

.toast.error {
  background: rgba(239, 68, 68, 0.92);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes toastIn {
  from { transform: translate(-50%, 24px); opacity: 0; }
  to { transform: translate(-50%, 0); opacity: 1; }
}

/* ===== 加载 ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 50px;
  color: var(--text-2);
  font-size: 13px;
  gap: 14px;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(99, 102, 241, 0.15);
  border-top-color: var(--primary);
  border-right-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
}

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

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.4);
  border-radius: 4px;
  border: 2px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.5);
  background-clip: padding-box;
  border: 2px solid transparent;
}

/* ===== 响应式 ===== */
@media (max-width: 860px) {
  .sidebar {
    width: 230px;
  }
  .main {
    padding: 8px;
    gap: 8px;
  }
}

@media (max-width: 640px) {
  .header-actions .btn span,
  .header-actions .btn {
    font-size: 11px;
  }
  .mode-tag {
    display: none;
  }
}

/* ===== 深色模式 ===== */
[data-theme="dark"] {
  --bg: #0a0e1a;
  --surface: rgba(30, 41, 59, 0.7);
  --surface-hover: rgba(51, 65, 85, 0.85);
  --surface-solid: #1e293b;
  --glass-border: rgba(255, 255, 255, 0.08);
  --border: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --text-2: #94a3b8;
  --muted: #64748b;
  --primary-light: rgba(99, 102, 241, 0.18);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55), 0 8px 24px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body::before {
  background:
    radial-gradient(ellipse 55% 45% at 18% 28%, rgba(129, 140, 248, 0.5), transparent 60%),
    radial-gradient(ellipse 50% 40% at 82% 18%, rgba(244, 114, 182, 0.42), transparent 60%),
    radial-gradient(ellipse 55% 45% at 65% 82%, rgba(56, 189, 248, 0.45), transparent 60%),
    radial-gradient(ellipse 48% 40% at 28% 72%, rgba(167, 139, 250, 0.4), transparent 60%);
}

[data-theme="dark"] body::after {
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10, 14, 26, 0.5) 100%);
}

[data-theme="dark"] .btn {
  background: rgba(51, 65, 85, 0.5);
  color: var(--text);
}
[data-theme="dark"] .btn:hover {
  background: rgba(71, 85, 105, 0.7);
}
[data-theme="dark"] .modal-body textarea,
[data-theme="dark"] .modal-body input,
[data-theme="dark"] .sidebar-search input {
  background: rgba(15, 23, 42, 0.6);
  color: var(--text);
}
[data-theme="dark"] .modal-body textarea:focus,
[data-theme="dark"] .modal-body input:focus,
[data-theme="dark"] .sidebar-search input:focus {
  background: rgba(15, 23, 42, 0.95);
}
[data-theme="dark"] .tab { color: var(--text-2); }
[data-theme="dark"] .mailbox-tabs { background: rgba(15, 23, 42, 0.4); }
[data-theme="dark"] .modal-content { background: rgba(23, 32, 48, 0.85); }
[data-theme="dark"] .toast { background: rgba(15, 23, 42, 0.92); }
[data-theme="dark"] .code-item { background: rgba(51, 65, 85, 0.5); }

/* ===== 顶栏分隔线 & 图标按钮 ===== */
.header-divider {
  width: 1px;
  height: 22px;
  background: var(--border);
  margin: 0 4px;
}

.btn.icon-only {
  padding: 8px 10px;
  font-size: 15px;
}

/* ===== 邮件搜索框 ===== */
.mail-search-box {
  margin-left: auto;
}
.mail-search-box input {
  width: 220px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 9px;
  font-size: 12px;
  outline: none;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all var(--transition);
}
.mail-search-box input:focus {
  width: 260px;
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--primary);
  box-shadow: var(--shadow-glow);
}
[data-theme="dark"] .mail-search-box input { background: rgba(15, 23, 42, 0.5); color: var(--text); }
[data-theme="dark"] .mail-search-box input:focus { background: rgba(15, 23, 42, 0.95); }

/* ===== 批量操作栏 ===== */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(124, 58, 237, 0.08));
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}
.batch-bar.hidden { display: none; }

/* ===== 详情头部操作 ===== */
.detail-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== 骨架屏 ===== */
.skeleton-item {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.4);
}
.skeleton-line {
  height: 11px;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.18) 25%, rgba(148, 163, 184, 0.35) 50%, rgba(148, 163, 184, 0.18) 75%);
  background-size: 200% 100%;
  border-radius: 6px;
  margin-bottom: 8px;
  animation: skeletonShimmer 1.4s ease-in-out infinite;
}
.skeleton-line:last-child { margin-bottom: 0; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w40 { width: 40%; }
.skeleton-line.w30 { width: 30%; }
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== 邮件时间分组 ===== */
.mail-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 2;
}
[data-theme="dark"] .mail-group-header { background: rgba(15, 23, 42, 0.4); }

.group-label { display: flex; align-items: center; gap: 6px; }
.group-count {
  font-size: 10px;
  font-weight: 700;
  background: rgba(99, 102, 241, 0.15);
  color: var(--primary);
  padding: 0 6px;
  border-radius: 8px;
  text-transform: none;
  letter-spacing: 0;
}

.group-delete-btn {
  font-size: 11px;
  padding: 3px 10px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  transition: all 0.15s ease;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.group-delete-btn:hover {
  background: var(--danger-grad);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}
.group-delete-btn:active {
  transform: scale(0.95);
}

/* ===== 多选模式 ===== */
.mail-check {
  display: none;
  width: 17px;
  height: 17px;
  margin-right: 10px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.mail-list.select-mode .mail-check {
  display: inline-block;
}
.mail-list.select-mode .mail-item {
  padding-left: 14px;
}
.mail-item.selected {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.14), rgba(124, 58, 237, 0.08)) !important;
}

/* ===== 切换账号过渡 ===== */
.mail-list {
  transition: opacity 0.18s ease;
}
.mail-list.fading {
  opacity: 0;
}

/* ===== 账号健康状态（头像角标） ===== */
.account-avatar { position: relative; }
.health-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--surface-solid);
  z-index: 1;
}
.health-dot.ok { background: #10b981; box-shadow: 0 0 6px rgba(16, 185, 129, 0.6); }
.health-dot.fail { background: #ef4444; box-shadow: 0 0 6px rgba(239, 68, 68, 0.6); }
.health-dot.checking {
  background: #f59e0b;
  animation: healthPulse 1s ease-in-out infinite;
}
@keyframes healthPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* ===== 监听收码 浮窗 ===== */
.monitor-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 300px;
  background: var(--surface);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  z-index: 900;
  overflow: hidden;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.monitor-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.18), rgba(99, 102, 241, 0.1));
  border-bottom: 1px solid var(--border);
}
.monitor-pulse {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px #10b981;
  animation: monitorPulse 1.4s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes monitorPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}
.monitor-title { font-weight: 700; font-size: 13px; color: var(--text); }
.monitor-account {
  font-size: 11px;
  color: var(--text-2);
  flex: 1;
  margin-left: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.monitor-status {
  padding: 16px 14px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}
.monitor-status .latest-code {
  font-size: 28px;
  font-weight: 800;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  background: var(--warning-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 3px;
  margin: 8px 0;
  display: block;
}

/* ===== 验证码捕获 大号弹窗 ===== */
.code-alert {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 3000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  animation: modalFade 0.2s ease;
}
.code-alert.hidden { display: none; }
.code-alert-content {
  background: var(--surface);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 40px 56px;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: alertPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes alertPop {
  from { transform: scale(0.65); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.code-alert-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
  margin-bottom: 16px;
  letter-spacing: 0.5px;
}
.code-alert-code {
  font-size: 60px;
  font-weight: 800;
  font-family: "SF Mono", Consolas, Monaco, monospace;
  letter-spacing: 8px;
  background: var(--warning-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 14px;
  filter: drop-shadow(0 4px 12px rgba(245, 158, 11, 0.3));
}
.code-alert-meta {
  font-size: 13px;
  color: var(--text-2);
  margin-bottom: 12px;
}
.code-alert-hint {
  font-size: 12px;
  color: var(--success);
  font-weight: 700;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
