:root {
  --bg: #f1f4f9;
  --bg-ambient: radial-gradient(950px circle at 18% -12%, rgba(79, 70, 229, 0.08), transparent 58%),
                radial-gradient(800px circle at 88% -8%, rgba(14, 165, 233, 0.07), transparent 55%);
  --topbar-bg: rgba(255, 255, 255, 0.84);
  --rail-bg: rgba(246, 248, 252, 0.8);
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --paper-canvas: #f8fafc;
  --subtle: #f1f5f9;
  --subtle-hover: #e7edf6;
  --border: rgba(15, 23, 42, 0.085);
  --border-card: rgba(15, 23, 42, 0.12);
  --border-strong: rgba(15, 23, 42, 0.16);
  --msg-active-border: rgba(15, 23, 42, 0.22);
  --msg-active-shadow: 0 3px 12px -2px rgba(15, 23, 42, 0.10), 0 1px 3px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  --text: #0f172a;
  --text-sub: #475569;
  --text-muted: #94a3b8;

  --primary: #2563eb;
  --primary-grad: linear-gradient(180deg, #27324a 0%, #161d2e 100%);
  --primary-grad-hover: linear-gradient(180deg, #32405e 0%, #1d273d 100%);
  --primary-border: rgba(15, 23, 42, 0.88);
  --primary-shadow: 0 1px 2px rgba(15, 23, 42, 0.16), 0 4px 12px -3px rgba(15, 23, 42, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.18), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  --primary-shadow-hover: 0 2px 4px rgba(15, 23, 42, 0.18), 0 6px 16px -3px rgba(15, 23, 42, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.22), inset 0 -1px 0 rgba(0, 0, 0, 0.22);
  --primary-soft: rgba(37, 99, 235, 0.085);

  --soft-primary-bg: linear-gradient(180deg, #f3f7ff 0%, #e7f0ff 100%);
  --soft-primary-bg-hover: linear-gradient(180deg, #ebf2ff 0%, #dbe8ff 100%);
  --soft-primary-border: rgba(37, 99, 235, 0.28);
  --soft-primary-border-hover: rgba(37, 99, 235, 0.42);
  --soft-primary-text: #1d4ed8;
  --soft-primary-shadow: 0 1px 2px rgba(37, 99, 235, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.92);

  --btn-sec-bg: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  --btn-sec-bg-hover: linear-gradient(180deg, #ffffff 0%, #f1f5f9 100%);

  --success: #059669;
  --success-grad: linear-gradient(180deg, #10b981 0%, #059669 100%);
  --success-soft: rgba(16, 185, 129, 0.1);
  --warn: #d97706;
  --warn-soft: rgba(245, 158, 11, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(239, 68, 68, 0.1);

  --card-shadow: 0 1px 2px rgba(15, 23, 42, 0.03), 0 12px 32px -8px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --btn-sec-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.85);
  --rail-active-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 12px rgba(15, 23, 42, 0.04);
}

html[data-theme="dark"] {
  --bg: #090b10;
  --bg-ambient: radial-gradient(950px circle at 18% -12%, rgba(99, 102, 241, 0.14), transparent 58%),
                radial-gradient(800px circle at 88% -8%, rgba(14, 165, 233, 0.09), transparent 55%);
  --topbar-bg: rgba(14, 17, 25, 0.84);
  --rail-bg: rgba(12, 15, 22, 0.82);
  --surface: #11151f;
  --surface-elevated: #171c29;
  --paper-canvas: #0d1018;
  --subtle: #181e2c;
  --subtle-hover: #20283a;
  --border: rgba(255, 255, 255, 0.08);
  --border-card: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.16);
  --msg-active-border: rgba(148, 163, 184, 0.30);
  --msg-active-shadow: 0 4px 16px -3px rgba(0, 0, 0, 0.46), 0 1px 3px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  --text: #f1f5f9;
  --text-sub: #94a3b8;
  --text-muted: #64748b;

  --primary: #3b82f6;
  --primary-grad: linear-gradient(180deg, #4b7df7 0%, #2c5be0 100%);
  --primary-grad-hover: linear-gradient(180deg, #5c8bff 0%, #3766eb 100%);
  --primary-border: rgba(128, 172, 255, 0.36);
  --primary-shadow: 0 2px 10px -2px rgba(44, 91, 224, 0.48), inset 0 1px 0 rgba(255, 255, 255, 0.26), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  --primary-shadow-hover: 0 4px 16px -2px rgba(44, 91, 224, 0.58), inset 0 1px 0 rgba(255, 255, 255, 0.30), inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  --primary-soft: rgba(59, 130, 246, 0.15);

  --soft-primary-bg: linear-gradient(180deg, rgba(59, 130, 246, 0.22) 0%, rgba(37, 99, 235, 0.13) 100%);
  --soft-primary-bg-hover: linear-gradient(180deg, rgba(59, 130, 246, 0.30) 0%, rgba(37, 99, 235, 0.19) 100%);
  --soft-primary-border: rgba(96, 165, 250, 0.34);
  --soft-primary-border-hover: rgba(147, 197, 253, 0.50);
  --soft-primary-text: #93c5fd;
  --soft-primary-shadow: 0 1px 3px rgba(0, 0, 0, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.08);

  --btn-sec-bg: linear-gradient(180deg, #1b2232 0%, #151b28 100%);
  --btn-sec-bg-hover: linear-gradient(180deg, #222a3d 0%, #1a2130 100%);

  --success: #34d399;
  --success-grad: linear-gradient(180deg, #10b981 0%, #059669 100%);
  --success-soft: rgba(16, 185, 129, 0.14);
  --warn: #fbbf24;
  --warn-soft: rgba(245, 158, 11, 0.15);
  --danger: #f87171;
  --danger-soft: rgba(239, 68, 68, 0.15);

  --card-shadow: 0 8px 28px rgba(0, 0, 0, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.045);
  --btn-sec-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.055);
  --rail-active-shadow: 0 2px 10px rgba(0, 0, 0, 0.36), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

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

html, body {
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: "Inter", "Segoe UI Variable Text", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  background-image: var(--bg-ambient);
  color: var(--text);
  display: flex;
  flex-direction: column;
  font-size: 13.5px;
}

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.3);
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.52);
}

.hidden {
  display: none !important;
}

.icon {
  width: 15px;
  height: 15px;
  display: block;
}

/* 顶部毛玻璃导航栏 */
.topbar {
  height: 54px;
  background: var(--topbar-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  z-index: 20;
}

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

.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.brand-text {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand h1 {
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.35px;
}

.brand-tag {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: var(--subtle);
  border: 1px solid var(--border);
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 按钮体系 */
.btn {
  border: 1px solid transparent;
  border-radius: 8.5px;
  padding: 6.5px 13px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  background: var(--subtle);
  color: var(--text);
  white-space: nowrap;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn:active:not(:disabled) {
  transform: scale(0.975);
}

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

.btn-primary {
  background: var(--primary-grad);
  border-color: var(--primary-border);
  color: #ffffff;
  box-shadow: var(--primary-shadow);
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-grad-hover);
  box-shadow: var(--primary-shadow-hover);
  transform: translateY(-0.5px);
}

.btn-soft-primary {
  background: var(--soft-primary-bg);
  border-color: var(--soft-primary-border);
  color: var(--soft-primary-text);
  box-shadow: var(--soft-primary-shadow);
  font-weight: 550;
}
.btn-soft-primary:hover:not(:disabled) {
  background: var(--soft-primary-bg-hover);
  border-color: var(--soft-primary-border-hover);
  transform: translateY(-0.5px);
}

.btn-emerald {
  background: var(--success-grad);
  border-color: rgba(4, 120, 87, 0.5);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-emerald:hover:not(:disabled) {
  filter: brightness(1.06);
}

.btn-secondary {
  background: var(--btn-sec-bg);
  border-color: var(--border-strong);
  box-shadow: var(--btn-sec-shadow);
  color: var(--text);
}
.btn-secondary:hover:not(:disabled) {
  background: var(--btn-sec-bg-hover);
  border-color: var(--msg-active-border);
}

.btn-secondary.polling {
  background: var(--warn-soft);
  border-color: rgba(245, 158, 11, 0.45);
  color: var(--warn);
  font-weight: 600;
}

.btn-ghost {
  background: transparent;
  color: var(--text-sub);
}
.btn-ghost:hover:not(:disabled) {
  background: var(--subtle);
  color: var(--text);
}

.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
}
.btn-danger-ghost:hover:not(:disabled) {
  background: var(--danger-soft);
}

.btn-icon {
  width: 33px;
  height: 33px;
  padding: 0;
  border-radius: 8.5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-sub);
}
.btn-icon:hover {
  background: var(--surface-elevated);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--btn-sec-shadow);
}

.btn-sm { padding: 5px 11px; font-size: 12.5px; }
.btn-xs { padding: 4px 10px; font-size: 12px; border-radius: 7px; }

.btn-link {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  transition: 0.15s;
}
.btn-link:hover, .btn-link.is-active {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

.btn-copy-tag {
  border: 1px solid var(--border);
  background: var(--surface-elevated);
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 500;
  padding: 3.5px 8.5px;
  border-radius: 6.5px;
  display: inline-flex;
  align-items: center;
  gap: 4.5px;
  cursor: pointer;
  box-shadow: var(--btn-sec-shadow);
  transition: 0.15s;
}
.btn-copy-tag:hover {
  color: var(--primary);
  border-color: rgba(37, 99, 235, 0.35);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}
.is-loading .icon-refresh {
  animation: spin 0.75s linear infinite;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: 0.2s;
}
.polling .pulse-dot {
  background: var(--warn);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

/* 输入控件 */
.input, .textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8.5px;
  font-size: 13px;
  background: var(--surface);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.input:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.textarea {
  font-family: "JetBrains Mono", Consolas, monospace;
  line-height: 1.55;
  resize: vertical;
}

/* 主体布局 */
.workspace {
  flex: 1;
  min-height: 0;
  display: flex;
  overflow: hidden;
}

/* 最左侧：竖排渠道侧栏 */
.provider-rail {
  width: 148px;
  min-height: 0;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex-shrink: 0;
}

.rail-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  padding: 0 8px 6px;
}

.rail-tab {
  border: 1px solid transparent;
  background: transparent;
  padding: 8.5px 10px;
  border-radius: 9.5px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
}

.rail-tab.is-empty:not(.active) {
  opacity: 0.68;
}

.rail-tab:hover {
  background: var(--subtle);
  color: var(--text);
  opacity: 1;
}

.rail-tab.active {
  background: var(--surface-elevated);
  border-color: var(--border);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--rail-active-shadow);
}

.rail-left {
  display: flex;
  align-items: center;
  gap: 9px;
}

.rail-icon {
  width: 23px;
  height: 23px;
  border-radius: 6.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 800;
  flex-shrink: 0;
}
.rail-icon.all { background: rgba(99, 102, 241, 0.13); color: #6366f1; }
.rail-icon.gmail { background: rgba(239, 68, 68, 0.13); color: #ef4444; }
.rail-icon.microsoft { background: rgba(14, 165, 233, 0.13); color: #0ea5e9; }
.rail-icon.pl { background: rgba(168, 85, 247, 0.13); color: #a855f7; font-size: 9.5px; letter-spacing: -0.3px; }
.rail-icon.gmx { background: rgba(16, 185, 129, 0.13); color: #10b981; }

.rail-tab em {
  font-style: normal;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  background: var(--subtle);
  padding: 1px 7px;
  border-radius: 999px;
}
.rail-tab.active em {
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 600;
}

/* 次左栏：邮箱账号列表 */
.sidebar {
  width: 274px;
  min-width: 235px;
  min-height: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.search-bar {
  padding: 10px 10px 9px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 9px;
  color: var(--text-muted);
  pointer-events: none;
}

.search-clear {
  position: absolute;
  right: 6px;
  width: 20px;
  height: 20px;
  border: none;
  border-radius: 5px;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.search-clear:hover {
  background: var(--subtle-hover);
  color: var(--text);
}

.search-bar .input {
  padding: 6.5px 26px 6.5px 29px;
  font-size: 12.5px;
  background: var(--subtle);
  border-color: transparent;
  border-radius: 8px;
}
.search-bar .input:focus {
  background: var(--surface);
  border-color: var(--primary);
}

.batch-bar {
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  flex-shrink: 0;
}
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.batch-btns { display: flex; gap: 4px; }

.mailbox-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 0;
}

.mb-item {
  margin: 2px 8px;
  padding: 9.5px 11px;
  border-radius: 9.5px;
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  transition: all 0.14s ease;
}
.mb-item:hover {
  background: var(--subtle);
}
.mb-item.active {
  background: var(--primary-soft);
  border-color: rgba(37, 99, 235, 0.2);
}

.prov-dot {
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
  flex-shrink: 0;
}
.prov-dot.gmail { background: #ef4444; }
.prov-dot.microsoft { background: #0ea5e9; }
.prov-dot.pl { background: #a855f7; }
.prov-dot.gmx { background: #10b981; }
.prov-dot.other { background: #94a3b8; }
.prov-dot.err { box-shadow: 0 0 0 3px var(--danger-soft), 0 0 0 1px var(--danger); }

.mb-main {
  flex: 1;
  min-width: 0;
}

.mb-email {
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mb-user {
  font-weight: 600;
  color: var(--text);
}
.mb-domain {
  font-weight: 450;
  color: var(--text-muted);
  font-size: 12px;
}
.mb-item.active .mb-user {
  color: var(--primary);
}
.mb-item.active .mb-domain {
  color: var(--primary);
  opacity: 0.78;
}

.mb-sub {
  font-size: 11px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin-top: 2px;
}
.mb-sub.is-err {
  color: var(--danger);
}

.code-chip {
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.28);
  color: var(--success);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-weight: 700;
  font-size: 11.5px;
  padding: 1.5px 7px;
  border-radius: 6px;
  flex-shrink: 0;
}
.code-chip:hover {
  filter: brightness(0.95);
}

/* 右侧主工作台 */
.content-pane {
  flex: 1;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 20px;
  overflow: hidden;
}

.empty-state {
  margin: auto;
  text-align: center;
  max-width: 410px;
  padding: 38px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--card-shadow);
}
.empty-emblem {
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 15px;
  background: var(--primary-soft);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}
.empty-state h2 { font-size: 15.5px; font-weight: 650; margin-bottom: 8px; }
.empty-state p { color: var(--text-sub); font-size: 13px; line-height: 1.55; margin-bottom: 18px; }

.detail-container {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* 顶部当前账号栏 */
.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.account-left {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  flex: 1;
}

.provider-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2.5px 8px;
  border-radius: 6px;
  letter-spacing: 0.2px;
  flex-shrink: 0;
}
.provider-pill.gmail { background: rgba(239, 68, 68, 0.13); color: #ef4444; }
.provider-pill.microsoft { background: rgba(14, 165, 233, 0.14); color: #0284c7; }
.provider-pill.pl { background: rgba(168, 85, 247, 0.14); color: #9333ea; }
.provider-pill.gmx { background: rgba(16, 185, 129, 0.14); color: #059669; }
.provider-pill.other { background: var(--subtle); color: var(--text-sub); }

.cur-email {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s;
}
.cur-email:hover {
  color: var(--primary);
}

.remark-input {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-sub);
  font-size: 12.5px;
  padding: 4.5px 10px;
  border-radius: 7.5px;
  width: 220px;
  outline: none;
  transition: 0.15s;
}
.remark-input:hover {
  background: var(--surface);
  border-color: var(--border);
}
.remark-input:focus {
  background: var(--surface);
  border-color: var(--primary);
  color: var(--text);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

.account-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.alert-error {
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: var(--danger);
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12.5px;
  flex-shrink: 0;
}

/* 顶部最新邮件横条 */
.otp-bar {
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 12px;
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  box-shadow: var(--card-shadow);
  transition: all 0.2s ease;
}

.otp-bar.has-code {
  border-color: rgba(16, 185, 129, 0.45);
  background: linear-gradient(90deg, var(--success-soft) 0%, var(--surface) 58%);
}

.latest-badge {
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--primary-soft);
  color: var(--primary);
  flex-shrink: 0;
}
.otp-bar.has-code .latest-badge {
  background: var(--success-grad);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25);
}

.otp-bar-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.otp-code {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 1.6px;
  color: var(--success);
  background: var(--surface);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 2px 11px;
  border-radius: 7px;
  box-shadow: 0 1px 2px rgba(5, 150, 105, 0.08), inset 0 -1px 0 rgba(5, 150, 105, 0.14);
  cursor: pointer;
  user-select: all;
}

.otp-bar-main {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}
.otp-bar-main:hover {
  color: var(--primary);
}
.otp-bar-main .preview-muted {
  color: var(--text-sub);
  margin-left: 8px;
  font-size: 12.5px;
  font-weight: 400;
}

.otp-bar-link {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.latest-time {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* 主体阅读大卡片 */
.mail-card {
  flex: 1;
  min-height: 0;
  background: var(--surface);
  border: 1px solid var(--border-card);
  border-radius: 14px;
  box-shadow: var(--card-shadow);
  display: grid;
  grid-template-columns: 288px minmax(0, 1fr);
  overflow: hidden;
}

.mail-list-col {
  min-height: 0;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.024);
}

.list-header {
  height: 50px;
  padding: 0 13px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-shrink: 0;
}

.list-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-sub);
  white-space: nowrap;
}
.list-title em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 3px;
}

.messages-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 6px;
}

.msg-card {
  padding: 10px 11px;
  margin-bottom: 4px;
  border-radius: 10.5px;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  transition: all 0.15s ease;
}
.msg-card:hover:not(.active) {
  background: var(--subtle);
  border-color: var(--border-card);
}
.msg-card.active {
  background: var(--surface-elevated);
  border-color: var(--msg-active-border);
  box-shadow: var(--msg-active-shadow);
}

.msg-avatar {
  width: 29px;
  height: 29px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.av-0 { background: rgba(99, 102, 241, 0.13); color: #6366f1; }
.av-1 { background: rgba(14, 165, 233, 0.13); color: #0ea5e9; }
.av-2 { background: rgba(16, 185, 129, 0.13); color: #10b981; }
.av-3 { background: rgba(245, 158, 11, 0.14); color: #f59e0b; }
.av-4 { background: rgba(168, 85, 247, 0.13); color: #a855f7; }
.av-5 { background: rgba(236, 72, 153, 0.13); color: #ec4899; }

.msg-card-body {
  flex: 1;
  min-width: 0;
}

.msg-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 3.5px;
}

.msg-sender {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-date {
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  flex-shrink: 0;
}

.msg-subject {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.msg-card.active .msg-subject {
  color: var(--text);
  font-weight: 550;
}

.msg-preview {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.msg-tags {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.spam-tag {
  font-size: 11px;
  font-weight: 500;
  color: var(--warn);
  background: var(--warn-soft);
  padding: 1px 6px;
  border-radius: 5px;
}

/* 右侧阅读面板 */
.mail-reader-col {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
}

.reader-header {
  min-height: 50px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.reader-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.reader-title-wrap {
  min-width: 0;
  flex: 1;
}

.reader-subject {
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.reader-submeta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}
.meta-sender {
  overflow: hidden;
  text-overflow: ellipsis;
}
.meta-sep { opacity: 0.6; }
.meta-date { font-variant-numeric: tabular-nums; flex-shrink: 0; }

.reader-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* 胶囊分段切换器 */
.seg-switch {
  display: flex;
  background: var(--subtle);
  padding: 2.5px;
  border-radius: 8px;
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.seg-btn {
  border: none;
  background: transparent;
  padding: 3.5px 9px;
  font-size: 11.5px;
  font-weight: 500;
  border-radius: 6px;
  color: var(--text-sub);
  cursor: pointer;
  transition: all 0.14s ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active {
  background: var(--surface-elevated);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.reader-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 24px;
}

.reader-body.html-mode {
  padding: 12px 14px;
  background: var(--paper-canvas);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.html-paper-frame {
  flex: 1;
  min-height: 0;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.reader-pre {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  line-height: 1.72;
  font-size: 13.5px;
  color: var(--text);
}

.reader-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sandbox-iframe {
  flex: 1;
  width: 100%;
  height: 100%;
  border: none;
  background: #ffffff;
}

.empty-hint {
  padding: 48px 16px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.empty-hint svg {
  width: 28px;
  height: 28px;
  opacity: 0.55;
}

.loading-spinner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2.2px solid var(--border-strong);
  border-top-color: var(--primary);
  animation: spin 0.72s linear infinite;
}

.empty-hint.is-loading-hint {
  color: var(--text-sub);
}

/* 模态框 */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 11, 16, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 16px;
  animation: fadeIn 0.15s ease;
}

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

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

.modal {
  background: var(--surface-elevated);
  border: 1px solid var(--border-strong);
  width: 100%;
  max-width: 540px;
  border-radius: 16px;
  box-shadow: 0 24px 48px -12px rgba(0, 0, 0, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  animation: modalSlide 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { font-size: 15px; font-weight: 650; }

.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 7px;
  border: none;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: 0.15s;
}
.modal-close:hover {
  background: var(--subtle);
  color: var(--text);
}

.modal-body {
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.hint-text { font-size: 12.5px; color: var(--text-sub); line-height: 1.55; }
.hint-text code {
  background: var(--subtle);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 5px;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.form-label { display: block; font-size: 12.5px; font-weight: 500; margin-bottom: 6px; color: var(--text-sub); }
.input-row { display: flex; gap: 8px; }

.clean-details {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  font-size: 12.5px;
  color: var(--text-sub);
}
.clean-details summary { cursor: pointer; user-select: none; font-weight: 500; }
.details-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.tools-row {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-sub);
}

.proxy-test-msg { font-size: 12px; margin-top: 6px; font-weight: 500; }
.proxy-test-msg.ok { color: var(--success); }
.proxy-test-msg.err { color: var(--danger); }

.import-result {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--success-soft);
  border: 1px solid rgba(16, 185, 129, 0.25);
  font-size: 12px;
  line-height: 1.6;
}

/* 悬浮毛玻璃 Toast */
.toast-container {
  position: fixed;
  bottom: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 999;
}

.toast {
  background: rgba(15, 23, 42, 0.92);
  backdrop-filter: blur(12px);
  color: #ffffff;
  padding: 10px 15px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 12px 28px -6px rgba(0, 0, 0, 0.28);
  transition: opacity 0.2s ease, transform 0.2s ease;
  animation: modalSlide 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.toast-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #60a5fa;
  flex-shrink: 0;
}
.toast.success .toast-dot { background: #34d399; }
.toast.error .toast-dot { background: #f87171; }
.toast.is-leaving { opacity: 0; transform: translateY(6px); }

/* 管理员登录 / 初始化全屏界面 */
body.auth-locked .topbar,
body.auth-locked .workspace {
  visibility: hidden;
  pointer-events: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background-color: var(--bg);
  background-image: var(--bg-ambient);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.auth-theme-btn {
  position: fixed;
  top: 18px;
  right: 20px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface-elevated);
  border: 1px solid var(--border-card);
  border-radius: 18px;
  padding: 32px 28px 26px;
  box-shadow: 0 20px 50px -14px rgba(15, 23, 42, 0.16), 0 4px 14px -4px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  animation: modalSlide 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

html[data-theme="dark"] .auth-card {
  box-shadow: 0 24px 60px -12px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.auth-head {
  text-align: center;
  margin-bottom: 24px;
}

.auth-logo {
  width: 46px;
  height: 46px;
  margin: 0 auto 14px;
  border-radius: 13px;
  background: linear-gradient(135deg, #3b82f6 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px -4px rgba(79, 70, 229, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.auth-head h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: var(--text);
  margin-bottom: 6px;
}

.auth-head p {
  font-size: 12.5px;
  color: var(--text-sub);
  line-height: 1.55;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pwd-field {
  position: relative;
  display: flex;
  align-items: center;
}

.pwd-field .input {
  padding-right: 38px;
}

.pwd-toggle {
  position: absolute;
  right: 6px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: 0.14s;
}

.pwd-toggle:hover {
  background: var(--subtle);
  color: var(--text);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--text-sub);
}

.auth-error {
  padding: 9px 12px;
  border-radius: 9px;
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.28);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.45;
}

.auth-submit {
  width: 100%;
  padding: 9.5px 16px;
  font-size: 13.5px;
  font-weight: 600;
  margin-top: 2px;
}

.auth-foot {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  text-align: center;
  font-size: 11.5px;
  color: var(--text-muted);
}

.admin-user-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border-radius: 8px;
  background: var(--subtle);
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 500;
  color: var(--text-sub);
}

.admin-user-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--success);
}

.creds-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.creds-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.mobile-nav-bar {
  display: none;
}

/* 本地被动检测：Claude 封号状态筛选与徽章 */
.claude-filter-bar {
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  background: var(--surface);
}

.cf-pill {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--border);
  background: var(--subtle);
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 500;
  padding: 4.5px 8px;
  border-radius: 7.5px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.cf-pill:hover {
  color: var(--text);
  border-color: var(--border-strong);
}

.cf-pill em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  opacity: 0.78;
}

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

.cf-ok .cf-dot { background: var(--success); }
.cf-banned .cf-dot { background: var(--danger); }

.cf-pill.active {
  background: var(--surface-elevated);
  border-color: var(--msg-active-border);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
}

.cf-pill.cf-ok.active {
  background: var(--success-soft);
  border-color: rgba(16, 185, 129, 0.36);
  color: var(--success);
}

.cf-pill.cf-banned.active {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.36);
  color: var(--danger);
}

.claude-ban-mini {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(239, 68, 68, 0.28);
  padding: 1px 6px;
  border-radius: 5px;
  flex-shrink: 0;
  line-height: 1.4;
}

.claude-status-pill {
  border: 1px solid transparent;
  font-size: 11px;
  font-weight: 600;
  padding: 2.5px 8.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
  cursor: default;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.claude-status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.claude-status-pill.is-ok {
  background: var(--success-soft);
  border-color: rgba(16, 185, 129, 0.28);
  color: var(--success);
}
.claude-status-pill.is-ok::before {
  background: var(--success);
}

.claude-status-pill.is-banned {
  background: var(--danger-soft);
  border-color: rgba(239, 68, 68, 0.34);
  color: var(--danger);
  cursor: pointer;
}
.claude-status-pill.is-banned::before {
  background: var(--danger);
}
.claude-status-pill.is-banned:hover {
  filter: brightness(0.95);
}

/* 顶部账号栏：Claude 订阅套餐徽章（仅 Pro / Max / Ultra 显示） */
.claude-plan-pill {
  border: 1px solid var(--border);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.15px;
  padding: 2.5px 8.5px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  cursor: default;
  white-space: nowrap;
  transition: all 0.14s ease;
}

.claude-plan-pill.is-clickable {
  cursor: pointer;
}

.claude-plan-pill.is-clickable:hover {
  filter: brightness(0.94);
}

.claude-plan-pill.is-pro {
  background: rgba(37, 99, 235, 0.11);
  border-color: rgba(37, 99, 235, 0.3);
  color: #1d4ed8;
}

.claude-plan-pill.is-max {
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.34);
  color: #6d28d9;
}

.claude-plan-pill.is-ultra {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.18), rgba(217, 119, 6, 0.12));
  border-color: rgba(217, 119, 6, 0.4);
  color: #b45309;
}

[data-theme="dark"] .claude-plan-pill.is-pro {
  background: rgba(96, 165, 250, 0.18);
  border-color: rgba(96, 165, 250, 0.38);
  color: #93c5fd;
}

[data-theme="dark"] .claude-plan-pill.is-max {
  background: rgba(167, 139, 250, 0.18);
  border-color: rgba(167, 139, 250, 0.4);
  color: #c4b5fd;
}

[data-theme="dark"] .claude-plan-pill.is-ultra {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(245, 158, 11, 0.12));
  border-color: rgba(251, 191, 36, 0.42);
  color: #fcd34d;
}

/* ==========================================================================
   响应式适配（平板 / 小屏笔记本 / 手机端）
   ========================================================================== */

@media (max-width: 1180px) {
  .provider-rail { width: 132px; }
  .sidebar { width: 236px; min-width: 204px; }
  .mail-card { grid-template-columns: 244px minmax(0, 1fr); }
  .remark-input { width: 150px; }
  .account-bar { flex-wrap: wrap; gap: 8px 10px; }
  .otp-bar { flex-wrap: wrap; gap: 8px 10px; }
}

@media (max-width: 860px) {
  html, body {
    height: 100%;
    height: 100dvh;
  }

  .topbar {
    height: 50px;
    padding: 0 12px;
  }

  .brand-tag,
  .admin-user-pill {
    display: none !important;
  }

  .topbar-actions {
    gap: 6px;
  }

  .topbar-actions .btn {
    padding: 5.5px 10px;
    font-size: 12.5px;
  }

  .topbar-actions .btn-icon {
    width: 32px;
    height: 32px;
    padding: 0;
  }

  .workspace {
    flex-direction: column;
    overflow: hidden;
  }

  /* 手机端渠道切换栏：转为顶部横向滚动胶囊条 */
  .provider-rail {
    width: 100%;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 8px 10px;
    gap: 6px;
    border-right: none;
    border-bottom: 1px solid var(--border);
    scrollbar-width: none;
  }
  .provider-rail::-webkit-scrollbar {
    display: none;
  }
  .rail-section-label {
    display: none;
  }
  .rail-tab {
    flex-shrink: 0;
    padding: 6px 10px;
    gap: 7px;
    border-radius: 999px;
    background: var(--surface);
    border-color: var(--border);
  }
  .rail-tab.active {
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(37, 99, 235, 0.14);
  }

  /* 手机端列表视图：全宽显示邮箱列表，隐藏右侧详情 */
  .sidebar {
    width: 100%;
    min-width: 0;
    flex: 1;
    border-right: none;
  }

  body:not(.mobile-detail-open) .content-pane {
    display: none;
  }

  /* 手机端详情视图：隐藏渠道栏与邮箱列表，全屏显示收信与阅读 */
  body.mobile-detail-open .provider-rail,
  body.mobile-detail-open .sidebar {
    display: none;
  }

  body.mobile-detail-open .content-pane {
    display: flex;
    width: 100%;
    flex: 1;
    min-height: 0;
    padding: 10px 12px 18px;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
  }

  .detail-container {
    flex: none;
    overflow: visible;
    gap: 10px;
  }

  .account-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .account-left {
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .cur-email {
    font-size: 15px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .remark-input {
    width: 100%;
    flex-basis: 100%;
    background: var(--surface);
    border-color: var(--border);
    padding: 6px 10px;
  }

  .account-right {
    width: 100%;
    display: flex;
    gap: 7px;
  }

  .account-right #btnFetchNow,
  .account-right #btnAutoPoll {
    flex: 1;
  }

  .otp-bar {
    flex-wrap: wrap;
    padding: 10px 12px;
    gap: 8px;
  }

  .otp-bar-main {
    flex: 1 1 100%;
    white-space: normal;
    line-height: 1.45;
    font-size: 12.5px;
  }

  .otp-bar-link {
    flex-wrap: wrap;
  }

  .mail-card {
    flex: none;
    display: flex;
    flex-direction: column;
    overflow: visible;
    border-radius: 12px;
  }

  .mail-list-col {
    border-right: none;
    border-bottom: 1px solid var(--border);
    max-height: 270px;
  }

  .list-header {
    height: 44px;
    padding: 0 11px;
  }

  .mail-reader-col {
    min-height: 420px;
  }

  .reader-header {
    flex-wrap: wrap;
    padding: 11px 12px;
    gap: 8px 10px;
  }

  .reader-title-wrap {
    flex: 1 1 calc(100% - 48px);
  }

  .reader-subject {
    white-space: normal;
    line-height: 1.38;
  }

  .reader-submeta {
    flex-wrap: wrap;
    white-space: normal;
  }

  .reader-actions {
    width: 100%;
    justify-content: space-between;
  }

  .reader-body {
    padding: 14px 14px;
    overflow-y: visible;
  }

  .reader-body.html-mode {
    padding: 8px;
    min-height: 420px;
  }

  .html-paper-frame {
    min-height: 400px;
  }

  .sandbox-iframe {
    min-height: 400px;
  }

  /* 弹窗与登录页在手机端居中适配 */
  .modal-backdrop {
    padding: 12px;
    align-items: center;
  }

  .modal {
    max-height: 90dvh;
    overflow-y: auto;
  }

  .details-grid {
    grid-template-columns: 1fr;
  }

  .auth-card {
    padding: 26px 20px 22px;
    border-radius: 16px;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 14px;
    align-items: stretch;
  }

  .toast {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .topbar-actions #btnOpenSettings span {
    display: none;
  }
  .topbar-actions #btnOpenSettings {
    width: 32px;
    height: 32px;
    padding: 0;
  }
}
.toast.error .toast-dot { background: #f87171; }
.toast.is-leaving {
  opacity: 0;
  transform: translateY(6px);
}
