/* mailhost 控制台样式。浅色主题，跟系统控件风格一致，≤900px 自适应 */
:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d4d8de;
  --text: #1b1f24;
  --text-2: #5b6472;
  --text-3: #8b95a3;
  --primary: #1669e2;
  --primary-d: #1256bd;
  --danger: #d93a3a;
  --ok: #12855c;
  --warn: #b86b00;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.06);
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 600; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }

/* ---------- 登录 ---------- */
.login-wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
  background: radial-gradient(1200px 600px at 50% -10%, #e8f0fe 0%, var(--bg) 55%);
}
.login-card {
  width: 100%; max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand h1 { font-size: 18px; }
.brand p { margin: 2px 0 0; font-size: 12px; }
.brand-mark {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, #1669e2, #3f8cff);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 18px; flex: none;
}
.brand.small { margin: 0 0 18px; padding: 0 6px; gap: 10px; color: var(--text-2); font-weight: 600; }
.brand.small .brand-mark { width: 28px; height: 28px; border-radius: 8px; font-size: 14px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field.checkbox { flex-direction: row; align-items: center; gap: 8px; }
.field.checkbox > span { font-size: 13px; color: var(--text); }

input, select, textarea {
  font: inherit; color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px 11px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(22,105,226,.14);
}
select[multiple] { padding: 4px; }

.btn {
  font: inherit; font-weight: 500;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  padding: 9px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s;
}
.btn:hover { background: #f2f4f7; }
.btn:active { transform: translateY(.5px); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-d); border-color: var(--primary-d); }
.btn-danger { color: var(--danger); border-color: #f0c4c4; }
.btn-danger:hover { background: #fdf1f1; }
.btn-ghost { border-color: transparent; color: var(--primary); }
.btn-ghost:hover { background: #eef4ff; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.icon-btn {
  border: 1px solid transparent; background: transparent;
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer;
  color: var(--text-2); font-size: 15px; line-height: 1;
}
.icon-btn:hover { background: #eef1f5; color: var(--text); }
.err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 10px 0 0; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: 200px; flex: none;
  background: var(--surface);
  border-right: 1px solid var(--line);
  padding: 16px 10px;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  border: 0; background: transparent;
  padding: 9px 10px; border-radius: 8px;
  font: inherit; color: var(--text-2); cursor: pointer;
}
.nav-item i { font-style: normal; width: 16px; text-align: center; opacity: .8; }
.nav-item:hover { background: #f2f4f7; color: var(--text); }
.nav-item.active { background: #ecf3ff; color: var(--primary); font-weight: 600; }
.sidebar-foot { margin-top: auto; border-top: 1px solid var(--line); padding-top: 10px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 22px;
  background: rgba(255,255,255,.85);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar h2 { font-size: 16px; flex: 1; }
.pill {
  font-size: 12px; color: var(--text-2);
  border: 1px solid var(--line);
  background: #fafbfc;
  padding: 4px 10px; border-radius: 999px;
}
.mobile-only { display: none; }

.view { padding: 20px 22px 40px; }

/* ---------- 卡片 ---------- */
.cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.card .k { font-size: 12px; color: var(--text-2); }
.card .v { font-size: 24px; font-weight: 600; margin-top: 4px; letter-spacing: -.02em; }
.card .s { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px; border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 14px; }

/* ---------- 工具条 ---------- */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  margin-bottom: 12px;
}
.toolbar .input { min-width: 120px; }
.toolbar .grow { flex: 1; min-width: 200px; }
.bulkbar {
  display: flex; align-items: center; gap: 8px;
  background: #ecf3ff; border: 1px solid #cfe0fb;
  color: var(--primary);
  border-radius: 8px; padding: 8px 12px; margin-bottom: 10px;
  font-size: 13px;
}
.bulkbar span { margin-right: 4px; }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: auto;
}
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td {
  text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.grid th {
  font-weight: 500; color: var(--text-2); font-size: 12px;
  background: #fafbfc; position: sticky; top: 0; z-index: 1;
}
table.grid tbody tr:hover { background: #f8fafc; }
table.grid tbody tr.selected { background: #eef4ff; }
table.grid tbody tr { cursor: default; }
#msg-table tbody tr { cursor: pointer; }
.col-check { width: 36px; }
.col-size, .col-time { width: 1%; }
.col-act { width: 1%; }
.cell-mail { font-family: var(--mono); font-size: 12.5px; }
.cell-subject { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.truncate { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty { padding: 40px 16px; text-align: center; color: var(--text-3); }

.tag {
  display: inline-block; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; border: 1px solid var(--line-strong); color: var(--text-2);
  background: #fafbfc;
}
.badge { padding: 2px 8px; border-radius: 999px; font-size: 11px; }
.badge.on { background: #e6f6ef; color: var(--ok); }
.badge.off { background: #f0f2f5; color: var(--text-3); }
.clip {
  border: 0; background: transparent; color: var(--primary);
  cursor: pointer; font-size: 12px; padding: 0 4px;
}

/* ---------- 分页 ---------- */
.pager {
  display: flex; align-items: center; gap: 8px;
  justify-content: flex-end; padding: 12px 2px 0;
  font-size: 13px; color: var(--text-2);
}
.pager button {
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 7px; padding: 5px 10px; cursor: pointer; font: inherit;
}
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 弹窗 ---------- */
.modal-mask, .drawer-mask {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(16,24,40,.42);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  animation: fade .12s ease;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  width: 100%; max-width: 560px;
  background: var(--surface); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(16,24,40,.22);
  max-height: 90vh; display: flex; flex-direction: column;
}
.modal.narrow { max-width: 400px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 18px; overflow: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: 14px 18px; border-top: 1px solid var(--line);
}
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hint { font-size: 12px; color: var(--text-3); margin: 4px 0 0; }

/* ---------- 抽屉 ---------- */
.drawer-mask { justify-content: flex-end; padding: 0; }
.drawer {
  width: min(720px, 100%); height: 100%;
  background: var(--surface);
  display: flex; flex-direction: column;
  animation: slide .18s ease;
}
@keyframes slide { from { transform: translateX(24px); opacity: .6 } to { transform: none; opacity: 1 } }
.drawer-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.drawer-head h3 { font-size: 15px; line-height: 1.4; word-break: break-word; }
.drawer-actions {
  display: flex; gap: 8px; padding: 10px 20px;
  border-bottom: 1px solid var(--line); background: #fafbfc;
}
.drawer-body {
  flex: 1; overflow: auto; padding: 18px 20px;
  font-size: 14px; line-height: 1.65; word-break: break-word;
}
.drawer-body pre { white-space: pre-wrap; font: inherit; margin: 0; }
.drawer-body iframe { width: 100%; height: 100%; min-height: 480px; border: 0; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%);
  background: #1f242b; color: #fff; padding: 10px 18px;
  border-radius: 10px; font-size: 13px; z-index: 90;
  box-shadow: 0 8px 30px rgba(0,0,0,.24);
  animation: fade .15s ease;
}
.toast.err { background: #b3261e; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 30;
    transform: translateX(-100%);
    transition: transform .2s ease;
    box-shadow: var(--shadow);
  }
  .sidebar.open { transform: none; }
  .mobile-only { display: inline-block; }
  .view { padding: 14px; }
  .topbar { padding: 12px 14px; }
  .row { grid-template-columns: 1fr; }
  table.grid th, table.grid td { padding: 9px 10px; }
  .cell-subject { max-width: 180px; }
}

/* ================= v2 追加：多用户 / 标记 / 每页条数 ================= */

/* 角色可见性：非超管隐藏 .super-only */
body:not(.is-super) .super-only { display: none !important; }

.who {
  font-size: 12px;
  color: var(--text-2);
  padding: 0 10px 8px;
  line-height: 1.6;
  word-break: break-all;
}
.who b { color: var(--text); font-weight: 600; }
.who .role {
  display: inline-block; font-size: 10px; padding: 1px 6px;
  border-radius: 999px; background: #ecf3ff; color: var(--primary);
  margin-left: 4px; vertical-align: 1px;
}
.who .role.sub { background: #f0f2f5; color: var(--text-2); }

.nav-badge {
  margin-left: auto;
  background: var(--danger); color: #fff;
  font-size: 11px; font-style: normal;
  min-width: 18px; height: 18px; line-height: 18px;
  border-radius: 9px; text-align: center; padding: 0 5px;
}

/* 移动端遮罩 */
.scrim {
  position: fixed; inset: 0; background: rgba(16,24,40,.38);
  z-index: 25; animation: fade .12s ease;
}

/* 备注快捷筛选 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.chips:empty { display: none; }
.chip {
  border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 999px; padding: 4px 10px; font-size: 12px;
  cursor: pointer; color: var(--text-2); font-family: inherit;
}
.chip:hover { background: #f2f4f7; color: var(--text); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .n { opacity: .65; margin-left: 4px; }

/* 表格：未读 / 星标 / 标记 */
.col-star { width: 30px; text-align: center; }
.star-btn {
  border: 0; background: transparent; cursor: pointer; font-size: 15px;
  color: #c9ced6; padding: 0; line-height: 1;
}
.star-btn.on { color: #e8a13a; }
#msg-table tr.unread td { font-weight: 600; }
#msg-table tr.unread .cell-from { color: var(--text); }
#msg-table tr.is-unread-flag { }
.dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); margin-right: 6px; vertical-align: 1px;
}
.flag-tag {
  display: inline-block; font-size: 11px; padding: 1px 8px;
  border-radius: 999px; background: #eef1f5; color: var(--text-2);
  border: 1px solid var(--line);
}
.flag-tag.f-重要 { background: #fdeeee; color: #c0392b; border-color: #f6d5d5; }
.flag-tag.f-待处理 { background: #fff4e5; color: #a86100; border-color: #f5e0c2; }
.flag-tag.f-已归档 { background: #eaf5ee; color: #1d7a4f; border-color: #cfe8d9; }
.flag-tag.f-垃圾 { background: #f0f0f2; color: #7b8290; border-color: #e1e3e8; }

/* 小尺寸控件 */
.input-sm { padding: 6px 8px; font-size: 12px; }
.narrow-panel { max-width: 560px; }
.panel-body { padding: 16px; }
.panel-body .field:last-of-type { margin-bottom: 16px; }
.preview {
  background: #fafbfc; border: 1px dashed var(--line-strong);
  border-radius: 8px; padding: 10px 12px; margin-bottom: 12px;
  max-height: 160px; overflow: auto; line-height: 1.7;
}
.preview .addr { font-family: var(--mono); font-size: 12px; color: var(--text-2); }

/* 表格里的超管列 */
#acc-table th.super-only, #acc-table td.super-only { }
body:not(.is-super) #acc-table th:nth-child(6),
body:not(.is-super) #acc-table td:nth-child(6) { display: none; }

/* 设置页系统信息 */
#sys-info { font-size: 13px; line-height: 2; }
#sys-info code { font-family: var(--mono); font-size: 12px; background: #f4f6f8; padding: 1px 6px; border-radius: 5px; }

@media (max-width: 900px) {
  .who { display: none; }
  .chips { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .narrow-panel { max-width: none; }
}

/* ============================================================
   v2.1
   ============================================================ */

/* ---------- 登录页：毛玻璃 ---------- */
#login-view {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 20px;
  overflow: hidden;
  background: linear-gradient(128deg, #f6c79a 0%, #e6ae8a 16%, #b9c4d6 46%, #4d6787 76%, #16243a 100%);
}
.login-bg { position: absolute; inset: -12%; filter: blur(64px); }
.blob { position: absolute; border-radius: 50%; }
.b1 { width: 54vw; height: 54vw; left: -10vw; bottom: -16vw; background: #f2a25c; opacity: .9; }
.b2 { width: 46vw; height: 46vw; right: -8vw; top: -12vw; background: #86a9d8; opacity: .85; }
.b3 { width: 34vw; height: 34vw; left: 34vw; top: 16vh; background: #cf9782; opacity: .45; }
.b4 { width: 28vw; height: 28vw; right: 8vw; bottom: 2vh; background: #2c4468; opacity: .55; }
.grain {
  position: absolute; inset: 0;
  background-image: radial-gradient(rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 3px 3px; opacity: .25; mix-blend-mode: overlay;
}
#login-view::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(ellipse at 50% 38%, rgba(0,0,0,0) 0%, rgba(0,0,0,.18) 62%, rgba(0,0,0,.38) 100%);
  pointer-events: none;
}
.login-inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 352px; text-align: center;
  animation: rise .5s cubic-bezier(.2,.7,.3,1);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) } to { opacity: 1; transform: none } }

.welcome {
  margin: 0 0 30px;
  font-size: 46px; font-weight: 300;
  letter-spacing: .055em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0,0,0,.28);
}

.login-form { margin: 0; }
.glass-input {
  display: flex; align-items: center; gap: 11px;
  height: 47px; padding: 0 13px; margin-bottom: 14px;
  background: rgba(255,255,255,.17);
  border: 1px solid rgba(255,255,255,.30);
  border-radius: 6px;
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  transition: background .18s, border-color .18s, box-shadow .18s;
}
.glass-input svg { width: 18px; height: 18px; fill: rgba(255,255,255,.78); flex: none; }
.glass-input input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; background: transparent; outline: none;
  color: #fff; font-size: 14.5px; letter-spacing: .02em;
  padding: 0;
}
.glass-input input::placeholder { color: rgba(255,255,255,.62); letter-spacing: .04em; }
.glass-input input:-webkit-autofill {
  -webkit-text-fill-color: #fff;
  transition: background-color 9999s ease-out;
}
.glass-input:focus-within {
  background: rgba(255,255,255,.26);
  border-color: rgba(255,255,255,.62);
  box-shadow: 0 0 0 3px rgba(255,255,255,.12);
}
.login-err {
  min-height: 18px; margin: 0 0 10px;
  font-size: 12.5px; color: #ffe1e1;
  text-shadow: 0 1px 4px rgba(0,0,0,.4);
}
.btn-glass-primary {
  width: 100%; height: 47px;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.40);
  background: rgba(255,255,255,.23);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  color: #fff; font-size: 15px; font-weight: 500; letter-spacing: .22em;
  cursor: pointer;
  transition: background .18s, transform .1s;
}
.btn-glass-primary:hover { background: rgba(255,255,255,.32); }
.btn-glass-primary:active { transform: translateY(1px); }
.btn-glass-primary:disabled { opacity: .6; cursor: not-allowed; }

.or-line {
  display: flex; align-items: center; gap: 12px;
  margin: 20px 0; color: rgba(255,255,255,.72); font-size: 13px;
}
.or-line::before, .or-line::after {
  content: ""; flex: 1; height: 1px; background: rgba(255,255,255,.26);
}
.login-alt { display: flex; gap: 10px; }
.alt-btn {
  flex: 1; height: 43px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 6px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.30);
  background: rgba(255,255,255,.15);
  -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px);
  color: #fff; font-size: 13px; font-family: inherit;
  transition: background .18s, border-color .18s;
}
.alt-btn svg { width: 17px; height: 17px; fill: currentColor; }
.alt-btn:hover { background: rgba(255,255,255,.24); }
.alt-btn.wechat { background: rgba(7,193,96,.86); border-color: rgba(255,255,255,.35); }
.alt-btn.wechat:hover { background: rgba(6,174,86,1); }
.alt-btn:disabled { opacity: .45; cursor: not-allowed; }
.login-foot { margin: 18px 0 0; font-size: 12px; color: rgba(255,255,255,.66); }

@media (max-width: 480px) {
  .welcome { font-size: 36px; margin-bottom: 24px; }
  .login-alt { flex-direction: column; }
}

/* ---------- 子账号页 tab ---------- */
.tabs { display: flex; gap: 3px; background: #eef1f5; padding: 3px; border-radius: 8px; }
.tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 6px 13px; border-radius: 6px;
  font: inherit; font-size: 13px; color: var(--text-2);
}
.tab.active { background: #fff; color: var(--text); font-weight: 500; box-shadow: 0 1px 3px rgba(16,24,40,.08); }
.tab .n { margin-left: 5px; color: var(--danger); font-weight: 600; }

.row-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 邮件详情：163 风格 ---------- */
.mail-drawer {
  width: min(920px, 100%);
  background: #fff;
  display: flex; flex-direction: column;
}
.mail-head {
  position: relative;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
}
.back-btn { position: absolute; right: 12px; top: 12px; }
#dr-subject {
  margin: 0; padding-right: 40px;
  font-size: 19px; font-weight: 600; line-height: 1.45;
  word-break: break-word;
}
.mail-sub { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.avatar {
  width: 42px; height: 42px; border-radius: 50%;
  display: grid; place-items: center; flex: none;
  color: #fff; font-weight: 600; font-size: 17px;
  background: #4b7bec; letter-spacing: 0;
  box-shadow: inset 0 -2px 6px rgba(0,0,0,.08);
}
.mail-sub-text { flex: 1; min-width: 0; }
.mail-from { font-size: 14px; }
.mail-from b { font-weight: 600; }
.mail-from-addr { color: var(--text-2); font-size: 12px; margin-left: 6px; font-family: var(--mono); }
.mail-to { font-size: 12px; color: var(--text-3); margin-top: 3px; }
.mail-time { font-size: 12px; color: var(--text-3); white-space: nowrap; align-self: flex-start; }

.mail-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 18px;
  border-bottom: 1px solid var(--line);
  background: #fafbfc;
}
.mail-btn {
  border: 1px solid var(--line-strong); background: #fff;
  border-radius: 6px; padding: 5px 10px;
  font: inherit; font-size: 12px; color: var(--text-2); cursor: pointer;
}
.mail-btn:hover { color: var(--text); background: #f4f6f8; }
.mail-btn.on { color: #d98b17; border-color: #f0d3a8; background: #fff8ec; }
.mail-flag {
  border: 1px solid var(--line-strong); background: #fff; border-radius: 6px;
  padding: 5px 8px; font: inherit; font-size: 12px; color: var(--text-2);
}

.mail-attach {
  display: flex; flex-wrap: wrap; gap: 10px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--line);
  background: #fcfcfd;
}
.att-card {
  display: flex; align-items: center; gap: 10px;
  max-width: 280px; min-width: 160px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: #fff; color: var(--text); text-decoration: none;
  transition: border-color .15s, box-shadow .15s;
}
.att-card:hover { border-color: #b9d2f5; box-shadow: 0 2px 10px rgba(22,105,226,.10); }
.att-ico {
  width: 34px; height: 34px; border-radius: 6px; flex: none;
  display: grid; place-items: center;
  color: #fff; font-size: 10px; font-weight: 700; letter-spacing: .02em;
}
.att-meta { min-width: 0; }
.att-name { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-size { font-size: 11px; color: var(--text-3); margin-top: 1px; }

.mail-body {
  flex: 1; overflow: auto;
  padding: 22px 24px;
  font-size: 14px; line-height: 1.78; color: var(--text);
  word-break: break-word;
}
.mail-body pre {
  white-space: pre-wrap; font: inherit; margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
.mail-body iframe { width: 100%; height: 100%; min-height: 460px; border: 0; display: block; }
.mail-body img { max-width: 100%; height: auto; }
.mail-size { align-self: center; }
