/* 紫微星邮 Amail · 网页版样式（深空紫金品牌 + 清爽阅读区，自动深色模式） */
:root {
  --bg: #f6f4fb;
  --panel: #ffffff;
  --panel-2: #faf8ff;
  --line: #e7e2f3;
  --text: #1d1730;
  --muted: #6e6787;
  --faint: #a49dba;
  --brand: #5b2bd6;
  --brand-2: #7b4dff;
  --brand-soft: #efe8ff;
  --gold: #c99a2e;
  --gold-soft: #fff5d6;
  --danger: #d33a4a;
  --ok: #1f9d63;
  --unread: #1d1730;
  --hover: #f3effc;
  --sel: #e9e1ff;
  --shadow: 0 10px 30px rgba(45, 20, 110, .12);
  --radius: 14px;
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0817; --panel: #141027; --panel-2: #191431; --line: #2a2347; --text: #ece8ff; --muted: #a49cc7;
    --faint: #6f6794; --brand: #9b7bff; --brand-2: #b69cff; --brand-soft: #241b47; --gold: #e6bf3e; --gold-soft: #2c2410;
    --unread: #ffffff; --hover: #1d1738; --sel: #2a2052; --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b0817; --panel: #141027; --panel-2: #191431; --line: #2a2347; --text: #ece8ff; --muted: #a49cc7;
  --faint: #6f6794; --brand: #9b7bff; --brand-2: #b69cff; --brand-soft: #241b47; --gold: #e6bf3e; --gold-soft: #2c2410;
  --unread: #ffffff; --hover: #1d1738; --sel: #2a2052; --shadow: 0 10px 30px rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { background: var(--bg); color: var(--text); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.gold { color: var(--gold); }
.row { display: flex; align-items: center; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
kbd { font: 12px ui-monospace, Menlo, monospace; padding: 1px 5px; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; }

/* —— 按钮 —— */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--hover); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border-color: transparent; box-shadow: 0 6px 16px rgba(91, 43, 214, .28); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.gold { background: linear-gradient(135deg, #f0d574, #c99a2e); color: #2a1d00; border-color: transparent; }
.btn.danger { color: var(--danger); }
.btn.sm { height: 30px; padding: 0 10px; font-size: 13px; border-radius: 8px; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; color: var(--muted); font-size: 16px; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.on { color: var(--gold); }

.input, .select, textarea.input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); outline: none; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; }
.input:focus, .select:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--brand-soft); }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--brand-soft); color: var(--brand); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.badge.gold { background: var(--gold-soft); color: var(--gold); }
.badge.gray { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.badge.ok { background: rgba(31, 157, 99, .12); color: var(--ok); }
.badge.bad { background: rgba(211, 58, 74, .12); color: var(--danger); }
.pill-count { margin-left: auto; font-size: 12px; font-weight: 700; color: var(--brand); }

/* —— 布局 —— */
#app { display: grid; grid-template-columns: 248px minmax(320px, 440px) 1fr; height: 100vh; height: 100dvh; }
.side { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 10px; }
.brand img { width: 34px; height: 34px; }
.brand b { font-size: 16px; letter-spacing: .5px; }
.brand small { display: block; font-size: 11px; color: var(--gold); font-weight: 600; letter-spacing: 1px; }
.compose-btn { margin: 6px 14px 12px; height: 46px; border-radius: 14px; font-size: 15px; }
.nav { overflow-y: auto; padding: 0 8px 12px; flex: 1; }
.nav h6 { margin: 14px 10px 6px; font-size: 11px; letter-spacing: 1px; color: var(--faint); font-weight: 700; text-transform: uppercase; display: flex; align-items: center; }
.nav h6 button { margin-left: auto; color: var(--faint); font-size: 12px; }
.nav-item { display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 12px; border-radius: 10px; color: var(--text); text-align: left; }
.nav-item:hover { background: var(--hover); }
.nav-item.active { background: var(--sel); color: var(--brand); font-weight: 600; }
.nav-item .ico { width: 18px; text-align: center; opacity: .85; }
.nav-item .addr { font-size: 12.5px; }
.nav-item.unread .addr { font-weight: 700; }
.side-foot { border-top: 1px solid var(--line); padding: 10px 12px; display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; color: #fff; font-weight: 700; flex: none; font-size: 14px; background: linear-gradient(135deg, var(--brand), #c86bff); }
.plan-tag { font-size: 11px; font-weight: 800; letter-spacing: .5px; }

.list-pane { background: var(--panel); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.list-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--line); }
.search { position: relative; }
.search input { padding-left: 34px; height: 40px; border-radius: 12px; background: var(--panel-2); }
.search::before { content: "⌕"; position: absolute; left: 12px; top: 8px; font-size: 17px; color: var(--faint); }
.tabs { display: flex; gap: 4px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.tab { height: 30px; padding: 0 11px; border-radius: 999px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.tab.active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }
.toolbar { display: flex; align-items: center; gap: 2px; padding: 6px 8px; border-bottom: 1px solid var(--line); min-height: 46px; }
.toolbar .title { font-weight: 700; padding: 0 6px; }
.filter-chip { margin: 6px 12px 0; }
.list { overflow-y: auto; flex: 1; }
.item { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 10px; padding: 11px 14px 11px 10px; border-bottom: 1px solid var(--line); cursor: pointer; position: relative; }
.item:hover { background: var(--hover); }
.item.active { background: var(--sel); }
.item.unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.item .chk { grid-row: span 3; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-top: 1px; }
.item .chk input { width: 15px; height: 15px; accent-color: var(--brand); }
.item .star { font-size: 14px; color: var(--faint); line-height: 1; }
.item .star.on { color: var(--gold); }
.item .who { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.unread .who, .item.unread .subj { font-weight: 700; color: var(--unread); }
.item .time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.item.unread .time { color: var(--brand); font-weight: 600; }
.item .subj { grid-column: 2 / 4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item .snip { grid-column: 2 / 4; color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; gap: 6px; align-items: center; }
.item .snip .t { overflow: hidden; text-overflow: ellipsis; }
.empty { padding: 60px 24px; text-align: center; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 8px; }
.more { padding: 14px; text-align: center; }

.read-pane { display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--bg); }
.read-top { display: flex; align-items: center; gap: 2px; padding: 6px 12px; min-height: 46px; background: var(--panel); border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.read-top > * { flex: none; }
.read-body { overflow-y: auto; flex: 1; padding: 18px 22px 40px; }
.mail-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 1px 2px rgba(0, 0, 0, .03); margin-bottom: 14px; overflow: hidden; }
.mail-subject { font-size: 21px; font-weight: 700; margin: 2px 2px 14px; line-height: 1.35; word-break: break-word; }
.mail-head { display: flex; gap: 12px; padding: 16px 18px 10px; }
.mail-head .who b { font-size: 15px; }
.mail-head .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; overflow-wrap: anywhere; }
.mail-head .when { margin-left: auto; font-size: 12.5px; color: var(--muted); white-space: nowrap; text-align: right; }
.to-badges { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 18px 10px 64px; }
.img-bar { margin: 0 18px 10px; padding: 8px 12px; border-radius: 10px; background: var(--gold-soft); color: var(--text); font-size: 13px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.mail-frame { width: 100%; border: 0; display: block; min-height: 120px; background: #fff; }
.mail-text { padding: 4px 22px 18px; white-space: pre-wrap; word-break: break-word; }
.atts { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 18px 16px; border-top: 1px dashed var(--line); }
.att { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); max-width: 260px; color: var(--text); }
.att:hover { border-color: var(--brand-2); text-decoration: none; }
.att.off { opacity: .62; border-style: dashed; cursor: default; }
.att.off:hover { border-color: var(--line); }
.att .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.att .s { font-size: 11.5px; color: var(--muted); }
.ai-card { margin: 0 0 14px; padding: 14px 16px; border-radius: var(--radius); background: linear-gradient(135deg, var(--brand-soft), var(--gold-soft)); border: 1px solid var(--line); line-height: 1.75; }
.ai-card .h { font-weight: 700; margin-bottom: 6px; display: flex; gap: 8px; align-items: center; }
.thread-mini { display: flex; gap: 10px; align-items: center; padding: 12px 18px; cursor: pointer; }
/* —— 龍華樹 ASI 邮件管家 —— */
.pchip { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; margin-right: 5px; border-radius: 6px; font-size: 11px; font-weight: 700; vertical-align: 1px; }
.pchip.urgent { background: rgba(211, 58, 74, .14); color: var(--danger); }
.pchip.high { background: var(--gold-soft); color: var(--gold); }
.pchip.low { background: var(--panel-2); color: var(--faint); border: 1px solid var(--line); font-weight: 600; }
.badge.code { cursor: pointer; border: 0; background: rgba(31, 157, 99, .13); color: var(--ok); font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; flex: none; }
.badge.code:hover { background: rgba(31, 157, 99, .22); }
.item .snip .t.ai { color: var(--text); opacity: .82; }
.ai-card.butler .sum { font-weight: 500; }
.ai-card.butler ul.acts { margin: 6px 0 0; padding-left: 20px; }
.ai-card.butler .facts { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 6px; font-size: 13px; color: var(--gold); font-weight: 600; }
.otp { font: 700 22px/1.3 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: 3px; }
.butler-set { margin-top: 4px; }
.set-row { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-bottom: 1px solid var(--line); cursor: default; }
label.set-row { cursor: pointer; }
.set-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--brand); flex: none; }
.set-row .muted { font-size: 12.5px; }
.thread-mini:hover { background: var(--hover); }
.quick-reply { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.locked-card { text-align: center; padding: 34px 20px; }
.locked-card .big { font-size: 42px; }
.welcome { max-width: 560px; margin: 8vh auto; text-align: center; }
.welcome img { width: 72px; height: 72px; }
.welcome h2 { margin: 12px 0 4px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; }
.stat { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.stat b { font-size: 20px; display: block; }

/* —— 写信 —— */
.compose { position: fixed; right: 24px; bottom: 0; width: min(720px, calc(100vw - 32px)); height: min(680px, calc(100vh - 40px)); background: var(--panel); border: 1px solid var(--line); border-bottom: 0; border-radius: 16px 16px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column; z-index: 40; }
.compose.min { height: 48px; overflow: hidden; }
.compose.max { right: 5vw; width: 90vw; height: calc(100vh - 40px); }
.compose-head { display: flex; align-items: center; gap: 4px; padding: 0 8px 0 16px; height: 48px; border-bottom: 1px solid var(--line); background: var(--panel-2); border-radius: 16px 16px 0 0; cursor: default; }
.compose-head b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cfield { display: flex; align-items: center; gap: 8px; padding: 0 16px; border-bottom: 1px solid var(--line); min-height: 42px; position: relative; }
.cfield label { width: 52px; color: var(--muted); font-size: 13px; flex: none; }
.cfield input, .cfield select { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; height: 40px; }
.cfield .links { display: flex; gap: 8px; font-size: 13px; }
.suggest { position: absolute; left: 76px; right: 16px; top: 40px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); z-index: 5; max-height: 240px; overflow-y: auto; }
.suggest div { padding: 8px 12px; cursor: pointer; }
.suggest div:hover, .suggest div.on { background: var(--hover); }
.etool { display: flex; gap: 2px; padding: 4px 10px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.etool button { min-width: 30px; height: 30px; border-radius: 7px; color: var(--muted); font-size: 13px; padding: 0 6px; }
.etool button:hover { background: var(--hover); color: var(--text); }
.editor { flex: 1; overflow-y: auto; padding: 14px 18px; outline: none; line-height: 1.7; }
.editor blockquote { margin: 8px 0; padding-left: 12px; border-left: 3px solid var(--line); color: var(--muted); }
.editor:empty::before { content: attr(data-ph); color: var(--faint); }
.catts { display: flex; flex-wrap: wrap; gap: 6px; padding: 6px 16px; }
.catt { display: inline-flex; gap: 6px; align-items: center; padding: 4px 8px 4px 10px; border-radius: 8px; background: var(--panel-2); border: 1px solid var(--line); font-size: 12.5px; }
.compose-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); }
.drop-hint { position: absolute; inset: 48px 0 0; background: rgba(91, 43, 214, .08); border: 2px dashed var(--brand-2); display: grid; place-items: center; font-weight: 700; color: var(--brand); z-index: 6; border-radius: 0 0 0 0; }

/* —— 定时发送 / 稍后处理 —— */
.tmenu { position: fixed; z-index: 80; width: 310px; max-width: calc(100vw - 16px); background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; }
.tm-h { font-weight: 700; font-size: 13px; padding: 8px 10px 6px; }
.tm-i { display: flex; justify-content: space-between; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 9px; text-align: left; font-size: 13.5px; }
.tm-i:hover { background: var(--hover); }
.tm-i .muted { font-size: 12.5px; white-space: nowrap; }
.tm-custom { display: flex; gap: 6px; padding: 4px 6px 8px; }
.tm-custom .input { height: 34px; padding: 0 8px; font-size: 13px; }
.tm-tz { font-size: 11.5px; color: var(--faint); padding: 6px 10px 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.item .hacts { position: absolute; right: 8px; top: 6px; display: none; gap: 2px; padding: 1px; border-radius: 9px; background: var(--hover); }
.item.active .hacts { background: var(--sel); }
.item:hover .hacts { display: flex; }
.item:hover:has(.hacts) .time { visibility: hidden; }
.item .snip .keep { flex: none; }
.toast button { flex: none; white-space: nowrap; }
.item .hacts .icon-btn { width: 30px; height: 30px; font-size: 14px; }
@media (hover: none) { .item:hover .hacts { display: none; } }
.sched-ico { font-size: 14px; line-height: 1; }
.item .sched-time { color: var(--gold); font-weight: 600; }
.pill-count.bad { color: var(--danger); }
.notice.bad { background: rgba(211, 58, 74, .1); color: var(--danger); }

/* —— 弹层 / 设置 —— */
.modal-bg { position: fixed; inset: 0; background: rgba(10, 6, 25, .45); z-index: 60; display: grid; place-items: center; padding: 16px; backdrop-filter: blur(2px); }
.modal { background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); width: min(980px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; overflow: hidden; }
.modal.sm { width: min(460px, 100%); }
.modal-head { display: flex; align-items: center; padding: 14px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 16px; flex: 1; }
.modal-body { overflow-y: auto; padding: 18px 20px 22px; }
.set-wrap { display: grid; grid-template-columns: 190px 1fr; min-height: 520px; }
.set-nav { border-right: 1px solid var(--line); padding: 10px 8px; }
.set-main { padding: 18px 22px 26px; overflow-y: auto; max-height: calc(100vh - 110px); }
.set-main h3 { margin: 0 0 4px; font-size: 18px; }
.set-main h4 { margin: 22px 0 8px; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 14px; }
.plan-card { border: 1px solid var(--line); border-radius: 16px; padding: 18px; background: var(--panel-2); position: relative; }
.plan-card.vip { border-color: #c8b3ff; }
.plan-card.svip { border-color: #e6bf3e; background: linear-gradient(160deg, var(--panel-2), var(--gold-soft)); }
.plan-card .name { font-weight: 800; font-size: 16px; }
.plan-card .price { font-size: 28px; font-weight: 800; margin: 8px 0 2px; }
.plan-card .price small { font-size: 13px; font-weight: 500; color: var(--muted); }
.plan-card ul { padding-left: 18px; margin: 10px 0 14px; color: var(--muted); }
.plan-card li { margin: 3px 0; }
.plan-card .ribbon { position: absolute; top: 12px; right: 12px; }
.months { display: flex; gap: 6px; margin-bottom: 10px; }
.months button { flex: 1; min-height: 34px; height: auto; padding: 4px 2px; line-height: 1.3; border: 1px solid var(--line); border-radius: 9px; font-size: 12.5px; background: var(--panel); }
.months button.on { border-color: var(--brand); color: var(--brand); font-weight: 700; background: var(--brand-soft); }
table.dns { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dns th, table.dns td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.dns td.v { word-break: break-all; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }
.copy { color: var(--brand); font-size: 12px; white-space: nowrap; }
.kv { display: grid; grid-template-columns: 140px 1fr; gap: 6px 12px; font-size: 13.5px; }
.notice { padding: 12px 14px; border-radius: 12px; background: var(--brand-soft); font-size: 13.5px; margin: 10px 0; }
.notice.gold { background: var(--gold-soft); }
.steps { margin: 6px 0 0; padding-left: 20px; }
.steps li { margin: 4px 0; }
/* 合并向导 */
.wiz { padding: 14px 16px; }
.wiz-step { display: flex; align-items: center; gap: 8px; margin: 16px 0 8px; font-size: 14px; flex-wrap: wrap; }
.wiz-step:first-child { margin-top: 0; }
.wiz-n { width: 22px; height: 22px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: inline-grid; place-items: center; font-size: 12px; font-weight: 700; flex: none; }
.wiz-for { font-weight: 700; font-size: 13px; margin-bottom: 2px; }
.wiz .steps { font-size: 13px; }
.wiz .steps a { text-decoration: underline; }
.prov-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.prov { height: 32px; padding: 0 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-size: 13px; }
.prov:hover { background: var(--hover); }
.prov.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.tgl { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; user-select: none; }
.tgl input { width: 16px; height: 16px; margin: 0; accent-color: var(--brand); }
.prog { height: 6px; max-width: 360px; margin-top: 8px; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.prog i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }
pre.code { background: #120d24; color: #e8e2ff; padding: 12px 14px; border-radius: 10px; overflow-x: auto; font-size: 12.5px; }

/* —— 登录 —— */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(1200px 600px at 20% -10%, #3a1d8f 0%, transparent 60%), radial-gradient(900px 500px at 100% 110%, #6b4a10 0%, transparent 55%), #070512; overflow-y: auto; }
.auth-card { width: min(420px, 100%); background: rgba(20, 16, 39, .92); color: #ece8ff; border: 1px solid #2f2756; border-radius: 22px; padding: 28px 26px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45); }
.auth-card h1 { margin: 10px 0 2px; font-size: 22px; }
.auth-card .sub { color: #a49cc7; margin-bottom: 18px; font-size: 13.5px; }
.auth-card .input { background: #0f0b20; border-color: #2f2756; color: #ece8ff; height: 44px; }
.auth-card .btn { width: 100%; height: 44px; margin-top: 10px; }
.auth-card .btn:not(.primary) { background: #1b1535; border-color: #2f2756; color: #ece8ff; }
.auth-card .err { color: #ff8a95; font-size: 13px; min-height: 20px; margin-top: 8px; }
.auth-card .links { display: flex; justify-content: space-between; margin-top: 14px; font-size: 13px; }
.auth-card .links a { color: #c8b3ff; }

/* —— 提示 —— */
#toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 90; align-items: center; pointer-events: none; }
.toast { background: #1d1730; color: #fff; padding: 10px 16px; border-radius: 12px; box-shadow: var(--shadow); display: flex; gap: 14px; align-items: center; pointer-events: auto; font-size: 13.5px; max-width: 90vw; }
.toast button { color: #c8b3ff; font-weight: 700; }
.toast.err { background: #5a1520; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; display: grid; place-items: center; }

/* —— 手机 —— */
.mobile-only { display: none; }
@media (max-width: 1100px) {
  #app { grid-template-columns: 220px minmax(300px, 380px) 1fr; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  #app { display: block; height: auto; }
  .side { position: fixed; inset: 0 auto 0 0; width: 280px; z-index: 50; transform: translateX(-100%); transition: transform .2s; box-shadow: var(--shadow); }
  body.nav-open .side { transform: none; }
  body.nav-open::after { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .35); z-index: 45; }
  .list-pane { min-height: 100dvh; border-right: 0; }
  .read-pane { position: fixed; inset: 0; z-index: 30; transform: translateX(100%); transition: transform .2s; }
  body.reading .read-pane { transform: none; }
  .mobile-only { display: inline-grid; }
  .read-body { padding: 12px 10px 90px; }
  .mail-subject { font-size: 19px; }
  .to-badges { padding-left: 18px; }
  .compose, .compose.max { inset: 0; width: auto; height: auto; border-radius: 0; right: 0; }
  .compose-head { border-radius: 0; }
  .fab { position: fixed; right: 18px; bottom: 22px; width: 56px; height: 56px; border-radius: 18px; z-index: 20; font-size: 22px; display: grid !important; }
  .set-wrap { grid-template-columns: 1fr; }
  .set-nav { border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; }
  .set-nav .nav-item { width: auto; white-space: nowrap; }
  .set-main { max-height: none; }
  .kv { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
.fab { display: none; }
@media print {
  .side, .list-pane, .read-top, .compose, #toasts { display: none !important; }
  #app { display: block; }
  .read-body { overflow: visible; }
}
