:root {
  color-scheme: dark;
  --bg-canvas: #09090b;
  --bg-rail: #09090b;
  --bg-stream: #0c0c0f;
  --bg-workspace: #09090b;
  --bg-card: #121216;
  --bg-card-hover: #18181e;
  --bg-card-active: #202028;
  --bg-elevated: #18181e;
  --border-subtle: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text-main: #f4f4f5;
  --text-muted: #a1a1aa;
  --text-dim: #71717a;
  --primary: #f4f4f5;
  --primary-hover: #e4e4e7;
  --on-primary: #09090b;
  --accent-soft: rgba(255, 255, 255, 0.05);
  --accent-line: rgba(255, 255, 255, 0.16);

  /* 低饱和矿物语义色阶 */
  --tone-danger: #e57373;
  --tone-danger-bg: rgba(229, 115, 115, 0.10);
  --tone-danger-border: rgba(229, 115, 115, 0.28);
  --tone-spam: #d4a373;
  --tone-spam-bg: rgba(212, 163, 115, 0.11);
  --tone-spam-border: rgba(212, 163, 115, 0.28);
  --tone-promo: #b8c4e0;
  --tone-promo-bg: rgba(148, 163, 218, 0.12);
  --tone-promo-border: rgba(148, 163, 218, 0.32);
  --tone-ok: #8ab89d;
  --tone-ok-bg: rgba(138, 184, 157, 0.10);
  --tone-ok-border: rgba(138, 184, 157, 0.28);
  --tone-gray: #a1a1aa;
  --tone-gray-bg: rgba(161, 161, 170, 0.11);
  --tone-gray-border: rgba(161, 161, 170, 0.24);

  --phish: var(--tone-danger);
  --malware: var(--tone-danger);
  --spam: var(--tone-spam);
  --legit: var(--tone-ok);
  --gray: var(--tone-gray);
  --star: #f59e0b;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Noto Sans SC", sans-serif;
  --font-mono: "Cascadia Mono", "Fira Code", "Sarasa Mono SC", ui-monospace, monospace;
}

[data-theme="light"] {
  color-scheme: light;
  --bg-canvas: #f6f8fc;
  --bg-rail: #eef2f8;
  --bg-stream: #ffffff;
  --bg-workspace: #ffffff;
  --bg-card: #f8fafd;
  --bg-card-hover: #f0f4fa;
  --bg-card-active: #e4ecf7;
  --bg-elevated: #ffffff;
  --border-subtle: rgba(15, 23, 42, 0.08);
  --border-strong: rgba(15, 23, 42, 0.17);
  --text-main: #111827;
  --text-muted: #4b5563;
  --text-dim: #6b7280;
  --primary: #0b57d0;
  --primary-hover: #0842a0;
  --on-primary: #ffffff;
  --accent-soft: rgba(11, 87, 208, 0.07);
  --accent-line: rgba(11, 87, 208, 0.24);

  --tone-danger: #b42318;
  --tone-danger-bg: rgba(180, 35, 24, 0.07);
  --tone-danger-border: rgba(180, 35, 24, 0.24);
  --tone-spam: #9a5b13;
  --tone-spam-bg: rgba(154, 91, 19, 0.08);
  --tone-spam-border: rgba(154, 91, 19, 0.24);
  --tone-promo: #0b57d0;
  --tone-promo-bg: rgba(11, 87, 208, 0.08);
  --tone-promo-border: rgba(11, 87, 208, 0.28);
  --tone-ok: #286847;
  --tone-ok-bg: rgba(40, 104, 71, 0.07);
  --tone-ok-border: rgba(40, 104, 71, 0.24);
  --tone-gray: #52525b;
  --tone-gray-bg: rgba(82, 82, 91, 0.08);
  --tone-gray-border: rgba(82, 82, 91, 0.22);
  --star: #d97706;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  scrollbar-width: thin;
  scrollbar-color: #3f3f46 #121216;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: #121216;
}

::-webkit-scrollbar-thumb {
  background: #3f3f46;
  border-radius: 5px;
  border: 2px solid #121216;
}

::-webkit-scrollbar-thumb:hover {
  background: #52525b;
}

::-webkit-scrollbar-corner {
  background: #121216;
}

::-webkit-resizer {
  background: transparent;
}

[data-theme="light"] * {
  scrollbar-color: #cbd5e1 #f8fafd;
}

[data-theme="light"] ::-webkit-scrollbar-track {
  background: #f8fafd;
}

[data-theme="light"] ::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-color: #f8fafd;
}

[data-theme="light"] ::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

[data-theme="light"] ::-webkit-scrollbar-corner {
  background: #f8fafd;
}

[hidden] {
  display: none !important;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-canvas);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

/* 登录视图 */
.login-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  background: var(--bg-canvas);
  padding: 36px 28px;
}

.login-panel {
  width: 100%;
  max-width: 400px;
}

.login-title {
  font-size: 34px;
  font-weight: 550;
  letter-spacing: -0.03em;
  margin-bottom: 36px;
}

.login-panel .form-group {
  margin-bottom: 24px;
}

.login-panel .form-group label {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

.login-panel input {
  border: none;
  border-bottom: 1px solid var(--border-strong);
  border-radius: 0;
  background: transparent;
  padding: 11px 0 13px;
}

.login-panel input:focus {
  border-bottom-color: var(--primary);
}

.login-panel .btn-primary {
  border-radius: 8px;
  margin-top: 12px;
  padding: 13px;
  letter-spacing: 0.03em;
}

.login-panel .error-text {
  text-align: left;
}

.login-forgot {
  margin-top: 16px;
  padding: 0;
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
}

.login-forgot:hover {
  color: var(--text-main);
}

.reset-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.reset-card h2,
.reset-card h3,
.shortcut-card h2 {
  margin: 0;
  font-weight: 600;
}

.reset-card h2,
.shortcut-card h2 {
  font-size: 20px;
}

.reset-card h3 {
  font-size: 18px;
}

.reset-close {
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.reset-close:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.reset-step {
  display: grid;
  gap: 16px;
}

.reset-note {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
}

.reset-digits {
  display: flex;
  gap: 8px;
}

.reset-digits input {
  width: 44px;
  height: 52px;
  padding: 0;
  text-align: center;
  font-size: 22px;
  font-family: var(--font-mono);
  border-radius: 10px;
}

.reset-card .btn-primary {
  width: auto;
  min-width: 96px;
  justify-self: start;
  padding: 10px 22px;
  border-radius: 8px;
}

.reset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 18px;
  align-items: center;
}

.reset-actions button {
  padding: 0;
  border: none;
  background: none;
  color: var(--text-main);
  font-size: 14px;
  cursor: pointer;
}

.reset-actions button:disabled {
  color: var(--text-dim);
  cursor: default;
}

.reset-fields {
  display: grid;
  gap: 12px;
}

.reset-card .error-text {
  margin-top: 0;
  text-align: left;
}

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.ico {
  width: 20px;
  height: 20px;
  display: block;
  flex: none;
}

.form-group {
  display: grid;
  gap: 7px;
  margin-bottom: 18px;
}

.form-group label {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}

input, select, textarea {
  width: 100%;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-workspace);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
}

.btn-primary {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: var(--on-primary);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

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

.error-text {
  font-size: 14px;
  color: var(--tone-danger);
  min-height: 1.2em;
  margin-top: 12px;
  text-align: center;
}

/* 三列主壳 */
.app-shell {
  display: grid;
  grid-template-columns: 84px 384px 1fr;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

.app-shell.is-booting {
  visibility: hidden;
}

/* 第一列：功能轨 */
.rail {
  background: var(--bg-rail);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 18px 0;
  user-select: none;
}

.rail-top, .rail-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.rail-btn-compose {
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.rail-btn-compose .icon,
.rail-btn-compose .label {
  color: var(--text-main);
}

.rail-btn-compose:hover {
  background: var(--bg-card-active);
  border-color: var(--border-strong);
}

.rail-btn {
  width: 68px;
  height: 62px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  position: relative;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.rail-btn .icon {
  display: flex;
  color: var(--text-muted);
}

.rail-btn:hover {
  background: var(--bg-card-hover);
}

.rail-btn:hover .icon,
.rail-btn:hover .label {
  color: var(--text-main);
}

.rail-btn.active {
  background: var(--bg-card-active);
  border-color: var(--border-subtle);
}

.rail-btn.active .icon {
  color: var(--primary);
}

.rail-btn .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-dim);
  white-space: nowrap;
}

.rail-btn.active .label {
  color: var(--primary);
  font-weight: 600;
}

.rail-btn-sm {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: transparent;
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  color: var(--text-muted);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.rail-btn-sm:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.rail-btn-sm.active {
  background: var(--bg-card-active);
  border-color: var(--border-strong);
  color: var(--primary);
}

.rail-btn-sm .badge,
.rail-avatar-btn .badge {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  min-width: 18px;
  padding: 1px 5px;
  border-radius: 999px;
  background: var(--tone-danger);
  color: #ffffff;
  text-align: center;
  pointer-events: none;
}

.rail-divider {
  width: 28px;
  height: 1px;
  background: var(--border-subtle);
  margin: 2px 0;
}

.rail-avatar-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--accent-soft);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.12s ease, border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.rail-avatar-btn[data-role="owner"] {
  border-color: var(--tone-promo-border);
  background: var(--tone-promo-bg);
  color: var(--tone-promo);
}

.rail-avatar-btn:hover {
  transform: scale(1.04);
  border-color: var(--primary);
}

.rail-avatar-btn.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.rail-avatar-btn.has-alert {
  border-color: var(--tone-danger-border);
  box-shadow: 0 0 0 2px var(--tone-danger-bg);
}

/* 第二列：列表流 */
.stream {
  background: var(--bg-stream);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.stream-header {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.stream-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 32px;
}

.stream-title-row h2 {
  font-size: 18px;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.2;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.version-foot {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-dim);
}

.stream-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
}

.stream-actions .pill,
.stream-actions .btn-sm {
  height: 30px;
  padding: 0 9px;
  font-size: 12.5px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  flex: none;
}

.stream-subfilters {
  display: flex;
  gap: 8px;
}

.stream-mini-select {
  flex: 1;
  min-width: 0;
  height: 36px;
  padding: 0 10px;
  font-size: 13.5px;
  border-radius: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  cursor: pointer;
}

.stream-mini-select:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.stream-filter-bar {
  display: flex;
  align-items: center;
  width: 100%;
}

.stream-filter-select {
  width: 100%;
  height: 36px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
}

.stream-filter-select:hover {
  border-color: var(--border-strong);
}

.stream-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.45;
}

.btn-icon {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.search-box input {
  height: 38px;
  padding: 0 12px;
  font-size: 14px;
  border-radius: 8px;
  background: var(--bg-card);
  border-color: var(--border-subtle);
}

.search-box input:hover {
  border-color: var(--border-strong);
}

.pills-scroll {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.pills-scroll::-webkit-scrollbar {
  display: none;
}

.pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.pill:hover {
  border-color: var(--text-muted);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.pill.active {
  background: var(--text-main);
  color: var(--bg-canvas);
  border-color: var(--text-main);
  font-weight: 600;
}

.pill-subtle {
  border-color: var(--border-strong);
  background: transparent;
}

/* 推广胶囊：常驻清晰边框，激活态采用低饱和雾霾蓝靛，去除艳紫 */
.pill-promo {
  position: relative;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
}

.pill-corner-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--tone-promo);
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-variant-numeric: tabular-nums;
  border: 1px solid var(--tone-promo-border);
  pointer-events: none;
}

.pill-promo:hover {
  border-color: var(--tone-promo-border);
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.pill-promo.active {
  background: var(--tone-promo-bg);
  color: var(--tone-promo);
  border-color: var(--tone-promo-border);
  font-weight: 600;
}

.pill-star.active {
  background: rgba(245, 158, 11, 0.12);
  color: var(--star);
  border-color: rgba(245, 158, 11, 0.35);
  font-weight: 600;
}

.stream-notice {
  padding: 8px 16px;
  font-size: 13px;
  color: var(--text-dim);
}

.stream-notice:empty {
  display: none;
}

.item-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* 列表卡片 */
.mail-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  border-left: 3px solid transparent;
  cursor: pointer;
  transition: background-color 0.12s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

button.mail-item {
  width: 100%;
  border-top: none;
  border-right: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
}

.mail-item:hover {
  background: var(--bg-card-hover);
}

.mail-item.unread {
  background: rgba(255, 255, 255, 0.025);
}

[data-theme="light"] .mail-item.unread {
  background: rgba(11, 87, 208, 0.035);
}

.mail-item.unread .item-from {
  font-weight: 650;
}

.mail-item.unread .item-subject {
  color: var(--text-main);
  font-weight: 550;
}

.mail-item.selected,
.mail-item.unread.selected {
  background: var(--bg-card-active);
  border-left-color: var(--primary);
}

.item-line1 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.item-from-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  flex: 1;
}

.unread-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
  flex: none;
}

.item-from {
  font-size: 14px;
  font-weight: 550;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-time {
  font-size: 12px;
  color: var(--text-dim);
  flex: none;
  font-variant-numeric: tabular-nums;
}

.item-star-btn {
  border: none;
  background: transparent;
  color: var(--text-dim);
  padding: 2px;
  border-radius: 5px;
  cursor: pointer;
  display: inline-flex;
  opacity: 0.55;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.item-star-btn .ico {
  width: 14px;
  height: 14px;
}

.mail-item:hover .item-star-btn,
.item-star-btn.is-starred {
  opacity: 1;
}

.item-star-btn.is-starred {
  color: var(--star);
}

.item-line2 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  min-height: 22px;
}

.item-subject {
  font-size: 14px;
  font-weight: 450;
  line-height: 22px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

.item-badges {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: none;
}

.item-line3 {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.item-snippet {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  min-width: 0;
}

/* 验证码一键复制胶囊 */
.otp-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-main);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  flex: none;
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.otp-pill:hover {
  border-color: var(--primary);
  background: var(--accent-soft);
}

/* 低饱和分类标签与下拉框（无错位） */
.verdict-tag {
  font-size: 11.5px;
  font-weight: 550;
  height: 22px;
  padding: 0 7px;
  line-height: 1;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  display: inline-flex;
  align-items: center;
  flex: none;
}

.sent-status-tag {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-subtle);
}

.sent-status-tag[data-status="sent"] {
  background: var(--tone-ok-bg);
  color: var(--tone-ok);
  border-color: var(--tone-ok-border);
}

.sent-status-tag[data-status="error"] {
  background: var(--tone-danger-bg);
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
}

.verdict-tag[data-label="phish"],
.verdict-tag[data-label="malware"] {
  background: var(--tone-danger-bg);
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
}

.verdict-tag[data-label="spam"] {
  background: var(--tone-spam-bg);
  color: var(--tone-spam);
  border-color: var(--tone-spam-border);
}

.verdict-tag[data-label="unsolicited-admin"] {
  background: var(--tone-promo-bg);
  color: var(--tone-promo);
  border-color: var(--tone-promo-border);
}

.verdict-tag[data-label="legit"] {
  background: var(--bg-card);
  color: var(--text-muted);
  border-color: var(--border-strong);
}

.verdict-tag[data-label="gray"],
.verdict-tag[data-label="none"] {
  background: var(--tone-gray-bg);
  color: var(--tone-gray);
  border-color: var(--tone-gray-border);
}

.meta-item-verdict {
  display: flex;
  align-items: center;
  gap: 7px;
}

.verdict-control-group {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.verdict-select {
  width: auto;
  font-size: 13px;
  font-weight: 550;
  padding: 4px 10px;
  line-height: 1.35;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
  background: var(--bg-card);
  color: var(--text-main);
  transition: border-color 0.14s ease, background-color 0.14s ease;
}

.verdict-select:hover {
  border-color: var(--text-muted);
}

.verdict-select[data-label="phish"],
.verdict-select[data-label="malware"] {
  background: var(--tone-danger-bg);
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
}

.verdict-select[data-label="spam"] {
  background: var(--tone-spam-bg);
  color: var(--tone-spam);
  border-color: var(--tone-spam-border);
}

.verdict-select[data-label="unsolicited-admin"] {
  background: var(--tone-promo-bg);
  color: var(--tone-promo);
  border-color: var(--tone-promo-border);
}

.verdict-select[data-label="legit"] {
  background: var(--bg-card);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.verdict-select[data-label="gray"],
.verdict-select[data-label="none"] {
  background: var(--tone-gray-bg);
  color: var(--tone-gray);
  border-color: var(--tone-gray-border);
}

.verdict-select option {
  background: var(--bg-card);
  color: var(--text-main);
}

.model-verdict-hint {
  font-size: 12px;
  color: var(--text-dim);
  font-family: var(--font-mono);
}

/* 第三列：工作舞台 */
.workspace {
  background: var(--bg-workspace);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.workspace-view {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-dim);
  gap: 12px;
  text-align: center;
  padding: 40px;
}

.empty-icon .ico {
  width: 38px;
  height: 38px;
}

.empty-state h3 {
  font-size: 19px;
  font-weight: 600;
  color: var(--text-main);
}

.empty-state p {
  font-size: 14px;
  max-width: 440px;
}

/* 邮件详情阅读器 */
.detail-card {
  padding: 26px 34px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  min-height: 100%;
}

.detail-header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 18px;
}

.detail-title-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.detail-title-line h1 {
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.02em;
  word-break: break-word;
  flex: 1;
  min-width: 200px;
}

.star-btn-lg {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  color: var(--text-dim);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  margin-top: 1px;
}

.star-btn-lg:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.star-btn-lg.is-starred {
  color: var(--star);
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.08);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 8px 18px;
  font-size: 14px;
}

.meta-item {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.meta-label {
  color: var(--text-dim);
  flex: none;
}

.meta-val {
  color: var(--text-main);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 来回会话链 */
.thread-box {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.thread-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-dim);
}

.thread-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  overflow: hidden;
}

.thread-row {
  display: grid;
  grid-template-columns: minmax(0, 170px) minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: baseline;
  width: 100%;
  padding: 8px 12px;
  border: none;
  border-bottom: 1px solid var(--border-subtle);
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

button.thread-row {
  cursor: pointer;
}

button.thread-row:hover {
  background: var(--bg-card-hover);
}

.thread-row:last-child {
  border-bottom: none;
}

.thread-row.current {
  background: var(--bg-card);
}

.thread-who,
.thread-subject {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.thread-who {
  font-weight: 600;
}

.thread-subject {
  color: var(--text-muted);
}

.thread-time,
.thread-mark {
  font-size: 12px;
  color: var(--text-dim);
}

/* 通用次级按钮与静默危险按钮 */
.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 550;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  cursor: pointer;
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  transition: background-color 0.14s ease, color 0.14s ease, border-color 0.14s ease;
}

.btn-sm:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-sm:disabled {
  opacity: 0.45;
  cursor: default;
}

/* 加入黑名单 / 移入垃圾桶：常驻静默中性色，仅在悬停时呈现克制的暗玫红 */
.btn-danger-ghost {
  color: var(--text-muted);
  border-color: var(--border-subtle);
  background: var(--bg-card);
}

.btn-danger-ghost:hover {
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
  background: var(--tone-danger-bg);
}

.btn-danger {
  background: var(--tone-danger-bg);
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
}

.btn-danger:hover {
  background: var(--tone-danger);
  color: #ffffff;
  border-color: var(--tone-danger);
}

/* Tab 栏 */
.tab-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 2px;
  flex-wrap: wrap;
  gap: 10px;
}

.tab-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.tab-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  flex-wrap: wrap;
}

.tab-btn {
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 550;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  cursor: pointer;
}

.tab-btn:hover {
  color: var(--text-main);
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-panel {
  display: none;
  flex-direction: column;
  gap: 18px;
}

.tab-panel.active {
  display: flex;
}

/* 摘要卡片 */
.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 13px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.summary-text {
  font-size: 15px;
  color: var(--text-main);
  line-height: 1.6;
}

/* 安全沙箱自适应容器 */
.inlined-preview-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.section-subhead {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.subhead-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
}

.preview-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-guard {
  margin: 0;
  font-size: 13px;
  color: var(--text-dim);
  white-space: nowrap;
}

.btn-sec-action {
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 550;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-muted);
  cursor: pointer;
}

.btn-sec-action:hover {
  color: var(--text-main);
  background: var(--bg-card-hover);
}

.inlined-sandbox-wrap {
  width: 100%;
  height: 520px;
  min-height: 200px;
  max-height: 960px;
  resize: vertical;
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  overflow: hidden;
  background: var(--bg-card);
  transition: height 0.18s ease;
}

.inlined-sandbox-wrap.is-compact {
  height: 240px;
}

.inlined-sandbox-wrap.is-expanded {
  height: 820px;
}

.inlined-sandbox-wrap iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: transparent;
  display: block;
}

/* 外链、附件 */
.ai-section h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-muted);
}

.urls-grid, .attachments-grid {
  display: grid;
  gap: 8px;
}

.url-item {
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  word-break: break-all;
}

.url-item a {
  color: var(--primary);
  text-decoration: none;
}

.url-item a:hover {
  text-decoration: underline;
}

.attachment-item {
  padding: 8px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.collapsible-section {
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-card);
  overflow: hidden;
}

.collapsible-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  font-weight: 550;
  color: var(--text-main);
}

.collapsible-summary:hover {
  background: var(--bg-card-hover);
}

.collapsible-summary::marker,
.collapsible-summary::-webkit-details-marker {
  display: none;
}

.collapsible-summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  font-size: 12px;
  transition: transform 0.18s ease;
  color: var(--text-dim);
}

details[open] > .collapsible-summary::before {
  transform: rotate(90deg);
}

.collapsible-section .urls-grid {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
}

.code-block {
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.55;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-main);
  max-height: 700px;
  overflow-y: auto;
}

/* 身份检查（SPF/DKIM/DMARC）：沉稳克制，去除刺眼绿底 */
.auth-chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.auth-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  border-radius: 7px;
  font-size: 13px;
  font-family: var(--font-mono);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
}

.auth-chip::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-dim);
}

.auth-chip.pass {
  color: var(--text-main);
  border-color: var(--border-strong);
  background: var(--bg-card);
}

.auth-chip.pass::before {
  background: var(--tone-ok);
}

.auth-chip.fail {
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
  background: var(--tone-danger-bg);
}

.auth-chip.fail::before {
  background: var(--tone-danger);
}

/* 页面滚动与设置块 */
.page-scroll {
  padding: 28px 36px 76px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 940px;
}

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

.field-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.name-grid,
.name-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.name-row {
  display: grid;
  grid-template-columns: minmax(110px, 190px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.name-row.with-action {
  grid-template-columns: minmax(0, 1.3fr) minmax(110px, 0.8fr) auto;
}

.name-row.order-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.name-key {
  font-size: 13.5px;
  color: var(--text-dim);
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.block {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: var(--bg-card);
}

.block-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.block-head h2 {
  font-size: 17px;
  font-weight: 650;
}

.page-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.btn-fit {
  width: auto;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--primary);
  color: var(--on-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

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

.btn-fit:disabled {
  opacity: 0.4;
  cursor: default;
}

.btn-fit.ghost {
  background: transparent;
  color: var(--text-main);
  border-color: var(--border-strong);
}

.btn-fit.ghost:hover {
  background: var(--bg-card-hover);
}

.model-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
}

.thinking-pair {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.thinking-pair select,
.field-select-fit {
  width: auto;
  min-width: 120px;
  flex: none;
}

.inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.inline-row input {
  flex: 1 1 150px;
  width: auto;
  min-width: 0;
}

.inline-row input.field-narrow,
input.field-narrow {
  flex: none;
  width: 108px;
}

#dkim-alg {
  flex: none;
  width: auto;
  min-width: 128px;
}

.chk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 16px;
}

.chk {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  width: auto;
  font-size: 14px;
  cursor: pointer;
}

.chk input {
  flex: none;
  width: 16px;
  height: 16px;
  margin: 0;
  padding: 0;
}

.code-editor {
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.55;
  background: var(--bg-workspace);
  resize: vertical;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-workspace);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  overflow: hidden;
  font-size: 14px;
}

.data-table th, .data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-subtle);
  text-align: left;
}

.data-table th {
  background: var(--bg-card-hover);
  color: var(--text-muted);
  font-weight: 600;
}

.audit-table-wrap {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.compact-table th,
.compact-table td {
  padding: 8px 12px;
  font-size: 12.5px;
}

.mono-cell {
  font-family: var(--font-mono);
}

.domain-list,
.domain-cards,
.user-detail-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.domain-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.domain-row input {
  flex: 1;
  width: auto;
}

.domain-card {
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-workspace);
}

.domain-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dkim-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dkim-summary {
  cursor: pointer;
  user-select: none;
  font-size: 12.5px;
  color: var(--text-muted);
  width: fit-content;
}

.dkim-summary:hover {
  color: var(--text-primary);
}

.dkim-txt {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.45;
  word-break: break-all;
  white-space: pre-wrap;
  user-select: all;
  background: var(--bg-card-hover);
  padding: 8px 10px;
  border-radius: 7px;
  border: 1px solid var(--border-subtle);
}

/* 写信扩展样式 */
.send-form {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.from-field-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.from-field-wrap input {
  flex: 1;
  min-width: 0;
}

.compose-att-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}

.compose-att-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  font-size: 12px;
  color: var(--text-muted);
}

.compose-att-chip > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-att-remove {
  flex: none;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
}

.compose-att-remove:hover { color: var(--tone-danger); }

.from-status-chip {
  font-size: 12px;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-workspace);
  color: var(--text-muted);
  white-space: nowrap;
  flex: none;
}

.from-status-chip.signed {
  color: var(--tone-ok);
  border-color: var(--tone-ok-border);
  background: var(--tone-ok-bg);
}

/* 悬浮可折叠写信抽屉 */
.compose-sheet {
  position: fixed;
  right: 22px;
  bottom: 0;
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  z-index: 35;
  display: flex;
  flex-direction: column;
  background: var(--bg-elevated);
  border: 1px solid var(--border-strong);
  border-bottom: none;
  border-radius: 12px 12px 0 0;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
  overflow: hidden;
}

.compose-sheet.is-dragging {
  border-color: var(--accent-line);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42), 0 0 0 2px var(--accent-soft);
}

.compose-sheet.is-minimized {
  width: 300px;
}

.compose-sheet.is-minimized .compose-body {
  display: none;
}

.compose-sheet.is-expanded {
  right: 50%;
  bottom: 50%;
  transform: translate(50%, 50%);
  width: min(840px, calc(100vw - 48px));
  height: min(720px, calc(100vh - 64px));
  border-bottom: 1px solid var(--border-strong);
  border-radius: 14px;
}

.compose-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg-card-active);
  border-bottom: 1px solid var(--border-subtle);
  cursor: pointer;
  user-select: none;
}

.compose-title {
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compose-window-btns {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: none;
}

.compose-win-btn {
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.compose-win-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-main);
}

.compose-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 10px 16px 14px;
  gap: 6px;
}

.compose-quota {
  margin: 0;
  font-size: 11.5px;
}

.compose-field {
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--border-subtle);
  padding: 4px 0;
}

.compose-label {
  font-size: 12.5px;
  color: var(--text-dim);
  width: 36px;
  flex: none;
}

.compose-from-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.compose-identity-select {
  width: auto;
  max-width: 190px;
  padding: 4px 8px;
  font-size: 12.5px;
  border-radius: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}

.compose-field input {
  border: none;
  background: transparent;
  padding: 5px 2px;
  font-size: 13.5px;
  border-radius: 0;
  flex: 1;
  min-width: 0;
  color: var(--text-main);
}

.compose-field input:focus {
  border-color: transparent;
}

.btn-inline-link {
  padding: 2px 6px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.btn-inline-link:hover {
  color: var(--text-main);
}

.compose-textarea {
  flex: 1;
  min-height: 190px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 10px 2px;
  font-size: 14px;
  line-height: 1.6;
  resize: vertical;
  color: var(--text-main);
}

.compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.compose-foot-left,
.compose-foot-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.draft-status {
  font-size: 12px;
  color: var(--text-dim);
}

.send-note {
  margin: 0;
  color: var(--tone-spam);
  font-size: 13px;
}

.reply-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 8px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  font-size: 13px;
}

.reply-banner-text {
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 密钥测试状态反馈 & 多通道卡片 */
.channel-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-workspace);
}

.channel-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.channel-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.channel-provider-select {
  width: auto;
  min-width: 140px;
  padding: 5px 10px;
  font-size: 13px;
}

.channel-field {
  margin: 0;
}

.channel-keys-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 2px;
}

.probe-badge {
  font-size: 12px;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  white-space: nowrap;
}

.probe-badge.ok {
  color: var(--tone-ok);
  border-color: var(--tone-ok-border);
  background: var(--tone-ok-bg);
}

.probe-badge.err {
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
  background: var(--tone-danger-bg);
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 成员与邮箱管理 */
.credential-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.role-pill {
  font-size: 11.5px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text-muted);
  background: var(--bg-card);
}

.role-pill.is-admin {
  color: var(--tone-promo);
  border-color: var(--tone-promo-border);
  background: var(--tone-promo-bg);
}

.role-pill.is-disabled {
  color: var(--tone-danger);
  border-color: var(--tone-danger-border);
  background: var(--tone-danger-bg);
}

.alloc-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  background: var(--bg-workspace);
}

.alloc-addr {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.users-cards-host {
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
}

.form-error {
  color: var(--tone-danger);
  margin: 8px 0 0;
}

/* 概况统计与趋势 */
.stats-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-workspace);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  font-family: var(--font-mono);
}

.stat-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.stat-phish .stat-num,
.stat-malware .stat-num { color: var(--tone-danger); }
.stat-spam .stat-num { color: var(--tone-spam); }
.stat-legit .stat-num { color: var(--tone-ok); }
.stat-promo .stat-num { color: var(--tone-promo); }
.stat-gray .stat-num { color: var(--tone-gray); }

.trend {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 150px;
  padding-top: 8px;
}

.trend-col {
  flex: 1;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.trend-bar {
  width: 100%;
  max-width: 28px;
  background: var(--primary);
  opacity: 0.78;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
}

.trend-label {
  font-size: 11px;
  color: var(--text-dim);
  font-variant-numeric: tabular-nums;
}

.log-view {
  margin: 0;
  max-height: 440px;
  overflow: auto;
  padding: 14px;
  border-radius: 8px;
  background: var(--bg-workspace);
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 失败队列详情 */
.letter {
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: var(--bg-card);
}

.letter-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.letter-open {
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 16px;
  font-weight: 650;
  word-break: break-word;
  cursor: pointer;
  color: var(--text-main);
}

.letter-open:hover {
  text-decoration: underline;
}

.letter-subject {
  font-size: 16px;
  font-weight: 650;
  word-break: break-word;
}

.step-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
}

.step-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.step-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.step-error {
  font-size: 14px;
  word-break: break-word;
}

/* 账户与快捷中心居中弹窗（可扩展模块容器） */
.hub-card {
  width: min(540px, 100%);
  max-height: min(82vh, 680px);
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow: hidden;
}

.hub-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.hub-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--tone-promo-border);
  background: var(--tone-promo-bg);
  color: var(--tone-promo);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.hub-identity-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hub-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.hub-name-row h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-role-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  color: var(--text-muted);
}

.hub-sub {
  font-size: 13px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hub-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.hub-modules {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow-y: auto;
  min-height: 0;
  padding-right: 2px;
}

.hub-section {
  background: var(--bg-workspace);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 13px 15px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hub-section.is-alert {
  background: var(--tone-danger-bg);
  border-color: var(--tone-danger-border);
}

.hub-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.hub-section-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}

.hub-notice-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hub-notice-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.hub-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tone-ok);
  flex: none;
}

.hub-dot.is-alert {
  background: var(--tone-danger);
}

.hub-notice-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.hub-notice-desc {
  font-size: 13px;
  color: var(--text-dim);
}

.btn-alert-jump {
  border-color: var(--tone-danger-border);
  color: var(--tone-danger);
}

.btn-alert-jump:hover {
  background: var(--tone-danger);
  border-color: var(--tone-danger);
  color: #ffffff;
}

.hub-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 18px;
}

/* 快捷键网格与全局反馈 */
.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 18px;
}

.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--text-muted);
}

kbd {
  display: inline-block;
  padding: 2px 7px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-main);
  background: var(--bg-workspace);
  border: 1px solid var(--border-strong);
  border-radius: 5px;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(520px, calc(100vw - 36px));
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 14px;
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.5);
}

.modal-card {
  width: min(460px, 100%);
  display: grid;
  gap: 16px;
  padding: 22px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.mobile-back {
  display: none;
}

body,
.rail,
.stream,
.workspace,
.block,
.summary-card,
.stream-header {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

@media (max-width: 1035px) {
  .app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .rail {
    grid-column: 1;
    grid-row: 1;
    flex-direction: row;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    border-right: none;
    border-bottom: 1px solid var(--border-subtle);
    overflow-x: auto;
  }

  .rail-top,
  .rail-bottom {
    flex-direction: row;
    width: auto;
    gap: 6px;
  }

  .rail-divider {
    display: none;
  }

  .rail-btn {
    width: 54px;
    height: 46px;
  }

  .rail-btn .label {
    display: none;
  }

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

  .compose-sheet,
  .compose-sheet.is-expanded {
    right: 0;
    left: 0;
    bottom: 0;
    top: auto;
    transform: none;
    width: 100%;
    height: auto;
    max-height: 92vh;
    border-radius: 14px 14px 0 0;
  }

  .stream,
  .workspace {
    grid-column: 1;
    grid-row: 2;
    min-height: 0;
    border-right: none;
  }

  .app-shell[data-pane="list"] .workspace {
    display: none;
  }

  .app-shell[data-pane="detail"] .stream {
    display: none;
  }

  .app-shell[data-pane="detail"] .mobile-back {
    display: inline-flex;
  }

  .detail-card,
  .page-scroll {
    padding: 18px;
  }

  .name-row,
  .name-row.with-action,
  .name-row.order-row {
    grid-template-columns: 1fr;
  }

  .step-row,
  .alloc-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .inlined-sandbox-wrap {
    height: 440px;
  }
}
