/* ============================================================
   八分后台（B 端门店 / P 端平台共用）
   语言：明亮工作台 · 玻璃悬浮 · 蓝色主轨 · 橙色只标「今天要处理」
   与官网同一套晴空色，但收敛为高密度、可长时间看的操作界面。
   ============================================================ */

body {
  --ink: #211A3D;
  --ink-2: #3A2F5C;
  --ink-3: #52477A;
  --paper: #F7F3FE;
  --paper-2: #FBFAFE;
  --card: #FFFFFF;
  --line: rgba(var(--primary-rgb), .14);
  --line-soft: rgba(var(--primary-rgb), .075);
  --muted: #6B5F8C;
  --muted-2: #A79FBF;
  --primary: #7C68FA;
  --primary-2: #B9A8FF;
  --primary-d: #5F4BD8;
  --soft: #EDE7FA;
  --surface: #FFFFFF;
  --sh: 78, 56, 168;
  --primary-rgb: 124, 104, 250;
  --primary-2-rgb: 185, 168, 255;
  --font: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Noto Sans SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --num: "Bahnschrift", "DIN Alternate", "SF Pro Display", var(--font);

  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(38% 32% at 92% 0%, rgba(var(--primary-rgb), .26) 0%, rgba(var(--primary-rgb), 0) 68%),
    radial-gradient(30% 28% at 5% 10%, rgba(255, 107, 44, .12) 0%, rgba(255, 107, 44, 0) 70%),
    radial-gradient(42% 36% at 64% 100%, rgba(120, 190, 255, .16) 0%, rgba(var(--primary-2-rgb), 0) 72%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body[data-skin="sky"] {
  --ink: #10233D;
  --ink-2: #2B4466;
  --ink-3: #4F6686;
  --paper: #F3F8FF;
  --paper-2: #F8FBFF;
  --card: #FFFFFF;
  --line: rgba(var(--primary-rgb), .14);
  --line-soft: rgba(var(--primary-rgb), .07);
  --muted: #4F6686;
  --muted-2: #A6B8CF;
  --primary: #2E7CFF;
  --primary-2: #A8CAFF;
  --primary-d: #1B5BD1;
  --soft: #E6F1FF;
  --sh: 36, 92, 180;
  --primary-rgb: 46, 124, 255;
  --primary-2-rgb: 168, 202, 255;
}

::selection { background: rgba(var(--primary-rgb), .2); }

.app { display: flex; min-height: 100vh; background: transparent; }

/* ---------- 侧栏：白色玻璃悬浮卡 ---------- */
.side {
  width: 236px; flex: none;
  position: fixed; top: 12px; bottom: 12px; left: 12px;
  display: flex; flex-direction: column;
  padding: 18px 12px 12px; overflow-y: auto; z-index: 30;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 24px;
  background: linear-gradient(162deg, rgba(255, 255, 255, .94) 0%, rgba(255, 255, 255, .78) 55%, rgba(245, 251, 255, .74) 100%);
  box-shadow: 0 2px 4px rgba(var(--sh), .04), 0 30px 64px -36px rgba(var(--sh), .5), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(20px) saturate(1.35);
  backdrop-filter: blur(20px) saturate(1.35);
  color: var(--ink-2);
}
.side::-webkit-scrollbar { width: 0; }

.side-brand { display: flex; align-items: center; gap: 10px; padding: 2px 7px 18px; color: var(--ink); }
.side-brand img { width: 30px; height: 30px; flex: none; filter: drop-shadow(0 5px 9px rgba(var(--sh), .2)); }
.side-brand b { font-family: var(--font); font-size: 16px; font-weight: 800; letter-spacing: -.035em; white-space: nowrap; }
.side-brand span {
  display: inline-flex; align-items: center; height: 18px; padding: 0 7px;
  border: 1px solid rgba(var(--primary-rgb), .16); border-radius: 999px;
  background: var(--soft); color: var(--primary-d);
  font-size: 8.5px; font-weight: 700; letter-spacing: .14em; white-space: nowrap;
}

.store-switch {
  display: flex; align-items: center; gap: 9px;
  margin: 0 2px 8px; padding: 10px;
  border: 1px solid rgba(var(--primary-rgb), .14);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(var(--primary-rgb), .09), rgba(111, 211, 255, .055));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .9);
  cursor: pointer; transition: border-color .2s, box-shadow .2s, transform .2s;
}
.store-switch:hover { border-color: rgba(var(--primary-rgb), .3); box-shadow: 0 8px 20px -16px rgba(var(--sh), .5), inset 0 1px 0 #fff; transform: translateY(-1px); }
.store-switch .nm { font-size: 12.5px; color: var(--ink); font-weight: 700; }
.store-switch .sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
.store-switch .cv { margin-left: auto; color: var(--muted-2); font-size: 10px; }
.ss-dot {
  width: 32px; height: 32px; flex: none; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-family: var(--font); font-size: 12px; font-weight: 800;
  box-shadow: 0 6px 12px -6px rgba(var(--primary-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.ss-dot.plat { background: linear-gradient(135deg, #566BFF, #8FAEFF); box-shadow: 0 6px 12px -6px rgba(86, 107, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .45); }

.nav-label { padding: 17px 12px 6px; font-size: 9.5px; font-weight: 700; letter-spacing: .16em; color: var(--muted-2); }
.nav-item {
  position: relative; display: flex; align-items: center; gap: 11px;
  height: 40px; padding: 0 11px; margin-bottom: 2px;
  border-radius: 12px; color: var(--ink-2); font-size: 13px;
  cursor: pointer; transition: background .18s, color .18s, box-shadow .18s;
}
.nav-item:hover { background: rgba(var(--primary-rgb), .07); color: var(--primary-d); }
.nav-item.on {
  background: linear-gradient(100deg, rgba(var(--primary-rgb), .15), rgba(111, 211, 255, .06));
  color: var(--primary-d); font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(var(--primary-rgb), .12);
}
.nav-item.on::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 99px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  box-shadow: 0 0 10px rgba(var(--primary-rgb), .45);
}
.nav-item svg { width: 16px; height: 16px; flex: none; opacity: .82; }
.nav-item.on svg { opacity: 1; }
.nav-item .badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--orange); color: #fff;
  font-family: var(--num); font-size: 10.5px; font-weight: 700;
  box-shadow: 0 4px 8px -4px rgba(255, 107, 44, .6);
}

.side-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft); }
.side-foot .nav-item { height: 34px; font-size: 12px; color: var(--muted); }
.side-foot .nav-item:hover { color: var(--primary-d); }
.side-user { display: flex; align-items: center; gap: 9px; padding: 9px 7px 3px; margin-top: 4px; }
.side-user .av {
  width: 32px; height: 32px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-family: var(--font); font-size: 12px; font-weight: 700;
  box-shadow: 0 5px 12px -6px rgba(var(--primary-rgb), .65), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.side-user .nm { display: block; font-size: 12.5px; font-weight: 650; color: var(--ink); }
.side-user .rl { display: block; font-size: 10px; color: var(--muted); margin-top: 1px; }

/* ---------- 顶栏：悬浮玻璃条 ---------- */
.main { margin-left: 260px; flex: 1; min-width: 0; }
.top {
  position: sticky; top: 12px; z-index: 20;
  height: 60px; margin: 16px 18px 0; padding: 0 14px 0 18px;
  display: flex; align-items: center; gap: 14px;
  border: 1px solid rgba(255, 255, 255, .92);
  border-radius: 18px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 2px 4px rgba(var(--sh), .04), 0 20px 40px -28px rgba(var(--sh), .45), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  backdrop-filter: blur(18px) saturate(1.5);
}
.crumb { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.crumb b { overflow: hidden; text-overflow: ellipsis; color: var(--ink); font-weight: 700; }
.crumb i { font-style: normal; color: var(--muted-2); }

.top .side-toggle { display: none; }
.side-mask { display: none; }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }

.icon-btn {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border: 1px solid var(--line); border-radius: 50%;
  background: rgba(255, 255, 255, .88); color: var(--muted);
  box-shadow: 0 2px 5px -3px rgba(var(--sh), .22), inset 0 1px 0 #fff;
  transition: border-color .18s, color .18s, transform .18s, box-shadow .18s;
}
.icon-btn:hover { border-color: rgba(var(--primary-rgb), .4); color: var(--primary-d); transform: translateY(-1px); box-shadow: 0 8px 16px -10px rgba(var(--sh), .5); }
.admin-skin {
  display: flex; align-items: center; gap: 5px; flex: none;
  height: 34px; padding: 0 9px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .88);
}
.admin-skin button {
  width: 15px; height: 15px; padding: 0; border: 0; border-radius: 50%;
  cursor: pointer; position: relative;
  box-shadow: 0 1px 3px rgba(var(--sh), .25);
}
.admin-skin button:first-child { background: #7C68FA; }
.admin-skin button:last-child { background: #2E7CFF; }
.admin-skin button.on { outline: 2px solid #fff; box-shadow: 0 0 0 3px var(--primary), 0 2px 6px rgba(var(--sh), .3); }
.avatar {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: 12px; font-weight: 700;
  box-shadow: 0 6px 14px -8px rgba(var(--primary-rgb), .7), inset 0 1px 0 rgba(255, 255, 255, .45);
  border: 2px solid #fff;
}

.search {
  display: flex; align-items: center; gap: 8px;
  height: 38px; min-width: 210px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(247, 251, 255, .86); font-size: 12.5px; color: var(--muted-2);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search:focus-within { border-color: rgba(var(--primary-rgb), .5); background: #fff; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1); }
.search input { width: 100%; border: 0; outline: 0; background: transparent; font: inherit; color: var(--ink); }

/* ---------- 页面骨架 ---------- */
.page {
  position: relative; max-width: 1560px;
  padding: 20px 28px 60px;
}
.page::before {
  content: ""; position: fixed; right: 4%; top: 100px;
  width: 270px; height: 270px; border-radius: 50%;
  background: conic-gradient(from 210deg,
    rgba(139, 124, 246, .14) 0deg 80deg,
    rgba(255, 107, 44, .12) 80deg 160deg,
    rgba(47, 191, 113, .12) 160deg 240deg,
    rgba(245, 185, 35, .14) 240deg 320deg,
    rgba(var(--primary-rgb), .12) 320deg 360deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 59% 69%, transparent 70%);
  mask: radial-gradient(circle, transparent 58%, #000 59% 69%, transparent 70%);
  opacity: .38; pointer-events: none; z-index: 0;
}
.page > * { position: relative; z-index: 1; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 20px; flex-wrap: wrap; }
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.filters input { max-width: 100%; }
.page-head > div:first-child { min-width: 0; flex: 1 1 auto; }
.page-head > .filters { flex: 0 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.page-head > .filters .search { min-width: 208px; }
.page-head h1 {
  font-family: var(--font); font-size: 28px; font-weight: 800;
  letter-spacing: -.038em; line-height: 1.16; color: var(--ink);
}
.page-head p { max-width: 46rem; margin-top: 7px; font-size: 12.5px; line-height: 1.65; color: var(--muted); }

/* 分段控件：圆角胶囊，选中态用主蓝 */
.seg {
  display: inline-flex; align-items: center; padding: 3px;
  max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .72);
  box-shadow: inset 0 1px 0 #fff;
}
.seg::-webkit-scrollbar { display: none; }
.seg button {
  height: 30px; padding: 0 13px; border: 0; border-radius: 9px;
  background: transparent; color: var(--muted); font: inherit; font-size: 12px; font-weight: 550;
  white-space: nowrap; flex: none; transition: background .18s, color .18s, box-shadow .18s;
}
.seg button:hover { color: var(--primary-d); }
.seg button.on {
  background: linear-gradient(100deg, var(--primary), #55A8FF);
  color: #fff; font-weight: 700;
  box-shadow: 0 6px 12px -6px rgba(var(--primary-rgb), .65), inset 0 1px 0 rgba(255, 255, 255, .35);
}

/* ---------- 栅格 ---------- */
.grid { display: grid; gap: 14px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g-23 { grid-template-columns: 2fr 1fr; }
.g-32 { grid-template-columns: 1.55fr 1fr; }
.grid + .grid, .grid + .panel, .panel + .panel, .panel + .grid { margin-top: 14px; }

/* ---------- 面板 ---------- */
.panel {
  position: relative;
  padding: 18px 20px 20px;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 20px;
  background: linear-gradient(158deg, rgba(255, 255, 255, .92) 0%, rgba(255, 255, 255, .82) 100%);
  box-shadow: 0 1px 0 #fff inset, 0 24px 48px -36px rgba(var(--sh), .5), 0 2px 5px rgba(var(--sh), .035);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: box-shadow .2s, transform .2s, border-color .2s;
}
.panel[data-card] { cursor: pointer; }
.panel[data-card]:hover, .panel:hover { border-color: rgba(255, 255, 255, .98); box-shadow: 0 1px 0 #fff inset, 0 30px 56px -36px rgba(var(--sh), .58), 0 4px 10px rgba(var(--sh), .05); }
.panel[data-card]:hover { transform: translateY(-2px); }

.panel-h {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 0 0 14px; padding-bottom: 11px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-h h3 { font-size: 14px; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
.panel-h .sub { font-size: 11.5px; color: var(--muted-2); }
.panel-h a { font-size: 11.5px; color: var(--primary-d); font-weight: 600; }
.panel-h a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- KPI：大数字、彩色柔光、轻立体 ---------- */
.kpi {
  position: relative; overflow: hidden;
  min-height: 128px; padding: 16px 18px 15px;
  border: 1px solid rgba(255, 255, 255, .94);
  border-radius: 18px;
  background: linear-gradient(158deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .84) 100%);
  box-shadow: 0 1px 0 #fff inset, 0 22px 42px -34px rgba(var(--sh), .48), 0 2px 4px rgba(var(--sh), .03);
}
.g4 .kpi:nth-child(1) { --accent: var(--primary); }
.g4 .kpi:nth-child(2) { --accent: #2FBF71; }
.g4 .kpi:nth-child(3) { --accent: #FF6B2C; }
.g4 .kpi:nth-child(4) { --accent: var(--primary-2); }
.kpi::after {
  content: ""; position: absolute; right: -34px; top: -44px;
  width: 132px; height: 132px; border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent, var(--primary)) 18%, transparent) 0%, transparent 68%);
  pointer-events: none;
}
.kpi > * { position: relative; z-index: 1; }
.kpi-k { font-size: 12px; font-weight: 600; letter-spacing: .01em; color: var(--muted); }
.kpi-v {
  margin-top: 7px;
  font-family: var(--num); font-size: 34px; font-weight: 700;
  line-height: 1.05; letter-spacing: -.025em; color: var(--ink);
  font-variant-numeric: lining-nums tabular-nums;
}
.kpi-v small { margin-left: 3px; font-family: var(--font); font-size: 12px; font-weight: 600; color: var(--muted-2); letter-spacing: 0; }
.kpi-v.empty { margin-top: 12px; font-size: 22px; font-weight: 600; color: var(--muted-2); letter-spacing: 0; }
.kpi-f { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; font-size: 11.5px; color: var(--muted-2); }
.kpi-f .delta { padding: 3px 8px; border-radius: 999px; font-family: var(--num); font-weight: 700; white-space: nowrap; }
.delta.up { color: #0F7A48; background: #E7F8EF; }
.delta.down { color: #B42318; background: #FDECEC; }

/* ---------- 横向条 ---------- */
.bh-row { display: grid; grid-template-columns: 26px 1fr 34px; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 12px; }
.bh-track { height: 8px; border-radius: 999px; background: #EAF2FB; overflow: hidden; }
.bh-track i { display: block; height: 100%; border-radius: 999px; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45); }
.bh-v { text-align: right; color: var(--muted); font-family: var(--num); font-size: 11.5px; }
.bh-k { font-size: 11.5px; font-weight: 700; white-space: nowrap; }

/* ---------- 数据表 ---------- */
table.data { font-size: 13px; }
table.data th { padding: 0 12px 11px; font-size: 10.5px; letter-spacing: .06em; color: var(--muted-2); border-bottom: 1px solid var(--line); }
table.data td { padding: 13px 12px; border-bottom: 1px solid var(--line-soft); }
table.data tbody tr { transition: background .16s; }
table.data tbody tr.click { cursor: pointer; }
table.data tbody tr:hover { background: rgba(var(--primary-rgb), .045); }
table.data tbody tr:last-child td { border-bottom: 0; }

.avatar-cell { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar-cell .av {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #EAF3FF 0%, #D8E9FF 100%);
  color: var(--primary-d); font-family: var(--font); font-size: 12px; font-weight: 700;
  box-shadow: inset 0 1px 0 #fff, 0 2px 5px -3px rgba(var(--sh), .3);
  border: 0;
}
.avatar-cell .nm { font-size: 13px; font-weight: 700; color: var(--ink); }
.avatar-cell .id { font-size: 10.5px; color: var(--muted-2); font-family: var(--num); }

/* ---------- 标签：浅底胶囊 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 9px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 11px; font-weight: 650; white-space: nowrap;
  line-height: 1;
}
.t-red { background: #FDECEC; color: #B42318; border-color: #F8D7D5; }
.t-orange { background: #FFF2E8; color: #B45309; border-color: #FFE1CC; }
.t-green { background: #E8F8EF; color: #0F7A48; border-color: #D1F0DF; }
.t-gray { background: #F1F6FC; color: #62798F; border-color: #E2ECF7; }
.t-blue { background: var(--soft); color: var(--primary-d); border-color: var(--primary-2); }
.t-purple { background: var(--soft); color: var(--primary-d); border-color: var(--primary-2); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 30px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .8); color: var(--ink-2);
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.chip-orange { background: #FFF1E8; color: #B45309; border-color: #FFE0CC; }
.chip-green { background: #E8F8EF; color: #0F7A48; border-color: #D1F0DF; }
.chip-blue { background: var(--soft); color: var(--primary-d); border-color: var(--primary-2); }
.chip-red { background: #FDECEC; color: #B42318; border-color: #F8D7D5; }
.chip-purple { background: var(--soft); color: var(--primary-d); border-color: var(--primary-2); }
.chip:hover { border-color: rgba(var(--primary-rgb), .35); }
/* 选中的 chip：跟进表里选「微信 / 电话」这类，靠它表示当前值 */
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.dot { width: 7px; height: 7px; border-radius: 50%; display: inline-block; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(255, 255, 255, .86);
  color: var(--ink-2);
  font-family: var(--font); font-size: 13px; font-weight: 700;
  white-space: nowrap;
  box-shadow: inset 0 1px 0 #fff;
  transition: transform .18s, box-shadow .18s, background .18s, border-color .18s, color .18s;
}
.btn:hover { border-color: rgba(var(--primary-rgb), .4); color: var(--primary-d); }
.btn-primary {
  border-color: transparent;
  background: linear-gradient(100deg, var(--primary) 0%, #55A8FF 100%);
  color: #fff;
  box-shadow: 0 12px 22px -14px rgba(var(--primary-rgb), .75), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 16px 26px -14px rgba(var(--primary-rgb), .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
.btn-ink {
  border-color: transparent;
  background: linear-gradient(100deg, var(--primary-d) 0%, var(--primary) 100%);
  color: #fff;
  box-shadow: 0 12px 22px -15px rgba(26, 95, 221, .75), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.btn-ink:hover {
  transform: translateY(-1px);
  background: linear-gradient(100deg, #154EB8 0%, #237BDD 100%);
  box-shadow: 0 16px 26px -15px rgba(26, 95, 221, .8), inset 0 1px 0 rgba(255, 255, 255, .35);
}
.btn-ghost { border-color: var(--line); background: rgba(255, 255, 255, .84); color: var(--ink-2); box-shadow: inset 0 1px 0 #fff; }
.btn-ghost:hover { border-color: rgba(var(--primary-rgb), .45); color: var(--primary-d); }
.btn-accent { border-color: transparent; background: linear-gradient(100deg, #FF7A3D, #FF9A58); color: #fff; }
.btn-accent:hover { transform: translateY(-1px); }
.btn-sm { height: 34px; padding: 0 14px; font-size: 12.5px; border-radius: 11px; }
/* 少数抽屉里的按钮只写了 btn-primary，没有 btn，补上骨架 */
.btn-primary:not(.btn), .btn-ink:not(.btn) {
  display: inline-flex; align-items: center; justify-content: center;
  height: 38px; padding: 0 16px; border-radius: 11px;
  font-family: var(--font); font-size: 12.5px; font-weight: 700;
}
.drawer-f .btn-ink, .drawer-bd .btn-ink { border-color: var(--line); background: #fff; color: var(--ink-2); box-shadow: none; }
.drawer-f .btn-ink:hover, .drawer-bd .btn-ink:hover { border-color: rgba(var(--primary-rgb), .4); color: var(--primary-d); background: #F7FBFF; }

.btn-xs {
  height: 28px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, .82); color: var(--ink-2);
  font-family: var(--font); font-size: 11.5px; font-weight: 650;
  transition: border-color .16s, color .16s, background .16s, box-shadow .16s;
}
.btn-xs:hover { border-color: rgba(var(--primary-rgb), .42); color: var(--primary-d); background: #fff; box-shadow: 0 5px 12px -8px rgba(var(--sh), .45); }
.btn-xs.pri {
  border-color: transparent; color: #fff;
  background: linear-gradient(100deg, var(--primary), #55A8FF);
  box-shadow: 0 6px 12px -7px rgba(var(--primary-rgb), .7);
}
.btn-xs.pri:hover { background: linear-gradient(100deg, var(--primary-d), #3E96FF); color: #fff; }
.btn-mini {
  height: 30px; padding: 0 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink-2); font-family: var(--font); font-size: 11.5px; font-weight: 650;
}
.btn-mini:hover { border-color: rgba(var(--primary-rgb), .4); color: var(--primary-d); }

/* ---------- 周视图排课 ---------- */
.week { display: grid; grid-template-columns: 48px repeat(7, 1fr); grid-auto-rows: 70px; }
.week .hd {
  padding: 9px 4px; text-align: center; color: var(--muted);
  border-bottom: 1px solid var(--line); font-size: 10.5px; font-weight: 550;
}
.week .hd b { display: block; margin-bottom: 2px; font-family: var(--num); font-size: 14px; font-weight: 700; color: var(--ink); }
.week .hd.today b { color: var(--primary); }
.week .hd.today { background: linear-gradient(180deg, rgba(var(--primary-rgb), .055), transparent); }
.week .slot {
  height: 70px; padding: 4px; overflow: hidden;
  border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
  display: flex; flex-direction: column; gap: 4px;
  transition: background .16s;
}
.week .slot:hover { background: rgba(var(--primary-rgb), .025); }
.week .slot:nth-child(8n) { border-right: 0; }
.week .time {
  height: 70px; padding: 5px 9px 0 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: right; font-size: 10px; color: var(--muted-2);
}
.course {
  flex: 1; overflow: hidden; padding: 5px 7px 5px 8px;
  border-radius: 9px; color: var(--ink); font-size: 10px; line-height: 1.35;
  cursor: pointer;
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .62), rgba(255, 255, 255, .18));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .55), 0 3px 8px -5px rgba(var(--sh), .32);
  transition: transform .16s, box-shadow .16s, filter .16s;
}
.course:hover { transform: translateY(-1px); filter: saturate(1.05); box-shadow: 0 8px 14px -8px rgba(var(--sh), .5), inset 0 1px 0 rgba(255, 255, 255, .6); }
.course b { display: block; font-size: 10.5px; font-weight: 700; color: var(--ink); }
.course span { font-size: 9.5px; color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: var(--muted); }
.legend span {
  display: flex; align-items: center; gap: 5px;
  height: 24px; padding: 0 8px;
  border: 1px solid var(--line-soft); border-radius: 999px; background: rgba(255, 255, 255, .6);
}
.legend i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }

/* ---------- 抽屉 ---------- */
.drawer-mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(9, 33, 66, .24);
  opacity: 0; pointer-events: none;
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  transition: .25s;
}
.drawer-mask.on { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 61;
  width: 480px; max-width: 94vw;
  display: flex; flex-direction: column;
  background: #F6FAFF;
  border-left: 1px solid rgba(255, 255, 255, .9);
  border-radius: 26px 0 0 26px;
  box-shadow: -30px 0 70px -40px rgba(9, 33, 66, .5);
  transform: translateX(100%);
  transition: transform .3s cubic-bezier(.2, .7, .3, 1);
  overflow: hidden;
}
.drawer.on { transform: none; }
.drawer-h, .drawer-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 19px 22px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.drawer-h h3, .drawer-hd b {
  font-family: var(--font); font-size: 18px; font-weight: 800;
  letter-spacing: -.025em; color: var(--ink);
}
.drawer-hd b { line-height: 1.3; }
.drawer-b, .drawer-bd { flex: 1; padding: 20px 22px 28px; overflow: auto; }
.drawer-f {
  display: flex; gap: 9px; padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .82);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.mini-list { display: flex; flex-direction: column; }
.mini-list .row {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line-soft);
  font-size: 12.5px;
  transition: background .15s;
}
.mini-list .row:last-child { border-bottom: 0; }
.mini-list .row .t { font-size: 11.5px; color: var(--muted); }
.mini-list .row .grow { flex: 1; min-width: 0; }
.mini-list .row b { font-weight: 700; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 5px; bottom: 5px; width: 1px; background: var(--line); }
.tl { position: relative; padding-bottom: 15px; font-size: 12.5px; }
.tl::before {
  content: ""; position: absolute; left: -18px; top: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: #fff; border: 2px solid var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1);
}
.tl .t { margin-top: 3px; font-size: 10.5px; color: var(--muted-2); }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 6px; font-size: 12px; font-weight: 600; color: var(--muted); }
.field textarea, .field input, .field select, .drawer-bd textarea, .drawer-bd input {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  font-family: var(--font); font-size: 12.5px; line-height: 1.6;
  outline: 0;
  transition: border-color .18s, box-shadow .18s;
}
.field textarea:focus, .field input:focus, .field select:focus, .drawer-bd textarea:focus, .drawer-bd input:focus {
  border-color: rgba(var(--primary-rgb), .55);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .1);
}
.field textarea, .drawer-bd textarea { resize: vertical; }

.kv {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
  font-size: 12px;
}
.kv:last-child { border-bottom: 0; }
.kv span { flex: none; color: var(--muted-2); }
.kv b { text-align: right; font-weight: 650; color: var(--ink-2); }

/* 抽屉里的信息卡：统一白底、圆角、轻阴影 */
.drawer-b > div[style*="background:#fff"], .drawer-bd > div[style*="background:#fff"] {
  border-color: var(--line-soft) !important;
  border-radius: 14px !important;
  box-shadow: 0 10px 24px -22px rgba(var(--sh), .45), inset 0 1px 0 #fff;
}

.md-split { display: flex; gap: 24px; }
.md-radar { display: flex; gap: 16px; align-items: center; }

/* 私教体系等长内容：给正文一点可读的底色 */
.drawer-bd h4 { color: var(--ink); }

/* ---------- Toast ---------- */
#bafen-toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 99;
  max-width: 340px; padding: 12px 16px;
  border: 1px solid rgba(18, 72, 140, .14);
  border-left: 3px solid var(--primary);
  border-radius: 14px;
  background: rgba(255, 255, 255, .96);
  color: var(--ink);
  font-size: 12.5px; line-height: 1.6;
  box-shadow: 0 18px 40px -24px rgba(9, 33, 66, .4), inset 0 1px 0 #fff;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #C9DDF2; border: 3px solid transparent; border-radius: 99px; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #A9C7E8; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 动效 ---------- */
@keyframes pageRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#view > * { animation: pageRise .45s cubic-bezier(.2, .7, .3, 1) both; }
@media (prefers-reduced-motion: reduce) {
  #view > * { animation: none; }
  * { transition-duration: .001ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1280px) {
  .g4 { grid-template-columns: repeat(2, 1fr); }
  .g-23, .g-32 { grid-template-columns: 1fr; }
  .g3 { grid-template-columns: 1fr 1fr; }
  .page::before { width: 220px; height: 220px; right: 2%; }
}
@media (max-width: 980px) {
  .top .side-toggle { display: grid; }
  .side {
    top: 0; bottom: 0; left: 0; width: 250px;
    border-radius: 0 24px 24px 0;
    transform: translateX(-110%);
    transition: transform .3s cubic-bezier(.2, .7, .3, 1);
    box-shadow: 18px 0 60px -30px rgba(9, 33, 66, .5);
  }
  .side.open { transform: none; }
  .side-mask {
    display: block; position: fixed; inset: 0; z-index: 29;
    background: rgba(9, 33, 66, .3);
    opacity: 0; pointer-events: none; transition: .25s;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
  }
  .side-mask.on { opacity: 1; pointer-events: auto; }
  .main { margin-left: 0; }
  .top { margin: 10px 12px 0; top: 8px; height: 56px; border-radius: 16px; }
  .g2, .g3 { grid-template-columns: 1fr; }
  .page { padding: 16px 16px 50px; }
  .page::before { display: none; }
  .page-head > .filters { flex: 1 1 100%; justify-content: flex-start; }
}
@media (max-width: 640px) {
  .crumb { display: none; }
  .top { padding: 0 10px 0 12px; gap: 8px; }
  .top .search { min-width: 0; flex: 1; }
  .page-head { align-items: flex-start; gap: 12px; }
  .page-head h1 { font-size: 24px; }
  .page-head p { font-size: 12px; }
  .page-head > .filters .search { flex: 1 1 100%; min-width: 0; }
  .page-head > .filters .seg { width: 100%; }
  .page-head > .filters .seg button { flex: 1; text-align: center; padding: 0 8px; }
  .panel { padding: 14px 14px 16px; border-radius: 17px; }
  .panel:has(> table.data), .panel:has(> .week) { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table.data { min-width: 0; width: 100%; }
  table.data th, table.data td { padding-left: 9px; padding-right: 9px; white-space: nowrap; }
  table.data th { font-size: 9.5px; }
  .week { min-width: 580px; }
  .kpi { min-height: 116px; padding: 14px 15px; }
  .kpi-v { font-size: 29px; }
  .drawer { width: 100%; max-width: 100%; border-radius: 0; }
  .drawer-h, .drawer-hd { padding: 15px 16px 13px; }
  .drawer-h h3, .drawer-hd b { font-size: 16px; }
  .drawer-b, .drawer-bd { padding: 16px; }
  .drawer-f { padding: 11px 14px calc(12px + env(safe-area-inset-bottom)); }
  .field input, .field select, .field textarea, .drawer-bd textarea, .drawer-bd input { font-size: 16px; padding: 10px 12px; }
  .field label { font-size: 12px; }
  .md-radar { flex-direction: column; align-items: stretch !important; }
  .md-radar > svg { margin: 0 auto; }
  .md-split { flex-direction: column; gap: 14px !important; }
  #bafen-toast { left: 14px; right: 14px; bottom: 14px; max-width: none; }
}
@media (max-width: 560px) {
  .top .search { display: none; }
  .top-right { gap: 6px; }
  .top { gap: 6px; }
}


