/* Bero Mail 管理后台 · 天下式庠风格 */
:root {
  --paper: #faf7f0;
  --card: #ffffff;
  --ink: #2b3a42;
  --ink-soft: #5c6b76;
  --line: #e6ddcf;
  --cinnabar: #b5342c;
  --cinnabar-dark: #8f2822;
  --gold: #c9a86a;
  --paper-deep: #f1e9d8;
  --ok: #2e7d4f;
  --warn: #b07d1e;
  --danger: #b5342c;
  --radius: 12px;
}
* { box-sizing: border-box; }
body {
  font: 16px/1.6 -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans TC", system-ui, sans-serif;
  margin: 0; background: var(--paper); color: var(--ink);
  -webkit-text-size-adjust: 100%;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px 48px; }

/* 顶栏 */
.site-header { background: var(--card); border-bottom: 3px double var(--cinnabar); }
.header-inner {
  max-width: 1080px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand img { width: 48px; height: 48px; border-radius: 50%; }
.brand-name { font-size: 20px; font-weight: 700; letter-spacing: 2px; }
.brand-sub { font-size: 12px; color: var(--ink-soft); letter-spacing: 1px; }
.header-spacer { flex: 1; }
.lang-form { display: flex; align-items: center; gap: 8px; margin: 0; }
.lang-form select { padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font: inherit; }
.webmail-link { color: var(--cinnabar); text-decoration: none; font-size: 14px; white-space: nowrap; }
.webmail-link:hover { text-decoration: underline; }

/* 卡片 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; margin: 18px 0; box-shadow: 0 1px 3px rgba(43,58,66,.06);
}
.card h2 { margin: 0 0 12px; font-size: 19px; letter-spacing: 1px; }
.card h2 .sec-icon { width: 26px; height: 26px; vertical-align: -5px; margin-right: 8px; }
.card h3 { margin: 20px 0 8px; font-size: 16px; }
.divider {
  height: 22px; margin: 6px auto 14px; max-width: 420px; opacity: .9;
  background: url("cloud.svg") center/contain no-repeat;
}
.alert {
  background: #fdf0ef; border: 1px solid #eec5c2; color: var(--danger);
  border-radius: 8px; padding: 12px 16px; margin: 14px 0;
}
.notice {
  background: #f0f7f2; border: 1px solid #c4ddcc; color: var(--ok);
  border-radius: 8px; padding: 12px 16px; margin: 14px 0;
}
small.hint, .hint { color: var(--ink-soft); font-size: 13px; }

/* 表单 */
label.field { display: block; margin: 10px 0; font-size: 14px; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], input:not([type]), select, input[type=file] {
  font: inherit; padding: 10px 12px; margin-top: 4px; width: 100%;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink);
}
input:focus, select:focus { outline: 2px solid var(--gold); border-color: var(--gold); }
button, .btn {
  font: inherit; padding: 10px 18px; margin: 6px 6px 6px 0; border: 0; border-radius: 8px;
  background: var(--cinnabar); color: #fff; cursor: pointer; min-height: 44px;
  display: inline-block; text-decoration: none; text-align: center;
}
button:hover, .btn:hover { background: var(--cinnabar-dark); }
button.ghost, .btn.ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
button.ghost:hover, .btn.ghost:hover { background: var(--paper-deep); }
button.danger { background: #fff; color: var(--danger); border: 1px solid #eec5c2; }
button.danger:hover { background: #fdf0ef; }
button.small, .btn.small { padding: 8px 12px; min-height: 40px; font-size: 14px; }
.password-row { display: flex; gap: 8px; align-items: stretch; }
.password-row input { flex: 1; }
.password-row button { flex: none; margin: 4px 0 0; }

/* 密码强度 */
.strength { height: 6px; border-radius: 3px; background: #eee; margin-top: 6px; overflow: hidden; }
.strength > i { display: block; height: 100%; width: 0; border-radius: 3px; transition: width .25s; }
.strength-lbl { font-size: 13px; color: var(--ink-soft); min-height: 20px; }

/* 表格 */
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 15px; }
td, th { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
th { color: var(--ink-soft); font-weight: 600; font-size: 13px; letter-spacing: 1px; }
tr:last-child td { border-bottom: 0; }
.status-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 13px;
  background: #e9f4ec; color: var(--ok); border: 1px solid #c4ddcc; white-space: nowrap;
}
.status-pill.off { background: #f4f4f4; color: var(--ink-soft); border-color: #ddd; }
.quota-bar { min-width: 110px; }
.quota-bar .bar { height: 8px; background: #eee; border-radius: 4px; overflow: hidden; margin-top: 4px; }
.quota-bar .bar > i { display: block; height: 100%; background: var(--ok); border-radius: 4px; }
.quota-bar .bar > i.high { background: var(--warn); }
.quota-bar .bar > i.full { background: var(--danger); }
.quota-num { font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.row-actions form { display: inline; }
.row-actions button { margin: 2px 4px 2px 0; }

/* 搜索 */
.search-row { display: flex; gap: 8px; margin-bottom: 10px; }
.search-row input { flex: 1; margin-top: 0; }

/* 数据统计 */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 6px; }
.stat { background: var(--paper-deep); border-radius: 10px; padding: 12px 14px; text-align: center; }
.stat .num { font-size: 26px; font-weight: 700; color: var(--cinnabar); }
.stat .lbl { font-size: 13px; color: var(--ink-soft); }

/* 配置卡片 */
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cfg { border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff; }
.cfg h4 { margin: 0 0 8px; font-size: 15px; }
.cfg dl { margin: 0; font-size: 14px; }
.cfg dt { color: var(--ink-soft); font-size: 13px; }
.cfg dd { margin: 0 0 8px; font-family: ui-monospace, monospace; overflow-wrap: anywhere; }
.copy-btn { padding: 6px 12px; min-height: 36px; font-size: 13px; }

/* 页脚 */
.site-footer { text-align: center; color: var(--ink-soft); font-size: 13px; padding: 24px 16px 40px; }
.text-right { text-align: right; }
.w-auto { width: auto; }

/* 移动端 */
@media (max-width: 640px) {
  body { font-size: 15px; }
  .card { padding: 16px; margin: 12px 0; }
  .header-inner { padding: 10px 12px; }
  .brand-name { font-size: 17px; }
  button, .btn { width: 100%; margin: 6px 0; }
  .row-actions button, button.small, .btn.small, .copy-btn { width: auto; }
  .password-row { flex-direction: column; }
  .password-row button { width: 100%; }
  td, th { padding: 10px 8px; }
}

/* 账号 + 后缀下拉 */
.email-split{display:flex;align-items:stretch;gap:0}
.email-split input{flex:1;min-width:0;border-radius:.5rem 0 0 .5rem}
.email-split .at{display:flex;align-items:center;padding:0 .5rem;background:#f1e9d8;border:1px solid #e6ddcf;border-left:0;border-right:0;font-weight:700;color:#5c6b76}
.email-split select{flex:none;max-width:12rem;border-radius:0 .5rem .5rem 0;background:#fff}

/* 登录页 · 仿 163 式（插画左 + 登录卡右） */
.login-page { margin: 18px 0; }
.login-main {
  display: flex; gap: 0; align-items: stretch;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--card);
  box-shadow: 0 2px 10px rgba(43,58,66,.08);
}
.login-hero { position: relative; flex: 1.25; min-height: 420px; background: var(--paper-deep); }
.login-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-hero-text {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 40px 28px 22px;
  background: linear-gradient(transparent, rgba(43,30,20,.55)); color: #fff;
}
.login-hero-title { font-size: 24px; font-weight: 700; letter-spacing: 3px; text-shadow: 0 1px 6px rgba(0,0,0,.4); }
.login-hero-sub { font-size: 14px; letter-spacing: 2px; opacity: .92; margin-top: 4px; }
.login-card { flex: 1; margin: 0; border: 0; border-radius: 0; box-shadow: none; padding: 36px 32px; }
.login-card h2 { text-align: center; }
.login-submit { width: 100%; margin-top: 10px; font-size: 17px; padding: 12px 18px; }

/* 登录页移动端：上下堆叠 */
@media (max-width: 760px) {
  .login-main { flex-direction: column; }
  .login-hero { min-height: 200px; }
  .login-hero-title { font-size: 19px; }
  .login-card { padding: 24px 20px; }
}
