/* ============================================================
   临时邮箱 · 视觉体系：复刻「投手帮」雾海珍珠 Ocean Pearl 主题
   来源：投手帮 packages/ui/src/styles/globals.css
   说明：浅色海蓝、珍珠白卡片、柔和分层阴影、12/16px 圆角。
   注意：按要求「鼠标不替换样式」，不引入自定义 cursor。
   ============================================================ */
:root {
  /* 底色与文字 */
  --bg:      #f6fbfc;   /* 珍珠白 100 */
  --panel:   #ffffff;   /* 卡片白 */
  --panel2:  #eef7f9;   /* pearl-200 次级背景 */
  --panel3:  #e4f1f4;   /* pearl-300 */
  --line:    #d5e7eb;   /* pearl-400 冰蓝边框 */
  --line2:   #bcdfe8;
  --text:    #0d2630;   /* 深海 950 标题 */
  --text2:   #1c4652;   /* 正文 */
  --muted:   #557984;   /* sea-600 */
  --muted2:  #75929a;   /* 占位符 */

  /* 品牌海蓝 */
  --brand:     #2f879d; /* brand-600 主色 */
  --brand-600: #2f879d;
  --brand-500: #3f9fb6;
  --brand-300: #91d2df;
  --brand-100: #ddf3f7;
  --brand-050: #eef8fb;
  --accent:  #2f879d;   /* 兼容旧变量名 */

  /* 语义色：正向=海蓝、警告=金、危险=珊瑚红 */
  --ok:        #2f879d;
  --ok-bg:     #eef8fb;
  --ok-border: #bcdfe8;
  --warn:      #8a5b0a;
  --warn-bg:   #f5ebd0;
  --warn-border:#e7d49a;
  --danger:    #e65f5c;
  --danger-2:  #a93532;
  --danger-bg: #fff0ef;
  --danger-border:#f7b5b2;

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

  /* 分层阴影（深海色调）*/
  --hi:      inset 0 1px 0 rgba(255,255,255,.85);
  --sh1:     0 1px 2px rgba(15,74,88,.04), 0 6px 16px -8px rgba(15,74,88,.08);
  --sh2:     0 2px 4px rgba(15,74,88,.05), 0 12px 28px -12px rgba(15,74,88,.14);
  --sh3:     0 6px 12px rgba(15,74,88,.08), 0 18px 36px -14px rgba(15,74,88,.18);
  --ease:    cubic-bezier(.2,.8,.2,1);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text2);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
/* 全站雾海背景：径向光晕 + 渐变，固定不随滚动 */
body {
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    radial-gradient(60% 50% at 0% 0%, rgba(191,230,238,.55) 0%, rgba(246,251,252,0) 60%),
    radial-gradient(48% 40% at 100% 0%, rgba(145,210,223,.32) 0%, rgba(246,251,252,0) 55%),
    radial-gradient(70% 60% at 100% 100%, rgba(216,244,250,.45) 0%, rgba(246,251,252,0) 55%),
    linear-gradient(180deg, #f6fbfc 0%, #eef7f9 100%);
  background-attachment: fixed;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.tabular-nums, .mono { font-variant-numeric: tabular-nums; }

/* 顶栏：玻璃材质 + 冰蓝底线 */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 0 24px; height: 58px;
  background: rgba(246,251,252,.78);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid rgba(191,230,238,.7);
  box-shadow: var(--hi), 0 6px 24px -14px rgba(15,74,88,.18);
  position: sticky; top: 0; z-index: 20;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 16px; color: var(--text); letter-spacing: .2px; }
.brand a { display: flex; align-items: center; gap: 9px; color: inherit; }
.brand a:hover { text-decoration: none; }
.logo-mark { flex-shrink: 0; display: block; object-fit: contain; filter: drop-shadow(0 2px 7px rgba(56,189,248,.45)); }
.brand-name { font-size: 18px; font-weight: 800; letter-spacing: -.2px; color: var(--text); }
.brand-name b { color: var(--brand); font-weight: 800; }
.brand-tag {
  font-size: 11px; font-weight: 700; color: var(--brand); background: var(--brand-050);
  border: 1px solid var(--ok-border); border-radius: 999px; padding: 1px 8px; letter-spacing: 0;
}
.mainnav { display: flex; gap: 4px; flex: 1; }
.mainnav a {
  padding: 7px 16px; border-radius: 10px; color: var(--muted);
  font-weight: 600; transition: background .16s var(--ease), color .16s var(--ease);
}
.mainnav a:hover { background: rgba(221,243,247,.6); text-decoration: none; color: var(--brand); }
.mainnav a.active {
  color: #fff;
  background-image: linear-gradient(180deg, #3f9fb6 0%, #2f879d 60%, #286f82 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), 0 6px 14px -8px rgba(28,115,135,.5);
}
.userbox { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.userbox > span { font-weight: 600; color: var(--text2); }
.logout { color: var(--muted); }
.logout:hover { color: var(--danger); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 24px; }
.wrap.full { max-width: 1440px; padding: 18px 22px; }
.foot { text-align: center; color: var(--muted); padding: 24px; font-size: 12px; }

/* 卡片/面板：珍珠表面 */
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 22px; margin-bottom: 20px;
  box-shadow: var(--hi), var(--sh1);
}
.card h2 { margin: 0 0 16px; font-size: 15px; color: var(--text); }
.grid { display: grid; gap: 16px; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }

/* 统计块 */
.stat { background: var(--panel2); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.stat .num { font-size: 28px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.stat .lbl { color: var(--muted); font-size: 12px; }
.stat .num.ok { color: var(--brand); }
.stat .num.warn { color: var(--warn); }
.stat .num.danger { color: var(--danger); }

/* 表格 */
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 700; font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
tr:hover td { background: var(--panel2); }
td.code { font-family: ui-monospace, Consolas, monospace; }

/* 徽章 */
.badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.badge.ok { background: var(--ok-bg); color: var(--brand); border-color: var(--ok-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge.danger { background: var(--danger-bg); color: var(--danger-2); border-color: var(--danger-border); }
.badge.muted { background: var(--panel3); color: var(--muted); border-color: var(--line); }

/* 验证码高亮（价格胶囊·海蓝版）*/
.vcode {
  font-family: ui-monospace, Consolas, monospace; font-size: 18px; font-weight: 700;
  color: var(--brand); letter-spacing: 2px; cursor: pointer;
  padding: 3px 12px; border-radius: 999px; background: var(--brand-050);
  border: 1px solid var(--ok-border); box-shadow: inset 0 1px 0 rgba(255,255,255,.7);
}
.vcode:hover { background: var(--brand-100); border-color: var(--brand-300); }

/* 表单：内凹珍珠 + 海蓝外环 */
label { display: block; margin: 12px 0 5px; color: var(--muted); font-size: 13px; font-weight: 600; }
input, select, textarea {
  width: 100%; padding: 10px 12px; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), inset 0 1px 2px rgba(15,74,88,.04);
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--muted2); }
input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) { border-color: var(--brand-300); }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--brand-500); background: #fafdfd;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 0 0 3px rgba(63,159,182,.18);
}

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer;
  color: #fff; border: 1px solid rgba(15,74,88,.25);
  background-image: linear-gradient(180deg, #3f9fb6 0%, #2f879d 60%, #286f82 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(15,74,88,.12),
              0 1px 2px rgba(15,74,88,.1), 0 8px 18px -10px rgba(28,115,135,.45);
  transition: transform .14s var(--ease), box-shadow .18s var(--ease), background-image .18s var(--ease);
}
.btn:hover {
  text-decoration: none; transform: translateY(-1px);
  background-image: linear-gradient(180deg, #4babbf 0%, #2f879d 55%, #245d6e 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45), 0 2px 4px rgba(15,74,88,.1), 0 14px 28px -12px rgba(28,115,135,.55);
}
.btn:active { transform: translateY(0); box-shadow: inset 0 1px 2px rgba(15,74,88,.18), 0 1px 1px rgba(15,74,88,.08); }
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.btn.sm { padding: 6px 13px; font-size: 13px; border-radius: 10px; }
/* 玻璃/次级按钮 */
.btn.ghost {
  background-image: none; background-color: rgba(255,255,255,.85); color: var(--text2);
  border: 1px solid var(--line2);
  box-shadow: var(--hi), 0 1px 2px rgba(15,74,88,.04);
}
.btn.ghost:hover { background-color: #fff; border-color: var(--brand-300); color: var(--brand); box-shadow: var(--hi), 0 4px 10px -4px rgba(15,74,88,.18); }
.btn.danger {
  background-image: linear-gradient(180deg, #ef7a77 0%, #e65f5c 60%, #d64b48 100%);
  border-color: rgba(169,53,50,.35);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.35), 0 8px 18px -10px rgba(214,75,72,.5);
}

/* Flash 提示 */
.flash {
  background: var(--brand-050); border: 1px solid var(--ok-border);
  color: var(--text2); padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px;
  box-shadow: var(--hi);
}
.flash.danger { border-color: var(--danger-border); background: var(--danger-bg); color: var(--danger-2); }

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.muted { color: var(--muted); }
.warn-text { color: var(--warn); }
.danger-text { color: var(--danger-2); }
.mono { font-family: ui-monospace, Consolas, monospace; }
.progress { height: 6px; background: var(--panel3); border-radius: 3px; overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; background: var(--brand); }
.progress > span.warn { background: var(--warn); }
.progress > span.danger { background: var(--danger); }
hr { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ============================================================
   C 端工作台：左侧邮箱列表（红角标）+ 右侧实时收件（手风琴）
   ============================================================ */
.workspace {
  display: grid; grid-template-columns: 186px 300px 1fr; gap: 16px;
  height: calc(100vh - 58px - 64px);
  min-height: 480px;
}
@media (max-width: 1080px) {
  .workspace { grid-template-columns: 168px 1fr; }
  .workspace .mail-pane { grid-column: 1 / -1; }
}
@media (max-width: 820px) {
  .workspace { grid-template-columns: 1fr; height: auto; }
  .workspace .mail-pane { grid-column: auto; }
  .org-rail { flex-direction: row; gap: 10px; }
  .org-rail .org-sec { flex: 1; min-width: 0; }
  .mb-list { max-height: 46vh; }
}

/* --- 左侧邮箱列表 --- */
.mb-list {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--hi), var(--sh1);
}
.mb-list-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--muted);
}
.mb-list-head b { color: var(--text); font-variant-numeric: tabular-nums; }
.mb-search { padding: 10px 12px; border-bottom: 1px solid var(--line); }
.mb-search input { padding: 8px 11px; font-size: 13px; border-radius: 10px; }
#mbItems { list-style: none; margin: 0; padding: 8px; overflow-y: auto; flex: 1; }
.mb-empty {
  padding: 28px 18px; text-align: center; color: var(--muted);
  font-size: 13px; line-height: 1.9;
}
/* 分页控件（上千邮箱时每页 100 条） */
.mb-pager {
  display: none; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 12px; border-top: 1px solid var(--line); background: var(--panel2);
}
.mb-pager #pgInfo { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-pager .btn.sm { padding: 5px 10px; font-size: 12px; }
.mb-pager .btn:disabled { opacity: .45; }
/* 未读总数（提示其他页也有新信） */
.unread-all { color: var(--danger-2); font-weight: 700; }

/* 回收站按钮上的数量 */
.rc-count { font-weight: 800; }
#btnRecycle { position: relative; }

/* 回收站浮层 */
.overlay {
  position: fixed; inset: 0; background: rgba(13,38,48,.45);
  display: none; align-items: center; justify-content: center; z-index: 60; padding: 24px;
  backdrop-filter: blur(2px);
}
.overlay.show { display: flex; }
.rc-modal {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  width: 100%; max-width: 560px; max-height: 80vh; display: flex; flex-direction: column;
  box-shadow: var(--hi), var(--sh3);
}
.rc-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.rc-title { font-size: 17px; font-weight: 800; color: var(--text); }
.rc-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.rc-empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.rc-item {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 10px; margin-bottom: 4px; border: 1px solid transparent;
}
.rc-item:hover { background: var(--panel2); border-color: var(--line); }
.rc-info { min-width: 0; }
.rc-addr { font-size: 14px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.rc-actions { display: flex; gap: 8px; flex-shrink: 0; }
.rc-purge { color: var(--danger-2); border-color: var(--danger-border); }
.rc-purge:hover { background: var(--danger-bg); border-color: var(--danger); color: var(--danger-2); }
.mb-item {
  position: relative; padding: 11px 34px 11px 13px; border-radius: 12px;
  cursor: pointer; margin-bottom: 4px; border: 1px solid transparent;
  transition: background .14s var(--ease), border-color .14s var(--ease);
}
.mb-item:hover { background: var(--panel2); }
.mb-item.active {
  background: var(--brand-050); border-color: var(--line2);
  box-shadow: inset 3px 0 0 var(--brand-500);
}
.mb-addr {
  font-family: ui-monospace, Consolas, monospace; font-size: 13px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-item.active .mb-addr { color: var(--text); font-weight: 600; }
.mb-meta { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.mb-time { color: var(--muted); font-size: 11px; }
.mini-code {
  font-family: ui-monospace, monospace; font-size: 11px; font-weight: 700;
  color: var(--brand); background: var(--brand-050); border: 1px solid var(--ok-border);
  padding: 1px 7px; border-radius: 999px;
}
/* 红色未读角标 */
.badge-dot {
  position: absolute; top: 9px; right: 11px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: linear-gradient(180deg, #ef7a77 0%, #e65f5c 100%); color: #fff; border-radius: 999px;
  font-size: 11px; font-weight: 700; line-height: 18px; text-align: center;
  box-shadow: 0 0 0 2px #fff, 0 2px 5px -1px rgba(214,75,72,.5);
  animation: badgePop .25s var(--ease);
}
@keyframes badgePop { from { transform: scale(.4); opacity: 0 } to { transform: scale(1); opacity: 1 } }
.mb-del {
  position: absolute; bottom: 9px; right: 9px; width: 20px; height: 20px;
  border: none; border-radius: 6px; background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; opacity: 0; transition: opacity .12s, background .12s;
}
.mb-item:hover .mb-del { opacity: 1; }
.mb-del:hover { background: var(--danger-bg); color: var(--danger); }

/* --- 右侧收件区 --- */
.mail-pane {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow: var(--hi), var(--sh1);
}
.mail-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 15px 18px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
  background: linear-gradient(180deg, #ffffff 0%, #f9fdfe 100%);
}
.mail-head-left { min-width: 0; }
.addr-line { display: flex; align-items: center; gap: 10px; }
.cur-addr { font-size: 16px; font-weight: 700; color: var(--text); cursor: pointer; }
.cur-addr:hover { color: var(--brand); }
.live { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.live .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500);
  display: inline-block; animation: pulse 1.6s infinite;
}
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

.mail-body { flex: 1; overflow-y: auto; overflow-anchor: none; position: relative; }
.msg-list { list-style: none; margin: 0; padding: 10px; }
.msg-empty { padding: 44px 20px; text-align: center; color: var(--muted); font-size: 13px; }

/* 每封信 = 可折叠容器（手风琴，点开原位展开，不弹窗） */
.msg {
  border-radius: 12px; border: 1px solid transparent;
  margin-bottom: 6px; overflow: hidden; background: #fff;
  transition: border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.msg:hover { border-color: var(--line); box-shadow: var(--sh1); }
.msg.unread { background: var(--brand-050); border-color: var(--ok-border); }
.msg.open {
  background: #fff; border-color: var(--brand-300);
  box-shadow: var(--hi), var(--sh2);
}

/* 标题行：点击这一行展开/收起 */
.msg-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 15px; cursor: pointer; transition: background .12s var(--ease);
  border-left: 3px solid transparent;
}
.msg-check { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; accent-color: var(--brand); }
/* 30 天自动删除倒计时 */
.msg-ttl {
  font-size: 11px; color: var(--muted); white-space: nowrap; flex-shrink: 0;
  background: var(--panel2); border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px;
}
.msg-ttl.soon { color: var(--danger-2); background: var(--danger-bg); border-color: var(--danger-border); }
/* 单封删除按钮（hover 才显） */
.msg-del {
  flex-shrink: 0; width: 26px; height: 26px; display: inline-flex; align-items: center; justify-content: center;
  border: none; background: transparent; color: var(--muted); border-radius: 7px; cursor: pointer;
  opacity: 0; transition: opacity .12s, background .12s, color .12s;
}
.msg-row:hover .msg-del { opacity: 1; }
.msg-del:hover { background: var(--danger-bg); color: var(--danger); }

/* 多选操作栏 */
.sel-bar {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 16px; border-bottom: 1px solid var(--line);
  background: var(--brand-050);
}
.sel-bar[hidden] { display: none; }
.sel-all { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); cursor: pointer; }
.sel-all input { accent-color: var(--brand); }
#selCount { font-size: 13px; }

/* 页内快捷回复 */
.reply-box { padding: 12px 0 4px; }
.reply-box[hidden] { display: none; }
.reply-box label { margin: 8px 0 4px; }
.reply-box .rp-body { resize: vertical; }
.rp-status { font-size: 12px; }
.ok-text { color: var(--brand); }

/* 顶部「我的邮箱」未读角标 */
.nav-badge {
  display: inline-block; min-width: 16px; height: 16px; line-height: 16px; padding: 0 5px;
  margin-left: 6px; border-radius: 999px; font-size: 11px; font-weight: 700; text-align: center;
  background: #ef5670; color: #fff; vertical-align: 1px;
}
.nav-badge[hidden] { display: none; }   /* 未读为 0 时真正隐藏（display 会覆盖 [hidden]） */
.mainnav a.has-unread { color: var(--brand); }
/* 右上角账号入口 */
.whoami { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-weight: 600; }
.whoami:hover, .whoami.active { color: var(--brand); text-decoration: none; }
.msg.unread .msg-row { border-left-color: var(--brand-500); }
.msg.open .msg-row { border-left-color: var(--brand); }
.msg-row:hover { background: rgba(238,247,249,.6); }
.msg-main { flex: 1; min-width: 0; }
.msg-top { display: flex; justify-content: space-between; gap: 10px; }
.msg-from { font-size: 13px; color: var(--muted); }
.msg.unread .msg-from { color: var(--text); font-weight: 700; }
.msg-time { font-size: 11px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.msg-sub {
  margin-top: 3px; font-size: 14px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.msg.unread .msg-sub { font-weight: 700; color: var(--text); }
.caret {
  color: var(--muted); font-size: 16px; flex-shrink: 0;
  transition: transform .2s var(--ease), color .2s var(--ease); user-select: none;
}
.msg.open .caret { transform: rotate(90deg); color: var(--brand); }

/* 展开区：max-height 过渡做平滑展开/收起 */
.msg-detail { max-height: 0; overflow: hidden; transition: max-height .28s var(--ease); }
.detail-inner { padding: 0 16px 16px; }
.detail-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 12px 0 14px; border-top: 1px solid var(--line); color: var(--muted);
}
.mail-frame { width: 100%; height: 420px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.mail-text {
  white-space: pre-wrap; word-break: break-word; font: inherit; margin: 0;
  color: var(--text2); background: var(--brand-050); border: 1px solid var(--line);
  border-radius: 12px; padding: 14px; max-height: 380px; overflow: auto;
}
.detail-loading { padding: 18px; text-align: center; color: var(--muted); font-size: 13px; }

/* 新邮件闪入：只淡背景，不位移，避免打乱滚动位置 */
.flash-in .msg-row { animation: flashIn 1.1s var(--ease); }
@keyframes flashIn {
  0% { background: rgba(63,159,182,.22); }
  100% { background: transparent; }
}

/* 一键复制的验证码：软海蓝按钮 */
.code-btn {
  font-family: ui-monospace, Consolas, monospace; font-size: 16px; font-weight: 800;
  letter-spacing: 1px; color: #245d6e; cursor: pointer; white-space: nowrap; flex-shrink: 0;
  padding: 7px 13px; border-radius: 10px; border: 1px solid var(--brand-300);
  background-image: linear-gradient(180deg, #ddf3f7 0%, #bfe6ee 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.85), 0 1px 2px rgba(15,74,88,.05);
  transition: transform .14s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.code-btn:hover { border-color: #5db8ca; transform: translateY(-1px); box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 4px 10px -4px rgba(15,74,88,.2); }
.code-btn.copied {
  color: #fff; border-color: rgba(15,74,88,.25);
  background-image: linear-gradient(180deg, #3f9fb6 0%, #2f879d 100%);
}

/* 登录 / 注册 */
.login-wrap, .auth-wrap { max-width: 400px; margin: 9vh auto; }
.login-wrap .card, .auth-wrap .card { padding: 34px; }
.login-wrap h1, .auth-wrap h1 { font-size: 22px; margin: 0 0 20px; text-align: center; color: var(--text); }
.topbar .brand a:hover { opacity: .85; text-decoration: none; }

/* 地址展示胶囊 */
.addr {
  font-size: 17px; font-weight: 700; cursor: pointer; color: var(--text);
  padding: 5px 12px; border-radius: 999px; background: var(--brand-050);
  border: 1px solid var(--ok-border); display: inline-block; transition: background .15s var(--ease);
}
.addr:hover { background: var(--brand-100); border-color: var(--brand-300); }
.addr.copied { background: var(--brand); color: #fff; border-color: var(--brand); }
.addr.copied::after { content: " ✓已复制"; font-size: 12px; }

/* ============================================================
   分组 / 标签 / 备注（左栏 + 邮箱项 + 弹层）
   ============================================================ */
/* --- 最左侧分组/标签栏 --- */
.org-rail {
  display: flex; flex-direction: column; gap: 14px; overflow-y: auto;
}
.org-sec {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--hi), var(--sh1); overflow: hidden; display: flex; flex-direction: column;
}
.org-sec-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 12px 9px; font-size: 12px; font-weight: 700; color: var(--muted);
  letter-spacing: .04em;
}
.org-add {
  width: 22px; height: 22px; border-radius: 7px; border: 1px solid var(--line);
  background: var(--panel2); color: var(--brand); font-size: 15px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; transition: all .14s var(--ease);
}
.org-add:hover { background: var(--brand-050); border-color: var(--brand-300); }
.org-list, .org-tags { list-style: none; margin: 0; padding: 4px 6px 8px; }
.org-item, .tag-item {
  position: relative; display: flex; align-items: center; gap: 6px;
  padding: 7px 8px; border-radius: 9px; cursor: pointer; margin-bottom: 2px;
  border: 1px solid transparent; transition: background .12s var(--ease);
}
.org-item:hover, .tag-item:hover { background: var(--panel2); }
.org-item.active, .tag-item.active { background: var(--brand-050); border-color: var(--line2); }
.org-name {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.org-item.active .org-name { color: var(--text); font-weight: 600; }
.org-cnt {
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  background: var(--panel2); border-radius: 999px; padding: 0 6px; min-width: 20px; text-align: center;
}
.org-item.active .org-cnt, .tag-item.active .org-cnt { background: #fff; }
.org-ops { display: none; gap: 2px; margin-left: 2px; }
.org-item:hover .org-ops, .tag-item:hover .org-ops { display: inline-flex; }
.org-op {
  width: 20px; height: 20px; border: none; background: transparent; color: var(--muted);
  border-radius: 6px; font-size: 13px; line-height: 1; cursor: pointer;
}
.org-op:hover { background: var(--danger-bg); color: var(--danger); }
.org-op[data-gedit]:hover, .org-op[data-tedit]:hover { background: var(--brand-050); color: var(--brand); }
.org-hint { padding: 8px; font-size: 12px; color: var(--muted); line-height: 1.7; }
@media (max-width: 820px) { .org-ops { display: inline-flex; } }

/* --- 顶部筛选提示条 --- */
.mb-filter-chip {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 7px 12px; font-size: 12px; color: var(--brand);
  background: var(--brand-050); border-bottom: 1px solid var(--line);
}
.mb-filter-chip[hidden] { display: none; }
.chip-x { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 12px; }
.chip-x:hover { color: var(--danger); }

/* --- 邮箱多选批量栏 --- */
.mb-selbar {
  display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
  padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--brand-050);
}
.mb-selbar[hidden] { display: none; }
.btn.xs { padding: 4px 9px; font-size: 12px; border-radius: 8px; }
.btn.xs.danger { color: var(--danger-2); border-color: var(--danger-border); }
.btn.xs.danger:hover { background: var(--danger-bg); border-color: var(--danger); }

/* 按钮加载态：文字隐去、中间转圈（用于「立即刷新」等）*/
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 14px; height: 14px;
  margin: -7px 0 0 -7px; border: 2px solid rgba(63,159,182,.3);
  border-top-color: var(--brand); border-radius: 50%; animation: btnspin .6s linear infinite;
}
@keyframes btnspin { to { transform: rotate(360deg); } }

/* --- 邮箱项：紧凑两行（省空间，一屏更多邮箱）---
   第1行：勾选 + 地址(占满省略) + 未读 + 单标签 + 删除(右上角)
   第2行：分组(≤6字，固定) + 备注(占满剩余，固定单行，超出省略) */
.mb-item {
  display: flex; flex-direction: column; gap: 4px;
  padding: 8px 10px;
}
.mb-item.picked { background: var(--brand-050); border-color: var(--line2); }
.mb-row1 { display: flex; align-items: center; gap: 7px; }
.mb-row2 { display: flex; align-items: center; gap: 6px; min-height: 22px; }
.mb-check { flex-shrink: 0; width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.mb-row1 .mb-addr { flex: 1; min-width: 0; }
/* 未读小红标（行内，取代旧的绝对定位角标）*/
.mb-unread {
  flex-shrink: 0; min-width: 16px; height: 16px; line-height: 16px; padding: 0 5px;
  border-radius: 999px; font-size: 10px; font-weight: 800; text-align: center; color: #fff;
  background: linear-gradient(180deg, #ef7a77 0%, #e65f5c 100%);
  box-shadow: 0 1px 3px -1px rgba(214,75,72,.5);
}
/* 单个标签放右上角，过长省略 */
.mb-tagone { flex-shrink: 0; max-width: 88px; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.badge-dot { display: none; }   /* 旧绝对角标不再使用 */
/* 删除按钮：右上角，平时淡、hover 变红 */
.mb-del {
  position: static; flex-shrink: 0; width: 20px; height: 20px; opacity: .45;
  border: none; border-radius: 6px; background: transparent; color: var(--muted);
  font-size: 15px; line-height: 1; cursor: pointer; transition: opacity .12s, background .12s, color .12s;
}
.mb-item:hover .mb-del { opacity: 1; }
.mb-del:hover { background: var(--danger-bg); color: var(--danger); }
/* 第2行：分组不压缩，备注占满剩余、固定单行框 */
.mb-row2 > .chip { flex-shrink: 0; max-width: 108px; overflow: hidden; text-overflow: ellipsis; }
.mb-note {
  flex: 1; min-width: 0; font-size: 12px; color: var(--text2);
  background: #fff7e6; border: 1px solid #f0dca6; padding: 1px 8px; border-radius: 7px;
  cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb-note:hover { border-color: #e6c65e; }
/* 单选标签弹层 */
.tag-pick-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-pick { cursor: pointer; opacity: .58; filter: grayscale(.25); }
.tag-pick.on { opacity: 1; filter: none; box-shadow: 0 0 0 2px rgba(63,159,182,.4); }
.tag-pick:hover { opacity: 1; }
/* 收件区头部的备注不撑满 */
.cur-org .mb-note { flex: 0 1 auto; max-width: 260px; }

/* 通用小胶囊：分组名 / 设置按钮 / 标签管理入口 */
.chip {
  font-size: 12px; line-height: 1.6; padding: 1px 9px; border-radius: 999px;
  cursor: pointer; white-space: nowrap; border: 1px solid transparent;
}
.chip.grp { background: var(--brand-050); color: var(--brand); border-color: var(--brand-300); font-weight: 600; }
.chip.grp:hover { background: var(--brand-100); }
.chip.set {
  background: transparent; color: var(--muted); border: 1px dashed var(--line2);
}
.chip.set:hover { color: var(--brand); border-color: var(--brand-300); background: var(--brand-050); }

/* 彩色标签 */
.tg {
  display: inline-block; font-size: 11px; font-weight: 600; line-height: 1.7;
  padding: 0 8px; border-radius: 999px; white-space: nowrap; border: 1px solid transparent;
}
.tg-teal   { background: #d8f0f2; color: #1f6b78; border-color: #a8dbe1; }
.tg-blue   { background: #dde8fb; color: #2a4d8f; border-color: #b8cdf3; }
.tg-red    { background: #fce0df; color: #a63b39; border-color: #f3bfbd; }
.tg-gold   { background: #fbedcf; color: #8a6410; border-color: #f0d79a; }
.tg-purple { background: #eadff8; color: #6b3ca6; border-color: #d4bef0; }
.tg-green  { background: #ddf3e0; color: #2c7a42; border-color: #b6e2be; }
.tg-gray   { background: #e7ecef; color: #556069; border-color: #cdd6dc; }
.tg-dark   { background: #3a4650; color: #fff;    border-color: #2b343c; }

/* 收件区头部的分组/备注/标签 */
.cur-org { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.cur-org:empty { display: none; }

/* --- 通用弹层 --- */
.md-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  width: 100%; max-width: 440px; max-height: 82vh; display: flex; flex-direction: column;
  box-shadow: var(--hi), var(--sh3); overflow: hidden;
}
.md-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 18px; border-bottom: 1px solid var(--line); font-size: 15px; color: var(--text);
}
.md-x { border: none; background: transparent; font-size: 20px; color: var(--muted); cursor: pointer; line-height: 1; }
.md-x:hover { color: var(--danger); }
.md-body { padding: 16px 18px; overflow-y: auto; }
.md-body textarea, .md-body input {
  width: 100%; padding: 9px 11px; font-size: 14px; border-radius: 10px;
  border: 1px solid var(--line2); background: #fff; color: var(--text); resize: vertical;
}
.md-body textarea:focus, .md-body input:focus { outline: none; border-color: var(--brand-300); box-shadow: 0 0 0 3px var(--brand-050); }
.md-foot {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-top: 1px solid var(--line); background: var(--panel2);
}
/* 分组选择列表 */
.pick-list { display: flex; flex-direction: column; gap: 4px; }
.pick-row {
  text-align: left; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: #fff; color: var(--text2); font-size: 14px; cursor: pointer; transition: all .12s var(--ease);
}
.pick-row:hover { background: var(--brand-050); border-color: var(--brand-300); color: var(--brand); }
/* 标签切换（单个邮箱） */
.tag-toggle-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-toggle { cursor: pointer; opacity: .55; filter: grayscale(.3); position: relative; padding-left: 8px; }
.tag-toggle.on { opacity: 1; filter: none; box-shadow: 0 0 0 2px rgba(63,159,182,.35); }
.tag-toggle.on::before { content: "✓ "; font-weight: 800; }
/* 标签批量添加/移除 */
.tag-batch-wrap { display: flex; flex-direction: column; gap: 8px; }
.tag-batch-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; }
/* 颜色选择器 */
.sw-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 12px; }
.sw {
  width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--line); transition: transform .1s var(--ease);
}
.sw:hover { transform: scale(1.12); }
.sw.on { box-shadow: 0 0 0 2px var(--brand); }
.sw-teal { background: #6fc6d2; } .sw-blue { background: #6d93e0; } .sw-red { background: #e07b78; }
.sw-gold { background: #e6bd5c; } .sw-purple { background: #a884d8; } .sw-green { background: #6cc182; }
.sw-gray { background: #9aa6ae; } .sw-dark { background: #3a4650; }
.tg-preview { margin-top: 14px; font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.danger-text { color: var(--danger-2); }

/* ============================================================
   Telegram 通知管理页
   ============================================================ */
.tg-wrap { max-width: 760px; margin: 0 auto; }
.tg-h1 { font-size: 22px; margin: 4px 0 6px; color: var(--text); }
.tg-lead { line-height: 1.8; margin-bottom: 18px; }
.tg-card { padding: 18px 20px; margin-bottom: 16px; }
.tg-card-h { font-size: 15px; font-weight: 800; color: var(--text); margin-bottom: 10px; }
.tg-link-row { display: flex; gap: 8px; align-items: center; }
.tg-link-row input { flex: 1; min-width: 0; font-size: 13px; padding: 8px 11px; border-radius: 10px; }
.tg-chats, .tg-bots { list-style: none; margin: 6px 0 0; padding: 0; }
.tg-chats li, .tg-bots li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--panel2);
}
.tg-chat-info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tg-chat-name { font-weight: 600; color: var(--text); }
.tg-chat-ops { display: flex; gap: 8px; flex-shrink: 0; }
.tg-addbot { display: flex; gap: 8px; margin: 10px 0; }
.tg-addbot input { flex: 1; min-width: 0; font-size: 13px; padding: 8px 11px; border-radius: 10px; }
.tg-mini { font-size: 11px; color: var(--muted); margin-top: 3px; word-break: break-all; }
.tg-steps { margin: 8px 0 0; padding-left: 20px; line-height: 2.1; color: var(--text2); }
.tg-steps code { background: var(--panel2); border: 1px solid var(--line); padding: 1px 7px; border-radius: 6px; font-size: 13px; }
.btn.sm.danger, .btn.ghost.sm.danger { color: var(--danger-2); border-color: var(--danger-border); }
.btn.ghost.sm.danger:hover { background: var(--danger-bg); border-color: var(--danger); }
@media (max-width: 560px) {
  .tg-chats li, .tg-bots li { flex-direction: column; align-items: flex-start; }
  .tg-chat-ops { width: 100%; }
}

/* ============================================================
   顶栏 + 多列布局响应式收尾（放最后，确保覆盖上面的基础规则）
   ============================================================ */
.mainnav a { white-space: nowrap; }
.whoami .uname {
  display: inline-block; max-width: 130px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; vertical-align: bottom;
}

/* 平板（821–1080）：分组栏竖排，收件区在下一行占满，给足高度 */
@media (min-width: 821px) and (max-width: 1080px) {
  .org-rail { flex-direction: column; }
  .mail-pane { min-height: 60vh; }
}

/* 手机（≤820）：整体竖排；分组 + 标签并排两卡，节省纵向空间；收件区给足高度 */
@media (max-width: 820px) {
  .topbar { gap: 12px; padding: 0 14px; }
  .workspace { gap: 12px; }
  .org-rail { flex-direction: row; gap: 10px; align-items: stretch; overflow: visible; }
  .org-rail .org-sec { flex: 1 1 0; min-width: 0; }
  .org-list, .org-tags { max-height: 30vh; overflow-y: auto; }
  .org-name { font-size: 12px; }
  .mb-list { max-height: none; }
  .mail-pane { min-height: 66vh; }
  .mail-frame { height: 58vh; }
  .mail-head { padding: 12px 14px; }
  /* 收件区头部的操作按钮换行不挤 */
  .mail-head .row { flex-wrap: wrap; }
}

/* 小屏（≤560）：顶栏压缩，用户名收起为图标，避免「我的邮箱」被挤成竖排 */
@media (max-width: 560px) {
  .topbar { gap: 8px; padding: 0 10px; }
  .brand-name { font-size: 16px; }
  .mainnav { gap: 2px; }
  .mainnav a { padding: 6px 10px; font-size: 14px; }
  .userbox { gap: 8px; }
  .whoami .uname { display: none; }          /* 只留账号图标，退出仍在 */
  .mb-list-head { flex-wrap: wrap; gap: 8px; }
}
