/* ============================================================
   上海嘉定武校 · 门店运营管理系统 (SOMS)
   设计令牌 / 布局 / 组件
   ============================================================ */

:root {
  --primary: #c1272d;
  --primary-600: #a81e24;
  --primary-700: #8d181e;
  --primary-50: #fdf3f3;
  --primary-100: #fae2e3;

  --ink: #111827;
  --ink-2: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;

  --line: #e5e7eb;
  --line-2: #f1f2f4;
  --bg: #f4f5f7;
  --card: #ffffff;

  --ok: #15803d;
  --ok-bg: #ecfdf3;
  --ok-line: #bbf7d0;
  --warn: #b45309;
  --warn-bg: #fffbeb;
  --warn-line: #fde68a;
  --danger: #b91c1c;
  --danger-bg: #fef2f2;
  --danger-line: #fecaca;
  --info: #1d4ed8;
  --info-bg: #eff6ff;
  --info-line: #bfdbfe;
  --muted-bg: #f3f4f6;

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow-xs: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 40px rgba(16, 24, 40, 0.16);
  --sidebar-w: 236px;
  --topbar-h: 62px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3, h4 { margin: 0; font-weight: 650; line-height: 1.35; }
p { margin: 0; }
a { color: var(--primary); text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: #d3d6db; border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: #b9bdc5; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------------------------- 启动占位 ---------------------------- */
.boot {
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; color: var(--muted);
}
.boot p { font-size: 13px; }

/* ---------------------------- 基础控件 ---------------------------- */
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid var(--primary-100); border-top-color: var(--primary);
  animation: spin 0.7s linear infinite; display: inline-block; flex: none;
}
.spinner.lg { width: 30px; height: 30px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  font-size: 13.5px; font-weight: 550; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}
.btn:hover { background: #fafbfc; border-color: #d6d9de; }
.btn:active { transform: translateY(0.5px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-600); border-color: var(--primary-600); }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #991b1b; border-color: #991b1b; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn-ok:hover { background: #136c34; border-color: #136c34; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--muted-bg); color: var(--ink-2); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 15px; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { padding: 0 8px; }

.input, .select, .textarea {
  width: 100%; height: 38px; padding: 0 11px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: #fff; color: var(--ink);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { height: auto; min-height: 78px; padding: 9px 11px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-50);
}
.input::placeholder, .textarea::placeholder { color: var(--muted-2); }
.input:disabled, .select:disabled { background: #f9fafb; color: var(--muted); }
.select {
  appearance: none; padding-right: 30px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5L6 8l3.5-3.5' fill='none' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
}

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.field .err { font-size: 12px; color: var(--danger); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 14px; }
.form-section-title {
  font-size: 13px; font-weight: 650; color: var(--ink); margin: 4px 0 12px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line-2);
}

/* ---------------------------- 徽标 / 状态 ---------------------------- */
.pill {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px;
  border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--muted-bg); color: var(--muted); border: 1px solid transparent;
}
.pill-ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.pill-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.pill-danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.pill-info { background: var(--info-bg); color: var(--info); border-color: var(--info-line); }
.pill-primary { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px;
  background: var(--muted-bg); border-radius: 7px; font-size: 12.5px; color: var(--ink-2);
}

/* 到馆名单名牌（数据看板「今日到馆」）：在店实底、离店浅底，点姓名开学员详情 */
.chip-group-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 650; color: var(--ink); margin-bottom: 9px;
}
.chip-group-label + .chip-group-label { margin-top: 15px; }
.name-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip-sub-label {
  font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 2px 8px; border-radius: 6px; background: var(--muted-bg);
  flex: 0 0 auto; white-space: nowrap;
}
.name-chip {
  display: inline-flex; align-items: center; height: 28px; padding: 0 13px;
  border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  border: 1px solid transparent; white-space: nowrap;
}
.name-chip.is-in { background: var(--primary); color: #fff; }
.name-chip.is-in:hover { background: var(--primary-600); }
.name-chip.is-out { background: var(--primary-50); color: var(--primary-600); border-color: var(--primary-100); }
.name-chip.is-out:hover { background: var(--primary-100); }

/* ---------------------------- 登录页 ---------------------------- */
.auth-wrap {
  min-height: 100vh; display: grid; grid-template-columns: 1.05fr 0.95fr;
  background: var(--bg);
}
.auth-hero {
  position: relative; overflow: hidden; padding: 54px 60px;
  background: linear-gradient(150deg, #7f1418 0%, #a81e24 46%, #c1272d 100%);
  color: #fff; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-hero::after {
  content: ""; position: absolute; right: -140px; bottom: -170px;
  width: 460px; height: 460px; border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.16), transparent 66%);
}
.auth-hero::before {
  content: "武"; position: absolute; right: 34px; bottom: -34px;
  font-size: 300px; font-weight: 800; color: rgba(255, 255, 255, 0.07); line-height: 1;
  font-family: serif;
}
.auth-brand { display: flex; align-items: center; gap: 13px; position: relative; z-index: 1; }
.auth-brand .mark {
  width: 46px; height: 46px; border-radius: 12px; background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28); display: grid; place-items: center;
  font-size: 22px; font-weight: 700; font-family: serif;
}
.auth-brand .txt strong { display: block; font-size: 17px; letter-spacing: 0.5px; }
.auth-brand .txt span { font-size: 12.5px; opacity: 0.78; letter-spacing: 2px; }
.auth-hero-body { position: relative; z-index: 1; max-width: 430px; }
.auth-hero-body h1 { font-size: 30px; line-height: 1.35; letter-spacing: 0.5px; }
.auth-hero-body p { margin-top: 14px; font-size: 14px; opacity: 0.85; line-height: 1.85; }
.auth-hero-list { margin-top: 30px; display: grid; gap: 11px; }
.auth-hero-list div { display: flex; align-items: center; gap: 9px; font-size: 13.5px; opacity: 0.9; }
.auth-hero-list i {
  width: 18px; height: 18px; border-radius: 5px; background: rgba(255, 255, 255, 0.2);
  display: grid; place-items: center; font-style: normal; font-size: 11px;
}
.auth-hero-foot { position: relative; z-index: 1; font-size: 12px; opacity: 0.62; }

.auth-panel { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 384px; }
.auth-card > h2 { font-size: 21px; margin-bottom: 6px; }
.auth-card > .sub { font-size: 13px; color: var(--muted); margin-bottom: 22px; }
.auth-tabs {
  display: flex; gap: 4px; padding: 4px; background: var(--muted-bg);
  border-radius: 10px; margin-bottom: 20px;
}
.auth-tabs button {
  flex: 1; height: 34px; border: 0; background: transparent; border-radius: 7px;
  font-size: 13.5px; font-weight: 550; color: var(--muted); cursor: pointer;
}
.auth-tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }
.otp-row { display: flex; gap: 8px; }
.otp-row .btn { flex: none; min-width: 104px; }
.auth-alert {
  padding: 9px 12px; border-radius: var(--radius-sm); font-size: 12.8px; margin-bottom: 14px;
  background: var(--danger-bg); color: var(--danger); border: 1px solid var(--danger-line);
}
.auth-alert.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }
.auth-foot { margin-top: 18px; text-align: center; font-size: 12.5px; color: var(--muted); }
.auth-foot a { font-weight: 550; }
.auth-note {
  margin-top: 18px; padding: 11px 13px; background: var(--muted-bg); border-radius: var(--radius-sm);
  font-size: 12.2px; color: var(--muted); line-height: 1.7;
}

/* ---------------------------- 主框架 ---------------------------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w); background: #fff;
  border-right: 1px solid var(--line); display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; z-index: 40;
}
.sidebar-brand {
  height: var(--topbar-h); flex: none; display: flex; align-items: center; gap: 10px;
  padding: 0 16px; border-bottom: 1px solid var(--line-2);
}
.sidebar-brand .mark {
  width: 32px; height: 32px; border-radius: 9px; flex: none;
  background: linear-gradient(140deg, var(--primary), var(--primary-700));
  color: #fff; display: grid; place-items: center; font-size: 16px; font-family: serif; font-weight: 700;
}
.sidebar-brand .txt { min-width: 0; }
.sidebar-brand strong { display: block; font-size: 14px; letter-spacing: 0.3px; }
.sidebar-brand span { font-size: 11px; color: var(--muted); letter-spacing: 0.6px; }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 10px 20px; }
.nav-group-label {
  font-size: 11px; font-weight: 650; color: var(--muted-2); letter-spacing: 1px;
  padding: 12px 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px;
  border-radius: 9px; color: var(--ink-2); font-size: 13.6px; font-weight: 500;
  cursor: pointer; margin-bottom: 2px; transition: background 0.14s, color 0.14s;
  position: relative;
}
.nav-item:hover { background: var(--muted-bg); }
.nav-item.active { background: var(--primary-50); color: var(--primary-600); font-weight: 620; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 9px; bottom: 9px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--primary);
}
.nav-item svg { flex: none; width: 17px; height: 17px; }
.nav-item .badge {
  margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 11px; font-weight: 650;
  display: grid; place-items: center;
}

/* 二级菜单（活动管理 → 九个频道）。父项只折叠不导航，展开状态沿用 nav-item 的 hover。 */
.nav-parent { user-select: none; }
.nav-parent .nav-chev {
  margin-left: auto; font-style: normal; font-size: 10px; line-height: 1;
  color: var(--muted-2); transition: transform 0.16s;
}
.nav-parent.open .nav-chev { transform: rotate(180deg); }
.nav-sub { display: none; }
.nav-sub.open { display: block; }
.nav-subitem {
  height: 32px; font-size: 12.8px; font-weight: 500; padding-left: 34px;
  color: var(--muted); margin-bottom: 1px;
}
.nav-subitem.active { color: var(--primary-600); font-weight: 620; background: var(--primary-50); }
.nav-subitem.active::before { top: 7px; bottom: 7px; }
.sidebar-foot {
  flex: none; padding: 12px 14px; border-top: 1px solid var(--line-2);
  font-size: 11.5px; color: var(--muted-2);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-h); flex: none; background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 12px; padding: 0 20px;
  position: sticky; top: 0; z-index: 30;
}
.topbar h1 { font-size: 16.5px; }
.topbar .crumb { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.topbar-spacer { flex: 1; }
.hamburger {
  display: none; width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; place-items: center;
}
.user-chip {
  display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
}
.user-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%; flex: none;
  background: linear-gradient(140deg, var(--primary), var(--primary-700)); color: #fff;
  display: grid; place-items: center; font-size: 12.5px; font-weight: 650;
}
.user-chip .meta { line-height: 1.25; }
.user-chip .meta strong { display: block; font-size: 12.5px; font-weight: 600; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-chip .meta span { font-size: 11px; color: var(--muted); }

.content { flex: 1; padding: 20px 22px 40px; }
.page { animation: fade 0.22s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.page-head { display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head .grow { flex: 1; min-width: 200px; }
.page-head h2 { font-size: 19px; }
.page-head p { font-size: 12.8px; color: var(--muted); margin-top: 3px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------------------------- 卡片 ---------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-xs);
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px;
  border-bottom: 1px solid var(--line-2);
}
.card-head h3 { font-size: 14.5px; }
.card-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.card-head .grow { flex: 1; min-width: 0; }
.card-body { padding: 16px; }
.card-body.tight { padding: 10px 16px 16px; }

.stat-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(196px, 1fr));
  gap: 14px; margin-bottom: 16px;
}
.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 16px; box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
}
.stat .label { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.stat .value { font-size: 27px; font-weight: 700; letter-spacing: -0.5px; margin-top: 7px; line-height: 1.15; }
.stat .value small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 3px; }
.stat .foot { font-size: 11.8px; color: var(--muted); margin-top: 6px; }
.stat .ico {
  position: absolute; right: 14px; top: 14px; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; background: var(--primary-50); color: var(--primary);
}
.stat.clickable { cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.stat.clickable:hover { border-color: var(--primary-100); box-shadow: var(--shadow); transform: translateY(-1px); }
.stat.tone-ok .ico { background: var(--ok-bg); color: var(--ok); }
.stat.tone-warn .ico { background: var(--warn-bg); color: var(--warn); }
.stat.tone-danger .ico { background: var(--danger-bg); color: var(--danger); }
.stat.tone-info .ico { background: var(--info-bg); color: var(--info); }
.stat.tone-danger .value { color: var(--danger); }
.stat.tone-warn .value { color: var(--warn); }
.stat.tone-ok .value { color: var(--ok); }

.cols { display: grid; gap: 16px; }
.cols-2 { grid-template-columns: 1.35fr 1fr; }
.cols-1-1 { grid-template-columns: 1fr 1fr; }
@media (max-width: 1080px) { .cols-2, .cols-1-1 { grid-template-columns: 1fr; } }

/* ---------------------------- 表格 ---------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); }
table.tbl { width: 100%; border-collapse: collapse; min-width: 720px; }
table.tbl th {
  text-align: left; font-size: 12.2px; font-weight: 620; color: var(--muted);
  padding: 11px 14px; background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.tbl td {
  padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-size: 13.3px;
  vertical-align: middle;
}
table.tbl tbody tr:hover { background: #fcfcfd; }
table.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl .num { font-variant-numeric: tabular-nums; }
.tbl .name-link {
  color: var(--primary); font-weight: 600; cursor: pointer; background: none; border: 0;
  padding: 0; font-size: 13.3px; text-align: left;
}
.tbl .name-link:hover { text-decoration: underline; }
.tbl .row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.tbl .sub { font-size: 11.8px; color: var(--muted); }
.tbl .cell-strong { font-weight: 600; }
.tbl tr.alert-row td { background: var(--danger-bg); }
.tbl tr.alert-row:hover td { background: #fdeaea; }
.tbl tr.watch-row td { background: #fffdf5; }
.tbl tr.watch-row:hover td { background: #fdf8e9; }
/* 课包已过期：比「剩余课时不足」更硬 —— 课包已经失效，课时再多也上不了课。
   用更实的底色 + 左侧红条，跟浅色的 alert-row 一眼区分开。 */
.tbl tr.expired-row td { background: #fde8e8; }
.tbl tr.expired-row td:first-child { box-shadow: inset 3px 0 0 var(--danger); }
.tbl tr.expired-row:hover td { background: #fbdcdc; }

.cell-user { display: flex; align-items: center; gap: 9px; }
.avatar-sm {
  width: 30px; height: 30px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--primary-50); color: var(--primary-600); display: grid; place-items: center;
  font-size: 12.5px; font-weight: 650;
}
.avatar-sm img { width: 100%; height: 100%; object-fit: cover; display: block; }

.toolbar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.toolbar .search { position: relative; flex: 1; min-width: 190px; max-width: 320px; }
.toolbar .search .input { padding-left: 32px; }
.toolbar .search svg {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  width: 15px; height: 15px; color: var(--muted-2); pointer-events: none;
}
.toolbar .select { width: auto; min-width: 118px; }
.toolbar .grow { flex: 1; }

/* 批量选择条：勾了人才出现（平时 hidden），不占地方 */
.bulk-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--line-2);
  background: var(--danger-bg); color: var(--ink-2); font-size: 13px;
}
/* display:flex 会盖掉 [hidden] 自带的 display:none，必须显式兜一道 */
.bulk-bar[hidden] { display: none; }
/* 同理：.pill / .btn / .chip 自带 display:inline-flex，加了 hidden 也照样显示 */
.pill[hidden], .btn[hidden], .chip[hidden] { display: none; }
/* .input/.select 在部分浏览器里被 toolbar 布局给了 display，同样要兜一道 */
.input[hidden], .select[hidden] { display: none; }
.bulk-bar .grow { flex: 1; }
.bulk-bar b { color: var(--danger); font-variant-numeric: tabular-nums; }

/* 勾选列：只放一个复选框，窄且不参与换行 */
table.tbl th.pick, table.tbl td.pick { width: 40px; padding-right: 0; }
.ck {
  width: 15px; height: 15px; margin: 0; vertical-align: middle;
  accent-color: var(--primary); cursor: pointer;
}

.pager {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-top: 1px solid var(--line-2); flex-wrap: wrap;
}
.pager .info { font-size: 12.5px; color: var(--muted); }
.pager .grow { flex: 1; }
.pager .pages { display: flex; gap: 4px; }
.pager .pages button {
  min-width: 30px; height: 30px; padding: 0 8px; border-radius: 7px; border: 1px solid var(--line);
  background: #fff; font-size: 12.5px; cursor: pointer; color: var(--ink-2);
}
.pager .pages button:hover:not(:disabled) { border-color: #d6d9de; background: #fafbfc; }
.pager .pages button.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.pager .pages button:disabled { opacity: 0.42; cursor: not-allowed; }
/* 「每页 N 条」下拉：比表单里的 select 矮一档，跟页码按钮同高 */
.pager .sizes .select {
  width: auto; height: 30px; padding: 0 26px 0 10px;
  font-size: 12.5px; border-radius: 7px; background-position: right 9px center;
}

/* ---------------------------- 卡片网格（班级/课程） ---------------------------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(258px, 1fr)); gap: 14px; }
.tile {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; box-shadow: var(--shadow-xs); display: flex; flex-direction: column;
  transition: box-shadow 0.16s, border-color 0.16s, transform 0.16s;
}
.tile:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.tile-head { display: flex; align-items: flex-start; gap: 11px; margin-bottom: 11px; }
.tile-ico {
  width: 40px; height: 40px; border-radius: 11px; flex: none; display: grid;
  place-items: center; font-size: 20px; background: var(--primary-50); color: var(--primary);
}
.tile-title { flex: 1; min-width: 0; }
.tile-title strong { display: block; font-size: 14.5px; }
.tile-title span { font-size: 12px; color: var(--muted); }
.tile-rows { display: grid; gap: 7px; font-size: 12.8px; color: var(--ink-2); margin-bottom: 12px; }
.tile-rows .r { display: flex; justify-content: space-between; gap: 12px; }
.tile-rows .r span:first-child { color: var(--muted); }
.tile-actions { margin-top: auto; display: flex; gap: 7px; }
.progress { height: 6px; border-radius: 999px; background: var(--muted-bg); overflow: hidden; }
.progress i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.progress.ok i { background: var(--ok); }
.progress.warn i { background: var(--warn); }
.progress.danger i { background: var(--danger); }

/* ---------------------------- 图表 ---------------------------- */
.chart { width: 100%; display: block; overflow: visible; }
.bar-list { display: grid; gap: 13px; }
.bar-row .top { display: flex; justify-content: space-between; font-size: 12.8px; margin-bottom: 6px; }
.bar-row .top span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.legend { display: grid; gap: 9px; margin-top: 14px; }
.legend .item { display: flex; align-items: center; gap: 8px; font-size: 12.8px; }
.legend .item i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.legend .item .v { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }

/* ---------------------------- 提示 / 空态 ---------------------------- */
.empty {
  padding: 46px 20px; text-align: center; color: var(--muted);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.empty .ico {
  width: 46px; height: 46px; border-radius: 14px; background: var(--muted-bg);
  display: grid; place-items: center; color: var(--muted-2); font-size: 21px;
}
.empty strong { font-size: 14px; color: var(--ink-2); }
.empty p { font-size: 12.5px; }

.inline-load { padding: 42px; display: flex; justify-content: center; }

.notice {
  display: flex; gap: 9px; padding: 11px 13px; border-radius: var(--radius-sm);
  font-size: 12.6px; background: var(--info-bg); color: var(--info);
  border: 1px solid var(--info-line); line-height: 1.65;
}
.notice.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-line); }
.notice.danger { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-line); }
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: var(--ok-line); }

/* ---------------------------- Toast ---------------------------- */
.toast-root {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 9px;
  pointer-events: none; width: min(92vw, 420px);
}
.toast {
  display: flex; align-items: flex-start; gap: 9px; padding: 11px 14px;
  border-radius: var(--radius-sm); background: #1f2937; color: #fff;
  font-size: 13.2px; box-shadow: var(--shadow-lg); animation: toastIn 0.22s ease;
  line-height: 1.55;
}
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }
.toast.warn { background: #78350f; }
.toast .ico { flex: none; font-size: 14px; line-height: 1.4; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------------------------- Modal ---------------------------- */
.modal-root { position: fixed; inset: 0; z-index: 200; pointer-events: none; }
.modal-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.46);
  display: flex; align-items: center; justify-content: center; padding: 20px;
  pointer-events: auto; animation: maskIn 0.18s ease; overflow-y: auto;
}
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: calc(100vh - 40px);
  display: flex; flex-direction: column; animation: modalIn 0.2s cubic-bezier(0.2, 0.9, 0.3, 1);
  margin: auto;
}
.modal.sm { max-width: 400px; }
.modal.lg { max-width: 660px; }
.modal.xl { max-width: 880px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.99); } to { opacity: 1; transform: none; } }
.modal-head {
  flex: none; display: flex; align-items: flex-start; gap: 12px;
  padding: 17px 20px 14px; border-bottom: 1px solid var(--line-2);
}
.modal-head .t { flex: 1; min-width: 0; }
.modal-head h3 { font-size: 16px; }
.modal-head p { font-size: 12.4px; color: var(--muted); margin-top: 3px; }
.modal-close {
  flex: none; width: 30px; height: 30px; border-radius: 8px; border: 0; background: transparent;
  color: var(--muted); cursor: pointer; font-size: 17px; line-height: 1; display: grid; place-items: center;
}
.modal-close:hover { background: var(--muted-bg); color: var(--ink); }
.modal-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.modal-body.flush { padding: 0; }
.modal-foot {
  flex: none; display: flex; justify-content: flex-end; gap: 9px;
  padding: 13px 20px; border-top: 1px solid var(--line-2); background: #fcfcfd;
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
.modal-foot .grow { flex: 1; }

/* ---------------------------- 抽屉 ---------------------------- */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.42); z-index: 210;
  display: flex; justify-content: flex-end; animation: maskIn 0.18s ease;
  /* ⚠️ 这句不能省：抽屉挂在 .modal-root（pointer-events:none）下，会把它**继承**成
     none，整个抽屉看得见却点不进 —— 点右上角 ✕ 实际点到的是底下同位置的
     「退出」按钮（2026-10-13 用户实测：关详情直接被登出），抽屉里其他按钮
     也全是点到下层页面。弹窗的 .modal-mask 写了这句所以一直正常，抽屉漏了。 */
  pointer-events: auto;
}
.drawer {
  width: 100%; max-width: 560px; background: #fff; height: 100%;
  display: flex; flex-direction: column; animation: drawerIn 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
}
@keyframes drawerIn { from { transform: translateX(28px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.drawer-head {
  flex: none; padding: 17px 20px 15px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: flex-start; gap: 12px;
}
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }
.tabs { display: flex; gap: 5px; padding: 4px; background: var(--muted-bg); border-radius: 10px; margin-bottom: 16px; }
.tabs button {
  flex: 1; height: 32px; border: 0; background: transparent; border-radius: 7px;
  font-size: 13px; font-weight: 550; color: var(--muted); cursor: pointer;
}
.tabs button.active { background: #fff; color: var(--primary); box-shadow: var(--shadow-xs); }

.dl { display: grid; grid-template-columns: 96px 1fr; gap: 9px 12px; font-size: 13.2px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; color: var(--ink); word-break: break-all; }
/* 学员抽屉里的「每个课程 + 各自带班教练」：多课程学员要逐行列，一行一个班 */
.dl .course-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.dl .course-line + .course-line { margin-top: 3px; padding-top: 3px; border-top: 1px dashed var(--line-2); }
.dl .course-line .klass, .dl .course-line .coach { color: var(--muted); font-size: 12.4px; }
.dl .course-line .coach { white-space: nowrap; }

.timeline { display: grid; gap: 0; }
.tl-item { display: flex; gap: 11px; padding-bottom: 14px; position: relative; }
.tl-item:not(:last-child)::before {
  content: ""; position: absolute; left: 6.5px; top: 17px; bottom: 0; width: 1px; background: var(--line);
}
.tl-dot {
  width: 14px; height: 14px; border-radius: 50%; flex: none; margin-top: 3px;
  border: 2.5px solid var(--primary); background: #fff; z-index: 1;
}
.tl-dot.ok { border-color: var(--ok); }
.tl-dot.warn { border-color: var(--warn); }
.tl-body { flex: 1; min-width: 0; }
.tl-body .t { font-size: 13.2px; font-weight: 550; }
.tl-body .m { font-size: 12px; color: var(--muted); margin-top: 2px; }
.tl-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.tl-amount.plus { color: var(--ok); }
.tl-amount.minus { color: var(--danger); }

.bind-card {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.bind-card .qr { width: 168px; height: 168px; display: grid; place-items: center; background: #fff; }
.bind-card .qr svg, .bind-card .qr img { width: 100%; height: 100%; display: block; }
.bind-card .code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 15px;
  letter-spacing: 2px; font-weight: 650; color: var(--ink);
}

.kv-inline { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.8px; color: var(--muted); }
.kv-inline b { color: var(--ink); font-weight: 600; }

/* ---------------------------- 批量导入 ---------------------------- */
/* .hint / .sub 都是作用域限定的（.field .hint、.tbl .sub），弹窗里用不到，
   所以这里给两个通用工具类，避免出现「文字没有任何样式」的裸奔元素 */
.muted { color: var(--muted-2); }
.imp-note { font-size: 12px; color: var(--muted); }
.imp-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.imp-step {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--card);
}
.imp-step-no {
  flex: 0 0 22px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--primary-50); color: var(--primary);
  font-size: 12px; font-weight: 700; line-height: 22px; text-align: center;
}
.imp-step-t { font-size: 13.4px; font-weight: 600; color: var(--ink); }
.imp-step .sub { font-size: 12px; color: var(--muted); }

/* 拖拽区：用 label 包住隐藏的 file input，点击与拖拽共用一个热区 */
.imp-drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 22px 16px; margin-bottom: 8px; cursor: pointer; text-align: center;
  border: 1.6px dashed var(--line); border-radius: var(--radius);
  background: var(--bg); transition: border-color 0.15s ease, background 0.15s ease;
}
.imp-drop strong { font-size: 13.4px; color: var(--ink); }
.imp-drop span { font-size: 12px; color: var(--muted); }
.imp-drop:hover { border-color: var(--primary-100); background: var(--primary-50); }
.imp-drop.is-over { border-color: var(--primary); background: var(--primary-50); }

.imp-paste { margin-top: 12px; }
.imp-paste summary { cursor: pointer; font-size: 12.6px; color: var(--muted); }
.imp-paste summary:hover { color: var(--primary); }

.imp-issues { margin: 6px 0 0; padding-left: 18px; font-size: 12.4px; line-height: 1.7; }
.imp-issues li { color: var(--ink-2); }

/* ---------------------------- 遮罩 / 响应式 ---------------------------- */
.nav-overlay {
  position: fixed; inset: 0; background: rgba(17, 24, 39, 0.4); z-index: 35;
  display: none; animation: maskIn 0.18s ease;
}
.app.nav-open .nav-overlay { display: block; }

@media (max-width: 980px) {
  .sidebar {
    position: fixed; left: 0; top: 0; height: 100vh; transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.2, 0.9, 0.3, 1); box-shadow: var(--shadow-lg);
  }
  .app.nav-open .sidebar { transform: translateX(0); }
  .hamburger { display: grid; }
  .topbar { padding: 0 14px; }
  .content { padding: 16px 14px 32px; }
  .user-chip .meta { display: none; }
  .user-chip { padding: 4px; border: 0; }
}

@media (max-width: 640px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .auth-panel { padding: 26px 18px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 13px; }
  .stat .value { font-size: 22px; }
  .stat .ico { width: 26px; height: 26px; right: 10px; top: 10px; font-size: 13px; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .page-head h2 { font-size: 17px; }
  .modal, .modal.lg, .modal.xl { max-width: 100%; }
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { max-height: 92vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-foot { border-radius: 0; }
  .drawer { max-width: 100%; }
  .toolbar { padding: 12px; }
  .toolbar .search { max-width: none; }
  .card-head { padding: 12px 13px; }
  .card-body { padding: 13px; }
  .dl { grid-template-columns: 82px 1fr; }
  /* 窄屏下「步骤 + 按钮」会挤，改成上下排 */
  .imp-step { flex-wrap: wrap; }
  .imp-step .grow { flex-basis: calc(100% - 32px); }
  .imp-drop { padding: 18px 12px; }
}
