/* ==========================================================================
   小辉辉AI矩阵 · 注册 / 登录 / 后台样式
   与 css/style.css 共用设计令牌；本文件只负责表单与后台界面。
   通过根路径绝对引用（/css/auth.css），三个目录深度一致。
   ========================================================================== */

/* ---------------------------------- 页面容器 ---------------------------- */
.auth-page {
  position: relative;
  min-height: 100vh;
  min-height: -webkit-fill-available;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  padding-top: max(40px, env(safe-area-inset-top));
  padding-bottom: max(48px, env(safe-area-inset-bottom));
  overflow: hidden;
  background: var(--ink-900);
}

.auth-page .aurora { position: absolute; inset: 0; }
.auth-page .aurora__blob { opacity: .35; }

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 452px;
  padding: 38px 32px 32px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-xl);
  background: linear-gradient(165deg, rgba(30, 42, 71, .72) 0%, rgba(7, 11, 22, .86) 100%);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: var(--sh-lg);
}

.auth-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: linear-gradient(90deg, transparent, rgba(34, 211, 238, .55) 30%, rgba(168, 85, 247, .55) 70%, transparent);
}

.auth-card--wide { max-width: 1100px; }

/* ---------------------------------- 品牌头 ------------------------------ */
.auth-brand { text-align: center; margin-bottom: 30px; }

.auth-brand__mark {
  width: 54px; height: 54px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--grad-brand);
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  box-shadow: var(--sh-brand);
}

.auth-brand__name { font-size: 1.35rem; font-weight: 800; color: var(--tx-100); letter-spacing: .02em; }
.auth-brand__name em { font-style: normal; background: var(--grad-brand); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.auth-brand__slogan { margin-top: 8px; font-size: .9rem; color: var(--tx-400); }

.auth-card h1 { font-size: 1.3rem; margin-bottom: 6px; }
.auth-card .auth-sub { font-size: .9rem; color: var(--tx-400); margin-bottom: 26px; }

/* ---------------------------------- 表单 -------------------------------- */
.field { margin-bottom: 20px; }

.field > label {
  display: block;
  margin-bottom: 9px;
  font-size: .92rem;
  font-weight: 600;
  color: var(--tx-200);
}

.field .req { color: var(--rose); margin-left: 2px; }
.field .opt { color: var(--tx-500); font-weight: 400; font-size: .84rem; }

.input, .select {
  width: 100%;
  padding: 13px 15px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  background: rgba(4, 6, 13, .62);
  color: var(--tx-100);
  font-family: inherit;
  font-size: 1rem;              /* ≥16px：避免 iOS 聚焦时自动放大 */
  line-height: 1.4;
  transition: border-color .22s, box-shadow .22s, background .22s;
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder { color: var(--tx-500); }

.input:focus, .select:focus {
  outline: none;
  border-color: var(--indigo);
  background: rgba(4, 6, 13, .85);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .2);
}

.input.is-error { border-color: var(--rose); box-shadow: 0 0 0 3px rgba(251, 113, 133, .16); }

.select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2393a3c0' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 42px;
  cursor: pointer;
}

.select option { background: var(--ink-700); color: var(--tx-100); }

/* 手机号 + 验证码 两列 */
.field-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: stretch; }

/* ---------------------------------- 验证码 ------------------------------ */
.captcha-row { display: flex; gap: 10px; align-items: stretch; }

.captcha-box {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 15px;
  border: 1px dashed var(--line-3);
  border-radius: var(--r-sm);
  background: linear-gradient(118deg, rgba(34, 211, 238, .10), rgba(168, 85, 247, .10));
  cursor: pointer;
  user-select: none;
  transition: border-color .22s, background .22s;
}

.captcha-box:hover { border-color: var(--cyan); }

.captcha-code {
  font-family: var(--font-num);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: .34em;
  text-indent: .34em;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: transform .15s, opacity .15s;
}

.captcha-refresh {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: rgba(148, 178, 255, .06);
  color: var(--tx-300);
  cursor: pointer;
  font-size: .82rem;
  transition: transform .3s var(--ease), color .22s, border-color .22s;
}

.captcha-refresh:hover { color: var(--cyan); border-color: var(--cyan); transform: rotate(180deg); }

.hint { margin-top: 8px; font-size: .78rem; color: var(--tx-500); }

/* ---------------------------------- 勾选 -------------------------------- */
.check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 22px; }

.check input {
  flex-shrink: 0;
  width: 18px; height: 18px;
  margin-top: 3px;
  accent-color: var(--indigo);
  cursor: pointer;
}

.check label { font-size: .85rem; color: var(--tx-400); line-height: 1.6; cursor: pointer; }
.check a { color: var(--cyan); }

/* ---------------------------------- 按钮 -------------------------------- */
.btn-submit {
  width: 100%;
  padding: 15px 20px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--grad-brand);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: var(--sh-brand);
  transition: transform .22s var(--ease), box-shadow .22s, opacity .22s;
}

.btn-submit:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 22px 48px -18px rgba(99, 102, 241, .8); }
.btn-submit:active:not(:disabled) { transform: translateY(0); }
.btn-submit:disabled { opacity: .45; cursor: not-allowed; }

.secure-tip { margin-top: 16px; text-align: center; font-size: .82rem; color: var(--tx-500); }

.auth-foot { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--line); text-align: center; font-size: .88rem; color: var(--tx-400); }
.auth-foot a { color: var(--cyan); }
.auth-foot a:hover { text-decoration: underline; }

.auth-back { display: block; margin-top: 14px; text-align: center; font-size: .84rem; color: var(--tx-500); }
.auth-back:hover { color: var(--cyan); }

/* ---------------------------------- Toast ------------------------------- */
.toast {
  position: fixed;
  top: max(18px, env(safe-area-inset-top));
  left: 50%;
  z-index: 9999;
  max-width: calc(100vw - 36px);
  padding: 14px 22px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: rgba(11, 17, 32, .96);
  backdrop-filter: blur(14px);
  color: #fff;
  font-size: .93rem;
  font-weight: 600;
  text-align: center;
  box-shadow: var(--sh-lg);
  transform: translateX(-50%) translateY(-180px);
  transition: transform .42s cubic-bezier(.18, .9, .28, 1.2);
}

.toast.show { transform: translateX(-50%) translateY(0); }
.toast.success { background: rgba(5, 150, 105, .96); border-color: rgba(45, 212, 191, .5); }
.toast.error   { background: rgba(190, 30, 45, .96); border-color: rgba(251, 113, 133, .5); }

/* ==========================================================================
   后台管理
   ========================================================================== */
.admin-wrap { width: 100%; max-width: 1120px; margin: 0 auto; }

.admin-top {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
}

.admin-top h1 { font-size: 1.25rem; }
.admin-top .who { font-size: .84rem; color: var(--tx-400); }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; margin-bottom: 26px; }

.kpi {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: rgba(148, 178, 255, .035);
}

.kpi b {
  display: block;
  font-family: var(--font-num);
  font-size: 1.8rem;
  font-weight: 800;
  line-height: 1.15;
  background: var(--grad-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.kpi span { font-size: .84rem; color: var(--tx-300); }

.panel {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: rgba(11, 17, 32, .6);
  overflow: hidden;
  margin-bottom: 22px;
}

.panel__head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.panel__head h2 { font-size: 1rem; }
.panel__body { padding: 22px; }

.table-scroll { overflow-x: auto; }

table.data { width: 100%; border-collapse: collapse; font-size: .89rem; min-width: 720px; }

table.data th {
  padding: 13px 16px;
  text-align: left;
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--tx-300);
  background: rgba(148, 178, 255, .055);
  border-bottom: 1px solid var(--line-2);
  white-space: nowrap;
}

table.data td { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--tx-300); }
table.data tbody tr:hover td { background: rgba(148, 178, 255, .035); }
table.data td.strong { color: var(--tx-100); font-weight: 600; }

.pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: .75rem;
  font-weight: 600;
  background: rgba(148, 178, 255, .1);
  border: 1px solid var(--line-2);
  color: var(--tx-200);
}

.pill--new { background: rgba(34, 211, 238, .14); border-color: rgba(34, 211, 238, .3); color: #86e7f7; }
.pill--follow { background: rgba(240, 180, 41, .14); border-color: rgba(240, 180, 41, .3); color: var(--gold-lt); }
.pill--deal { background: rgba(45, 212, 191, .14); border-color: rgba(45, 212, 191, .3); color: #7ef0dd; }
.pill--lost { background: rgba(251, 113, 133, .14); border-color: rgba(251, 113, 133, .3); color: #ffb3bf; }

.mini-btn {
  padding: 6px 13px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  background: rgba(148, 178, 255, .06);
  color: var(--tx-200);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .22s, border-color .22s, color .22s;
}

.mini-btn:hover { background: rgba(148, 178, 255, .13); border-color: var(--cyan); color: var(--cyan); }

/* 转化漏斗 */
.funnel { display: grid; gap: 10px; }

.funnel__row { display: flex; align-items: center; gap: 14px; }

.funnel__label { flex: 0 0 74px; font-size: .85rem; color: var(--tx-300); }

.funnel__bar {
  position: relative;
  flex: 1;
  height: 34px;
  border-radius: var(--r-xs);
  background: rgba(148, 178, 255, .06);
  overflow: hidden;
}

.funnel__fill {
  height: 100%;
  border-radius: var(--r-xs);
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  padding-left: 12px;
  font-family: var(--font-num);
  font-size: .84rem;
  font-weight: 700;
  color: #fff;
  transition: width .8s var(--ease-out);
  min-width: 44px;
}

.pager { display: flex; gap: 10px; align-items: center; justify-content: center; padding: 18px; }

.empty { padding: 46px 20px; text-align: center; color: var(--tx-500); font-size: .9rem; }

/* ---------------------------------- 小屏 ------------------------------- */
@media (max-width: 460px) {
  .auth-card { padding: 30px 22px 26px; border-radius: var(--r-lg); }
  .auth-card h1 { font-size: 1.15rem; }
  .captcha-code { font-size: 1.3rem; letter-spacing: .28em; text-indent: .28em; }
  .admin-top { flex-direction: column; align-items: flex-start; }
}
