/* ==========================================================================
   微迹 Weetrack — 邮箱
   --------------------------------------------------------------------------
   布局：顶栏（账号 / 文件夹 / 操作）
         └ 主体：左「邮件列表」（固定宽，自己滚）＋ 右「正文」（占满，自己滚）

   【为什么整页不滚，而是左右各自滚】
   和 Agent 那一页同一条思路：列表和正文是两块独立的滚动区。
   如果让整页滚，看到正文中间时列表会被带着一起滚走，
   想换一封就得先滚回顶部 —— 那很烦。
   ========================================================================== */

#view.view-fill > .view-host > .mail-body {
  /* 【basis 必须是 0，不能是 auto】见 agent.css 里那段说明 */
  flex: 1 1 0;
  min-height: 0;
}

.mail-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 0;
}

.mail-loading {
  align-self: center;
  margin: auto;
  font-size: 13px;
  color: var(--text-3);
  padding: 18px;
}
.mail-error {
  margin: auto;
  font-size: 13px;
  color: var(--red);
}

/* ------------------------------ 进页骨架 ------------------------------ */

/* 【为什么要有它】
   用户原话：「点击邮箱时直接进去并且有数据吗？进去之后再进行刷新数据」。
   慢网络实测：不画骨架的话，点进来有 2.5 秒是纯空白。
   骨架把"邮件界面长什么样"先摆出来，那 2.5 秒就变成"正在读信"
   而不是"页面坏了"。

   尺寸刻意和真实布局对齐（左列表 330px、右正文自适应），
   这样数据填进来时是**原地替换**，不会整页跳一下。 */
.mail-skel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 0;
  min-height: 0;
}
/* 顶栏的三个占位（账号下拉 / 两个按钮） */
.mail-skel-bar { display: flex; gap: 8px; align-items: center; }
.mail-skel-pill {
  height: 28px;
  width: 220px;
  border-radius: 8px;
  background: var(--surface-2);
}
.mail-skel-pill.sm { width: 74px; }

.mail-skel-client {
  display: flex;
  gap: 12px;
  flex: 1 1 0;
  min-height: 0;
}
.mail-skel-list {
  flex: none;
  width: 330px;
  min-width: 0;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow: hidden;
}
.mail-skel-read {
  flex: 1 1 0;
  min-width: 0;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

/* 【占位条要"像内容"，所以宽度不一样】
   等长的条看着像表格；参差一点才像邮件标题 + 摘要。
   宽度靠 nth-child 轮着给，不用随机数（随机会让人以为页面在抖）。 */
.mail-skel-line {
  height: 9px;
  border-radius: 5px;
  background: var(--surface-2);
}
.mail-skel-row { display: flex; flex-direction: column; gap: 6px; }
.mail-skel-row .w1 { width: 62%; height: 10px; }
.mail-skel-row .w2 { width: 88%; }
.mail-skel-row:nth-child(2n) .w1 { width: 48%; }
.mail-skel-row:nth-child(3n) .w1 { width: 73%; }
.mail-skel-row:nth-child(2n) .w2 { width: 70%; }
.mail-skel-row:nth-child(3n) .w2 { width: 94%; }
.mail-skel-read .w1 { width: 46%; height: 12px; margin-bottom: 14px; }
.mail-skel-read .w2 { width: 92%; margin-bottom: 9px; }
.mail-skel-read .w3 { width: 78%; }

/* 【缓慢呼吸，表示"在动"】
   不闪、不转圈 —— 这里只是让人知道"还在读"，不是出错。
   动画很轻（1.4s、透明度小幅变化），盯久了也不烦。 */
.mail-skel-pill,
.mail-skel-line {
  animation: mail-skel-breathe 1.4s ease-in-out infinite;
}
@keyframes mail-skel-breathe {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}
/* 尊重"减少动态效果"的系统设置 */
@media (prefers-reduced-motion: reduce) {
  .mail-skel-pill,
  .mail-skel-line { animation: none; }
}

.mail-skel-tip {
  font-size: 11.5px;
  color: var(--text-3);
  text-align: center;
  /* 不抢眼：它是说明，不是要点的东西 */
  margin-top: -2px;
}

/* 窄屏和真实布局一样落成单栏，免得骨架和内容看着不是一套 */
@media (max-width: 860px) {
  .mail-skel-client { flex-direction: column; }
  .mail-skel-list { width: auto; }
}

/* ============================ 密匣那道门 ============================ */

.mail-gate {
  margin: auto;
  max-width: 520px;
  text-align: center;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}
.mail-gate-ico {
  font-size: 34px;
  color: var(--brand);
  opacity: .8;
  margin-bottom: 10px;
}
.mail-gate h2 {
  margin: 0 0 10px;
  font-size: 17px;
}
.mail-gate p {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.75;
}
.mail-gate-note {
  font-size: 12px !important;
  color: var(--text-3) !important;
  text-align: left;
  background: var(--surface-3);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 16px !important;
}

/* ============================ 一个邮箱都没有 ============================ */

.mail-empty {
  margin: auto;
  text-align: center;
  padding: 30px;
  max-width: 560px;
}
.mail-empty-ico {
  font-size: 34px;
  opacity: .35;
  margin-bottom: 8px;
}
.mail-empty-t {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}
.mail-empty-d {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: 18px;
}
.mail-empty-hint {
  margin-top: 14px;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
}

/* ============================ 顶栏 ============================ */

.mail-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex: none;
}
.mail-head-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.mail-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.mail-title > span:first-child {
  font-size: 15px;
  opacity: .6;
}
.mail-title h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}
.mail-acc { max-width: 240px; }
.mail-folder { max-width: 200px; }
.mail-head-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 「正在刷新…」/「已同步 …」
   先出缓存、再去服务器同步，这两个状态要在顶栏看得见 ——
   不写的话用户不知道"现在看到的可能不是最新的"。 */
.mail-syncing,
.mail-sync-ok {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
}
.mail-spin {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--line-strong, #d8cfc4);
  border-top-color: var(--brand);
  animation: mail-spin .7s linear infinite;
}
@keyframes mail-spin {
  to { transform: rotate(360deg); }
}
/* 系统里开了"减少动态效果"就只留文字，不转圈 */
@media (prefers-reduced-motion: reduce) {
  .mail-spin { animation: none; }
}

/* 「密匣已授权 · 还剩 N 天」
   用户要的规则是"解锁一次管 7 天"。不把这句写出来的话，
   他每次打开邮箱都在等那个输主密码的框，还会以为功能坏了。
   做成不抢眼的小字：它只是"现在不用解锁"的说明，不是一个要点的东西。 */
.mail-grant {
  font-size: 11.5px;
  color: var(--text-3);
  background: var(--surface-2, #f6f3ee);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  white-space: nowrap;
  cursor: help;
}
/* 空状态里那个（"还没有接邮箱"页）—— 居中放在说明下面 */
.mail-empty-grant {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

/* ============================ 主体两栏 ============================ */

.mail-client {
  display: flex;
  gap: 12px;
  flex: 1 1 0;
  min-height: 0;
}

/* ==========================================================================
   列表和正文之间那条可拖的分隔条（用户 2026-10-06：
   「左边邮件列表和右侧邮件详情 中的竖杠 应该可活动调整」）
   --------------------------------------------------------------------------
   做法照抄 Agent 页那条横分隔条（.agent-splitter），
   只是把方向转 90°。手感要和那边一致，所以：
     · 视觉上很细（1px 的线），但**可拖动区域宽 10px** ——
       只有 1px 的话根本抓不住，鼠标要抖半天
     · 悬停/拖动时变色 + 变宽一点，明确告诉用户"这里能抓"
   ========================================================================== */
.mail-splitter {
  flex: none;
  align-self: stretch;
  width: 10px;
  margin: 0 -5px;              /* 视觉上不额外占地（吃掉 gap 的一部分） */
  cursor: col-resize;
  position: relative;
  /* 【不能有 touch-action: none】那样手机上就没法滚动列表了。
     只禁掉横向手势，纵向照旧能滚。 */
  touch-action: pan-y;
  border-radius: 4px;
  transition: background var(--dur) var(--ease);
}
/* 中间那条细线 */
.mail-splitter::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-50%);
  border-radius: 1px;
  background: transparent;
  transition: background var(--dur) var(--ease);
}
.mail-splitter:hover::before,
.mail-splitter.dragging::before { background: var(--brand); }
.mail-splitter:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }

/* 【拖动中：整页禁选 + 光标保持"左右拉"】
   不禁选的话，鼠标划过正文会把文字选成一片蓝。 */
body.mail-resizing { user-select: none; cursor: col-resize; }
body.mail-resizing * { cursor: col-resize !important; }

.mail-list {
  flex: none;
  width: 330px;
  min-width: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}
.mail-list-empty {
  margin: auto;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 20px;
}

.mail-syncwarn {
  font-size: 11.5px;
  line-height: 1.6;
  color: #8a6d24;
  background: var(--amber-soft);
  border-radius: 9px;
  padding: 8px 10px;
  margin-bottom: 6px;
}

.mail-row {
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
  border-left: 3px solid transparent;
  /* 【批量模式下每行前面多一个勾选框】
     用 flex 排，勾选框定宽、右边的内容区自己伸缩（见 .mail-row 内部的
     两个 div —— 它们原来是块级顺序排列，这里让它们继续占满剩余宽度）。 */
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.mail-row > div { flex: 1 1 auto; min-width: 0; }
.mail-row:hover { background: var(--surface-3); }
.mail-row.active { background: var(--brand-soft); border-left-color: var(--brand); }
.mail-row.failed { border-left-color: var(--red); }

/* 批量模式：选中那一行整行高亮，一眼看出勾了哪几封 */
.mail-row.picked { background: var(--brand-soft); }

/* 勾选框：和待办/灵感的批量选择用的是同一个 svg 勾 */
.mail-pick {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: transparent;          /* 没勾时勾是透明的（位置不跳） */
  background: var(--surface);
}
.mail-pick.on {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--on-brand);
}
.mail-pick svg { width: 12px; height: 12px; }

.mail-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.mail-from {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-date {
  flex: none;
  font-size: 11px;
  color: var(--text-3);
}
.mail-row-mid {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
}
/* 【主题：粗、深、独占一行（2026-10-06 改）】
   原来这里和发件人同字号同深浅，两个抢宽度、都被截断。
   现在它是这一行的主角：加粗、用最深的一级文字色。
   （--text-1 这个变量以前**没定义**，见 tokens.css 里的说明 ——
    那 20 处声明其实一直是失效的，所以主题才显得发灰。） */
.mail-subject {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 里面那层装文字。inline-block 让它的宽度 = 文字真实宽度，
   这样它比外层宽就说明"被截断了"，可以滚（见 --scroll-x）。 */
.mail-subject-in { display: inline-block; }

/* 【鼠标移上去，长标题自己滚动 —— 用户点名要的】
   「鼠标放上去 会滚动标题」

   做法：悬停时把里面的文字整体向左平移到底，再弹回来（alternate）。
   这样不用复制文字、也不会出现"滚到底露白"——
   因为它是"移过去再移回来"，来回看两遍就够了。

   为什么平移动画挂在**里面那层** .mail-subject-in：
   外层被 flex 压成可视宽度，平移它等于把整块挪出容器；
   内层是 inline-block，宽度就是文字真实宽度，平移它才是"文字在走"。

   --scroll-x 由 JS 量出来（超出多少像素），见 mail.js 的 fitSubject。
   没超出的标题不加 .can-scroll，也就不会滚（短标题滚起来很怪）。 */
.mail-row:hover .mail-subject.can-scroll > .mail-subject-in {
  animation: mail-scroll var(--scroll-dur, 5s) ease-in-out infinite alternate;
}
.mail-row:hover .mail-subject.can-scroll { text-overflow: clip; }
@keyframes mail-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(calc(-1 * var(--scroll-x, 0px))); }
}
/* 【必须尊重"减少动态效果"】
   系统里开了这个偏好的人，滚动动画会让他不舒服。
   关掉动画、退回省略号 —— 信息一样拿得到（悬停有 title 全文）。 */
@media (prefers-reduced-motion: reduce) {
  .mail-row:hover .mail-subject.can-scroll > .mail-subject-in { animation: none; }
}

/* 【摘要：细、灰、一行】
   和主题拉开层次：字号小 1px、字重 400、颜色用最弱那级。
   单行省略 —— 列表是"扫一眼"的地方，多行会让每行高度不一、更难扫。 */
.mail-snippet {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-clip, .mail-star {
  flex: none;
  font-size: 11px;
  color: var(--text-3);
}
.mail-star { color: #d0a13c; }
.mail-failtag {
  flex: none;
  font-size: 10.5px;
  color: var(--red);
  background: var(--red-soft);
  padding: 1px 6px;
  border-radius: 999px;
}

/* 【未读要一眼看出来】
   只加粗是不够的 —— 一堆加粗的字看着一样重。
   所以未读那行左边加一条竖线，发件人也用更深的颜色。 */
.mail-row.unread { border-left-color: var(--brand); }
.mail-row.unread .mail-from { font-weight: 700; }
.mail-row.unread .mail-subject { color: var(--text-1); font-weight: 600; }

/* ============================ 正文 ============================ */

.mail-read {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}
.mail-read-empty {
  margin: auto;
  font-size: 12.5px;
  color: var(--text-3);
  padding: 20px;
}

/* 【表头改成"左边信息 + 右上角动作"两栏（2026-10-06）】
   用户原话：
     「这四个按钮是否可以移动到右上方，现在 占用了一行的空间，
       右边有很多空白位置」

   原来 .mail-read-head 是个普通块：主题 → 发件人/收件人/时间 → 动作，
   一行一行往下堆。那四个按钮明明很短，却独占一行，
   而它们右边一大片全空着 —— 邮件一多，每封都要往下滚才能看到正文。

   现在用 grid 分两块：
     左上：主题（跨两列，长主题需要整幅宽度）
     左下：发件人 / 收件人 / 抄送 / 时间
     右上：四个动作按钮，**贴着顶对齐**，不再占正文的位置
   窄屏（见下面 @media）会退回上下排列 —— 右边放不下就换行，
   总比把按钮挤成一条线好。 */
.mail-read-head {
  flex: none;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 14px;
  row-gap: 8px;
}
.mail-read-subject {
  grid-column: 1 / -1;      /* 主题横跨整行 */
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  word-break: break-word;
}
.mail-read-meta {
  grid-column: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-2);
  min-width: 0;             /* 让长收件人列表能省略，而不是把动作挤走 */
}
.mail-meta-k {
  display: inline-block;
  width: 52px;
  color: var(--text-3);
}
.mail-read-actions {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;   /* 贴右边 */
  align-self: start;           /* 贴顶 —— 不跟着左边信息的高度被拉长 */
  /* 【不设 margin-top】grid 的 row-gap 已经管了间距；
     再加一个会和主题下面那条间距叠起来，看着忽宽忽窄。 */
}
/* 【窄屏退回上下排列】
   右边放不下四个按钮时，硬挤会把它们压成两行、还把发件人挤没。
   与其那样，不如让动作单独占一行（也就是原来的样子）——
   窄屏本来就不缺这点纵向空间。 */
@media (max-width: 820px) {
  .mail-read-head { grid-template-columns: minmax(0, 1fr); }
  .mail-read-meta { grid-column: 1; }
  .mail-read-actions { grid-column: 1; grid-row: auto; justify-content: flex-start; }
}

/* 附件条 */
.mail-atts {
  flex: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px 0;
}
.mail-att {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12px;
  color: var(--text-1);
  text-decoration: none;
  transition: all var(--dur) var(--ease);
}
.mail-att:hover { border-color: var(--brand); color: var(--brand); }
/* 【回形针和文件名对齐】
   2026-09-27 样式体检发现它一直没有规则。文件名的行高和 emoji 的行高
   不一样，不加约束时它在药丸里会偏上一两个像素。
   和 .agent-tab-ico / .vt-ico 一样：固定字号 + 行高 1，跟着文字走。 */
.mail-att-ico {
  flex: none;
  font-size: 13px;
  line-height: 1;
}
/* 【文件名要能截断】
   2026-09-27 样式体检（npm run audit:styles）发现 `.mail-att-name` 没有规则：
   它自己没宽度限制，而 `.mail-att` 是 inline-flex —— 文件名一长
   （尤其是没有空格的长名字），整个药丸会被撑得很宽、把附件条挤变形。
   现在给它一个上限 + 省略号，鼠标停上去有 title 看全名。 */
.mail-att-name {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mail-att-size { color: var(--text-3); font-size: 11px; }

/* 纯文本正文 */
.mail-text {
  margin: 0;
  padding: 14px 16px;
  font: 13px/1.8 system-ui, 'Microsoft YaHei', sans-serif;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-1);
}

/* HTML 正文 */
.mail-html {
  flex: 1 1 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 10px 16px 14px;
}
.mail-imgbar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 11.5px;
  line-height: 1.6;
  color: #8a6d24;
  background: var(--amber-soft);
  border-radius: 9px;
  padding: 7px 10px;
  margin-bottom: 8px;
}
.mail-frame {
  flex: 1 1 0;
  min-height: 260px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

/* 发信记录详情 */
.mail-sent-detail {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.mail-ok-line, .mail-fail-line {
  font-size: 12.5px;
  line-height: 1.7;
  padding: 8px 11px;
  border-radius: 9px;
}
.mail-ok-line { background: var(--brand-soft); color: var(--text-1); }
.mail-fail-line { background: var(--red-soft); color: var(--red); }
.mail-idline {
  font-size: 11px;
  color: var(--text-3);
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
}

/* ============================ 右键菜单 ============================ */

.mail-menu {
  position: fixed;
  z-index: 900;
  min-width: 168px;
  padding: 5px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  box-shadow: 0 12px 30px -14px rgba(0, 0, 0, .4);
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.mail-menu-item {
  text-align: left;
  padding: 7px 11px;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--text-1);
}
.mail-menu-item:hover { background: var(--brand-soft); color: var(--brand); }
.mail-menu-item.danger { color: var(--red); }
.mail-menu-item.danger:hover { background: var(--red-soft); color: var(--red); }
.mail-menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 6px;
}

/* ============================ 写邮件 / 表单 ============================ */

.mail-compose,
.mail-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ==========================================================================
   邮箱设置：左边账号列表 + 右边编辑（用户 2026-10-06 提的）
   --------------------------------------------------------------------------
   「邮箱的设置UI不太对，应该是 左侧有一个列表，列表是账号列表，
     选择某个账号即可编辑对应邮箱账号内容；也可新建邮箱添加邮箱等」

   原来是"一个弹窗只显示一个账号"，想改另一个得先关掉、切账号、再点设置。
   现在分成两栏：左栏列全部邮箱 + 末尾一个「＋ 添加邮箱」，
   右栏是选中那个的表单。
   ========================================================================== */
.maset {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 0;
  /* 【固定高度，两栏各自滚】
     不固定的话，切换账号时"高的那个表单"会把弹窗撑高、矮的那个又缩回去，
     整个弹窗一跳一跳的。给个最小高度之后它稳得住。 */
  min-height: 380px;
}

/* ---- 左栏 ---- */
.maset-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 4px 10px 4px 0;
  border-right: 1px solid var(--line);
  /* 账号多了自己滚，不把弹窗撑高 */
  max-height: min(62vh, 560px);
  overflow-y: auto;
}
.maset-list-head {
  padding: 4px 8px 8px;
  font-size: 11.5px;
  color: var(--text-3);
}
.maset-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 9px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  text-align: left;
  cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.maset-item:hover { background: var(--surface-2); }
.maset-item.on { background: var(--brand-soft); color: var(--brand-deep); }
.maset-item-ico { flex: none; font-size: 13px; opacity: .7; }
.maset-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.maset-item-mail {
  font-size: 12px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.maset-item-sub {
  font-size: 10.5px;
  color: var(--text-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 「使用中」小标 —— 区分"这个是我主界面正在看的" */
.maset-item-cur {
  flex: none;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--surface-3);
  color: var(--text-3);
  font-size: 9.5px;
  font-weight: 400;
}
.maset-item.on .maset-item-cur { background: var(--brand); color: var(--on-brand); }
.maset-add {
  margin-top: 4px;
  padding: 8px 9px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  text-align: left;
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.maset-add:hover { border-color: var(--brand); color: var(--brand); border-style: solid; }

/* ---- 右栏 ---- */
.maset-pane {
  padding: 2px 2px 2px 18px;
  min-width: 0;
  overflow-y: auto;
  max-height: min(62vh, 560px);
}
.maset-pane-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}
.maset-pane-head h4 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.maset-pane-sub { flex: none; font-size: 11px; color: var(--text-3); }

/* 表单底部的按钮条 */
.maset-acts {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
}
.maset-acts .left { flex: 1; }

/* 【窄屏：列表折到上面去】
   两栏并排要 208px + 表单，窗口太窄时表单会被压得没法用。
   这时改成上下：列表变成一排横向可滚的标签，表单在下面占满宽度。 */
@media (max-width: 720px) {
  .maset { grid-template-columns: minmax(0, 1fr); }
  .maset-list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    max-height: none;
    padding: 0 0 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
  }
  .maset-list-head { display: none; }
  .maset-item { width: auto; flex: none; }
  .maset-item-mail { max-width: 150px; }
  .maset-item-sub { display: none; }
  .maset-add { margin-top: 0; flex: none; white-space: nowrap; }
  .maset-pane { padding: 0; max-height: none; }
}

/* 【"自己填服务器"那两块也要有间距】
   2026-09-27 样式体检（npm run audit:styles）查出来的：
   这块容器只有类名、没有任何规则。外面 `.mail-form` 的 12px 间距
   只能管到它的**直接子元素**，而 IMAP / SMTP 两组字段是装在这个盒子里的，
   间距在盒子里面断掉了 —— 两组输入框贴在一起，看起来像一坨。
   给它和 .mail-form 同一套列布局，加了第二个服务商字段也不会再贴住。 */
.mail-host-box {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.mail-compose-from {
  font-size: 13px;
  color: var(--text-2);
  padding: 7px 10px;
  background: var(--surface-3);
  border-radius: 9px;
}
.mail-compose-body {
  min-height: 220px;
  font: 13px/1.7 system-ui, 'Microsoft YaHei', sans-serif;
  resize: vertical;
}
.mail-compose-sig {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
  background: var(--surface-3);
  padding: 8px 10px;
  border-radius: 9px;
}
.mail-port {
  display: flex;
  align-items: center;  gap: 6px;
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 4px;
}
.mail-port input { width: 92px; }

.mail-prov-hint {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-top: -6px;
}
.mail-prov-note {
  font-size: 11.5px;
  line-height: 1.75;
  color: var(--text-3);
  background: var(--surface-3);
  padding: 9px 11px;
  border-radius: 9px;
}
.mail-prov-hint a {
  font-size: 11.5px;
  color: var(--brand);
}

.mail-test-result {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mail-test-line {
  font-size: 12.5px;
  line-height: 1.7;
}
.mail-test-line.ok { color: #4a7a4e; }
.mail-test-line.bad { color: var(--red); }
.mail-test-folders {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
  word-break: break-word;
}

/* ============================ 窄屏 ============================ */

@media (max-width: 820px) {
  .mail-client {
    flex-direction: column;
  }
  .mail-list {
    width: 100%;
    max-height: 40%;
  }
  .mail-read {
    min-height: 320px;
  }
}
