/* ============================================================
   barber-membership UI — 设计令牌 + 组件（对齐 docs/UIUX.md）
   v3「barbershop premium」：整卡渐变金刚区 / 铜金点缀 / 大数字排版
   光斑网格纹理 / 交错入场动效 / 毛玻璃导航 / 深色侧栏
   ============================================================ */
:root {
  --bg: #F4F6F9;
  --surface: #FFFFFF;
  --surface-warm: #FBF7F1;
  --fg: #171B21;
  --fg-2: #3A4048;
  --muted: #6B7280;
  --meta: #98A2B3;
  --border: #E6E8EC;
  --border-soft: #F0F1F4;

  --accent: #1976D2;
  --accent-bright: #2196F3;
  --accent-hover: #1565C0;
  --accent-active: #0D47A1;
  --accent-on: #FFFFFF;
  --accent-soft: rgba(25,118,210,.09);
  --accent-grad: linear-gradient(135deg, #2196F3 0%, #1976D2 52%, #125EA6 100%);

  --brand-brass: #B0761F;
  --brand-brass-light: #E8B45A;
  --brass-grad: linear-gradient(135deg, #F0C97E 0%, #D8A23F 55%, #B0761F 100%);
  --brand-brass-soft: rgba(176,118,31,.10);

  --success: #15803D;
  --success-grad: linear-gradient(135deg, #35BA6E 0%, #15803D 55%, #0D6B33 100%);
  --warn: #B45309;
  --danger: #C0362C;
  --danger-grad: linear-gradient(135deg, #E4604F 0%, #C0362C 55%, #A32A22 100%);
  --info: #0E7490;

  --side-bg: #0D2A4A;
  --side-bg-deep: #081C36;
  --side-fg: #A7BCCB;
  --side-fg-dim: rgba(167,188,203,.62);
  --side-border: rgba(255,255,255,.07);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --radius-pill: 9999px;

  --elev-raised: 0 1px 2px rgba(16,42,60,.04), 0 8px 26px rgba(16,42,60,.09);
  --shadow-md: 0 2px 6px rgba(16,42,60,.05), 0 12px 32px rgba(16,42,60,.10);
  --shadow-lg: 0 4px 14px rgba(16,42,60,.10), 0 24px 56px rgba(16,42,60,.16);

  --focus-ring: 0 0 0 4px rgba(25,118,210,.20);

  --motion-fast: 80ms;
  --motion-base: 150ms;
  --motion-enter: 240ms;
  --ease: cubic-bezier(0.2, 0, 0, 1);
  --ease-spring: cubic-bezier(0.34, 1.35, 0.5, 1);

  --font-body: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px;
  --s8: 32px; --s10: 40px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1100px 420px at 12% -8%, rgba(33,150,243,.09), transparent 60%),
    radial-gradient(900px 420px at 105% 6%, rgba(176,118,31,.05), transparent 55%),
    var(--bg);
  background-attachment: fixed;
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  /* 派生语义令牌：必须在 body 层声明，让 var() 跟随当前主题解析
     （放在 :root 会在 html 元素固化成亮色主题的值，暗夜下失效） */
  --money-in: var(--success);
  --money-out: var(--danger);
  --money-neutral: var(--fg);
  --elev-ring: 0 0 0 1px var(--border);
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; }
::selection { background: rgba(25,118,210,.18); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #CBD2DA; border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: #B4BDC8; }

:focus-visible { outline: none; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

.money, .num { font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.money-in { color: var(--money-in); }
.money-out { color: var(--money-out); }
.mono { font-family: var(--font-mono); font-size: 0.92em; }
.muted { color: var(--muted); }
.meta { color: var(--meta); font-size: var(--t-xs, 12px); }

/* ---------- 通用按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4);
  border-radius: var(--radius-sm); border: 1px solid transparent;
  font-size: 15px; font-weight: 580; letter-spacing: .01em; cursor: pointer;
  transition: transform var(--motion-fast) var(--ease),
              box-shadow var(--motion-base) var(--ease),
              background var(--motion-base) var(--ease),
              border-color var(--motion-base) var(--ease), color var(--motion-base) var(--ease);
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary {
  background: var(--accent-grad); color: var(--accent-on);
  box-shadow: 0 4px 14px rgba(25,118,210,.32), inset 0 1px 0 rgba(255,255,255,.18);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); box-shadow: 0 7px 20px rgba(25,118,210,.40), inset 0 1px 0 rgba(255,255,255,.18); }
.btn-primary:active:not(:disabled) { transform: translateY(1px); box-shadow: 0 2px 6px rgba(25,118,210,.30); filter: brightness(.98); }
.btn-secondary { background: var(--surface); color: var(--fg); border-color: var(--border); box-shadow: 0 1px 2px rgba(16,42,60,.04); }
.btn-secondary:hover:not(:disabled) { border-color: var(--accent-bright); color: var(--accent); box-shadow: 0 3px 10px rgba(25,118,210,.13); }
.btn-secondary:active:not(:disabled) { transform: translateY(1px); }
.btn-danger { background: var(--danger-grad); color: #fff; box-shadow: 0 4px 14px rgba(192,54,44,.32); }
.btn-danger:active:not(:disabled) { transform: translateY(1px); }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--fg); background: var(--border-soft); }
.btn-block { width: 100%; }
.btn-lg { min-height: 58px; font-size: 17px; font-weight: 620; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 var(--s3); font-size: 13px; }
.btn .icon { width: 20px; height: 20px; }

/* ---------- 返回上一页（圆形按钮，page-title 内使用） ---------- */
.back-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: var(--radius-pill); text-decoration: none;
  color: var(--muted); background: var(--surface); border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16,42,60,.05);
  transition: color var(--motion-base) var(--ease), background var(--motion-base) var(--ease),
              border-color var(--motion-base) var(--ease), transform var(--motion-fast) var(--ease),
              box-shadow var(--motion-base) var(--ease);
}
.back-btn:hover { color: var(--accent); border-color: var(--accent-bright); box-shadow: var(--focus-ring); transform: translateX(-2px); }
.back-btn:active { transform: translateX(-2px) scale(.95); }
.back-btn .icon { width: 20px; height: 20px; }

/* ---------- 表单 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--s4); }
.label { font-size: 14px; font-weight: 560; color: var(--fg-2); }
.input {
  width: 100%; min-height: 48px; padding: 10px var(--s3);
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--fg);
  font-size: 16px; font-family: inherit;
  transition: border-color var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
}
.input:hover:not(:focus) { border-color: #CBD3DC; }
.input:focus { outline: none; border-color: var(--accent-bright); box-shadow: var(--focus-ring); }
.input::placeholder { color: var(--meta); }
.input-error { border-color: var(--danger) !important; }
.error-text { color: var(--danger); font-size: 13px; display: flex; align-items: center; gap: 4px; }
textarea.input { min-height: 80px; resize: vertical; }
select.input { appearance: auto; }

/* ---------- 卡片 / 徽章 ---------- */
.card {
  background: var(--surface); border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(16,42,60,.03), 0 10px 30px rgba(16,42,60,.05);
  padding: var(--s4);
}
.card-warm {
  background: linear-gradient(180deg, #FEFBF4, var(--surface-warm));
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px rgba(176,118,31,.16), 0 1px 2px rgba(16,42,60,.03), 0 10px 30px rgba(176,118,31,.05);
  padding: var(--s4);
}
.card-title { font-size: 15px; font-weight: 600; margin: 0 0 var(--s3); color: var(--fg-2); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 550; line-height: 1.6;
}
.badge-success { background: rgba(21,128,61,.10); color: var(--success); }
.badge-danger { background: rgba(192,54,44,.10); color: var(--danger); }
.badge-warn { background: rgba(180,83,9,.12); color: var(--warn); }
.badge-info { background: rgba(14,116,144,.10); color: var(--info); }
.badge-neutral { background: var(--border-soft); color: var(--muted); }

/* ---------- 横幅（成功/失败提示） ---------- */
.banner {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3) var(--s4); border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: var(--s4);
  border-left: 3px solid;
}
.banner .icon { width: 20px; height: 20px; flex-shrink: 0; margin-top: 2px; }
.banner-success { background: rgba(21,128,61,.07); color: var(--success); border-left-color: var(--success); }
.banner-error { background: rgba(192,54,44,.06); color: var(--danger); border-left-color: var(--danger); }
.banner-info { background: rgba(14,116,144,.06); color: var(--info); border-left-color: var(--info); }
.banner-title { font-weight: 600; }
.banner-body { color: var(--fg-2); font-size: 13px; }

/* ============================================================
   登录页 v2「暗夜分屏」：极夜底色 + 双色极光 + 发光卡片
   左品牌区 / 右登录卡，对齐参考视觉
   ============================================================ */
.login-page { background: #05070D; }
.login-shell {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column;
  position: relative; overflow: hidden;
  color: #E8ECF4;
  background:
    radial-gradient(1200px 620px at 88% -12%, rgba(37,99,235,.16), transparent 62%),
    radial-gradient(920px 520px at -8% 112%, rgba(20,184,166,.10), transparent 55%),
    #05070D;
}
.login-aurora {
  position: absolute; border-radius: 50%;
  filter: blur(110px); opacity: .55; pointer-events: none; will-change: transform;
}
.login-aurora.a1 { width: 560px; height: 560px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(124,58,237,.50), transparent 65%); animation: driftA 16s ease-in-out infinite alternate; }
.login-aurora.a2 { width: 520px; height: 520px; left: -120px; bottom: -240px; background: radial-gradient(circle, rgba(34,211,238,.36), transparent 65%); animation: driftB 19s ease-in-out infinite alternate; }
.login-aurora.a3 { width: 660px; height: 660px; right: -220px; top: -180px; background: radial-gradient(circle, rgba(37,99,235,.42), transparent 65%); animation: driftC 22s ease-in-out infinite alternate; }
@keyframes driftA { to { transform: translate(70px, 60px) scale(1.12); } }
@keyframes driftB { to { transform: translate(90px, -70px) scale(1.08); } }
@keyframes driftC { to { transform: translate(-80px, 80px) scale(1.15); } }
.login-grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(75% 70% at 60% 42%, #000, transparent 78%);
  mask-image: radial-gradient(75% 70% at 60% 42%, #000, transparent 78%);
  animation: gridPan 60s linear infinite;
}
@keyframes gridPan { to { background-position: 44px 44px; } }
.login-spot {
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(560px circle at var(--sx, 72%) var(--sy, 38%), rgba(56,132,255,.10), transparent 62%);
}
@keyframes drift { to { transform: translate(60px, 40px) scale(1.08); } }

.login-split { position: relative; z-index: 2; flex: 1; display: flex; align-items: stretch; }

/* ---- 左：品牌区 ---- */
.login-intro {
  flex: 1 1 46%; max-width: 620px;
  padding: clamp(32px, 8vh, 100px) clamp(28px, 5vw, 84px);
  display: flex; flex-direction: column; justify-content: center; gap: 16px;
  border-right: 1px solid rgba(255,255,255,.05);
}
.login-brand .logo-mark {
  width: 46px; height: 46px; margin: 0 0 8px; border-radius: 14px;
  background: linear-gradient(135deg, #3B82F6, #1D4ED8);
  display: flex; align-items: center; justify-content: center; color: #fff;
  box-shadow: 0 10px 30px rgba(37,99,235,.45), inset 0 1px 0 rgba(255,255,255,.25);
}
.login-brand .logo-mark .icon { width: 24px; height: 24px; }
.login-eyebrow { margin: 0; color: #FF5C7A; font-size: 13px; font-weight: 600; letter-spacing: .22em; }
.login-title {
  margin: 0; color: #F4F7FF;
  font-size: clamp(34px, 4.6vw, 46px); font-weight: 700; letter-spacing: .02em; line-height: 1.2;
  text-shadow: 0 0 34px rgba(96,165,250,.25);
}
.login-sub { margin: 0; max-width: 40em; color: rgba(214,222,236,.66); font-size: 15px; line-height: 1.75; }
.login-feats { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.login-feats li {
  position: relative; padding-left: 20px;
  color: rgba(203,213,230,.78); font-size: 14px; line-height: 1.65;
  opacity: 0; transform: translateY(10px);
  animation: featIn .55s var(--ease) forwards;
}
.login-feats li:nth-child(1) { animation-delay: .18s; }
.login-feats li:nth-child(2) { animation-delay: .30s; }
.login-feats li:nth-child(3) { animation-delay: .42s; }
.login-feats li:nth-child(4) { animation-delay: .54s; }
@keyframes featIn { to { opacity: 1; transform: none; } }
.login-feats li::before {
  content: ""; position: absolute; left: 2px; top: .62em;
  width: 6px; height: 6px; border-radius: 50%; background: #FF5C7A;
  animation: dotPulse 2.6s ease-out infinite;
}
@keyframes dotPulse {
  0%  { box-shadow: 0 0 0 0 rgba(255,92,122,.45); }
  70% { box-shadow: 0 0 0 7px rgba(255,92,122,0); }
  100%{ box-shadow: 0 0 0 0 rgba(255,92,122,0); }
}

/* ---- 右：登录卡 ---- */
.login-side {
  flex: 1 1 54%;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(24px, 6vh, 72px) clamp(20px, 4vw, 64px);
}
.login-card {
  position: relative; width: 100%; max-width: 424px; overflow: hidden;
  padding: 34px 30px 22px; border-radius: 18px;
  background: linear-gradient(180deg, rgba(19,24,36,.62), rgba(13,17,27,.74));
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
  border: 1px solid rgba(255,255,255,.11);
  box-shadow: 0 30px 80px rgba(0,0,0,.55), inset 0 1px 0 rgba(255,255,255,.08);
  animation: loginIn .55s var(--ease-spring);
  transition: box-shadow .3s var(--ease);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .login-card { background: linear-gradient(180deg, rgba(19,24,36,.96), rgba(13,17,27,.97)); }
}
.login-card:hover { box-shadow: 0 34px 90px rgba(0,0,0,.6), 0 0 46px rgba(37,99,235,.12), inset 0 1px 0 rgba(255,255,255,.06); }
/* 鼠标位置边光（JS 写 --mx/--my） */
.login-card::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, -20%), rgba(86,156,255,.26), transparent 60%);
  opacity: 0; transition: opacity .35s var(--ease);
}
.login-card:hover::before { opacity: 1; }
/* 顶部渐变亮线 */
.login-card::after {
  content: ""; position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(96,165,250,.85), rgba(34,211,238,.7), transparent);
}
@keyframes loginIn { from { opacity: 0; transform: translateY(20px) scale(.97); } }

.signin-eyebrow { margin: 0 0 10px; color: #38BDF8; font-size: 11px; font-weight: 700; letter-spacing: .34em; }
.card-title { margin: 0 0 10px; color: #F2F6FF; font-size: 24px; font-weight: 700; letter-spacing: .01em; }
.card-desc { margin: 0 0 20px; color: rgba(203,213,230,.60); font-size: 13px; line-height: 1.7; }

/* 暗色错误横幅覆盖 */
.login-card .banner { margin: 0 0 16px; border-radius: 10px; border-left-width: 3px; }
.login-card .banner-error { background: rgba(255,92,122,.10); color: #FF8FA6; border-left-color: #FF5C7A; }
.login-card .banner-error .icon { color: #FF5C7A; }
.login-card .banner-error .banner-body { color: rgba(255,143,166,.85); }

/* 文字链：忘记密码 / 返回登录 */
.llink {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: #60A5FA; font-size: 13px; font-family: inherit;
  transition: color .2s var(--ease);
}
.llink:hover { color: #93C5FD; text-decoration: underline; }
.pane-reset .back { margin-top: 16px; font-size: 13.5px; }

/* 输入域 */
.lfield { margin-bottom: 15px; }
.lfield .label { display: block; margin: 0 0 7px; color: rgba(203,213,230,.72); font-size: 13px; font-weight: 500; }
.lcontrol { position: relative; display: flex; align-items: center; }
.lcontrol > .licon {
  position: absolute; left: 13px; width: 17px; height: 17px;
  color: rgba(148,163,184,.55); pointer-events: none; transition: color .2s var(--ease);
}
.lcontrol:focus-within > .licon { color: #60A5FA; }
.linput {
  width: 100%; min-height: 46px; padding: 0 44px 0 40px;
  background: rgba(8,11,18,.75); color: #EDF2FB;
  border: 1px solid rgba(255,255,255,.10); border-radius: 11px;
  font-size: 15px; font-family: inherit; outline: none;
  transition: border-color .2s var(--ease), box-shadow .25s var(--ease), background .2s var(--ease);
}
.linput::placeholder { color: rgba(148,163,184,.42); }
.linput:hover { border-color: rgba(255,255,255,.18); }
.linput:focus {
  border-color: #3B82F6; background: rgba(10,14,24,.9);
  box-shadow: 0 0 0 4px rgba(59,130,246,.16), 0 0 22px rgba(59,130,246,.12);
}
.linput.input-error { border-color: rgba(255,92,122,.65); box-shadow: 0 0 0 4px rgba(255,92,122,.12); }
.leye {
  position: absolute; right: 6px; width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: none; color: rgba(148,163,184,.60); cursor: pointer;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.leye:hover { color: #CBD5E1; background: rgba(255,255,255,.06); }
.leye svg { width: 18px; height: 18px; }

.lrow { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 18px; font-size: 13px; color: rgba(203,213,230,.66); }
.lcheck { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.lcheck input { width: 16px; height: 16px; accent-color: #3B82F6; cursor: pointer; }
.lhint { color: rgba(148,163,184,.55); }

/* 登录按钮：蓝色渐变 + 呼吸光晕（扫光/涟漪由全局 v4 提供） */
.login-submit {
  min-height: 48px; font-size: 15.5px; font-weight: 600;
  letter-spacing: .30em; text-indent: .30em;
  background: linear-gradient(135deg, #2F7BFF 0%, #1D5FE0 55%, #1748C7 100%);
  box-shadow: 0 10px 26px rgba(37,99,235,.40), inset 0 1px 0 rgba(255,255,255,.22);
  animation: submitGlow 3.2s ease-in-out infinite;
}
.login-submit:hover {
  background: linear-gradient(135deg, #3E86FF 0%, #2565EC 55%, #1B50D4 100%);
  box-shadow: 0 14px 36px rgba(37,99,235,.55), inset 0 1px 0 rgba(255,255,255,.25);
}
@keyframes submitGlow {
  50% { box-shadow: 0 10px 32px rgba(37,99,235,.55), 0 0 0 5px rgba(37,99,235,.10), inset 0 1px 0 rgba(255,255,255,.22); }
}

/* 找回密码说明卡 */
.help-card { display: grid; gap: 12px; }
.help-item {
  display: flex; gap: 12px; padding: 14px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09); border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.06);
}
.help-item .n {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(56,132,255,.18); color: #7EB3FF; font-size: 12px; font-weight: 700;
}
.help-item p { margin: 0; font-size: 13px; color: rgba(203,213,230,.75); line-height: 1.65; }
.help-item strong { color: #E6ECF7; font-weight: 600; }

.login-foot {
  margin-top: 22px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,.07);
  text-align: center; color: rgba(148,163,184,.45); font-size: 12px; letter-spacing: .04em;
}
.login-legal { position: absolute; left: 24px; bottom: 18px; z-index: 2; margin: 0; color: rgba(148,163,184,.38); font-size: 12px; }

.hidden { display: none !important; }

@media (max-width: 960px) {
  .login-split { flex-direction: column; }
  .login-intro { max-width: 560px; margin: 0 auto; padding: 52px 24px 10px; border-right: 0; }
  .login-side { padding: 20px 20px 56px; }
  .login-legal { position: static; text-align: center; padding: 0 16px 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .login-aurora, .login-grid, .login-feats li::before, .login-submit { animation: none; }
  .login-feats li { opacity: 1; transform: none; animation: none; }
}

/* ============================================================
   内部页面暗夜皮肤（body.app-night）：与登录页同源的极夜背景
   令牌整体覆盖 + 玻璃导航/横幅/滚动条等少数硬编码修正
   ============================================================ */
body.app-night {
  --bg: #0E1422;
  --surface: #151C2C;
  --surface-warm: #172033;
  --fg: #EDF2FB;
  --fg-2: #D3DCEB;
  --muted: #A2B0C5;
  --meta: #73859E;
  --border: rgba(255,255,255,.11);
  --border-soft: rgba(255,255,255,.065);
  --accent-soft: rgba(59,130,246,.18);
  --brand-brass: #E8B45A;
  --brand-brass-soft: rgba(232,180,90,.14);
  --success: #4ADE80;
  --warn: #FBBF24;
  --danger: #F87171;
  --info: #38BDF8;
  --money-in: var(--success);
  --money-out: var(--danger);
  --elev-ring: 0 0 0 1px rgba(255,255,255,.10);
  --elev-raised: 0 1px 2px rgba(0,0,0,.35), 0 8px 26px rgba(0,0,0,.45);
  --shadow-md: 0 2px 6px rgba(0,0,0,.35), 0 12px 32px rgba(0,0,0,.50);
  --shadow-lg: 0 4px 14px rgba(0,0,0,.40), 0 24px 56px rgba(0,0,0,.55);
  --side-bg: #101A2E;
  --side-bg-deep: #0A1220;
  background:
    radial-gradient(1200px 620px at 88% -12%, rgba(37,99,235,.20), transparent 62%),
    radial-gradient(920px 520px at -8% 112%, rgba(20,184,166,.13), transparent 55%),
    radial-gradient(1100px 640px at 46% 38%, rgba(30,64,138,.16), transparent 62%),
    #0B101C;
  background-attachment: fixed;
  color: var(--fg);
  color-scheme: dark; /* 原生控件（select 菜单/复选框/滚动条）跟随暗色 */
}
body.app-night button { color: inherit; } /* 兜底：未显式声明颜色的按钮继承正文色 */

/* 背景层：极光 + 网格（fixed，滚动不动） */
.app-aurora {
  position: fixed; z-index: 0; border-radius: 50%;
  filter: blur(110px); opacity: .62; pointer-events: none; will-change: transform;
}
.app-aurora.a1 { width: 580px; height: 580px; left: -160px; top: -200px; background: radial-gradient(circle, rgba(124,58,237,.48), transparent 65%); animation: driftA 16s ease-in-out infinite alternate; }
.app-aurora.a2 { width: 540px; height: 540px; left: -120px; bottom: -240px; background: radial-gradient(circle, rgba(34,211,238,.33), transparent 65%); animation: driftB 19s ease-in-out infinite alternate; }
.app-aurora.a3 { width: 680px; height: 680px; right: -220px; top: -180px; background: radial-gradient(circle, rgba(37,99,235,.40), transparent 65%); animation: driftC 22s ease-in-out infinite alternate; }
.app-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(80% 62% at 50% 30%, #000, transparent 80%);
  mask-image: radial-gradient(80% 62% at 50% 30%, #000, transparent 80%);
  animation: gridPan 60s linear infinite;
}
.clerk-shell, .owner-shell { position: relative; z-index: 1; }

/* 玻璃导航 / TabBar → 暗玻璃 */
body.app-night .appbar,
body.app-night .tabbar,
body.app-night .owner-nav,
body.app-night .owner-topbar-mobile {
  background: rgba(10,15,24,.72);
  border-color: rgba(255,255,255,.08);
}
body.app-night .tabbar { box-shadow: 0 -6px 28px rgba(0,0,0,.45); }
body.app-night .owner-appbar { background: rgba(18,24,38,.55); border-color: rgba(255,255,255,.08); -webkit-backdrop-filter: saturate(170%) blur(20px); backdrop-filter: saturate(170%) blur(20px); }

/* 硬编码浅色修正 */
body.app-night .confirm-rows { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.03)); }
body.app-night .banner { border-left-width: 3px; }
body.app-night .banner-error { background: rgba(248,113,113,.10); }
body.app-night .banner-success { background: rgba(74,222,128,.10); }
body.app-night .banner-info { background: rgba(56,189,248,.10); }
body.app-night .banner-warn { background: rgba(251,191,36,.10); }
body.app-night ::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-color: transparent; }
body.app-night ::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,.22); }
body.app-night .ui-table thead th { background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02)); }
body.app-night .switch .track { background: rgba(255,255,255,.18); }

/* ---- 毛玻璃表面（glassmorphism）：极光透卡 ---- */
body.app-night .card,
body.app-night .card-warm,
body.app-night .stat:not(.stat-hero),
body.app-night .member-card,
body.app-night .table-wrap,
body.app-night .search-results,
body.app-night .tier-card:not(.selected) {
  background: rgba(255,255,255,.055);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  backdrop-filter: blur(20px) saturate(160%);
  border-color: rgba(255,255,255,.10);
  box-shadow: 0 8px 32px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.07);
}
body.app-night .modal {
  background: rgba(18,24,38,.78);
  -webkit-backdrop-filter: blur(24px) saturate(165%);
  backdrop-filter: blur(24px) saturate(165%);
  border: 1px solid rgba(255,255,255,.12);
  box-shadow: 0 -12px 48px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08);
}
body.app-night .search-results { box-shadow: 0 18px 48px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.07); }
/* 流水行：轻玻璃（无 blur，行多保性能） */
body.app-night .tx-row {
  background: rgba(255,255,255,.045);
  border-color: rgba(255,255,255,.07);
}
/* 次级按钮玻璃化 */
body.app-night .btn-secondary {
  background: rgba(255,255,255,.06);
  border-color: rgba(255,255,255,.13);
}
body.app-night .btn-secondary:hover:not(:disabled) {
  background: rgba(255,255,255,.10);
  border-color: var(--accent-bright);
}
body.app-night .back-btn {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.16);
}
body.app-night .back-btn:hover {
  background: rgba(255,255,255,.11);
  box-shadow: 0 0 0 4px rgba(59,130,246,.18);
}
/* 顶栏 / TabBar 更通透的玻璃 */
body.app-night .appbar,
body.app-night .tabbar,
body.app-night .owner-nav,
body.app-night .owner-topbar-mobile {
  background: rgba(10,15,24,.55);
  -webkit-backdrop-filter: saturate(170%) blur(20px);
  backdrop-filter: saturate(170%) blur(20px);
}
/* 卡片 hover：玻璃提亮 */
@media (hover: hover) {
  body.app-night .card:hover,
  body.app-night .stat:not(.stat-hero):hover,
  body.app-night .member-card:hover {
    background: rgba(255,255,255,.075);
    border-color: rgba(255,255,255,.16);
  }
}
/* 无 backdrop-filter 支持时回退实色（不透明） */
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  body.app-night .card,
  body.app-night .card-warm,
  body.app-night .stat:not(.stat-hero),
  body.app-night .member-card,
  body.app-night .table-wrap,
  body.app-night .search-results,
  body.app-night .tier-card:not(.selected),
  body.app-night .modal { background: rgba(18,24,38,.96); }
}

/* ---- 筛选 / 输入控件：亮玻璃面，从卡片里浮出来 ---- */
body.app-night .input {
  background: rgba(255,255,255,.07);
  border-color: rgba(255,255,255,.17);
  color: #F1F5FD;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.05);
}
body.app-night .input:hover:not(:focus) { border-color: rgba(255,255,255,.26); }
body.app-night .input:focus {
  background: rgba(255,255,255,.09);
  border-color: var(--accent-bright);
  box-shadow: 0 0 0 4px rgba(59,130,246,.20), 0 0 22px rgba(59,130,246,.14);
}
body.app-night .input::placeholder { color: rgba(148,164,188,.60); }
body.app-night .input.input-error { border-color: rgba(248,113,113,.7) !important; box-shadow: 0 0 0 4px rgba(248,113,113,.12); }
body.app-night .search-results { border: 1px solid rgba(255,255,255,.14); }
body.app-night .label { color: var(--fg-2); }
body.app-night .member-card .balance-item.total .v {
  color: #FFFFFF;
  text-shadow: 0 0 20px rgba(59,130,246,.35);
}

/* ============================================================
   店员端外壳：顶栏 + 内容 + 底部 TabBar
   ============================================================ */
.clerk-shell, .owner-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.appbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.86);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding: var(--s3) var(--s4);
  display: flex; align-items: center; gap: var(--s3);
}
.appbar .brand { display: flex; align-items: center; gap: var(--s2); font-weight: 660; font-size: 16px; letter-spacing: .01em; }
.appbar .brand .icon { width: 22px; height: 22px; color: var(--brand-brass); }
.appbar .spacer { flex: 1; }
.appbar .user-chip { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius-pill);
  background: transparent; border: none; color: var(--muted); cursor: pointer;
  transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), transform var(--motion-fast) var(--ease);
}
.icon-btn:hover { background: var(--border-soft); color: var(--fg); }
.icon-btn:active { transform: scale(.94); }
.icon-btn .icon { width: 22px; height: 22px; }

.page { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: var(--s4) var(--s4) calc(88px + env(safe-area-inset-bottom)); }
@media (min-width: 768px) { .page { padding-bottom: var(--s6); } }

.page-title { font-size: 23px; font-weight: 680; margin: var(--s2) 0 var(--s4); display: flex; align-items: center; gap: var(--s2); letter-spacing: .01em; }
.page-title .icon {
  width: 42px; height: 42px; padding: 9px; color: var(--accent);
  background: var(--accent-soft); border-radius: 13px;
}

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -6px 28px rgba(16,42,60,.08);
}
.tabbar-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 0 7px; font-size: 11px; font-weight: 550; color: var(--muted);
  text-decoration: none; min-height: 54px; position: relative;
  transition: color var(--motion-base) var(--ease);
}
.tabbar-item .icon {
  width: 24px; height: 24px; padding: 3px 13px; margin: -3px -13px; border-radius: var(--radius-pill);
  transition: background var(--motion-base) var(--ease), transform var(--motion-base) var(--ease-spring);
}
.tabbar-item.active { color: var(--accent); }
.tabbar-item.active .icon { background: var(--accent-soft); transform: translateY(-1px); }
.tabbar-item.active::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--accent-grad);
}
@media (min-width: 768px) { .tabbar { display: none; } }

/* ---------- 店员工作台：整卡渐变金刚区 ---------- */
.action-grid { display: grid; grid-template-columns: 1fr; gap: var(--s3); }
@media (min-width: 600px) { .action-grid { grid-template-columns: 1fr 1fr; } }
.action-btn {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: var(--s4);
  min-height: 100px; padding: var(--s5) var(--s4);
  border: none; border-radius: var(--radius-md);
  color: #fff; text-decoration: none;
  transition: transform var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease), filter var(--motion-base) var(--ease);
  animation: cardIn .45s var(--ease-spring) backwards;
}
.action-grid .action-btn:nth-child(1) { animation-delay: 20ms; }
.action-grid .action-btn:nth-child(2) { animation-delay: 80ms; }
.action-grid .action-btn:nth-child(3) { animation-delay: 140ms; }
.action-grid .action-btn:nth-child(4) { animation-delay: 200ms; }
@keyframes cardIn { from { opacity: 0; transform: translateY(16px) scale(.97); } }
.action-btn::after {
  content: ""; position: absolute; right: -46px; top: -66px;
  width: 190px; height: 190px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 68%);
  pointer-events: none;
}
.action-btn.t-blue { background: var(--accent-grad); box-shadow: 0 8px 22px rgba(25,118,210,.32); }
.action-btn.t-green { background: var(--success-grad); box-shadow: 0 8px 22px rgba(21,128,61,.30); }
.action-btn.t-red { background: var(--danger-grad); box-shadow: 0 8px 22px rgba(192,54,44,.28); }
.action-btn.t-brass { background: var(--brass-grad); box-shadow: 0 8px 22px rgba(176,118,31,.32); }
@media (hover: hover) {
  .action-btn:hover { transform: translateY(-3px); filter: brightness(1.06); }
  .action-btn.t-blue:hover { box-shadow: 0 14px 34px rgba(25,118,210,.42); }
  .action-btn.t-green:hover { box-shadow: 0 14px 34px rgba(21,128,61,.40); }
  .action-btn.t-red:hover { box-shadow: 0 14px 34px rgba(192,54,44,.38); }
  .action-btn.t-brass:hover { box-shadow: 0 14px 34px rgba(176,118,31,.42); }
  .action-btn:active { transform: translateY(-1px) scale(.99); filter: brightness(.98); }
}
.action-btn .action-icon {
  width: 54px; height: 54px; border-radius: 16px;
  background: rgba(255,255,255,.18);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
}
.action-btn .action-icon .icon { width: 28px; height: 28px; }
.action-btn .action-text b { display: block; font-size: 19px; font-weight: 660; letter-spacing: .01em; }
.action-btn .action-text span { font-size: 13px; color: rgba(255,255,255,.78); }

/* ---------- 会员搜索 ---------- */
.search-wrap { position: relative; }
.search-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: var(--surface); border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg); overflow: hidden;
  max-height: 320px; overflow-y: auto;
  animation: dropIn var(--motion-enter) var(--ease);
  transform-origin: top center;
}
@keyframes dropIn { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.search-result-item {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  width: 100%; padding: var(--s3) var(--s4);
  background: none; border: none; border-bottom: 1px solid var(--border-soft);
  color: var(--fg); /* button 不继承正文色，必须显式声明（否则暗色主题下 UA 默认黑字看不见） */
  cursor: pointer; text-align: left; font-size: 15px;
  transition: background var(--motion-fast) var(--ease);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--accent-soft); }
.search-result-item .who { display: flex; flex-direction: column; }
.search-result-item .who b { font-weight: 560; }
.search-result-item .who span { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.search-result-item .bal { font-size: 15px; font-weight: 640; white-space: nowrap; }

/* ---------- 会员卡（选中后展示） ---------- */
.member-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--s4); margin-bottom: var(--s4);
  box-shadow: 0 0 0 1px var(--border), 0 10px 30px rgba(16,42,60,.08);
  animation: popIn var(--motion-enter) var(--ease-spring);
}
.member-card .head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.member-card .avatar {
  width: 48px; height: 48px; border-radius: 16px;
  background: var(--brass-grad); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; font-weight: 660; flex-shrink: 0;
  box-shadow: 0 5px 12px rgba(176,118,31,.32), inset 0 1px 0 rgba(255,255,255,.35);
}
.member-card .head .who { flex: 1; min-width: 0; }
.member-card .head .who b { font-size: 17px; font-weight: 660; display: block; }
.member-card .head .who span { font-size: 12px; color: var(--muted); font-family: var(--font-mono); }
.member-card .balances { display: grid; grid-template-columns: 1fr 1fr 1.2fr; gap: var(--s2); border-top: 1px solid var(--border-soft); padding-top: var(--s3); }
.member-card .balance-item { text-align: center; }
.member-card .balance-item + .balance-item { border-left: 1px solid var(--border-soft); }
.member-card .balance-item .k { font-size: 12px; color: var(--muted); }
.member-card .balance-item .v { font-size: 18px; font-weight: 620; font-variant-numeric: tabular-nums; }
.member-card .balance-item.total .v { font-size: 26px; font-weight: 700; color: var(--money-neutral); letter-spacing: -.025em; }

/* ---------- 档位卡片 ---------- */
.tier-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (min-width: 768px) { .tier-grid { grid-template-columns: repeat(3, 1fr); } }
.tier-card {
  position: relative;
  background: var(--surface); border: 1.5px solid var(--border); border-radius: var(--radius-md);
  padding: var(--s4) var(--s3); text-align: center; cursor: pointer;
  box-shadow: 0 1px 2px rgba(16,42,60,.03);
  transition: border-color var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease),
              transform var(--motion-base) var(--ease), background var(--motion-base) var(--ease);
}
.tier-card:hover { border-color: var(--accent-bright); transform: translateY(-2px); box-shadow: var(--elev-raised); }
.tier-card:active { transform: scale(.98); }
.tier-card.selected {
  background: var(--accent-grad); border-color: transparent;
  box-shadow: 0 8px 22px rgba(25,118,210,.38), inset 0 1px 0 rgba(255,255,255,.22);
}
.tier-card .pay { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.025em; }
.tier-card .gift { font-size: 13px; color: var(--success); margin-top: 2px; font-weight: 550; }
.tier-card .gift.none { color: var(--meta); }
.tier-card .total { font-size: 12px; color: var(--muted); margin-top: 5px; }
.tier-card.selected .pay { color: #fff; }
.tier-card.selected .gift { color: #A5E8BE; }
.tier-card.selected .gift.none { color: rgba(255,255,255,.6); }
.tier-card.selected .total { color: rgba(255,255,255,.72); }

/* ---------- 底部抽屉/居中弹窗（二次确认） ---------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(10,29,44,.52);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadeIn var(--motion-enter) var(--ease);
}
@media (min-width: 640px) { .modal-mask { align-items: center; } }
.modal {
  width: 100%; max-width: 480px;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  padding: var(--s5) var(--s4) calc(var(--s4) + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 48px rgba(5,20,32,.25);
  animation: slideUp var(--motion-enter) var(--ease-spring);
}
.modal::before {
  content: ""; display: block; width: 40px; height: 4px; border-radius: 4px;
  background: var(--border); margin: 0 auto var(--s3);
}
@media (min-width: 640px) {
  .modal { border-radius: var(--radius-lg); padding-bottom: var(--s5); box-shadow: var(--shadow-lg); }
  .modal::before { display: none; }
}
.modal h3 { margin: 0 0 var(--s3); font-size: 18px; font-weight: 660; display: flex; align-items: center; gap: var(--s2); }
.modal h3 .icon { width: 22px; height: 22px; color: var(--accent); }
.confirm-rows { background: linear-gradient(180deg,#F7F9FB,var(--border-soft)); border-radius: var(--radius-md); padding: var(--s3) var(--s4); margin-bottom: var(--s4); }
.confirm-row { display: flex; justify-content: space-between; align-items: baseline; padding: 6px 0; font-size: 15px; }
.confirm-row + .confirm-row { border-top: 1px dashed var(--border); }
.confirm-row .k { color: var(--muted); }
.confirm-row .v { font-weight: 560; font-variant-numeric: tabular-nums; }
.confirm-row.big .v { font-size: 26px; font-weight: 700; letter-spacing: -.025em; }
.modal-actions { display: flex; gap: var(--s3); }

/* ---------- 流水行 ---------- */
.tx-list { display: flex; flex-direction: column; gap: var(--s2); }
.tx-row {
  display: flex; align-items: center; gap: var(--s3);
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius-md);
  padding: var(--s3) var(--s4);
  box-shadow: 0 1px 2px rgba(16,42,60,.03);
  transition: box-shadow var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.tx-row:hover { border-color: var(--border); box-shadow: var(--elev-raised); }
.tx-row .tx-icon { width: 38px; height: 38px; border-radius: 12px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tx-row .tx-icon .icon { width: 20px; height: 20px; }
.tx-icon.in { background: rgba(21,128,61,.10); color: var(--success); }
.tx-icon.out { background: rgba(192,54,44,.08); color: var(--danger); }
.tx-icon.neutral { background: var(--border-soft); color: var(--muted); }
.tx-row .tx-main { flex: 1; min-width: 0; }
.tx-row .tx-main .l1 { display: flex; align-items: center; gap: 6px; font-weight: 560; font-size: 15px; }
.tx-row .tx-main .l2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tx-row .tx-amount { text-align: right; }
.tx-row .tx-amount .amt { font-size: 17px; font-weight: 680; font-variant-numeric: tabular-nums; display: block; letter-spacing: -.015em; }
.tx-row .tx-amount .after { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 空状态 ---------- */
.empty { text-align: center; padding: var(--s8) var(--s4); color: var(--muted); }
.empty .icon {
  width: 60px; height: 60px; color: var(--meta); margin: 0 auto var(--s3);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--border-soft); border-radius: 50%; padding: 15px;
}
.empty p { margin: 0; font-size: 14px; }
.empty .hint { font-size: 12px; color: var(--meta); margin-top: 4px; }

/* ---------- 加载中 ---------- */
.loading { display: flex; align-items: center; justify-content: center; gap: var(--s2); padding: var(--s4); color: var(--muted); font-size: 14px; }
.spinner {
  width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(25,118,210,.18); border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}

/* ============================================================
   老板端外壳：侧边栏（桌面） + 顶部横向导航（移动）
   ============================================================ */
.owner-nav {
  display: flex; gap: var(--s2); overflow-x: auto;
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 30;
  padding: 0 var(--s3); scrollbar-width: none;
}
.owner-nav::-webkit-scrollbar { display: none; }
.owner-nav-item {
  display: flex; align-items: center; gap: 6px;
  padding: var(--s3) var(--s3); font-size: 14px; font-weight: 550; color: var(--muted);
  border-bottom: 2.5px solid transparent; white-space: nowrap; text-decoration: none;
  min-height: 48px; position: relative;
  transition: color var(--motion-base) var(--ease), border-color var(--motion-base) var(--ease);
}
.owner-nav-item .icon { width: 18px; height: 18px; }
.owner-nav-item.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 620; }

@media (min-width: 1024px) {
  .owner-shell { flex-direction: row; }
  .owner-side {
    width: 240px; flex-shrink: 0;
    background: linear-gradient(180deg, var(--side-bg) 0%, var(--side-bg-deep) 100%);
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
  }
  .owner-side::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background:
      radial-gradient(320px 220px at -20% -5%, rgba(33,150,243,.18), transparent 60%),
      radial-gradient(260px 200px at 120% 108%, rgba(216,162,63,.10), transparent 60%);
  }
  .owner-side { position: sticky; }
  .owner-side .side-brand {
    position: relative;
    display: flex; align-items: center; gap: var(--s2);
    padding: var(--s5) var(--s4); font-weight: 680; color: #fff; letter-spacing: .02em;
    border-bottom: 1px solid var(--side-border);
  }
  .owner-side .side-brand .icon { width: 24px; height: 24px; color: var(--brand-brass-light); }
  .side-link {
    position: relative;
    display: flex; align-items: center; gap: var(--s3);
    margin: 2px 10px; padding: var(--s3) var(--s4);
    border-radius: var(--radius-sm); border-left: none;
    color: var(--side-fg); font-size: 14.5px; font-weight: 550; text-decoration: none;
    transition: background var(--motion-base) var(--ease), color var(--motion-base) var(--ease), box-shadow var(--motion-base) var(--ease);
  }
  .side-link .icon { width: 20px; height: 20px; color: var(--side-fg-dim); transition: color var(--motion-base) var(--ease); }
  .side-link:hover { background: rgba(255,255,255,.07); color: #fff; }
  .side-link:hover .icon { color: var(--side-fg); }
  .side-link.active {
    background: var(--accent-grad); color: #fff; font-weight: 620;
    box-shadow: 0 5px 16px rgba(25,118,210,.48), inset 0 1px 0 rgba(255,255,255,.18);
  }
  .side-link.active .icon { color: #fff; }
  .side-footer { position: relative; margin-top: auto; padding: var(--s4); border-top: 1px solid var(--side-border); font-size: 12px; color: var(--side-fg-dim); }
  .side-footer .btn-secondary { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.14); color: #DCE7EF; }
  .side-footer .btn-secondary:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.22); color: #fff; box-shadow: none; }
  .owner-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
  .owner-side { display: flex; }
  .owner-nav, .owner-topbar-mobile { display: none; }
}
.owner-topbar-mobile {
  display: flex; align-items: center; gap: var(--s3);
  background: rgba(255,255,255,.88);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
  padding: var(--s3) var(--s4); position: sticky; top: 0; z-index: 31;
}
.owner-topbar-mobile .brand { display: flex; align-items: center; gap: var(--s2); font-weight: 660; }
.owner-topbar-mobile .brand .icon { width: 22px; height: 22px; color: var(--brand-brass); }
@media (min-width: 1024px) { .owner-topbar-mobile { display: none; } }
.owner-appbar {
  display: none; align-items: center; gap: var(--s3);
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: var(--s2) var(--s5);
}
@media (min-width: 1024px) { .owner-appbar { display: flex; } }
.owner-appbar .spacer { flex: 1; }

/* ---------- 看板统计卡 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--s3); }
@media (min-width: 1024px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: var(--s4); position: relative; overflow: hidden;
  box-shadow: 0 1px 2px rgba(16,42,60,.03);
  transition: box-shadow var(--motion-base) var(--ease), transform var(--motion-base) var(--ease);
  animation: cardIn .45s var(--ease-spring) backwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.stat-grid .stat:nth-child(1) { --i: 0; }
.stat-grid .stat:nth-child(2) { --i: 1; }
.stat-grid .stat:nth-child(3) { --i: 2; }
.stat-grid .stat:nth-child(4) { --i: 3; }
@media (hover: hover) {
  .stat:hover { box-shadow: var(--elev-raised); transform: translateY(-2px); }
}
.stat .k { font-size: 13px; font-weight: 550; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .k .icon { width: 16px; height: 16px; color: var(--accent-bright); }
.stat .v { font-size: 28px; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -.025em; margin-top: 6px; }
.stat .v.money-in { font-size: 28px; }
.stat .v.money-out { font-size: 28px; }
.stat .sub { font-size: 12px; color: var(--meta); margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat-hero {
  grid-column: 1 / -1;
  background: var(--accent-grad); border: none; color: #fff;
  box-shadow: 0 10px 30px rgba(25,118,210,.38);
}
.stat-hero::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 30px 30px;
  -webkit-mask-image: radial-gradient(120% 130% at 85% 0%, #000 30%, transparent 78%);
  mask-image: radial-gradient(120% 130% at 85% 0%, #000 30%, transparent 78%);
}
.stat-hero::after {
  content: ""; position: absolute; right: -70px; top: -90px;
  width: 260px; height: 260px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 68%);
  pointer-events: none;
}
.stat-hero .k { color: rgba(255,255,255,.82); }
.stat-hero .k .icon { color: var(--brand-brass-light); }
.stat-hero .v { font-size: 46px; font-weight: 720; letter-spacing: -.03em; color: #fff; }
.stat-hero .v span.unit { font-size: 19px; color: rgba(255,255,255,.65); font-weight: 510; }
.stat-hero .sub { color: rgba(255,255,255,.68); }

/* ---------- 数据表格（桌面表格 / 移动卡片化） ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; box-shadow: 0 1px 2px rgba(16,42,60,.03), 0 8px 24px rgba(16,42,60,.04); }
.ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ui-table th {
  text-align: left; font-weight: 600; font-size: 12px; letter-spacing: .05em;
  color: var(--muted);
  padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg,#FAFBFC,var(--border-soft)); white-space: nowrap;
}
.ui-table td { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.ui-table tr:last-child td { border-bottom: none; }
.ui-table tr.rowlink { cursor: pointer; transition: background var(--motion-fast) var(--ease); }
.ui-table tr.rowlink:hover td { background: var(--accent-soft); }
.ui-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.ui-table th.num { text-align: right; }

@media (max-width: 767px) {
  .ui-table thead { display: none; }
  .ui-table, .ui-table tbody, .ui-table tr, .ui-table td { display: block; width: 100%; }
  .ui-table tr { border-bottom: 1px solid var(--border); padding: var(--s2) 0; }
  .ui-table tr:last-child { border-bottom: none; }
  .ui-table td { border-bottom: none; padding: 4px var(--s4); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); }
  .ui-table td::before {
    content: attr(data-label); color: var(--muted); font-size: 12px; flex-shrink: 0;
  }
  .ui-table td.td-actions { justify-content: flex-end; }
  .ui-table .num { text-align: right; }
}

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-bottom: var(--s4);
}
@media (min-width: 768px) { .filter-bar { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.filter-bar .field { margin-bottom: 0; }
.filter-bar .input { min-height: 42px; font-size: 14px; }

/* ---------- 分页 ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: var(--s2);
  padding: var(--s4) 0; flex-wrap: wrap;
}
.pagination .info { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 26px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; background: #D4D9DF; border-radius: var(--radius-pill);
  transition: background var(--motion-base) var(--ease); cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px;
  background: var(--surface); border-radius: 50%;
  transition: transform var(--motion-base) var(--ease-spring); box-shadow: 0 1px 3px rgba(0,0,0,.22);
}
.switch input:checked + .track { background: var(--accent-grad); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ---------- 动画 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes slideUp { from { transform: translateY(28px); opacity: .6; } }
@keyframes popIn { 0% { transform: scale(.94); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
.pop-in { animation: popIn var(--motion-enter) var(--ease-spring); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 全局 Livewire 加载进度条（点按即时反馈） ---------- */
.lw-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 3px;
  z-index: 9999;
  pointer-events: none;
  background: var(--accent-grad);
  opacity: 0;
  transition: opacity .12s ease;
}
.lw-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.85), transparent);
  transform: translateX(-100%);
}
body.lw-busy .lw-progress { opacity: 1; }
body.lw-busy .lw-progress::after { animation: lw-sweep 1s ease-in-out infinite; }
@keyframes lw-sweep {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
body.lw-busy { cursor: progress; }
body.lw-busy .btn:not([disabled]),
body.lw-busy .action-btn { cursor: progress; }

/* ============================================================
   v4 特效层：涟漪 / 聚光灯 / 扫光 / 流动渐变 / 滚动显现 / 彩带
   ============================================================ */

/* ---- 涟漪载体（overflow 收敛） ---- */
.btn, .icon-btn, .tabbar-item, .side-link, .search-result-item, .tier-card {
  position: relative;
  overflow: hidden;
}
.fx-ripple {
  position: absolute; z-index: 1;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(25,118,210,.25) 0%, rgba(25,118,210,.08) 55%, transparent 70%);
  transform: scale(0);
  animation: fxRip .65s cubic-bezier(0.2, 0, 0, 1) forwards;
}
.btn-primary .fx-ripple, .btn-danger .fx-ripple, .action-btn .fx-ripple,
.tier-card.selected .fx-ripple, .side-link.active .fx-ripple, .tabbar-item.active .fx-ripple {
  background: radial-gradient(circle, rgba(255,255,255,.5) 0%, rgba(255,255,255,.12) 55%, transparent 70%);
}
@keyframes fxRip { to { transform: scale(1); opacity: 0; } }

/* ---- 主按钮 hover 扫光 ---- */
.btn-primary::after {
  content: ""; position: absolute; top: -10%; bottom: -10%; left: -80%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.42), transparent);
  transform: skewX(-18deg);
  pointer-events: none;
}
@media (hover: hover) {
  .btn-primary:hover:not(:disabled)::after { animation: fxShine .85s var(--ease); }
}
@keyframes fxShine { to { transform: skewX(-18deg) translateX(420%); } }

/* ---- 渐变常驻流动（金刚区 / hero / 选中态 / 侧栏 active） ---- */
@keyframes fxFlow {
  0%, 100% { background-position: 0% 0%; }
  50%      { background-position: 100% 100%; }
}
.action-btn { background-size: 170% 170%; animation: cardIn .45s var(--ease-spring) backwards, fxFlow 10s ease-in-out infinite; }
.stat-hero  { background-size: 170% 170%; animation: cardIn .45s var(--ease-spring) backwards, fxFlow 11s ease-in-out infinite; }
.tier-card.selected { background-size: 170% 170%; animation: fxFlow 7s ease-in-out infinite; }
.side-link.active {
  background-size: 170% 170%;
  animation: fxFlow 9s ease-in-out infinite, fxSideGlow 3.4s ease-in-out infinite;
}
@keyframes fxSideGlow { 50% { filter: brightness(1.12); } }

/* ---- 卡片聚光灯（JS 设置 --mx/--my） ---- */
.fx-glow {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  opacity: 0; transition: opacity .35s var(--ease);
  background: radial-gradient(230px circle at var(--mx, 50%) var(--my, 50%), rgba(33,150,243,.16), transparent 62%);
}
.action-btn .fx-glow, .stat-hero .fx-glow, .tier-card.selected .fx-glow {
  background: radial-gradient(230px circle at var(--mx, 50%) var(--my, 50%), rgba(255,255,255,.24), transparent 62%);
}

/* ---- 金刚区图标 hover 弹跳 ---- */
@media (hover: hover) {
  .action-btn:hover .action-icon .icon { animation: fxWig .55s var(--ease-spring); }
}
@keyframes fxWig {
  30% { transform: rotate(-8deg) scale(1.16); }
  65% { transform: rotate(5deg) scale(1.08); }
}

/* ---- 档位选中角标 ---- */
.tier-card.selected::before {
  content: "✓"; position: absolute; top: 8px; right: 9px; z-index: 2;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.26); color: #fff;
  font-size: 12px; font-weight: 700; font-style: normal;
  animation: popIn .3s var(--ease-spring);
}

/* ---- 表格 / 流水行左侧指示条 ---- */
.ui-table tbody tr.rowlink { transition: box-shadow var(--motion-base) var(--ease); }
.ui-table tbody tr.rowlink:hover td:first-child { box-shadow: inset 3px 0 0 var(--accent-bright); }
.tx-row:hover { box-shadow: var(--elev-raised), inset 3px 0 0 var(--accent-bright); }

/* ---- 输入框 focus 呼吸 ---- */
.input:focus { animation: fxPulse 1.2s var(--ease) 2; }
@keyframes fxPulse { 50% { box-shadow: 0 0 0 7px rgba(25,118,210,.13); } }

/* ---- 空状态浮动 / logo 光环 ---- */
.empty .icon { animation: fxBob 3.4s ease-in-out infinite; }
@keyframes fxBob { 50% { transform: translateY(-6px); } }
.login-brand .logo-mark { animation: fxHalo 3.6s ease-in-out infinite; }
@keyframes fxHalo {
  50% { box-shadow: 0 12px 32px rgba(25,118,210,.52), 0 0 0 9px rgba(232,180,90,.20), inset 0 1px 0 rgba(255,255,255,.25); }
}

/* ---- 成功横幅打勾弹跳 ---- */
.banner-success > .icon { animation: fxCheck .6s var(--ease-spring); }
@keyframes fxCheck {
  0%   { transform: scale(0) rotate(-25deg); }
  60%  { transform: scale(1.22) rotate(6deg); }
  100% { transform: scale(1) rotate(0); }
}

/* ---- 弹窗内容依次入场 ---- */
.modal > * { animation: fxRow .42s var(--ease) both; }
.modal > *:nth-child(1) { animation-delay: .04s; }
.modal > *:nth-child(2) { animation-delay: .10s; }
.modal > *:nth-child(3) { animation-delay: .16s; }
.modal > *:nth-child(4) { animation-delay: .22s; }
.modal > *:nth-child(5) { animation-delay: .28s; }
.modal > *:nth-child(n+6) { animation-delay: .34s; }
@keyframes fxRow { from { opacity: 0; transform: translateY(12px); } }

/* ---- hero 卡光斑漂移 ---- */
.stat-hero::after { animation: drift 15s ease-in-out infinite alternate; }

/* ---- 滚动显现（html.js-fx 由 JS 标记，无 JS 零影响） ---- */
html.js-fx .fx-rv:not(.fx-in) { opacity: 0; transform: translateY(14px); }
html.js-fx .fx-rv { transition: opacity .45s var(--ease), transform .55s var(--ease); }

/* ---- 彩带画布 ---- */
.fx-confetti { position: fixed; inset: 0; z-index: 9998; pointer-events: none; }
