/* Kllo Mail —— 手写样式，无任何外部依赖（没有字体 CDN、没有图标库） */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  font: 14px/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;
  color: #23303c;
  background: #f4f6f8;
  -webkit-text-size-adjust: 100%;
}

a { color: #1f6feb; text-decoration: none; }
a:hover { text-decoration: underline; }

code {
  font-family: Consolas, Monaco, "Courier New", monospace;
  font-size: 12px;
  background: #eef1f4;
  padding: 1px 5px;
  border-radius: 3px;
  word-break: break-all;
}

/* ---------- 顶栏 ---------- */
.topbar {
  background: #23303c;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  height: 52px;
  flex-wrap: wrap;
}
.topbar .brand {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .3px;
}
.topbar .nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  flex-wrap: wrap;
}
.topbar .nav a {
  color: #c7d2dc;
  padding: 6px 10px;
  border-radius: 4px;
}
.topbar .nav a:hover { background: #33424f; color: #fff; text-decoration: none; }
.topbar .nav a.on { background: #1f6feb; color: #fff; }
.topbar .nav .who {
  margin-left: auto;
  color: #8fa3b5;
  font-size: 13px;
  max-width: 45vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topbar .nav .out { color: #f08a8a; }

/* ---------- 布局 ---------- */
.wrap {
  max-width: 1080px;
  margin: 20px auto 60px;
  padding: 0 16px;
}
.page-title {
  font-size: 18px;
  margin: 0 0 16px;
  font-weight: 600;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-block;
  padding: 7px 14px;
  border: 1px solid #ccd4dc;
  border-radius: 5px;
  background: #fff;
  color: #23303c;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.4;
  font-family: inherit;
}
.btn:hover { background: #f0f3f6; text-decoration: none; }
.btn.primary {
  background: #1f6feb;
  border-color: #1f6feb;
  color: #fff;
}
.btn.primary:hover { background: #1a5fcc; }
.btn.danger { color: #c0392b; border-color: #e6b8b3; }
.btn.danger:hover { background: #fdf1f0; }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.wide { width: 100%; padding: 10px; margin-top: 6px; }

/* ---------- 表单 ---------- */
label {
  display: block;
  font-size: 13px;
  color: #52616f;
  margin: 14px 0 5px;
}
input[type=text], input[type=password], input[type=number], input[type=email], textarea, select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccd4dc;
  border-radius: 5px;
  font: inherit;
  color: #23303c;
  background: #fff;
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: #1f6feb;
  box-shadow: 0 0 0 3px rgba(31, 111, 235, .12);
}
input:disabled { background: #eef1f4; color: #6b7b8a; }
textarea { resize: vertical; min-height: 200px; }

.compose-form {
  background: #fff;
  border: 1px solid #e2e7ec;
  border-radius: 8px;
  padding: 8px 20px 20px;
  max-width: 780px;
}
.form-actions { margin-top: 20px; display: flex; gap: 10px; align-items: center; }

/* 一排字段的表单（后台加号） */
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.inline-form .field { flex: 1 1 150px; }
.inline-form .field label { margin-top: 0; }
.suffix-input { display: flex; align-items: center; gap: 6px; }
.suffix-input input { flex: 1; }
.suffix-input span { color: #6b7b8a; font-size: 13px; white-space: nowrap; }

.mini-form {
  display: flex;
  gap: 6px;
  margin: 6px 0;
  align-items: center;
}
.mini-form input { flex: 1; padding: 5px 8px; font-size: 13px; }
form.inline { display: inline; }

/* ---------- 提示条 ---------- */
.flash {
  padding: 10px 14px;
  border-radius: 6px;
  margin: 0 0 16px;
  font-size: 13px;
  border: 1px solid transparent;
}
.flash.ok   { background: #e9f7ef; border-color: #c3e7d1; color: #1e7a45; }
.flash.bad  { background: #fdecea; border-color: #f5c6c1; color: #b3261e; }
.flash.info { background: #eaf2fd; border-color: #c6dbf7; color: #1a5fcc; }

.hint {
  background: #fffdf3;
  border: 1px solid #f0e4bd;
  color: #6b5a20;
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.9;
  margin: 16px 0;
}
.hint code { background: #f6efd8; }

.card {
  background: #fff;
  border: 1px solid #e2e7ec;
  border-radius: 8px;
  padding: 8px 18px 18px;
  margin-bottom: 20px;
}
.card-title { font-size: 15px; margin: 12px 0 4px; font-weight: 600; }

/* ---------- 信箱切换 ---------- */
.folderbar {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.folderbar a {
  padding: 5px 11px;
  border-radius: 20px;
  color: #52616f;
  background: #e9edf1;
  font-size: 13px;
}
.folderbar a:hover { background: #dde3e9; text-decoration: none; }
.folderbar a.on { background: #23303c; color: #fff; }
.folderbar .spacer { flex: 1; }
.folderbar a:last-child { background: transparent; color: #1f6feb; }

/* ---------- 邮件列表 ---------- */
table.mail-list {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #e2e7ec;
  border-radius: 8px;
  overflow: hidden;
}
table.mail-list th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: #6b7b8a;
  padding: 9px 12px;
  background: #f7f9fb;
  border-bottom: 1px solid #e2e7ec;
  white-space: nowrap;
}
table.mail-list td {
  padding: 10px 12px;
  border-bottom: 1px solid #eef1f4;
  vertical-align: top;
}
table.mail-list tr:last-child td { border-bottom: 0; }
table.mail-list tr:hover td { background: #fafcfe; }
table.mail-list td.empty { text-align: center; color: #8fa3b5; padding: 40px 12px; }

table.mail-list tr.unread td.from,
table.mail-list tr.unread td.subj a {
  font-weight: 700;
  color: #16202a;
}
table.mail-list tr.unread { background: #fcfdff; }

td.c1 { width: 22px; padding-right: 0; }
td.c1 .dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: transparent;
}
tr.unread td.c1 .dot { background: #1f6feb; }

td.from { width: 170px; }
td.from a, td.from { overflow: hidden; text-overflow: ellipsis; }
td.subj { word-break: break-word; }
td.c2 { width: 130px; color: #6b7b8a; font-size: 12px; white-space: nowrap; }
td.c3 { width: 70px; color: #8fa3b5; font-size: 12px; white-space: nowrap; text-align: right; }

.admin-list td.ops { width: 300px; }
.admin-list details { margin-bottom: 4px; }
.admin-list summary {
  cursor: pointer;
  font-size: 12px;
  color: #1f6feb;
  margin-bottom: 2px;
}
.tag {
  display: inline-block;
  font-size: 11px;
  padding: 1px 7px;
  border-radius: 10px;
}
.tag.on  { background: #e9f7ef; color: #1e7a45; }
.tag.off { background: #f1f3f5; color: #8fa3b5; }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: flex-end;
  padding: 14px 4px;
  color: #6b7b8a;
  font-size: 13px;
}

/* ---------- 读信 ---------- */
.toolbar {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.mail-view {
  background: #fff;
  border: 1px solid #e2e7ec;
  border-radius: 8px;
  padding: 20px;
}
.mail-view h1.subject {
  font-size: 18px;
  margin: 0 0 14px;
  line-height: 1.45;
  word-break: break-word;
}
.mail-view .meta {
  font-size: 13px;
  color: #52616f;
  border-bottom: 1px solid #eef1f4;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.mail-view .meta div { margin: 2px 0; word-break: break-word; }
.mail-body-frame {
  width: 100%;
  height: 400px;
  border: 0;
  background: #fff;
  display: block;
}
.mail-body-text {
  white-space: normal;
  word-break: break-word;
  line-height: 1.75;
}

.attachments {
  background: #f7f9fb;
  border: 1px solid #e2e7ec;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 18px;
}
.attachments .att-title { font-size: 12px; color: #6b7b8a; margin-bottom: 6px; }
.attachments ul { margin: 0; padding-left: 18px; }
.attachments li { margin: 3px 0; word-break: break-all; }
.attachments .size { color: #8fa3b5; font-size: 12px; margin-left: 6px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #23303c;
}
.login-card {
  background: #fff;
  border-radius: 10px;
  padding: 28px 26px 22px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.login-brand { font-size: 20px; font-weight: 600; }
.login-sub { font-size: 13px; color: #8fa3b5; margin: 4px 0 18px; }
.login-note {
  margin-top: 18px;
  font-size: 12px;
  color: #8fa3b5;
  text-align: center;
  line-height: 1.7;
}

/* 页面底部的浮动提示 */
body > .flash {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  margin: 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, .15);
  background: #23303c;
  color: #fff;
  border-color: #23303c;
  z-index: 99;
  max-width: 90vw;
}

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  .topbar { height: auto; padding: 8px 12px; gap: 8px; }
  .topbar .nav .who { max-width: 100%; order: 9; flex-basis: 100%; margin-left: 0; }
  .wrap { margin: 14px auto 80px; padding: 0 10px; }

  table.mail-list th:nth-child(5),
  table.mail-list td.c3 { display: none; }

  td.from { width: auto; max-width: 34vw; }
  td.c2 { width: 78px; font-size: 11px; }

  .admin-list th:nth-child(2),
  .admin-list th:nth-child(5),
  .admin-list td:nth-child(2),
  .admin-list td:nth-child(5) { display: none; }
  .admin-list td.ops { width: auto; }

  .mail-view { padding: 14px; }
  .compose-form { padding: 4px 14px 16px; }
  .pager { justify-content: center; }
  body > .flash { bottom: 12px; }
}
