/* 安逸邮箱 · 白+蓝主题，适配电脑/手机/平板 */
:root {
  --brand: #1e6fd9;
  --brand-dark: #1558b0;
  --brand-light: #eaf3fd;
  --bg: #f5f8fc;
  --card: #ffffff;
  --text: #23324a;
  --muted: #7c8aa0;
  --line: #e3ebf5;
  --danger: #d9534f;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); min-height: 100vh;
  display: flex; flex-direction: column;
}

/* 顶栏 */
.topbar {
  background: linear-gradient(90deg, var(--brand-dark), var(--brand));
  color: #fff; padding: 0 20px; height: 56px;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
}
.brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 8px; }
.brand-logo {
  background: #fff; color: var(--brand-dark); width: 30px; height: 30px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 800;
}
.folder-tabs { display: flex; gap: 4px; flex: 1; }
.tab {
  color: rgba(255,255,255,.85); text-decoration: none; padding: 6px 14px; border-radius: 18px;
  font-size: 14px; transition: background .15s;
}
.tab:hover { background: rgba(255,255,255,.15); color: #fff; }
.tab.active { background: #fff; color: var(--brand-dark); font-weight: 600; }
.topbar-right { display: flex; gap: 8px; align-items: center; }

/* 布局 */
.container { max-width: 960px; width: 100%; margin: 20px auto; padding: 0 16px; flex: 1; }
.container.narrow { max-width: 640px; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 16px 0 24px; }

/* 按钮/表单 */
.btn {
  display: inline-block; border: 0; border-radius: 8px; padding: 9px 18px; font-size: 14px;
  cursor: pointer; text-decoration: none; line-height: 1.4;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: rgba(255,255,255,.18); color: #fff; }
main .btn-ghost, .compose-card .btn-ghost { background: var(--brand-light); color: var(--brand-dark); }
.btn-danger { background: #fdecec; color: var(--danger); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-block { width: 100%; }
label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
input[type=text], input[type=password], input[type=email], textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px;
  font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
}
input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(30,111,217,.12); }
button { font-family: inherit; }
form button.btn { margin-top: 18px; margin-right: 8px; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }

/* 列表 */
.mail-list { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.mail-item + .mail-item { border-top: 1px solid var(--line); }
.mail-item a { display: block; padding: 14px 18px; text-decoration: none; color: var(--text); transition: background .12s; }
.mail-item a:hover { background: var(--brand-light); }
.mail-top { display: flex; justify-content: space-between; gap: 12px; }
.mail-from { font-weight: 600; font-size: 14px; }
.mail-date { color: var(--muted); font-size: 12px; white-space: nowrap; }
.mail-subject { font-size: 14px; margin-top: 4px; display: flex; align-items: center; gap: 6px; }
.unread .mail-subject { font-weight: 700; color: var(--brand-dark); }
.dot { width: 8px; height: 8px; background: var(--brand); border-radius: 50%; display: inline-block; flex: none; }
.mail-preview { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* 空状态 */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty-icon { font-size: 44px; margin-bottom: 10px; }
.small { font-size: 13px; }
.muted { color: var(--muted); }

/* 阅读页 */
.view-subject { margin: 0 0 12px; font-size: 20px; }
.view-meta { background: var(--brand-light); border-radius: 10px; padding: 12px 16px; font-size: 13px; line-height: 2; }
.meta-label { color: var(--muted); margin-right: 8px; }
.view-actions { margin: 14px 0; display: flex; gap: 8px; }
.attach-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.attach {
  background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px;
  font-size: 13px; color: var(--brand-dark); text-decoration: none;
}
.attach:hover { border-color: var(--brand); }
.mail-body { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 14px; }
.body-frame { width: 100%; border: 0; min-height: 120px; }

/* 提示 */
.alert { background: #fdecec; color: var(--danger); border-radius: 8px; padding: 10px 14px; font-size: 13px; margin-bottom: 8px; }
.tip { margin-top: 14px; }

/* 登录页 */
.login-body { align-items: center; justify-content: center; background: linear-gradient(160deg, var(--brand-dark) 0%, var(--brand) 55%, #3f93ea 100%); }
.login-card {
  background: #fff; border-radius: 18px; padding: 34px 30px; width: 92%; max-width: 380px;
  box-shadow: 0 20px 50px rgba(10, 50, 110, .35); margin: 40px auto;
}
.login-brand { text-align: center; margin-bottom: 18px; }
.login-logo {
  width: 58px; height: 58px; margin: 0 auto 12px; background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; font-size: 26px; font-weight: 800; border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
}
.login-card h1 { margin: 0; font-size: 22px; color: var(--text); }
.login-sub { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.login-foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 18px; }

/* 手机适配 */
@media (max-width: 640px) {
  .topbar { padding: 0 12px; height: auto; padding-top: 10px; padding-bottom: 10px; }
  .folder-tabs { order: 3; width: 100%; justify-content: center; }
  .brand { font-size: 15px; }
  .container { margin-top: 14px; }
  .mail-item a { padding: 12px 14px; }
  .view-subject { font-size: 17px; }
  .btn { padding: 8px 14px; }
}
