/* ============================================================================
   统一控制台模板（v2）
   超管端 / 商户端 / 客服端三端共用同一套视觉语言，最终加载，覆盖：
     console.css（基础组件） → dash2.css（经营星链） → board.css（超管大盘）

   设计对齐参考图：
     · 左侧白色竖栏、圆角选中块（实心主色 + 白字）
     · 顶栏与内容区浅灰蓝底，卡片纯白、1px 细边、极轻阴影
     · 主色蓝 #2f6bff，圆角 10px，间距 12/16/20 节奏
     · 深色模式同一结构，仅换令牌

   本文件只做「覆盖」，不复制原组件规则：原样式仍负责布局与交互态，
   这里统一令牌、圆角、间距、字号与配色。想再调风格只改本文件即可。
   ========================================================================== */

/* ---------------------------------------------------------------- 令牌 · 浅色 */
:root,
html[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #eef2f8;
  --panel: #ffffff;
  --panel-2: #f7f9fc;
  --panel-3: #eef2f8;

  --line: #e8edf5;
  --line-2: #dce3ee;

  --text: #101828;
  --text-2: #344054;
  --muted: #667085;
  --muted-2: #98a2b3;

  --accent: #2f6bff;
  --accent-2: #12b76a;
  --accent-soft: rgba(47, 107, 255, 0.08);
  --grad: linear-gradient(135deg, #2f6bff 0%, #4f86ff 100%);

  --ok: #12b76a;
  --warn: #f79009;
  --danger: #f04438;
  --ok-soft: rgba(18, 183, 106, 0.1);
  --warn-soft: rgba(247, 144, 9, 0.1);
  --danger-soft: rgba(240, 68, 56, 0.1);

  --shadow: 0 12px 32px rgba(16, 24, 40, 0.1);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --bg-glow: none;
  --sidebar-bg: #ffffff;

  --bubble-in: #f2f5fa;
  --bubble-out: #2f6bff;
  --bubble-out-text: #ffffff;

  --radius: 10px;
  --radius-sm: 8px;
  --radius-lg: 14px;
  --nav-h: 28px;
  --sidebar-w: 212px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* ---------------------------------------------------------------- 令牌 · 深色 */
html[data-theme="dark"] {
  --bg: #0b0f17;
  --bg-2: #0f1420;
  --panel: #121826;
  --panel-2: #161e2e;
  --panel-3: #1b2436;

  --line: #222c3f;
  --line-2: #2c3850;

  --text: #e7ebf3;
  --text-2: #c6cede;
  --muted: #8b95a7;
  --muted-2: #626d80;

  --accent: #4f86ff;
  --accent-2: #2dd4bf;
  --accent-soft: rgba(79, 134, 255, 0.14);
  --grad: linear-gradient(135deg, #4f86ff 0%, #6f9bff 100%);

  --ok: #32d583;
  --warn: #fdb022;
  --danger: #f97066;
  --ok-soft: rgba(50, 213, 131, 0.12);
  --warn-soft: rgba(253, 176, 34, 0.12);
  --danger-soft: rgba(249, 112, 102, 0.12);

  --shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sidebar-bg: #0f1521;

  --bubble-in: #1a2334;
  --bubble-out: #2f6bff;
  --bubble-out-text: #ffffff;
}

/* ---------------------------------------------------------------- 基础 */
html { background: var(--bg); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--accent-soft); color: var(--text); }

html ::-webkit-scrollbar { width: 8px; height: 8px; }
html ::-webkit-scrollbar-track { background: transparent; }
html ::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: content-box;
}
html ::-webkit-scrollbar-thumb:hover { background: var(--muted-2); background-clip: content-box; }

/* ---------------------------------------------------------------- 外壳 */
.app { background: var(--bg); }

.sidebar {
  box-sizing: border-box;
  width: var(--sidebar-w);
  flex: 0 0 var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--line);
  padding: 14px 12px 12px;
}

/* 品牌区：参考图为 34px 圆角方块 + 两行文字，块面纯主色，无多层光晕 */
.brand { padding: 2px 4px 16px; gap: 10px; }
.brand-logo {
  width: 34px; height: 34px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.24);
}
html[data-theme="dark"] .brand-logo { box-shadow: none; }
.brand-txt b { font-size: 14px; font-weight: 650; color: var(--text); letter-spacing: 0.01em; }
/* 同 console.css：只作用于直接子级的副标题，别把 <b> 里的品牌名压成小字 */
.brand-txt > span { display: block; font-size: 9.5px; letter-spacing: 0.16em; color: var(--muted-2); margin-top: 2px; }
/* 品牌名留空时收起分隔点与空的 Logo 方块（新装默认状态） */
.brand-txt b > [data-brand="name"]:empty + .brand-sep { display: none; }
.brand-logo.no-logo { display: none; }

/* 当前页面：从「装饰块」降级为信息卡，标题仍然是各页的唯一定位锚点 */
.side-current {
  margin: 0 0 6px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.side-current > span { display: none; }
.side-current b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.5;
}
.side-current small { display: none; }

/* 导航：36px 行高、8px 圆角、选中项实心主色（参考图的核心特征） */
.nav { gap: 0; margin-top: 2px; padding-bottom: 2px; overflow-y: auto; scrollbar-width: thin; }
.nav-item {
  flex: 0 0 auto;
  box-sizing: border-box;
  height: var(--nav-h);
  padding: 0 10px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-size: 12.5px;
  color: var(--muted);
  gap: 9px;
  transition: background 0.14s ease, color 0.14s ease;
}
.nav-ic { width: 15px; height: 15px; opacity: 0.8; }
.nav-ic svg { width: 15px; height: 15px; }
.nav-item:hover { background: var(--panel-2); color: var(--text); }
.nav-item.active {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(47, 107, 255, 0.22);
}
html[data-theme="dark"] .nav-item.active { box-shadow: none; }
.nav-item.active .nav-ic { opacity: 1; }
.nav-item.active .nav-badge { background: rgba(255, 255, 255, 0.22); color: #fff; }
.nav-badge { font-size: 10px; padding: 1px 6px; }

/* 侧栏工具区：原来三行竖排占 124px，挤掉 4 条菜单。
   改成「主题一整行 + 其余自动流」，高度压到 66px 左右。 */
.side-tools {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.side-tools-theme { flex: 1 1 100%; }
.side-tools-row { flex: 1 1 auto; min-width: 0; gap: 6px; }
.side-tools .conn, .side-tools .sv-pill { padding: 3px 8px; font-size: 10.5px; }
.side-foot { border-top: 1px solid var(--line); padding-top: 8px; margin-top: 6px; }
.side-user { padding: 7px 6px; border-radius: var(--radius-sm); gap: 9px; }
.side-user:hover { background: var(--panel-2); }
.side-user b { font-size: 12.5px; color: var(--text); }
.side-user span { font-size: 10.5px; color: var(--muted-2); }
.avatar { border-radius: 8px; background: var(--accent-soft); color: var(--accent); border-color: transparent; }

/* ---------------------------------------------------------------- 顶栏 / 内容区 */
.main { background: var(--bg); }
.topbar {
  height: 60px; flex: 0 0 60px;
  padding: 0 22px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 16px; font-weight: 650; color: var(--text); }
.topbar p { font-size: 11.5px; color: var(--muted-2); }

.page { padding: 18px 22px 26px; }
.page.page-chat { padding: 0; }

.toolbar { gap: 10px; margin-bottom: 14px; }
.toolbar .muted { color: var(--muted); }

/* ---------------------------------------------------------------- 卡片 / 统计 */
.card {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  padding: 16px;
  background: var(--panel);
}
.card-title { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }

.stat-grid { gap: 12px; margin-bottom: 14px; }
.stat {
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: none;
  padding: 14px 16px;
}
.stat::after { display: none; }
.stat-label { font-size: 12px; color: var(--muted); }
.stat-val { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; margin-top: 6px; }
.stat-sub { font-size: 11px; color: var(--muted-2); margin-top: 6px; }

/* ---------------------------------------------------------------- 按钮 */
.btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--panel);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  box-shadow: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn:hover {
  background: var(--panel-2);
  border-color: var(--line-2);
  color: var(--text);
  transform: none;
}
.btn:active { transform: none; }
.btn-primary {
  background: var(--accent);
  border: 1px solid var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06);
}
.btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 88%, #000);
  border-color: color-mix(in srgb, var(--accent) 88%, #000);
  color: #fff;
  filter: none;
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--panel-2); color: var(--text); }
.btn-danger {
  background: var(--danger-soft);
  border-color: transparent;
  color: var(--danger);
}
.btn-danger:hover { background: var(--danger-soft); filter: brightness(0.97); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-icon { width: 36px; padding: 0; }
.btn-icon.btn-sm { width: 30px; }

/* ---------------------------------------------------------------- 表单 */
.field { gap: 6px; margin-bottom: 13px; }
.field > label { font-size: 12px; font-weight: 500; color: var(--text-2); }
.field .tip { font-size: 11px; color: var(--muted-2); }

input, textarea, select {
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text);
  transition: border-color 0.14s ease, box-shadow 0.14s ease;
}
input:hover, textarea:hover, select:hover { border-color: var(--muted-2); }
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  background: var(--panel);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
textarea { min-height: 72px; line-height: 1.6; }
select option { background: var(--panel); color: var(--text); }

.search input { height: 36px; padding-left: 32px; width: 236px; }
.search svg { top: 10px; color: var(--muted-2); }

.switch .track { background: var(--panel-3); border-color: var(--line-2); }
.switch .track::after { background: #fff; opacity: 1; box-shadow: 0 1px 2px rgba(16, 24, 40, 0.2); }
.switch input:checked + .track { background: var(--accent); border-color: var(--accent); box-shadow: none; }

/* 分段控件 */
.seg {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.seg button {
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  color: var(--muted);
}
.seg button.active {
  background: var(--panel);
  color: var(--text);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ---------------------------------------------------------------- 表格 */
.table { font-size: 13px; }
.table th {
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--muted);
  background: var(--panel-2);
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
}
.table th:first-child { border-top-left-radius: var(--radius-sm); border-bottom-left-radius: var(--radius-sm); }
.table th:last-child { border-top-right-radius: var(--radius-sm); border-bottom-right-radius: var(--radius-sm); }
.table td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.table tbody tr:hover { background: var(--panel-2); }
.table tbody tr:last-child td { border-bottom: none; }
.table .mono { color: var(--accent); }

/* ---------------------------------------------------------------- 徽章 / 标签 */
.badge {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  border-color: transparent;
  background: var(--panel-3);
  color: var(--muted);
}
.badge::before { width: 5px; height: 5px; }
.badge-ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.badge-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.badge-danger { background: var(--danger-soft); color: var(--danger); border-color: transparent; }
.badge-info { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-muted { background: var(--panel-3); color: var(--muted-2); }

/* ---------------------------------------------------------------- 会话 / 客服台 */
.chat-list { width: 288px; flex: 0 0 288px; background: var(--panel); border-right: 1px solid var(--line); }
.chat-list-head { padding: 10px; }
.conv { padding: 10px 12px; gap: 9px; }
.conv:hover { background: var(--panel-2); }
.conv.active { background: var(--accent-soft); }
.conv.active::before { width: 3px; background: var(--accent); }
.conv-name { font-size: 12.5px; }
.conv-time { font-size: 10.5px; }
.conv-last { font-size: 11.5px; }
.conv-unread { border-radius: 6px; }

.chat-main { background: var(--bg-2); }
.chat-head { height: 56px; flex: 0 0 56px; background: var(--panel); border-bottom: 1px solid var(--line); }
.chat-head h3 { font-size: 14px; }
.chat-body { padding: 14px 16px 10px; gap: 10px; }
.chat-foot { background: var(--panel); border-top: 1px solid var(--line); padding: 9px 12px 11px; }
.chat-input-row textarea { border-radius: var(--radius-sm); }

.msg .bubble { border-radius: 10px; }

/* 消息气泡：自己发的用主色实心，对方用浅灰底（两套主题一致） */
.msg.out .bubble { background: var(--bubble-out); color: var(--bubble-out-text); }
.msg.in .bubble { background: var(--bubble-in); color: var(--text); }

/* ---------------------------------------------------------------- 弹窗 / Toast / 空态 */
.modal-mask { background: rgba(16, 24, 40, 0.45); backdrop-filter: blur(2px); }
.modal {
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 20px;
}
.modal h3 { font-size: 15px; font-weight: 650; }
.modal .modal-sub { font-size: 12px; color: var(--muted-2); }
.toast { border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); font-size: 12.5px; }
.empty { color: var(--muted-2); }
.chip { border-radius: 6px; font-size: 11.5px; background: var(--panel); }
.chip:hover { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

/* ---------------------------------------------------------------- 登录页 */
.auth-screen { background: var(--bg); }
.auth-visual {
  background:
    radial-gradient(720px 460px at 8% 0%, rgba(47, 107, 255, 0.1), transparent 62%),
    radial-gradient(560px 420px at 100% 100%, rgba(18, 183, 106, 0.08), transparent 60%),
    var(--bg-2);
  border-right: 1px solid var(--line);
}
.auth-visual::after {
  background-image: linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.55;
}
.auth-copy h2 { font-size: 29px; }
.auth-copy h2 em { background: var(--accent); -webkit-background-clip: text; background-clip: text; }
.auth-form-wrap { background: var(--bg); }
.auth-form {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.auth-point i { border-radius: 6px; }

/* ---------------------------------------------------------------- 主题切换（两档） */
.theme-switch {
  display: flex;
  width: 100%;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--panel-2);
}
.theme-dot {
  flex: 1 1 0;
  width: auto;
  height: 26px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 11.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.theme-dot:hover { transform: none; color: var(--text); }
.theme-dot.active {
  background: var(--panel);
  color: var(--text);
  border-color: transparent;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}
.theme-dot .ti { font-size: 12px; line-height: 1; }

/* ---------------------------------------------------------------- 大盘 / 星链对齐 */
.bd { gap: 12px; }
.bd-alerts { gap: 8px; }
.bd-alert { border-radius: var(--radius); }
.bd-kpis { gap: 12px; }
.bd-kpi { border-radius: var(--radius); padding: 14px 16px 13px; }
.bd-kpi:hover { box-shadow: none; }
.bd-kpi-ic { border-radius: var(--radius-sm); }
.bd-kpi-num { font-size: 26px; margin: 8px 0 5px; }
.bd-duo { gap: 12px; }
.bd-card { border-radius: var(--radius); padding: 14px 16px 12px; }
.bd-cols { gap: 12px; }
.d2-shell { border-radius: var(--radius); }
.d2-head { border-radius: var(--radius) var(--radius) 0 0; }
.ov-box { border-radius: var(--radius); }
.qn-item { border-radius: var(--radius-sm); }

/* ---------------------------------------------------------------- 深色微调 */
html[data-theme="dark"] .btn-primary:hover {
  background: color-mix(in srgb, var(--accent) 86%, #fff);
  border-color: color-mix(in srgb, var(--accent) 86%, #fff);
}
html[data-theme="dark"] .avatar { background: var(--panel-3); color: var(--text-2); }
html[data-theme="dark"] .bd-alert.is-info { background: var(--accent-soft); }
html[data-theme="dark"] .modal-mask { background: rgba(3, 7, 18, 0.66); }

/* 低端设备：去掉仅有的两个阴影过渡，避免滚动时掉帧 */
@media (prefers-reduced-motion: reduce) {
  .bd-kpi, .btn, .nav-item, .conv { transition: none; }
}

/* 旧「深空」模板的点击粒子开关：统一模板默认关闭，入口一并下线 */
.fx-btn { display: none !important; }

/* ---------------------------------------------------------------- 群聊（v1.31.0） */
/* 群卡片：桌面两列、窄屏一列。群聊码是这个页面最重要的信息，
   所以给足字号与字距，方便商户直接念给客户听。 */
.cg-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
.cg-card { display:flex; flex-direction:column; gap:10px; }
.cg-head { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.cg-name { font-size:14px; font-weight:650; color:var(--text); }
.cg-state { font-size:11px; padding:2px 8px; border-radius:999px; background:var(--panel-3); color:var(--muted); }
.cg-state.on { background:color-mix(in srgb, var(--accent-2) 14%, transparent); color:var(--accent-2); }
.cg-code {
  font-family:ui-monospace,Consolas,monospace; font-size:19px; font-weight:700;
  letter-spacing:.16em; color:var(--accent);
  background:var(--accent-soft); border:1px dashed color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius:var(--radius-sm); padding:8px 10px; text-align:center; user-select:all;
}
.cg-meta { font-size:12px; color:var(--muted); display:flex; gap:12px; flex-wrap:wrap; }
.cg-acts { display:flex; flex-wrap:wrap; gap:8px; }
.cg-acts .btn { height:30px; padding:0 10px; font-size:12px; }
.cg-members { display:flex; flex-direction:column; gap:8px; max-height:52vh; overflow:auto; }
.cg-member { display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--line); border-radius:var(--radius-sm); }
.cg-member b { font-size:13px; font-weight:600; color:var(--text); }
.cg-member small { color:var(--muted-2); font-size:11.5px; }
.cg-qr { display:flex; flex-direction:column; align-items:center; gap:10px; }
.cg-qr img { width:220px; height:220px; border-radius:10px; background:#fff; padding:8px; border:1px solid var(--line); }
.cg-link { font-family:ui-monospace,Consolas,monospace; font-size:11.5px; color:var(--muted); word-break:break-all; }

/* ================================================================ 登录页（v1.36.0）
 * 两个问题一起解决：
 *   1) 三端登录页顶部会露出一条白线 —— 原因是 .auth-screen 用 100dvh
 *      撑满，但 html/body 没有背景色，移动端地址栏收起时露出的
 *      那一条画布是白色；再加上 .auth-visual 的 border-right 在浅色
 *      主题下几乎就是白色，视觉上像一条没画完的缝。
 *   2) 登录页原来是静态渐变，看起来像一张截图。现在加一层纯 CSS 的
 *      动态光晕（只用 transform / opacity，走合成层，不触发重排）。
 */

/* 画布补色：任何「露出来的地方」都应该是页面底色，而不是白色 */
html, body { background: var(--bg); }
html { overflow-x: hidden; }

.auth-screen { overflow-x: hidden; }
/* 去掉那条看起来像白线的分隔线，改用极轻的阴影过渡 */
.auth-visual { border-right: 0; box-shadow: 1px 0 0 rgba(15, 23, 42, .04); }

/* 动态光晕：两层缓慢漂移的径向渐变。
   刻意做得很淡（.10 ~ .16 透明度）——登录页的主角是表单，
   背景太花会让「输入框在哪」变得难找。 */
.auth-visual::before {
  content: "";
  position: absolute;
  inset: -22%;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(closest-side, rgba(47, 107, 255, .16), transparent 72%),
    radial-gradient(closest-side, rgba(14, 165, 164, .13), transparent 72%);
  background-repeat: no-repeat;
  background-size: 62% 58%, 58% 56%;
  background-position: 12% 18%, 86% 84%;
  filter: blur(6px);
  animation: authAurora 22s ease-in-out infinite alternate;
  will-change: transform;
}
/* 第二层反向漂移，避免两层同步运动看起来像整体平移 */
.auth-visual > .brand::after,
.auth-visual .auth-copy::after { content: none; }
/* 网格层：用 background-position 而不是 transform。
   这一层带了 mask-image（中心亮、四周淡出），整个元素平移会把
   遮罩一起拖走，看起来像一块方形色块在动。 */
.auth-visual::after {
  animation: authGrid 34s linear infinite;
}
@keyframes authAurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2.4%, -2%, 0) scale(1.04); }
  100% { transform: translate3d(-2%, 2.4%, 0) scale(1.02); }
}
@keyframes authGrid {
  0%   { background-position: 0 0, 0 0; }
  100% { background-position: 48px 48px, 48px 48px; }
}

/* 表单卡片入场：从下方 8px 淡入。只在首屏播一次，不循环。 */
.auth-form {
  animation: authCardIn .5s cubic-bezier(.22, .8, .3, 1) both;
}
@keyframes authCardIn {
  from { opacity: 0; transform: translate3d(0, 10px, 0); }
  to   { opacity: 1; transform: none; }
}

/* 输入框聚焦时给一点金色反馈：与后台侧栏的金色光幕是同一套语言，
   让「这里是平台的系统」这件事在三个入口上保持一致。 */
.auth-form input:focus,
.auth-form select:focus {
  border-color: #c9a227 !important;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, .16) !important;
}
.auth-form .btn-primary {
  position: relative;
  overflow: hidden;
}
.auth-form .btn-primary::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, .32) 50%, transparent 70%);
  transform: translateX(-120%);
  animation: authBtnSweep 4.6s ease-in-out infinite;
}
@keyframes authBtnSweep {
  0%, 62% { transform: translateX(-120%); }
  86%, 100% { transform: translateX(120%); }
}

/* 手机端：光晕收小、关掉网格漂移（小屏上动效更容易看成分辨率问题） */
@media (max-width: 720px) {
  .auth-visual::before { animation-duration: 26s; }
  .auth-visual::after { animation: none; }
  .auth-form .btn-primary::after { animation-duration: 6s; }
}

/* 减少动态效果：全部停掉，保留静态渐变 */
@media (prefers-reduced-motion: reduce) {
  .auth-visual::before,
  .auth-visual::after,
  .auth-form,
  .auth-form .btn-primary::after { animation: none !important; }
}

/* 深色主题：光晕要更亮一点才看得见，否则等于没有 */
[data-theme="dark"] .auth-visual::before {
  background:
    radial-gradient(closest-side, rgba(86, 132, 255, .22), transparent 72%),
    radial-gradient(closest-side, rgba(45, 212, 191, .16), transparent 72%);
}
