/* ==========================================================================
   邮件分发系统 - UI
   设计语言沿用 login.xueyuanpie.com：品牌蓝 + 青色渐变、浅色卡片、圆角
   ========================================================================== */

:root {
  --brand: #2b6cdd;
  --brand-2: #4e94fd;
  --brand-dark: #1a5ad7;
  --teal: #34b7c6;
  --ink: #1f2937;
  --ink-2: #374151;
  --muted: #6b7585;
  --muted-2: #9aa4b2;
  --line: #eef2f7;
  --line-2: #e2e8f2;
  --soft: #f6f9ff;
  --bg: #f5f7fb;
  --white: #fff;
  --ok: #18a058;
  --ok-bg: #e8f7ee;
  --danger: #e5484d;
  --danger-bg: #fdecec;
  --warn: #e08a00;
  --warn-bg: #fff7e6;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow: 0 10px 30px rgba(43, 108, 221, .08);
  --shadow-lg: 0 24px 60px rgba(31, 41, 55, .12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* hidden 属性必须优先于组件自身的 display，否则弹窗/抽屉会一直遮挡页面 */
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img, svg { display: block; }
ul, ol { list-style: none; }
code { font-family: var(--mono); font-size: .92em; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn:disabled { opacity: .6; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand-2), var(--brand));
  color: #fff;
  box-shadow: 0 8px 20px rgba(58, 125, 232, .28);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(58, 125, 232, .34); }
.btn-ghost { background: #fff; border-color: #d7e3f7; color: var(--brand); }
.btn-ghost:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand-dark); }
.btn-soft { background: #eef4ff; color: var(--brand); }
.btn-soft:hover { background: #e2edff; }
.btn-danger-ghost { background: #fff; border-color: #f3c9ca; color: var(--danger); }
.btn-danger-ghost:hover { background: #fff5f5; }
.btn-sm { padding: 6px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 13px 30px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }

.link-btn {
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 13px;
  cursor: pointer;
  padding: 2px 0;
}
.link-btn:hover { color: var(--brand-dark); text-decoration: underline; }

.icon-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--soft); color: var(--ink); }

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { height: 64px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; color: var(--ink); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(135deg, var(--brand-2), var(--teal));
  color: #fff; display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 14px rgba(43, 108, 221, .25);
  flex: none;
}
.brand-mark svg { width: 19px; height: 19px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 14px; }
.nav-links a:not(.btn) { color: #4b5563; transition: color .2s; }
.nav-links a:not(.btn):hover, .nav-links a.active { color: var(--brand-dark); }
.nav-links a.active { font-weight: 600; }
.nav-user { color: var(--muted); font-size: 13px; }
.nav-burger {
  display: none; width: 40px; height: 40px; border: 0; background: transparent;
  flex-direction: column; justify-content: center; gap: 5px; cursor: pointer; padding: 9px;
}
.nav-burger span { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; }

.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 90; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(300px, 82vw);
  background: #fff; z-index: 91; display: flex; flex-direction: column;
  box-shadow: -20px 0 50px rgba(15, 23, 42, .16);
  transform: translateX(100%); transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.drawer.is-open { transform: none; }
.drawer-hd { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-nav { display: flex; flex-direction: column; gap: 4px; padding: 12px; }
.drawer-nav a { padding: 12px 14px; border-radius: 10px; font-size: 15px; color: var(--ink-2); }
.drawer-nav a.active { background: #eef4ff; color: var(--brand-dark); font-weight: 600; }
.drawer-nav a.btn { margin-top: 8px; justify-content: center; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1000px 420px at 88% -12%, rgba(52, 183, 198, .14), transparent 60%),
    radial-gradient(900px 420px at 8% -18%, rgba(78, 148, 253, .16), transparent 60%),
    linear-gradient(180deg, #f6f9ff, #fff);
  padding: 76px 0 84px;
}
.hero-inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; }
.hero-badge {
  display: inline-block; padding: 6px 15px; border-radius: 999px;
  background: rgba(78, 148, 253, .1); color: var(--brand-dark);
  font-size: 13px; margin-bottom: 20px;
}
.hero-title {
  font-size: 44px; line-height: 1.2; font-weight: 800; letter-spacing: .5px;
  background: linear-gradient(120deg, var(--brand), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-title small {
  display: block; margin-top: 12px; font-size: 19px; font-weight: 600;
  letter-spacing: 0; color: var(--ink-2); -webkit-text-fill-color: var(--ink-2);
}
.hero-sub { margin-top: 20px; color: #5b6675; font-size: 15.5px; line-height: 1.95; max-width: 560px; }
.hero-actions { margin-top: 30px; display: flex; gap: 14px; flex-wrap: wrap; }
.hero-points { margin-top: 30px; display: flex; gap: 22px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.hero-points .check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%; background: #e8f3ff; color: var(--brand);
  font-size: 10px; margin-right: 5px;
}
.hero-panel { position: relative; }
.code-card {
  border-radius: 16px; overflow: hidden; background: #1e2430;
  box-shadow: 0 28px 60px rgba(31, 41, 55, .28);
}
.code-bar { display: flex; align-items: center; gap: 8px; padding: 12px 16px; background: #2a3140; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }
.dot-r { background: #ff5f57; }
.dot-y { background: #febc2e; }
.dot-g { background: #28c840; }
.code-bar-title { margin-left: 10px; color: #9aa4b2; font-size: 12px; }
.code-body {
  padding: 20px 22px; margin: 0; font-family: var(--mono); font-size: 12.5px;
  line-height: 1.9; color: #d7dce5; white-space: pre-wrap; word-break: break-word;
}
.float-badge {
  position: absolute; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 16px; text-align: center;
  box-shadow: 0 14px 34px rgba(43, 108, 221, .16);
}
.float-badge b {
  display: block; font-size: 17px;
  background: linear-gradient(120deg, var(--brand), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.float-badge span { font-size: 12px; color: var(--muted); }
.badge-left { left: -20px; bottom: -20px; }
.badge-right { right: -16px; top: -20px; }

/* ---------- Stats strip ---------- */
.stats-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 26px 18px; margin-top: -36px; position: relative;
  box-shadow: 0 12px 34px rgba(43, 108, 221, .08);
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 30px; font-weight: 800; line-height: 1.2;
  background: linear-gradient(120deg, var(--brand), var(--teal));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.stat-unit { font-size: 15px; font-weight: 600; }
.stat-label { margin-top: 5px; font-size: 13px; color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding: 72px 0; }
.alt-bg { background: linear-gradient(180deg, #f6f9ff, #fff); }
.section-head { text-align: center; margin-bottom: 38px; }
.section-title { font-size: 28px; font-weight: 700; color: var(--ink); margin-bottom: 10px; }
.section-desc { font-size: 14px; color: var(--muted); }
.channels-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; }
.channel-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 8px 16px; border: 1px solid var(--line); border-radius: 13px;
  background: #fff; transition: all .2s;
}
.channel-card:hover { border-color: #cfe0fb; box-shadow: 0 12px 30px rgba(43, 108, 221, .1); transform: translateY(-2px); }
.channel-ico {
  width: 44px; height: 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; margin-bottom: 9px;
}
.channel-name { font-size: 13px; color: var(--ink-2); }
.channel-host { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.channels-note { text-align: center; color: var(--muted-2); font-size: 12.5px; margin-top: 20px; }

.features-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature {
  display: flex; gap: 14px; padding: 22px;
  border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  transition: all .2s;
}
.feature:hover { border-color: #cfe0fb; box-shadow: 0 14px 34px rgba(43, 108, 221, .1); transform: translateY(-2px); }
.feature-ico {
  flex: none; width: 46px; height: 46px; border-radius: 13px;
  background: linear-gradient(135deg, #eef4ff, #ecfbfc);
  display: flex; align-items: center; justify-content: center; font-size: 22px;
}
.feature-text h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature-text p { font-size: 13px; color: var(--muted); line-height: 1.8; }

.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.process-step {
  position: relative; padding: 26px 20px; text-align: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
}
.process-step:not(:last-child)::after {
  content: "→"; position: absolute; right: -14px; top: 30px; color: #9db8e8; font-size: 16px; z-index: 1;
}
.step-num {
  width: 42px; height: 42px; margin: 0 auto 14px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-2), var(--teal));
  color: #fff; font-size: 17px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.process-step h3 { font-size: 15.5px; margin-bottom: 8px; }
.process-step p { font-size: 13px; color: var(--muted); line-height: 1.8; }

.faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }
.faq-item { background: #fff; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.faq-item summary {
  cursor: pointer; padding: 17px 22px; font-size: 14.5px; font-weight: 600; color: var(--ink);
  list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted-2);
  border-bottom: 2px solid var(--muted-2); transform: rotate(45deg); transition: transform .25s; flex: none;
}
.faq-item[open] summary::after { transform: rotate(-135deg); }
.faq-item p { padding: 0 22px 18px; font-size: 13.5px; color: var(--muted); line-height: 1.9; }
.faq-item p a { color: var(--brand); }

.home-cta { padding: 10px 0 72px; }
.cta-inner {
  text-align: center; padding: 54px 40px; border-radius: 22px;
  background: linear-gradient(135deg, var(--brand), var(--teal)); color: #fff;
  box-shadow: 0 24px 60px rgba(43, 108, 221, .26);
}
.cta-inner h2 { font-size: 28px; margin-bottom: 12px; }
.cta-inner p { font-size: 15px; opacity: .94; margin-bottom: 28px; }
.cta-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.cta-btn-primary { background: #fff; color: var(--brand); font-weight: 600; border-color: #fff; }
.cta-btn-primary:hover { transform: translateY(-1px); }
.cta-btn-ghost { background: rgba(255, 255, 255, .16); border-color: rgba(255, 255, 255, .5); color: #fff; }
.cta-btn-ghost:hover { background: rgba(255, 255, 255, .26); }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 26px 0; color: var(--muted-2); font-size: 13px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--brand); }

/* ---------- Auth ---------- */
.auth-page {
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 92px 20px 40px; position: relative; overflow: hidden;
  background: linear-gradient(180deg, #eef3ff, #fff 62%);
}
.auth-glow { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .5; pointer-events: none; }
.auth-glow-a { width: 420px; height: 420px; background: #cfe0ff; top: -140px; right: -80px; }
.auth-glow-b { width: 360px; height: 360px; background: #d3f4f6; bottom: -140px; left: -100px; }
.auth-top {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 34px; z-index: 2;
}
.auth-top-link { font-size: 13px; color: var(--muted); }
.auth-top-link:hover { color: var(--brand); }
.auth-card {
  position: relative; z-index: 1; width: 100%; max-width: 430px;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line);
  border-radius: 20px; padding: 36px 34px 30px;
  box-shadow: 0 30px 70px rgba(43, 108, 221, .13);
  backdrop-filter: blur(10px);
}
.auth-card-wide { max-width: 520px; }
.auth-head { margin-bottom: 24px; }
.auth-head h1 { font-size: 25px; letter-spacing: .5px; }
.auth-head p { margin-top: 6px; font-size: 13.5px; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: 16px; }
.auth-benefits { display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; color: var(--muted); margin: 2px 0 2px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--muted); }
.auth-foot a { color: var(--brand); font-weight: 600; }
.auth-legal { position: relative; z-index: 1; margin-top: 26px; font-size: 12px; color: var(--muted-2); text-align: center; }

.alert {
  border-radius: 10px; padding: 11px 14px; font-size: 13px; line-height: 1.7; margin-bottom: 18px;
}
.alert-error { background: var(--danger-bg); border: 1px solid #f6c9cb; color: #b42326; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 12.5px; color: #64748b; font-weight: 500; }
.field-label em { font-style: normal; color: var(--muted-2); font-weight: 400; }
.field .hint { font-size: 11.5px; color: var(--muted-2); line-height: 1.6; }
.input, .select, .textarea {
  width: 100%; border: 1px solid var(--line-2); border-radius: 9px;
  padding: 11px 13px; font-size: 14px; color: var(--ink); background: #fff;
  font-family: inherit; transition: border-color .18s, box-shadow .18s;
}
.input::placeholder, .textarea::placeholder { color: #b3bcc9; }
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(78, 148, 253, .14);
}
.input:disabled { background: #f6f8fb; color: var(--muted); }
.textarea { resize: vertical; line-height: 1.75; min-height: 90px; }
.textarea-mono { font-family: var(--mono); font-size: 12.5px; }
.input-sm, .select-sm { padding: 8px 11px; font-size: 13px; border-radius: 8px; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236b7585' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-affix { position: relative; display: block; }
.input-affix .input { padding-right: 62px; }
.affix-btn {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  border: 0; background: transparent; color: var(--brand); font-size: 12px; cursor: pointer; padding: 4px 6px;
}
.checkbox { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); cursor: pointer; margin-top: 4px; }
.checkbox input { width: 15px; height: 15px; accent-color: var(--brand); }
.check-field { justify-content: center; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 4px; }
.form-note { font-size: 12px; color: var(--muted-2); }

/* ---------- Doc ---------- */
.doc-page { padding: 30px 0 70px; background: var(--bg); min-height: 70vh; }
.doc-layout { display: flex; align-items: flex-start; gap: 24px; }
.doc-toc {
  width: 220px; flex: 0 0 220px; position: sticky; top: 88px;
  background: #fff; border: 1px solid #e8edf5; border-radius: 12px; padding: 14px 8px;
}
.doc-toc-title { font-size: 12px; font-weight: 700; color: var(--muted-2); letter-spacing: 1px; padding: 3px 12px 10px; }
.doc-toc a { display: block; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: #475569; transition: all .16s; }
.doc-toc a:hover { background: #eef4ff; color: var(--brand-dark); }
.doc-body { flex: 1; min-width: 0; }
.doc-hero { padding: 6px 4px 22px; }
.doc-h1 { font-size: 30px; margin: 12px 0 10px; letter-spacing: .5px; }
.doc-lead { color: var(--muted); font-size: 14.5px; line-height: 1.9; max-width: 760px; }
.doc-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 16px; font-size: 12.5px; color: var(--muted); }
.doc-meta code { background: #eef2f8; padding: 2px 7px; border-radius: 5px; color: #31579e; }
.doc-card { background: #fff; border: 1px solid #e8edf5; border-radius: 13px; margin-bottom: 16px; overflow: hidden; scroll-margin-top: 84px; }
.doc-card-hd {
  padding: 14px 20px; font-weight: 700; font-size: 15.5px; color: var(--ink);
  border-bottom: 1px solid #eef2f8; background: #fafcff;
}
.doc-card-bd { padding: 18px 20px 20px; color: var(--ink-2); font-size: 14px; line-height: 1.9; }
.doc-card-bd h4 { margin: 18px 0 8px; font-size: 14px; color: var(--ink); }
.doc-card-bd h4:first-child { margin-top: 0; }
.doc-card-bd p { margin: 8px 0; }
.doc-card-bd a { color: var(--brand); }
.doc-card-bd a:hover { text-decoration: underline; }
.doc-card-bd code { background: #f1f5fb; color: #31579e; padding: 2px 6px; border-radius: 5px; word-break: break-all; }
.method { display: inline-block; font-family: var(--mono); font-size: 11px; font-weight: 700; padding: 3px 7px; border-radius: 5px; color: #fff; letter-spacing: .5px; }
.method-post { background: #18a058; }
.method-get { background: #2b6cdd; }
.doc-code {
  background: #0f172a; color: #dbeafe; border-radius: 10px; padding: 15px 17px;
  margin: 10px 0 16px; font-size: 12.5px; line-height: 1.8; overflow-x: auto;
  font-family: var(--mono); white-space: pre;
}
.doc-table-wrap { overflow-x: auto; }
.doc-table { width: 100%; border-collapse: collapse; margin: 10px 0 14px; font-size: 13px; }
.doc-table th, .doc-table td { border: 1px solid #e6ebf3; padding: 9px 11px; text-align: left; vertical-align: top; }
.doc-table th { background: #f4f7fd; color: #334155; font-weight: 600; white-space: nowrap; }
.doc-table tr:nth-child(2n) td { background: #fafbfe; }
.doc-table td code { white-space: nowrap; }
.doc-steps, .doc-list { padding-left: 20px; list-style: disc; }
.doc-steps li, .doc-list li { margin: 7px 0; }
.doc-tip { background: #eef5ff; border: 1px solid #d6e6ff; border-radius: 9px; padding: 10px 14px; color: #31579e; font-size: 13px; margin: 12px 0; }
.doc-download { margin-top: 28px; background: linear-gradient(135deg, #f4f8ff, #eef2ff); border: 1px dashed #b9cdfb; border-radius: 16px; padding: 36px 20px; text-align: center; }
.doc-download-tip { margin: 14px 0 0; font-size: 13px; color: #64748b; }

/* ---------- 404 ---------- */
.nf-page { min-height: 64vh; display: flex; align-items: center; justify-content: center; padding: 60px 20px; background: linear-gradient(180deg, #eef3ff, #fff 70%); }
.nf-box { text-align: center; max-width: 420px; }
.nf-code {
  font-size: 86px; font-weight: 800; line-height: 1.1; letter-spacing: 4px;
  background: linear-gradient(135deg, #3b6cff, #7ba3ff);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.nf-tip { margin: 10px 0 8px; font-size: 20px; }
.nf-sub { margin: 0 0 26px; font-size: 14px; color: var(--muted); }
.nf-btns { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ==========================================================================
   Console
   ========================================================================== */
.console-body { background: var(--bg); }
.app-shell { display: flex; min-height: 100vh; }

.side {
  width: 236px; flex: 0 0 236px; background: #fff; border-right: 1px solid var(--line);
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 60;
  display: flex; flex-direction: column; padding: 18px 12px 14px;
}
.side-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; }
.side-brand b { display: block; font-size: 15px; line-height: 1.3; }
.side-brand small { display: block; font-size: 10.5px; color: var(--muted-2); letter-spacing: 1.5px; }
.side-nav { display: flex; flex-direction: column; gap: 3px; overflow-y: auto; }
.side-link {
  display: flex; align-items: center; gap: 11px; width: 100%;
  padding: 10px 12px; border: 0; border-radius: 9px; background: transparent;
  color: #4b5563; font-size: 13.5px; text-align: left; cursor: pointer; transition: all .16s;
}
.side-link svg { width: 18px; height: 18px; flex: none; opacity: .82; }
.side-link:hover { background: #f5f8ff; color: var(--brand-dark); }
.side-link.is-active { background: #eef4ff; color: var(--brand-dark); font-weight: 600; }
.side-link.is-active svg { opacity: 1; }
.side-count {
  margin-left: auto; font-style: normal; font-size: 11px; background: #eef2f8;
  color: var(--muted); padding: 1px 7px; border-radius: 999px;
}
.side-foot { margin-top: auto; padding: 14px 10px 0; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.side-doc { font-size: 12.5px; color: var(--muted); }
.side-doc:hover { color: var(--brand); }
.side-logout { border: 0; background: transparent; color: var(--muted); font-size: 12.5px; cursor: pointer; padding: 0; }
.side-logout:hover { color: var(--danger); }

.app-main { flex: 1; min-width: 0; margin-left: 236px; display: flex; flex-direction: column; }
.topbar {
  height: 64px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px;
  padding: 0 26px; position: sticky; top: 0; z-index: 40;
}
.topbar-title { font-size: 15px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok); background: var(--ok-bg); padding: 5px 11px; border-radius: 999px; }
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); }
.user-chip { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: linear-gradient(135deg, var(--brand-2), var(--teal));
  color: #fff; font-size: 13px; display: inline-flex; align-items: center; justify-content: center;
}
.side-toggle { display: none; }

.content { padding: 26px 30px 60px; max-width: 1240px; width: 100%; margin: 0 auto; }
.panel { display: none; }
.panel.is-active { display: block; animation: fadeUp .25s ease; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-title { font-size: 22px; letter-spacing: .3px; }
.page-sub { margin-top: 5px; font-size: 13px; color: var(--muted); }
.page-tag { font-size: 12px; color: var(--brand); background: #eef4ff; padding: 5px 12px; border-radius: 999px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; }
.stat-card .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat-card .value { margin-top: 8px; font-size: 27px; font-weight: 800; line-height: 1.2; letter-spacing: .3px; }
.stat-card .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat-card .delta { margin-top: 6px; font-size: 11.5px; color: var(--muted-2); }
.stat-card.accent { background: linear-gradient(135deg, #f7faff, #f2fbfc); border-color: #e2edfc; }
.stat-card .value.ok { color: var(--ok); }
.stat-card .value.bad { color: var(--danger); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.card-hd {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
  font-size: 13.5px; font-weight: 600; color: var(--ink);
}
.card-sub { font-size: 12px; color: var(--muted-2); font-weight: 400; }
.card-bd { padding: 16px 18px; }
.card-bd > .field + .field { margin-top: 14px; }

.chart { display: flex; align-items: flex-end; gap: 10px; height: 170px; padding: 18px 4px 4px; }
.chart-day { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 42px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; }
.chart-fill { border-radius: 5px 5px 2px 2px; background: linear-gradient(180deg, #7fb0ff, var(--brand)); min-height: 2px; transition: height .3s; }
.chart-fill.failed { background: #f3b4b6; }
.chart-label { font-size: 10.5px; color: var(--muted-2); white-space: nowrap; }
.chart-num { font-size: 11px; color: var(--muted); }

.mailbox-mini { padding: 6px 18px 10px; }
.mini-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #f0f3f8; }
.mini-row:last-child { border-bottom: 0; }
.brand-dot {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 800;
}
.mini-info { min-width: 0; flex: 1; }
.mini-info b { display: block; font-size: 12.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-info span { font-size: 11px; color: var(--muted-2); }
.mini-usage { text-align: right; font-size: 11px; color: var(--muted); }
.mini-usage b { display: block; font-size: 12px; color: var(--ink-2); }

.quota-body { padding: 18px; }
.quota-top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.quota-top b { font-size: 22px; }
.quota-top span { font-size: 12px; color: var(--muted); }
.progress { height: 9px; border-radius: 999px; background: #eef2f8; overflow: hidden; }
.progress > i { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-2), var(--teal)); transition: width .3s; }
.progress.warn > i { background: linear-gradient(90deg, #f5bf4f, #e08a00); }
.progress.bad > i { background: linear-gradient(90deg, #ef8a8d, #e5484d); }
.quota-foot { margin-top: 10px; font-size: 11.5px; color: var(--muted-2); }
.quick-links { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 18px 18px; }
.quick-links a { font-size: 12.5px; color: var(--brand); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  text-align: left; padding: 11px 16px; font-size: 11.5px; font-weight: 600;
  color: var(--muted); background: #fafcff; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid #f2f5fa; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: #fbfdff; }
.table .ta-r { text-align: right; }
.table .t-main { font-weight: 500; color: var(--ink); }
.table .t-sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }
.table .t-ellipsis { max-width: 230px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.table .empty-cell { padding: 30px; }

.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-sent { background: var(--ok-bg); color: var(--ok); }
.badge-failed { background: var(--danger-bg); color: var(--danger); }
.badge-pending { background: #eef2f8; color: #64748b; }
.badge-running { background: #eef4ff; color: var(--brand); }
.badge-paused { background: var(--warn-bg); color: var(--warn); }
.badge-canceled { background: #f3f4f6; color: #6b7280; }
.badge-done { background: var(--ok-bg); color: var(--ok); }
.badge-test { background: #eef4ff; color: var(--brand); }

.pager { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 16px; font-size: 12.5px; color: var(--muted); }
.pager button { border: 1px solid var(--line-2); background: #fff; border-radius: 7px; padding: 5px 11px; font-size: 12.5px; cursor: pointer; color: var(--ink-2); }
.pager button:hover:not(:disabled) { border-color: var(--brand-2); color: var(--brand); }
.pager button:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- forms in console ---------- */
.form-card .card-bd { padding: 18px 20px 20px; }
.grid-send { display: grid; grid-template-columns: 1.35fr .65fr; gap: 16px; align-items: start; }
.grid-batch { display: grid; grid-template-columns: 1.15fr .85fr; gap: 16px; align-items: start; }
.tip-list { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.75; }
.tip-list li { padding-left: 14px; position: relative; }
.tip-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: #b9cdf3; }
.upload-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 10px; }
.upload-row .btn { cursor: pointer; }

/* ---------- mailboxes ---------- */
.mailbox-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.mailbox-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; transition: all .18s; }
.mailbox-card:hover { border-color: #cfe0fb; box-shadow: var(--shadow); }
.mailbox-top { display: flex; align-items: flex-start; gap: 11px; }
.mailbox-brand { width: 40px; height: 40px; border-radius: 11px; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; }
.mailbox-id { min-width: 0; flex: 1; }
.mailbox-id b { display: block; font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mailbox-id span { font-size: 11.5px; color: var(--muted-2); }
.mailbox-badges { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.mailbox-meta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--muted); }
.mailbox-meta b { color: var(--ink-2); font-weight: 600; }
.mailbox-usage { margin-top: 12px; }
.mailbox-usage .quota-top { margin-bottom: 6px; }
.mailbox-usage .quota-top b { font-size: 12.5px; }
.mailbox-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; padding-top: 14px; border-top: 1px dashed #eef2f8; }
.mailbox-actions .btn { padding: 5px 11px; font-size: 12px; }
.mailbox-error { margin-top: 10px; font-size: 11.5px; color: var(--danger); background: #fdf2f2; border-radius: 7px; padding: 6px 9px; line-height: 1.6; word-break: break-all; }

/* ---------- keys ---------- */
.key-row { display: flex; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px dashed #f0f3f8; }
.key-row:last-child { border-bottom: 0; }
.key-ico { width: 34px; height: 34px; border-radius: 9px; background: #eef4ff; color: var(--brand); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.key-info { flex: 1; min-width: 0; }
.key-info b { display: block; font-size: 13px; }
.key-info code { font-size: 11.5px; color: var(--muted-2); }
.key-meta { font-size: 11px; color: var(--muted-2); text-align: right; white-space: nowrap; }
.mini-code { background: #0f172a; color: #dbeafe; border-radius: 10px; padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.8; overflow-x: auto; white-space: pre; margin: 0 0 12px; }
.mini-code-lg { white-space: pre-wrap; word-break: break-all; font-size: 13px; }
.muted { color: var(--muted); font-size: 12.5px; }

/* ---------- templates ---------- */
.tpl-row { padding: 13px 0; border-bottom: 1px dashed #f0f3f8; }
.tpl-row:last-child { border-bottom: 0; }
.tpl-row b { font-size: 13px; }
.tpl-row p { font-size: 12px; color: var(--muted-2); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-actions { display: flex; gap: 8px; margin-top: 6px; }

/* ---------- settings ---------- */
.kv-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.kv-item .k { font-size: 11.5px; color: var(--muted-2); }
.kv-item .v { font-size: 14px; margin-top: 4px; font-weight: 500; word-break: break-all; }

/* ---------- empty / skeleton / toast ---------- */
.empty-state { text-align: center; padding: 34px 16px; color: var(--muted-2); font-size: 12.5px; }
.empty-state .empty-ico { display: block; font-size: 30px; margin-bottom: 10px; }
.empty-state h3 { font-size: 16px; color: var(--ink-2); margin-bottom: 6px; }
.empty-state p { margin-bottom: 14px; }
.empty-state.big { background: #fff; border: 1px dashed #dbe4f0; border-radius: var(--radius); padding: 56px 20px; }
.skeleton { position: relative; overflow: hidden; background: #f4f7fb; border-radius: var(--radius); min-height: 96px; }
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .75), transparent);
  animation: shimmer 1.3s infinite; transform: translateX(-100%);
}
@keyframes shimmer { to { transform: translateX(100%); } }

.flash-key {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fff8e6; border: 1px solid #f5dfa8; border-radius: 12px;
  padding: 13px 16px; margin-bottom: 20px; font-size: 12.5px; color: #7a5a12;
}
.flash-key > div { flex: 1; min-width: 220px; }
.flash-key b { display: block; margin-bottom: 4px; }
.flash-key code { display: block; font-size: 12px; color: #5c4710; word-break: break-all; }

.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  pointer-events: auto; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--brand);
  border-radius: 10px; box-shadow: 0 16px 40px rgba(15, 23, 42, .14);
  padding: 11px 16px; font-size: 13px; color: var(--ink-2); max-width: min(92vw, 460px);
  animation: toastIn .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200; background: rgba(15, 23, 42, .48);
  display: flex; align-items: center; justify-content: center; padding: 18px;
  backdrop-filter: blur(2px);
}
.modal {
  width: 100%; max-width: 660px; max-height: 90vh; overflow: auto; background: #fff;
  border-radius: 16px; box-shadow: var(--shadow-lg); animation: modalIn .2s ease;
}
.modal-sm { max-width: 460px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-hd { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #fff; z-index: 1; }
.modal-hd h2 { font-size: 17px; }
.modal-bd { padding: 20px 22px 22px; display: flex; flex-direction: column; gap: 14px; }
.modal-ft { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.provider-hint { background: #f4f8ff; border: 1px solid #e2ecff; color: #31579e; border-radius: 9px; padding: 10px 13px; font-size: 12px; line-height: 1.75; }
.provider-hint a { color: var(--brand); font-weight: 600; }
.custom-smtp { border-top: 1px dashed #e6ecf5; padding-top: 14px; }
.modal-test { border-radius: 9px; padding: 10px 13px; font-size: 12.5px; line-height: 1.6; }
.modal-test.ok { background: var(--ok-bg); color: #12703c; }
.modal-test.err { background: var(--danger-bg); color: #b42326; word-break: break-all; }
.modal-test.loading { background: #eef4ff; color: var(--brand); }
.preview-subject { font-weight: 600; font-size: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.preview-frame { border: 1px solid var(--line); border-radius: 10px; padding: 16px; min-height: 160px; max-height: 52vh; overflow: auto; font-size: 14px; line-height: 1.8; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) {
  .side { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 50px rgba(15, 23, 42, .2); }
  .side.is-open { transform: none; }
  .app-main { margin-left: 0; }
  .side-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .grid-send, .grid-batch { grid-template-columns: 1fr; }
  .kv-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 940px) {
  .hero-inner { grid-template-columns: 1fr; gap: 40px; }
  .hero-panel { max-width: 520px; width: 100%; margin: 0 auto; }
  .float-badge { display: none; }
  .channels-grid { grid-template-columns: repeat(4, 1fr); }
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .process-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .process-step::after { display: none; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .mailbox-grid { grid-template-columns: 1fr; }
  .doc-toc { display: none; }
  .doc-layout { flex-direction: column; }
}
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav-burger { display: flex; }
  .hero { padding: 44px 0 60px; }
  .hero-title { font-size: 31px; }
  .hero-title small { font-size: 16px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); gap: 20px 10px; padding: 22px 14px; margin-top: -26px; }
  .stat-num { font-size: 24px; }
  .section { padding: 52px 0; }
  .section-title { font-size: 23px; }
  .channels-grid { grid-template-columns: repeat(3, 1fr); }
  .features-grid { grid-template-columns: 1fr; }
  .process-grid { grid-template-columns: 1fr; }
  .cta-inner { padding: 36px 20px; border-radius: 18px; }
  .cta-inner h2 { font-size: 23px; }
  .grid-2 { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .auth-top { padding: 16px 20px; }
  .auth-card { padding: 28px 22px 24px; }
  .content { padding: 18px 16px 50px; }
  .topbar { padding: 0 14px; }
  .status-pill { display: none; }
  .user-name { display: none; }
  .page-title { font-size: 20px; }
  .table th, .table td { padding: 10px 12px; }
  .doc-card-bd { padding: 14px 14px 16px; font-size: 13px; }
  .doc-code { font-size: 11.5px; padding: 12px; }
  .kv-grid { grid-template-columns: 1fr 1fr; }
  .flash-key { align-items: flex-start; }
}
@media (max-width: 460px) {
  .hero-actions .btn { width: 100%; }
  .channels-grid { grid-template-columns: repeat(2, 1fr); }
  .stats-strip { grid-template-columns: 1fr 1fr; }
  .kv-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
