/* XP TempMail — Linear dual theme */
:root, [data-theme="dark"] {
  --bg: #08090a;
  --panel: #0f1011;
  --surface: #191a1b;
  --surface-2: #28282c;
  --ink: #f7f8f8;
  --ink-2: #d0d6e0;
  --ink-3: #8a8f98;
  --ink-4: #62666d;
  --brand: #5e6ad2;
  --brand-2: #7170ff;
  --brand-3: #828fff;
  --brand-soft: rgba(113, 112, 255, 0.10);
  --brand-soft-2: rgba(113, 112, 255, 0.06);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.08);
  --line: rgba(255, 255, 255, 0.08);
  --line-2: rgba(255, 255, 255, 0.05);
  --line-strong: rgba(255, 255, 255, 0.14);
  --btn-bg: rgba(255, 255, 255, 0.02);
  --hover: rgba(255, 255, 255, 0.04);
  --nav-bg: rgba(8, 9, 10, 0.85);
  --shadow: rgba(0, 0, 0, 0.4) 0px 8px 24px;
  --hero-grad: linear-gradient(120deg, #f7f8f8 20%, #b9bdf0 75%, #828fff);
  --unread-dot: #5e6ad2;
}
[data-theme="light"] {
  --bg: #f7f8f8;
  --panel: #ffffff;
  --surface: #ffffff;
  --surface-2: #ffffff;
  --ink: #1a1b1f;
  --ink-2: #45474f;
  --ink-3: #71757e;
  --ink-4: #a6aab2;
  --brand: #5e6ad2;
  --brand-2: #5e6ad2;
  --brand-3: #4f59c4;
  --brand-soft: rgba(94, 106, 210, 0.09);
  --brand-soft-2: rgba(94, 106, 210, 0.05);
  --green: #10b981;
  --green-soft: rgba(16, 185, 129, 0.09);
  --line: rgba(0, 0, 0, 0.10);
  --line-2: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.16);
  --btn-bg: rgba(0, 0, 0, 0.02);
  --hover: rgba(0, 0, 0, 0.04);
  --nav-bg: rgba(247, 248, 248, 0.85);
  --shadow: rgba(0, 0, 0, 0.10) 0px 8px 24px;
  --hero-grad: linear-gradient(120deg, #1a1b1f 20%, #5e6ad2 75%, #7170ff);
  --unread-dot: #5e6ad2;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv01", "ss03";
  transition: background .25s, color .25s;
}
a { color: var(--brand-2); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: var(--nav-bg); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line-2); }
.nav-inner { max-width: 1120px; margin: 0 auto; padding: 13px 24px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 9px; color: var(--ink); }
.logo-mark { width: 26px; height: 26px; border-radius: 7px; background: linear-gradient(135deg, var(--brand), #7170ff); color: #fff; font-weight: 600; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.logo-text { font-size: 15px; font-weight: 500; letter-spacing: -0.2px; }
.logo-text b { font-weight: 600; }
.logo-text.sm { font-size: 13px; }
.nav-right { display: flex; align-items: center; gap: 8px; }
.icon-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--btn-bg); color: var(--ink-2); font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 999px; transition: all .15s; }
.icon-btn:hover { border-color: var(--line); color: var(--ink); }
.lang-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); background: var(--btn-bg); color: var(--ink-2); font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 999px; transition: all .15s; }
.lang-btn:hover { border-color: var(--line); color: var(--ink); }

.wrap { max-width: 1120px; margin: 0 auto; padding: 26px 24px 40px; }

/* 地址卡片 */
.tm-addr-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 16px; }
.tm-addr-display { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tm-addr-text { font-size: 19px; font-weight: 500; letter-spacing: .2px; color: var(--ink); word-break: break-all; }
.tm-addr-meta { margin-top: 8px; font-size: 12px; color: var(--ink-4); min-height: 16px; display: flex; align-items: center; gap: 14px; }
.tm-live { display: inline-flex; align-items: center; gap: 6px; color: var(--green); font-weight: 500; }
.tm-live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); animation: tmPulse 2s infinite; }
@keyframes tmPulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.tm-ttl { font-variant-numeric: tabular-nums; }
.tm-addr-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }

/* 按钮 */
.btn { display: inline-flex; align-items: center; gap: 8px; border-radius: 6px; font-size: 13px; font-weight: 500; padding: 9px 15px; border: none; transition: all .15s; height: 38px; }
.btn-copyall { background: var(--brand); color: #fff; }
.btn-copyall:hover { background: var(--brand-3); }
.btn-map { background: var(--btn-bg); border: 1px solid var(--line); color: var(--ink-2); }
.btn-map:hover { border-color: var(--brand-2); color: var(--ink); background: var(--brand-soft-2); }

/* 下拉 */
.dd { position: relative; }
.dd-btn { display: flex; align-items: center; gap: 10px; background: var(--btn-bg); border: 1px solid var(--line); border-radius: 6px; padding: 0 13px; font-size: 13px; font-weight: 500; color: var(--ink); text-align: left; transition: border-color .15s, background .15s; height: 38px; }
.dd-btn:hover { background: var(--hover); border-color: var(--line-strong); }
.dd.open .dd-btn { border-color: var(--brand-2); background: var(--brand-soft-2); }
.dd-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dd-caret { width: 9px; height: 9px; flex: 0 0 9px; color: var(--ink-4); transition: transform .15s; }
.dd.open .dd-caret { transform: rotate(180deg); }
.dd-menu { position: absolute; top: calc(100% + 6px); left: 0; right: 0; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow-y: auto; z-index: 40; display: none; padding: 5px; box-shadow: var(--shadow); }
.dd.open .dd-menu { display: block; }
.dd-opt { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 6px; font-size: 13px; color: var(--ink-2); cursor: pointer; white-space: nowrap; }
.dd-opt:hover { background: var(--hover); color: var(--ink); }
.dd-opt.sel { background: var(--brand-soft); color: var(--ink); font-weight: 500; }

/* 收件箱 */
.tm-inbox { display: grid; grid-template-columns: 340px 1fr; gap: 14px; align-items: start; }
.tm-list-pane, .tm-read-pane { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.tm-pane-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line-2); font-size: 13px; font-weight: 600; color: var(--ink-2); }
.tm-list { max-height: 560px; overflow-y: auto; }
.tm-list-tip { padding: 10px 16px; border-top: 1px solid var(--line-2); font-size: 11px; color: var(--ink-4); line-height: 1.5; }
.tm-empty { padding: 40px 20px; text-align: center; color: var(--ink-4); font-size: 13px; }
.tm-item { padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.tm-item:hover { background: var(--hover); }
.tm-item.unread .tm-item-from { color: var(--ink); font-weight: 600; }
.tm-item.unread .tm-item-subj { color: var(--ink-2); font-weight: 500; }
.tm-item.unread { position: relative; }
.tm-item.unread::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--unread-dot); }
.tm-item-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tm-item-from { font-size: 13px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-item-time { font-size: 11px; color: var(--ink-4); flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.tm-item-subj { font-size: 12.5px; color: var(--ink-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-att-tag { font-size: 11px; }

/* 阅读面板 */
.tm-read-pane { min-height: 560px; display: flex; flex-direction: column; }
.tm-read-subject { font-size: 15px; font-weight: 600; color: var(--ink); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tm-read-meta { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.tm-read-actions { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); }
.tm-read-body { flex: 1; overflow: auto; min-height: 300px; }
.tm-frame { width: 100%; height: 480px; border: none; background: #fff; }
.tm-text { padding: 16px; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; color: var(--ink-2); font-family: inherit; }
.tm-atts { border-top: 1px solid var(--line-2); padding: 12px 16px; }
.tm-att-head { font-size: 11px; font-weight: 600; color: var(--ink-4); text-transform: uppercase; letter-spacing: .6px; margin-bottom: 8px; }
.tm-att-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 8px; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; transition: all .12s; }
.tm-att-item:hover { border-color: var(--brand-2); color: var(--ink); background: var(--brand-soft-2); }
.tm-att-size { font-size: 11px; color: var(--ink-4); }

/* footer */
.footer { margin-top: 30px; border-top: 1px solid var(--line-2); }
.footer-inner { max-width: 1120px; margin: 0 auto; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.footer-note { font-size: 12px; color: var(--ink-4); }
.footer-attr { font-size: 11px; color: var(--ink-4); }

/* toast */
.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%) translateY(20px); background: var(--surface-2); color: var(--ink); font-size: 13px; font-weight: 500; padding: 10px 20px; border-radius: 8px; opacity: 0; pointer-events: none; transition: all .25s; z-index: 100; border: 1px solid var(--line); box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 滚动条 */
.tm-list::-webkit-scrollbar { width: 8px; }
.tm-list::-webkit-scrollbar-thumb { background: var(--hover); border-radius: 4px; }

@media (max-width: 760px) {
  .tm-inbox { grid-template-columns: 1fr; }
  .tm-read-pane { min-height: 400px; }
  .tm-frame { height: 360px; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}
