:root {
  --brand: #E8A33D;
  --brand-dark: #C07F1E;
  --brand-light: #FDF3E0;
  --brand-50: #FDF3E0;
  --dark: #141414;
  --accent: #D85A30;
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --text-tertiary: #9CA3AF;
  --border: #E9EBEF;
  --border-strong: #D5D9E0;
  --danger: #E24B4A;
  --warning: #EF9F27;
  --success: #1D9E75;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.05);
  --shadow: 0 1px 3px rgba(16,24,40,0.06);
  --shadow-md: 0 4px 12px rgba(16,24,40,0.08);
  --shadow-lg: 0 12px 32px rgba(16,24,40,0.14);
  --sidebar-w: 240px;
  --topbar-h: 56px;
  --content-max: 1280px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  height: 100%;
  -webkit-font-smoothing: antialiased;
}

#app { height: 100%; }

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* ===== 加载页 ===== */
.loading-screen {
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(180deg, #1C1C1C 0%, #0A0A0A 100%);
  color: #fff;
}
.loading-logo { width: 220px; max-width: 70vw; height: auto; display: block; }
.loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.loading-text { font-size: 13px; opacity: 0.85; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 登录页 ===== */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #1C1C1C 0%, #0A0A0A 100%);
}
.login-card {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 20px;
  padding: 32px 28px;
  box-shadow: var(--shadow-lg);
}
.login-brand {
  text-align: center;
  margin-bottom: 28px;
}
.login-brand .logo {
  width: 180px; height: auto;
  background: none;
  margin: 0 auto 16px;
  display: block;
}
.login-brand h1 { font-size: 20px; font-weight: 600; }
.login-brand p { font-size: 13px; color: var(--text-secondary); margin-top: 4px; }
.login-methods { display: flex; flex-direction: column; gap: 12px; }
.login-btn {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: opacity 0.2s;
}
.login-btn:active { opacity: 0.8; }
.login-btn.primary { background: var(--brand); color: #141414; font-weight: 600; }
.login-btn.wechat { background: #07C160; color: #fff; }
.login-btn.phone { background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); }
.login-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.login-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-tertiary); font-size: 12px; margin: 8px 0;
}
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.login-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: -4px;
}
.login-error {
  background: #FCEBEB; color: var(--danger);
  padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 13px; margin-top: 12px; display: none;
}
.login-error.show { display: block; }
.phone-form { display: none; flex-direction: column; gap: 12px; }
.phone-form.show { display: flex; }
.mode-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 4px;
}
.mode-tab {
  flex: 1;
  padding: 8px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.mode-tab.active {
  background: var(--surface);
  color: var(--brand);
  font-weight: 500;
  box-shadow: var(--shadow);
}
.login-sub-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-tertiary);
  text-decoration: underline;
  cursor: pointer;
}
.phone-row { display: flex; gap: 8px; }
.phone-row input {
  flex: 1; padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
}
.phone-row input:focus { border-color: var(--brand); }
.code-btn {
  white-space: nowrap; padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--brand-light); color: var(--brand);
  font-weight: 500;
}
.code-btn:disabled { opacity: 0.5; }
.field-error { color: var(--danger); font-size: 12px; display: none; }
.field-error.show { display: block; }

/* ===== 主布局 ===== */
.layout { display: flex; height: 100vh; height: 100dvh; overflow: hidden; }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 20px;
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--border);
}
.sidebar-brand .logo {
  width: 44px; height: 44px; border-radius: 10px;
  object-fit: cover;
}
.sidebar-brand .name { font-weight: 600; font-size: 16px; }
.sidebar-nav { flex: 1; padding: 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px;
  width: 100%; text-align: left; margin-bottom: 4px;
  transition: all 0.15s;
}
.nav-item:hover { background: var(--bg); }
.nav-item.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.nav-item .icon { font-size: 18px; width: 22px; text-align: center; }

/* 左侧项目栏：树形、可缩进、可拖拽 */
.nav-row {
  display: flex; align-items: center; gap: 6px;
  padding: 9px 10px; border-radius: var(--radius-sm);
  color: var(--text-secondary); font-size: 14px;
  cursor: pointer; position: relative;
  transition: background 0.15s;
  user-select: none;
}
.nav-row:hover { background: var(--bg); }
.nav-row.active { background: var(--brand-light); color: var(--brand); font-weight: 500; }
.nav-row.dragging { opacity: 0.4; }
.nav-row.drop-before { box-shadow: inset 0 2px 0 0 var(--brand); }
.nav-row.drop-after { box-shadow: inset 0 -2px 0 0 var(--brand); }
.nav-row.drop-inside { background: var(--brand-light); outline: 1px dashed var(--brand); }
.nav-caret {
  width: 14px; font-size: 9px; color: var(--text-tertiary);
  text-align: center; flex-shrink: 0; line-height: 1;
}
.nav-caret.empty { visibility: hidden; }
.nav-row .nav-icon { font-size: 15px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-actions { display: flex; gap: 2px; flex-shrink: 0; }
.nav-actions button {
  width: 22px; height: 22px; border-radius: 4px;
  font-size: 12px; color: var(--text-tertiary); line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.nav-actions button:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.nav-actions button[data-act="del"]:hover { background: #FCEBEB; color: var(--danger); }

.manage-btn, .add-top-btn {
  width: 100%; padding: 9px; border-radius: var(--radius-sm);
  font-size: 13px; margin-bottom: 8px;
  border: 1px solid var(--border-strong); color: var(--text-secondary);
  background: var(--surface);
}
.manage-btn:hover, .add-top-btn:hover { border-color: var(--brand); color: var(--brand); }
.manage-btn.active { background: var(--brand); color: #141414; border-color: var(--brand); font-weight: 600; }
.add-top-btn { color: var(--brand); border-color: var(--brand); }

.form-hint { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.custom-content { font-size: 14px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }

.mobile-menu-btn {
  font-size: 22px; color: var(--text); width: 40px; min-height: 40px;
  display: flex; align-items: center;
  text-align: left; line-height: 1;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
/* 手机端顶部快选条（不依赖抽屉） */
.mobile-nav-chips {
  display: none;
  gap: 8px;
  padding: 8px 12px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  flex-shrink: 0;
}
.mobile-nav-chips::-webkit-scrollbar { display: none; }
.mobile-chip {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text-secondary);
  white-space: nowrap;
  border: 1px solid transparent;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.mobile-chip.active { background: var(--dark); color: #fff; }

.sidebar-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  z-index: 1000;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-mask.show { display: block; }
.sidebar-footer { padding: 16px; border-top: 1px solid var(--border); }
/* 菜单最下方的版本号：以后「改了没生效」时，先看这里跑的是哪一版 */
.lf-ver {
  margin-top: 8px;
  text-align: center;
  font-size: 10.5px;
  letter-spacing: .5px;
  color: #C3B49A;
  user-select: text;
}
.user-info { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px; flex-shrink: 0;
}
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 12px; color: var(--text-tertiary); }
.user-meta { min-width: 0; flex: 1; }
.user-name, .user-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-edit-btn {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tertiary); font-size: 13px; line-height: 1;
  transition: background 0.15s ease, color 0.15s ease;
}
.user-edit-btn:hover { background: var(--brand-50); color: var(--brand-dark); }
.user-edit-btn:active { background: var(--brand-light); }
.logout-btn {
  width: 100%; padding: 10px;
  border-radius: var(--radius-sm);
  color: var(--danger); font-size: 13px;
  background: #FCEBEB; text-align: center;
}

/* 主内容 */
.main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  flex-shrink: 0;
}
.topbar h2 { font-size: 17px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.store-switch {
  padding: 8px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); font-size: 13px;
  background: var(--surface);
}
.content { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 24px; }

/* 移动端顶栏 + 底部导航 */
.mobile-topbar {
  display: none;
  height: var(--topbar-h);
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  flex-shrink: 0;
  position: relative;
  z-index: 500;
}
.mobile-topbar .brand-name { font-weight: 600; font-size: 16px; }
.sidebar-store {
  display: none;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.sidebar-store .store-switch {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: var(--surface);
}
.admin-claim-btn {
  width: 100%; padding: 9px; border-radius: var(--radius-sm);
  font-size: 12px; margin-bottom: 8px;
  color: var(--text-tertiary);
  border: 1px solid var(--border);
  background: var(--surface);
}
.admin-claim-btn:hover { color: var(--brand); border-color: var(--brand); }

/* ===== 页面容器 ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== 看板 ===== */
.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.metric-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
}
.metric-label { font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.metric-value { font-size: 26px; font-weight: 600; }
.metric-value .unit { font-size: 14px; font-weight: 400; color: var(--text-tertiary); margin-left: 2px; }
.metric-trend { font-size: 12px; margin-top: 6px; }
.metric-trend.up { color: var(--danger); }
.metric-trend.down { color: var(--success); }

.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 18px 20px;
  border: 1px solid var(--border);
}
.chart-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; }
.chart-wrap { position: relative; width: 100%; height: 260px; }

/* ===== 表格 ===== */
.table-card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.table-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  flex-wrap: wrap; gap: 12px;
}
.table-toolbar .title { font-size: 15px; font-weight: 600; }
.table-toolbar .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.search-input {
  padding: 9px 12px; border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none; min-width: 180px;
}
.search-input:focus { border-color: var(--brand); }
.btn {
  padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: 13px; font-weight: 500; transition: opacity 0.15s;
}
.btn:active { opacity: 0.8; }
.btn.primary { background: var(--brand); color: #141414; font-weight: 600; }
.btn.outline { border: 1px solid var(--border-strong); color: var(--text); background: var(--surface); }
.btn.danger { background: #FCEBEB; color: var(--danger); }
.btn.sm { padding: 6px 12px; font-size: 12px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; text-align: left; font-size: 13px; }
th {
  background: #FAFAFA; color: var(--text-secondary);
  font-weight: 500; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
td { border-bottom: 1px solid #F3F4F6; white-space: nowrap; }
tbody tr:hover { background: #FAFAFA; }
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 500;
}
.badge.green { background: #E1F5EE; color: var(--brand); }
.badge.red { background: #FCEBEB; color: var(--danger); }
.badge.amber { background: #FAEEDA; color: #854F0B; }
.badge.gray { background: #F1EFE8; color: var(--text-secondary); }
.badge.blue { background: #E6F1FB; color: #185FA5; }
.empty-state {
  padding: 40px; text-align: center; color: var(--text-tertiary);
}
.empty-state .icon { font-size: 40px; margin-bottom: 8px; }
.empty-state p { font-size: 13px; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  background: rgba(0,0,0,0.45);
  display: none; align-items: center; justify-content: center;
  z-index: 1400; padding: 16px;
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius);
  width: 100%; max-width: 520px; max-height: 90vh;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-header {
  padding: 18px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close { font-size: 22px; color: var(--text-tertiary); line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; }
.modal-footer {
  padding: 16px 20px; border-top: 1px solid var(--border);
  display: flex; justify-content: flex-end; gap: 10px;
}
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; font-size: 13px; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); outline: none;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ===== Toast ===== */
.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  background: #1F2937; color: #fff;
  padding: 12px 20px; border-radius: var(--radius-sm);
  font-size: 14px; z-index: 2000;
  display: none; max-width: 90%;
  box-shadow: var(--shadow-lg);
}
.toast.show { display: block; animation: fadeIn 0.2s; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes fadeIn { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== 日报卡片 ===== */
.report-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.report-card {
  background: var(--surface); border-radius: var(--radius);
  border: 1px solid var(--border); padding: 16px;
}
.report-card .report-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.report-card .report-date { font-size: 12px; color: var(--text-tertiary); }
.report-card .report-content { font-size: 13px; line-height: 1.6; color: var(--text); }

/* ===== 页面头部 ===== */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 20px; flex-wrap: wrap;
}
.page-h3 { font-size: 18px; font-weight: 600; }
.page-desc { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back-link {
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 8px; display: inline-block;
}
.back-link:hover { color: var(--brand); }
.notice-bar {
  background: var(--brand-light); border: 1px solid #F3DCAE;
  color: #7A5310; font-size: 13px; line-height: 1.6;
  padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px;
}

/* ===== 私教管理 ===== */
.pt-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}
.pt-coach-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px; cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}
.pt-coach-card:hover { border-color: var(--brand); }
.pt-churn-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 18px; padding: 12px 16px;
  background: var(--surface); border: 1px dashed var(--border-strong);
  border-radius: var(--radius); font-size: 13px; color: var(--text-secondary);
  flex-wrap: wrap;
}
.pt-churn-bar strong { color: var(--danger); }
.pt-coach-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.pt-coach-name { font-size: 15px; font-weight: 600; }
.pt-coach-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.pt-coach-stats { display: flex; gap: 20px; border-top: 1px solid var(--border); padding-top: 12px; }
.pt-coach-stats div { display: flex; flex-direction: column; gap: 2px; }
.pt-coach-stats strong { font-size: 18px; font-weight: 600; }
.pt-coach-stats span { font-size: 12px; color: var(--text-tertiary); }
.clickable-row { cursor: pointer; }

/* KPI 概览条 */
.kpi-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.kpi {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.kpi span { font-size: 12px; color: var(--text-tertiary); }
.kpi strong { font-size: 22px; font-weight: 600; color: var(--dark); }
.kpi .kpi-sub { font-size: 11px; font-style: normal; color: var(--text-tertiary); font-weight: 400; line-height: 1.35; }

/* 合同状态标签 */
.pill {
  display: inline-block; font-size: 12px; line-height: 18px;
  padding: 1px 8px; border-radius: 999px; white-space: nowrap;
}
.pill-ok { background: #E8F5E9; color: #2E7D32; }
.pill-warn { background: #FFF6E5; color: #B57E1E; }
.pill-muted { background: #F1F2F4; color: #8A8F99; }
.pill-danger { background: #FCEBEB; color: #C0392B; }

/* ===== 私教体验课 ===== */
.trial-filters {
  display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px;
}
.trial-filters .tbl-select { min-width: 128px; }
.trial-kv-grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px; margin-bottom: 16px;
}
.trial-kv-grid span, .trial-kv span {
  display: block; font-size: 12px; color: var(--text-tertiary); margin-bottom: 3px;
}
.trial-kv-grid strong { font-size: 14px; font-weight: 600; }
.trial-kv { margin-bottom: 12px; }
.trial-kv div {
  font-size: 13px; line-height: 1.7; color: var(--text); white-space: pre-wrap;
  background: var(--bg); border-radius: var(--radius-sm); padding: 8px 10px;
}
.mini-tag {
  font-size: 11px; color: var(--brand-dark); background: var(--brand-light);
  padding: 0 6px; border-radius: 4px; margin-left: 4px;
}
.txt-warn { color: #D97706; font-weight: 600; }
.txt-danger { color: var(--danger); font-weight: 600; }

/* ===== 会议录音 ===== */
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.rec-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 2600;
  background: rgba(20,20,20,0.96);
  color: #fff; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  display: none; gap: 12px; align-items: center;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.3);
}
.rec-bar.show { display: flex; }
.rec-dot {
  width: 10px; height: 10px; border-radius: 50%; background: #E24B4A;
  flex-shrink: 0; animation: recPulse 1.2s infinite;
}
@keyframes recPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }
.rec-time { font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; flex-shrink: 0; min-width: 52px; }
.rec-cap {
  flex: 1; font-size: 13px; color: #D6D6D6; line-height: 1.5;
  max-height: 48px; overflow: hidden; text-overflow: ellipsis;
}
.rec-cap em { color: #8A8F99; font-style: normal; }
.rec-hint { font-size: 12px; color: #9CA3AF; flex-shrink: 0; }
.rec-stop {
  flex-shrink: 0; padding: 8px 18px; border-radius: 999px;
  background: #E24B4A; color: #fff; font-size: 14px; font-weight: 500;
}
.rec-stop:active { opacity: 0.8; }
.rec-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-tertiary);
}
.rec-audio {
  width: 100%; margin-top: 10px; border-radius: var(--radius-sm);
}
.meet-card.recording { border-color: var(--danger); }

/* ===== 物资盘点 ===== */
.sync-hint {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: 14px; padding: 11px 16px;
  background: #FFF6E5; border: 1px solid #F3DFB6; border-radius: var(--radius);
  font-size: 13px; color: #8A6116; flex-wrap: wrap;
}
.sync-hint strong { color: #B57E1E; }
.push-list {
  font-size: 13px; line-height: 1.9; color: var(--text);
  background: var(--bg); border-radius: var(--radius-sm);
  padding: 12px 14px; white-space: pre-wrap;
  max-height: 46vh; overflow-y: auto;
}

/* 合同信息卡 */
.contract-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px 20px; padding: 16px;
}
.contract-grid > div { display: flex; flex-direction: column; gap: 4px; }
.contract-grid span { font-size: 12px; color: var(--text-tertiary); }
.contract-grid strong { font-size: 14px; font-weight: 600; }
.contract-progress {
  padding: 0 16px 12px; display: flex; align-items: center; gap: 12px;
}
.contract-progress .progress { flex: 1; margin-bottom: 0; }
.progress-bar { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.contract-dates {
  padding: 0 16px 12px; font-size: 12px; color: var(--text-secondary);
}
.date-chip {
  display: inline-block; background: var(--brand-light); color: var(--brand-dark);
  border-radius: 4px; padding: 1px 6px; margin: 0 4px 4px 0;
}
.contract-notes {
  padding: 12px 16px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-secondary);
}

/* ===== 训练计划清单（个人页只留时间，点开才看内容）===== */
.pp-list { padding: 4px 0; }
.pp-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.pp-row:last-child { border-bottom: none; }
.pp-row:hover { background: #FAFAFA; }
.pp-d { display: flex; flex-direction: column; align-items: center; width: 52px; flex: none; }
.pp-d b { font-size: 15px; font-weight: 600; color: var(--text-primary); font-variant-numeric: tabular-nums; }
.pp-d span { font-size: 11px; color: var(--text-tertiary); }
.pp-m { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pp-tag {
  font-size: 12px; padding: 2px 8px; border-radius: 4px; font-weight: 500;
  background: #F3F4F6; color: var(--text-secondary);
}
.pp-tag.pre { background: var(--brand-light); color: var(--brand-dark); }
.pp-tag.post { background: #E8F5E9; color: #2E7D32; }
.pp-tag.cycle { background: #FFF4E5; color: #B26A00; }
.pp-sub { font-size: 12px; color: var(--text-tertiary); }
.pp-st { font-size: 12px; color: var(--text-secondary); flex: none; }
.pp-st.done { color: #2E7D32; }
.pp-st.today { color: var(--brand-dark); font-weight: 600; }
.pp-st.miss { color: #B26A00; }
.pp-copy {
  flex: none; padding: 4px 10px; font-size: 12px;
  color: var(--brand-dark); background: var(--brand-light);
  border: 1px solid transparent; border-radius: 6px; cursor: pointer;
}
.pp-copy:active { opacity: .7; }
.pp-ar { color: var(--text-tertiary); font-size: 18px; flex: none; }
.pp-empty { padding: 24px 16px; text-align: center; color: var(--text-tertiary); font-size: 13px; }
.pp-foot { padding: 8px 16px 10px; font-size: 12px; color: var(--text-tertiary); }

/* 体测：只记日期，页面不出现 kg / % / cm */
.bt-last { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; padding: 16px 18px 6px; }
.bt-last b { font-size: 21px; font-weight: 600; letter-spacing: .3px; font-variant-numeric: tabular-nums; }
.bt-last span { font-size: 13px; color: var(--text-secondary); }
.bt-hint { padding: 0 18px 14px; font-size: 12px; color: var(--text-tertiary); }
.bt-hint.warn { color: var(--warning); font-weight: 600; }
.bt-hist { border-top: 1px solid var(--border); }
.bt-hrow { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--border); font-size: 13px; }
.bt-hrow:last-child { border-bottom: none; }
.bt-hrow .d { font-variant-numeric: tabular-nums; }
.bt-hrow .a { color: var(--text-tertiary); font-size: 12px; }
.bt-hrow .del { background: none; border: 0; color: var(--text-tertiary); font-size: 15px; line-height: 1; cursor: pointer; padding: 2px 6px; }
.bt-hrow .del:hover { color: var(--danger); }

/* 计划详情弹层 */
.ppv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 16px; margin-bottom: 4px; }
.ppv-kv { display: flex; flex-direction: column; gap: 3px; }
.ppv-kv span { font-size: 12px; color: var(--text-tertiary); }
.ppv-kv strong { font-size: 14px; font-weight: 600; }
.ppv-sec { margin-top: 14px; }
.ppv-sec > b { display: block; font-size: 12px; color: var(--text-tertiary); font-weight: 500; margin-bottom: 6px; }
.ppv-sec > p { margin: 0; font-size: 14px; color: var(--text-primary); line-height: 1.6; white-space: pre-wrap; }
.ppv-meta { margin-top: 14px; font-size: 12px; color: var(--text-tertiary); }
.ppv-moves { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.ppv-move {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; font-size: 13px;
  border-bottom: 1px solid var(--border);
}
.ppv-move:last-child { border-bottom: none; }
.ppv-move .nm { flex: 1; min-width: 0; color: var(--text-primary); }
.ppv-move .st { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.ppv-move .ld { min-width: 62px; text-align: right; color: var(--text-secondary); white-space: nowrap; }
.ppv-none { margin: 0; font-size: 13px; color: var(--text-tertiary); }
.ppv-ver { margin-top: 8px; border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; }
.ppv-ver-h { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.ppv-ver-h b { color: var(--text-primary); font-weight: 600; }
.ppv-ver-b { margin-top: 4px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }

/* ===== 课程记录「带入课前计划」桥接 ===== */
.tp-bridge { margin: 0 0 12px; }
.tp-bridge .btn { width: 100%; justify-content: center; }

/* ===== 进度条 ===== */
.progress {
  height: 8px; background: #F3F4F6; border-radius: 4px;
  overflow: hidden; margin-bottom: 4px; min-width: 120px;
}
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.progress-text { font-size: 12px; color: var(--text-secondary); }

/* ===== 排行榜 ===== */
.rank-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.rank-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.rank-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px; padding: 16px; border-bottom: 1px solid var(--border);
}
.rank-title { font-size: 15px; font-weight: 600; }
.rank-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }
.rank-actions { display: flex; gap: 4px; flex-shrink: 0; }
.rank-list { padding: 8px 0; }
.rank-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
}
.rank-row:hover { background: #FAFAFA; }
.rank-no {
  width: 24px; height: 24px; border-radius: 50%;
  background: #F1EFE8; color: var(--text-secondary);
  font-size: 12px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-no.top1 { background: #F5C24A; color: #4A3200; }
.rank-no.top2 { background: #D6D6D6; color: #3A3A3A; }
.rank-no.top3 { background: #E0B48C; color: #4A2E17; }
.rank-name { flex: 1; font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
.rank-note { font-size: 12px; color: var(--text-tertiary); margin-left: 6px; }
.champ-tag {
  display: inline-block; font-size: 11px; line-height: 17px;
  background: var(--brand-light); color: var(--brand-dark);
  border-radius: 4px; padding: 0 6px; margin-right: 6px;
  font-weight: 600; white-space: nowrap;
}
.rank-value { font-size: 14px; font-weight: 600; }
.rank-del { color: var(--text-tertiary); font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.rank-del:hover { background: #FCEBEB; color: var(--danger); }

/* ===== 密码门 ===== */
.gate-card {
  max-width: 360px; margin: 8vh auto 0; text-align: center;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 16px; padding: 32px 26px;
  box-shadow: 0 8px 30px rgba(20,20,20,0.06);
}
.gate-icon { font-size: 38px; margin-bottom: 10px; }
.gate-title { font-size: 18px; font-weight: 600; margin-bottom: 6px; }
.gate-desc { font-size: 13px; color: var(--text-tertiary); line-height: 1.7; margin-bottom: 20px; }
.gate-input {
  width: 100%; box-sizing: border-box; padding: 11px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  font-size: 15px; text-align: center; letter-spacing: 2px;
  background: var(--bg, #FAFAFA); color: var(--dark);
}
.gate-input:focus { outline: none; border-color: var(--brand); }
.gate-err { min-height: 18px; font-size: 12px; color: var(--danger); margin: 8px 0 4px; }
.gate-btn { width: 100%; justify-content: center; margin-top: 8px; }

/* ===== 财务看板 ===== */
.txt-in { color: #C0392B; }
.txt-out { color: #1E8449; }
.mini-input {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; background: var(--surface); color: var(--dark);
}
.cat-list { padding: 8px 16px 16px; }
.cat-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.cat-name { width: 150px; font-size: 13px; color: var(--text-secondary); flex-shrink: 0; }
.cat-bar { flex: 1; height: 8px; background: #F3F4F6; border-radius: 4px; overflow: hidden; }
.cat-bar-in { height: 100%; border-radius: 4px; }
.cat-bar-in.in { background: #E8A33D; }
.cat-bar-in.out { background: #9AA0A6; }
.cat-val { width: 96px; text-align: right; font-size: 13px; font-weight: 600; flex-shrink: 0; }

/* ===== 周例会 ===== */
.meet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.meet-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
}
.meet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.meet-date { font-size: 12px; color: var(--brand-dark); font-weight: 600; }
.meet-title { font-size: 15px; font-weight: 600; margin-top: 3px; }
.meet-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  font-size: 12px; color: var(--text-tertiary);
  padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px;
}
.meet-block { margin-bottom: 10px; }
.meet-block label {
  display: block; font-size: 11px; color: var(--brand-dark);
  background: var(--brand-light); border-radius: 4px;
  padding: 1px 6px; width: fit-content; margin-bottom: 4px;
}
.meet-block p { font-size: 13px; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; }

/* ===== 状态切换 ===== */
.seg-bar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.seg-btn {
  padding: 6px 14px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer;
}
.seg-btn.active { background: var(--dark); border-color: var(--dark); color: #fff; }

/* ===== 教练筛选条 ===== */
.coach-filter {
  display: flex; gap: 8px; margin-bottom: 14px;
  overflow-x: auto; padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.coach-filter::-webkit-scrollbar { display: none; }
.coach-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); cursor: pointer; white-space: nowrap;
  transition: all .15s ease;
}
.coach-chip em {
  font-style: normal; font-size: 11px; color: var(--text-tertiary);
  background: var(--bg); border-radius: 999px; padding: 1px 6px;
}
.coach-chip:hover { border-color: var(--brand); color: var(--brand-dark); }
.coach-chip.active {
  background: var(--dark); border-color: var(--dark); color: #fff;
}
.coach-chip.active em { background: rgba(255,255,255,.18); color: #fff; }

/* ===== 账号管理 ===== */
.acc-cell { display: flex; align-items: center; gap: 10px; }
.acc-name { font-size: 14px; font-weight: 600; color: var(--text); }
.acc-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.tbl-select {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 8px; font-size: 13px; background: var(--surface);
  color: var(--text); max-width: 150px;
}
.tbl-select:disabled { background: var(--bg); color: var(--text-tertiary); cursor: not-allowed; }
.role-legend-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px; }
.role-legend {
  background: var(--bg); border-radius: 10px; padding: 12px 14px;
  display: flex; flex-direction: column; gap: 4px;
}
.role-legend strong { font-size: 13px; color: var(--brand-dark); }
.role-legend span { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }

/* 邀请二维码弹窗 */
.invite-qr-wrap { text-align: center; margin-bottom: 14px; }
.invite-qr-wrap img { width: 100%; max-width: 300px; border-radius: 14px; display: inline-block; }
.invite-qr-tip { font-size: 13px; color: var(--text-secondary); line-height: 1.75; text-align: center; margin-bottom: 12px; }
.invite-link {
  font-size: 13px; color: var(--brand-dark); background: var(--brand-light);
  border-radius: 10px; padding: 10px 12px; text-align: center;
  word-break: break-all; user-select: all;
}



/* ===== KPI 考核 ===== */
.kpi-month {
  display: flex; align-items: center; gap: 2px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 2px 4px;
}
.kpi-month span { font-size: 13px; font-weight: 600; padding: 0 6px; min-width: 86px; text-align: center; color: var(--text); }
.kpi-nav { width: 26px; height: 26px; border-radius: 6px; color: var(--text-secondary); font-size: 17px; line-height: 1; }
.kpi-nav:hover { background: var(--bg); }

.kpi-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 22px 0 12px; }
.kpi-section-head h4 { font-size: 14px; font-weight: 600; color: var(--text); }
.kpi-hint { font-size: 12px; color: var(--text-tertiary); }

.kpi-std-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.kpi-std-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi-std-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.kpi-cat { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--brand-light); color: var(--brand-dark); margin-bottom: 6px; }
.kpi-std-title { font-size: 15px; font-weight: 600; color: var(--text); }
.kpi-std-ops { display: flex; gap: 2px; flex-shrink: 0; }
.kpi-std-meta { font-size: 12px; color: var(--text-tertiary); margin-top: 6px; }
.kpi-std-meta strong { color: var(--brand-dark); font-size: 13px; }
.kpi-std-text { font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); margin-top: 8px; }

.kpi-table th em { display: block; font-style: normal; font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.kpi-name { font-weight: 600; font-size: 13px; }
.kpi-sub { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.kpi-score-cell { text-align: center; font-variant-numeric: tabular-nums; }
.kpi-total { text-align: center; font-weight: 700; font-size: 15px; }
.c-hi { color: var(--brand-dark); font-weight: 600; }
.c-ok { color: #2E7D32; font-weight: 600; }
.c-bad { color: #C62828; font-weight: 600; }
.c-mute { color: var(--text-tertiary); }
.kpi-grade { display: inline-block; font-size: 11.5px; padding: 1px 8px; border-radius: 999px; line-height: 18px; white-space: nowrap; }
.g-a { background: #FDF3E0; color: #B57E1E; }
.g-b { background: #E8F5E9; color: #2E7D32; }
.g-c { background: #EEF2F7; color: #4B5563; }
.g-d { background: #FFF6E5; color: #B45309; }
.g-e { background: #FCEBEB; color: #C62828; }
.g-none { background: var(--bg); color: var(--text-tertiary); }

.kpi-inputs { display: flex; flex-direction: column; gap: 8px; margin: 4px 0 14px; }
.kpi-input-row { display: flex; align-items: center; gap: 10px; }
.kpi-input-label { flex: 1; min-width: 0; }
.kpi-input-label span { font-size: 13px; color: var(--text); }
.kpi-input-label em { display: block; font-style: normal; font-size: 11px; color: var(--text-tertiary); }
.kpi-input-row input { width: 84px; text-align: center; flex-shrink: 0; }
.kpi-preview { font-size: 13px; color: var(--text-secondary); background: var(--bg); border-radius: 10px; padding: 10px 12px; }
.kpi-preview strong { font-size: 20px; color: var(--brand-dark); margin-left: 6px; }
.kpi-preview span { font-size: 12px; color: var(--text-tertiary); margin-left: 8px; }

/* ===== 安装到桌面提示条 ===== */
.a2hs-bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 3000;
  display: flex; align-items: center; gap: 10px;
  background: var(--dark); color: #fff;
  border-radius: 14px; padding: 10px 12px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.28);
}
.a2hs-icon { width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0; }
.a2hs-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.a2hs-text strong { font-size: 13px; font-weight: 600; }
.a2hs-text span { font-size: 11.5px; color: rgba(255, 255, 255, 0.65); }
.a2hs-bar .btn.primary { background: var(--brand); color: #141414; border-color: transparent; flex-shrink: 0; }
.a2hs-close { color: rgba(255, 255, 255, 0.55); font-size: 18px; line-height: 1; padding: 4px 6px; flex-shrink: 0; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  /* 移动端：用 display 控制显隐，避开 iOS 上 fixed + transform 的兼容坑 */
  .layout { overflow: visible; }
  .sidebar {
    display: none;
    position: fixed;
    top: 0; bottom: 0; left: 0;
    z-index: 1100;
    width: 82vw;
    max-width: 300px;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
  .sidebar.open { display: flex; }
  html.drawer-open body { overflow: hidden; }
  .sidebar-store { display: block; }
  .mobile-topbar { display: flex; }
  .mobile-nav-chips { display: flex; }
  .topbar { display: none; }
  .content { padding: 16px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .metric-card { padding: 14px 16px; }
  .metric-value { font-size: 22px; }
  .chart-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .search-input { min-width: 120px; flex: 1; }
  .role-legend-grid { grid-template-columns: 1fr; padding: 12px; }
  .kpi-std-grid { grid-template-columns: 1fr; }
  .kpi-month { flex: 1; justify-content: space-between; }
  .kpi-section-head h4 { font-size: 13.5px; }
  .trial-filters .tbl-select, .trial-filters .mini-input { flex: 1 1 42%; min-width: 0; }
}

/* iPad 竖屏 / 窄屏笔记本：保留文字，只做紧凑处理 */
@media (min-width: 769px) and (max-width: 1100px) {
  :root { --sidebar-w: 208px; }
  .sidebar-brand { padding: 16px 14px; }
  .sidebar-brand .logo { width: 38px; height: 38px; }
  .sidebar-brand .name { font-size: 16px; }
  .nav-row { padding-left: 6px; }
  .nav-label { font-size: 13.5px; }
  .nav-actions { opacity: 0.9; }
  .user-name, .user-role { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 132px; }
  .content { padding: 18px 20px 24px; }
  .metric-grid { gap: 12px; }
  .metric-card { padding: 14px 16px; }
  .metric-value { font-size: 22px; }
}

/* ===== 三体云动数据接入 ===== */
.t3-note {
  background: var(--brand-light);
  border: 1px solid #F2DFC0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8A6A28;
}
.t3-drop {
  margin-top: 12px;
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius);
  padding: 26px 16px;
  text-align: center;
  cursor: pointer;
  background: #FBFBFC;
  transition: border-color .18s, background .18s;
}
.t3-drop:hover, .t3-drop.over { border-color: var(--brand); background: var(--brand-light); }
.t3-drop-icon { font-size: 26px; line-height: 1; }
.t3-drop-title { margin-top: 8px; font-size: 14px; font-weight: 600; color: var(--text); }
.t3-drop-sub { margin-top: 4px; font-size: 12px; color: var(--text-tertiary); }
.t3-file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 14px; padding: 9px 12px;
  background: #F6F7F9; border-radius: var(--radius-sm);
}
.t3-file-name { font-size: 12.5px; color: var(--text-secondary); word-break: break-all; }
.t3-section-title {
  margin: 18px 0 10px; font-size: 12.5px; font-weight: 600;
  color: var(--text-secondary); letter-spacing: .3px;
}
.map-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; }
.map-row { display: flex; align-items: center; gap: 10px; }
.map-label { width: 88px; flex: none; font-size: 12.5px; color: var(--text-secondary); }
.map-label em { color: var(--danger); font-style: normal; margin-left: 2px; }
.map-select {
  flex: 1; min-width: 0; height: 32px; padding: 0 8px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 12.5px; background: #fff; color: var(--text);
}
.t3-stat {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px;
  padding: 12px; background: #F8F9FB; border-radius: var(--radius);
}
.t3-stat > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.t3-stat span { font-size: 11.5px; color: var(--text-tertiary); }
.t3-stat strong { font-size: 14px; color: var(--text); word-break: break-all; }
.t3-warn {
  margin-top: 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  background: #FFF6E5; color: #9A6A12; font-size: 12.5px; line-height: 1.6;
}
.t3-preview-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.t3-preview-table th {
  text-align: left; padding: 8px 10px; background: #F6F7F9;
  color: var(--text-secondary); font-weight: 500; white-space: nowrap;
}
.t3-preview-table td { padding: 8px 10px; border-top: 1px solid var(--border); color: var(--text); }
.t3-api-status {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: #FBFBFC;
}
.t3-api-dot {
  width: 9px; height: 9px; border-radius: 50%; background: var(--warning);
  margin-top: 6px; flex: none; box-shadow: 0 0 0 3px rgba(239,159,39,.16);
}
.t3-ul { margin: 0 0 0 18px; font-size: 13px; color: var(--text-secondary); line-height: 1.9; }
.t3-copy-box {
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: #F8F9FB; font-size: 12.5px; line-height: 1.8; color: var(--text-secondary);
  user-select: text;
}
.t3-log-list { display: flex; flex-direction: column; gap: 8px; }
.t3-log-row {
  display: grid; grid-template-columns: 1.4fr 1.4fr auto; align-items: center; gap: 10px;
  padding: 11px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.t3-log-name { font-size: 13px; font-weight: 600; }
.t3-log-meta { font-size: 12.5px; color: var(--text-secondary); }
.t3-log-time { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

@media (max-width: 768px) {
  .map-grid { grid-template-columns: 1fr; }
  .t3-stat { grid-template-columns: 1fr 1fr; }
  .t3-log-row { grid-template-columns: 1fr; gap: 4px; }
  .t3-log-time { text-align: left; }
}

/* ===== KPI 考核（企微标准版）===== */
.kpi-tpl-bar { margin-bottom: 14px; }
.kpi-no {
  display: inline-block; min-width: 20px; margin-right: 6px;
  font-size: 12px; color: var(--brand-dark); font-weight: 600;
}
.kpi-weight-chip {
  flex-shrink: 0; font-size: 12px; font-weight: 600;
  color: var(--brand-dark); background: var(--brand-light);
  border-radius: 999px; padding: 2px 9px;
}
.kpi-std-goal {
  margin-top: 8px; font-size: 12.5px; line-height: 1.6;
  color: #8A6A28; background: #FBF6EC; border-radius: 8px; padding: 7px 9px;
}
.kpi-std-body { margin-top: 4px; }
.kpi-std-label {
  margin-top: 10px; font-size: 11.5px; font-weight: 600;
  color: var(--text-tertiary); letter-spacing: .3px;
}
.kpi-std-text { white-space: pre-wrap; }
.kpi-std-text.grade { color: var(--text); background: #F8F9FB; border-radius: 8px; padding: 8px 10px; }
.kpi-reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi-reward-card {
  background: var(--surface); border: 1px solid var(--border);
  border-left: 3px solid var(--border); border-radius: var(--radius); padding: 12px 14px;
}
.kpi-reward-card.plus { border-left-color: #2E7D32; }
.kpi-reward-card.minus { border-left-color: #C62828; }
.kpi-reward-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.kpi-reward-head strong { font-size: 15px; }
.kpi-reward-card.plus .kpi-reward-head strong { color: #2E7D32; }
.kpi-reward-card.minus .kpi-reward-head strong { color: #C62828; }
.kpi-reward-head span { font-size: 11.5px; color: var(--text-tertiary); }
.kpi-reward-line { font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); margin-top: 4px; }
.kpi-reward-line em { font-style: normal; color: var(--text-tertiary); margin-right: 6px; }
.kpi-rule-card { padding: 14px 16px; }
.kpi-grade-list { display: flex; flex-direction: column; gap: 6px; }
.kpi-grade-row { display: flex; align-items: center; gap: 12px; font-size: 12.5px; }
.kpi-grade-badge {
  flex-shrink: 0; width: 26px; height: 22px; border-radius: 6px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.kpi-grade-badge.g-a { background: #FDF3E0; color: #B57E1E; }
.kpi-grade-badge.g-b { background: #E8F5E9; color: #2E7D32; }
.kpi-grade-badge.g-c { background: #EEF2F7; color: #4B5563; }
.kpi-grade-badge.g-d { background: #FFF6E5; color: #B45309; }
.kpi-grade-badge.g-e, .kpi-grade-badge.g-f { background: #FCEBEB; color: #C62828; }
.kpi-grade-pay { flex-shrink: 0; width: 54px; font-weight: 600; color: var(--text); }
.kpi-grade-desc { color: var(--text-secondary); }
.kpi-eliminate {
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border);
}
.kpi-eliminate-title { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.kpi-eliminate p { font-size: 12.5px; line-height: 1.75; color: var(--text-secondary); }
.kpi-pending-row { background: #FCFCFD; }
.kpi-pending-row .kpi-name { color: var(--text-secondary); font-weight: 500; }

@media (max-width: 768px) {
  .kpi-reward-grid { grid-template-columns: 1fr; }
  .kpi-grade-row { flex-wrap: wrap; gap: 6px 10px; }
  .kpi-grade-desc { flex-basis: 100%; }
}

/* ============================================================
   整体 UI 优化（多设备适配增强）
   ============================================================ */

/* ---------- 全局 ---------- */
html { -webkit-text-size-adjust: 100%; }
button, a, .nav-row, .pt-coach-card { touch-action: manipulation; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }

/* 自定义滚动条（桌面更精致） */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #D6DAE2; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: #BFC5D0; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 侧边栏 ---------- */
.sidebar { background: #FBFCFE; }
.sidebar-brand {
  padding: 18px 16px;
  gap: 12px;
}
.sidebar-brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  background: #fff;
  padding: 3px;
  object-fit: contain;
}
.sidebar-brand .name { font-size: 16px; letter-spacing: .2px; }
.sidebar-nav { padding: 10px; }
.nav-row { padding: 10px 12px; margin-bottom: 2px; border-radius: 10px; }
.nav-row:hover { background: #F1F3F7; color: var(--text); }
.nav-row.active {
  background: var(--brand-light);
  color: var(--brand-dark);
  font-weight: 600;
  box-shadow: inset 0 0 0 1px #F4DFB8;
}
.nav-row.active .nav-icon { transform: translateZ(0); }
.nav-caret { color: #B9BFC9; }

.sidebar-footer { padding: 14px 16px; background: #FBFCFE; }
.user-avatar { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #F0F1F5; }
.logout-btn { border-radius: 10px; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: rgba(255,255,255,0.9);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(16,24,40,0.04);
}
.topbar h2 { font-size: 17px; letter-spacing: .2px; }
.topbar-right { gap: 14px; }

/* ---------- 内容区 ---------- */
.content { padding: 24px; }
.content-inner { max-width: var(--content-max); margin: 0 auto; }

/* ---------- 卡片 ---------- */
.metric-card, .chart-card, .table-card, .report-card, .pt-coach-card, .kpi-std-card, .kpi-reward-card {
  box-shadow: var(--shadow-sm);
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.metric-card:hover, .pt-coach-card:hover, .kpi-std-card:hover {
  box-shadow: var(--shadow-md);
  border-color: #E2E5EB;
}
.metric-card { position: relative; overflow: hidden; }
.metric-card::before {
  content: "";
  position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  opacity: 0; transition: opacity .2s;
}
.metric-card:hover::before { opacity: 1; }
.metric-label { letter-spacing: .3px; }
.metric-value { font-variant-numeric: tabular-nums; letter-spacing: -.3px; }

.chart-card h3 { display: flex; align-items: center; gap: 8px; }
.chart-card h3::before {
  content: ""; width: 4px; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

/* ---------- 表格 ---------- */
.table-card { border-radius: var(--radius-lg); }
th { background: #F7F8FA; font-size: 12.5px; letter-spacing: .2px; color: #6B7280; }
td { padding: 13px 16px; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: #FBF6EE; }
tbody tr:last-child td { border-bottom: none; }
.clickable-row { cursor: pointer; }

/* ---------- 按钮 ---------- */
.btn {
  border-radius: 10px; font-weight: 500;
  transition: transform .12s ease, box-shadow .15s ease, opacity .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); opacity: .85; }
.btn.primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(224,163,61,.35);
}
.btn.primary:hover { box-shadow: 0 4px 14px rgba(224,163,61,.45); }
.btn.outline:hover { border-color: var(--brand); color: var(--brand-dark); }

/* ---------- 输入控件 ---------- */
.search-input, .store-switch, .form-group input, .form-group select, .form-group textarea, .map-select {
  transition: border-color .15s ease, box-shadow .15s ease;
}
.search-input:focus, .form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,163,61,.15);
}

/* ---------- 弹窗 ---------- */
.modal { border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); }
.modal-header { padding: 18px 22px; }
.modal-body { padding: 22px; }
.modal-footer { padding: 16px 22px; }

/* ---------- 页头 / 分段 / 提示 ---------- */
.page-h3 { font-size: 19px; letter-spacing: .2px; }
.page-desc { line-height: 1.7; }
.notice-bar { border-radius: var(--radius-lg); }
.seg-btn {
  padding: 8px 16px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 13px;
  transition: all .15s ease;
}
.seg-btn.active { background: var(--dark); border-color: var(--dark); color: #fff; }
.seg-btn:not(.active):hover { border-color: var(--brand); color: var(--brand-dark); }

/* ---------- 空态 ---------- */
.empty-state .icon { opacity: .85; }

/* ============================================================
   手机端（iPhone / Android，≤768px）
   ============================================================ */
@media (max-width: 768px) {
  .content { padding: 14px 14px calc(20px + env(safe-area-inset-bottom)); }
  .page-head { gap: 12px; margin-bottom: 16px; }
  .page-h3 { font-size: 17px; }
  .page-head .actions { width: 100%; }
  .page-head .actions .btn { flex: 1; min-height: 42px; }
  .metric-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .metric-card { padding: 14px 14px; border-radius: var(--radius); }
  .metric-value { font-size: 21px; }

  .mobile-topbar {
    padding-top: env(safe-area-inset-top);
    height: calc(var(--topbar-h) + env(safe-area-inset-top));
    background: rgba(255, 255, 255, .94);
    -webkit-backdrop-filter: saturate(180%) blur(10px);
    backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
  }
  .mobile-chip { padding: 8px 14px; font-size: 13px; }
  .mobile-nav-chips { padding: 10px 12px; gap: 8px; }

  /* 触控目标放大 */
  .btn { min-height: 40px; }
  .btn.sm { min-height: 34px; }
  .nav-row { padding: 12px 14px; }
  .logout-btn { min-height: 44px; }

  /* 弹窗改为底部抽屉 */
  .modal-mask { align-items: flex-end; padding: 0; }
  .modal {
    max-width: 100% !important;
    width: 100%;
    border-radius: 20px 20px 0 0;
    max-height: 92vh;
    animation: sheetUp .26s ease;
  }
  @keyframes sheetUp { from { transform: translateY(24px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
  .modal-header { padding: 16px 18px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); }

  /* 表格横向可滑，首列可粘 */
  table { min-width: 0; }
  td, th { padding: 11px 12px; font-size: 12.5px; }
  .table-toolbar { padding: 14px 14px; }
  .table-toolbar .title { font-size: 14px; }
}

/* ============================================================
   iPad / 平板（769–1100px）
   ============================================================ */
@media (min-width: 769px) and (max-width: 1100px) {
  :root { --sidebar-w: 220px; }
  .content { padding: 20px; }
  .metric-grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .metric-value { font-size: 24px; }
  .chart-grid { grid-template-columns: 1fr 1fr; }
  .sidebar-brand { padding: 18px 14px; }
  .sidebar-nav { padding: 8px; }
  .nav-row { padding: 10px 10px; }
}

/* ============================================================
   宽屏（≥1440px）：内容居中限宽，避免拉伸
   ============================================================ */
@media (min-width: 1440px) {
  .content { padding: 28px; }
  .content > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
  .content > .page-head { margin-bottom: 20px; }
}

/* ===== 今日概览 ===== */
.ov-click { cursor: pointer; }
.ov-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.ov-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.ov-section-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px; cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background .12s ease;
}
.ov-section-head:hover { background: #FAFAFB; }
.ov-ic { font-size: 16px; line-height: 1; }
.ov-title { font-size: 14px; font-weight: 600; flex: 1; color: var(--text); }
.ov-count {
  font-size: 12px; font-weight: 600; border-radius: 999px;
  padding: 1px 9px; min-width: 22px; text-align: center; line-height: 18px;
}
.ov-count.danger { background: #FCEBEB; color: #C0392B; }
.ov-count.warn { background: #FFF6E5; color: #B57E1E; }
.ov-count.mute { background: #F1F2F4; color: #8A8F99; }
.ov-go { color: var(--text-tertiary); }
.ov-list { padding: 6px 0; max-height: 320px; overflow-y: auto; }
.ov-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px; cursor: pointer; font-size: 13px;
  transition: background .12s ease;
}
.ov-item:hover { background: #FBF6EE; }
.ov-item + .ov-item { border-top: 1px solid #F4F5F7; }
.ov-item-name { font-weight: 600; color: var(--text); white-space: nowrap; max-width: 32%; overflow: hidden; text-overflow: ellipsis; }
.ov-item-meta { flex: 1; color: var(--text-secondary); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ov-tag {
  flex: none; font-size: 11px; border-radius: 999px; padding: 1px 8px; white-space: nowrap;
}
.ov-tag.danger { background: #FCEBEB; color: #C0392B; }
.ov-tag.warn { background: #FFF6E5; color: #B57E1E; }
.ov-tag.mute { background: #F1F2F4; color: #8A8F99; }
.ov-empty { padding: 16px; font-size: 12.5px; color: var(--text-tertiary); }
.ov-empty.ok { color: var(--success); }

@media (max-width: 768px) {
  .ov-grid { grid-template-columns: 1fr; }
  .ov-item { min-height: 44px; padding: 12px 14px; }
  .ov-item-name { max-width: 40%; }
  .ov-item-meta { white-space: normal; line-height: 1.4; }
}

/* ===== 横版品牌 Logo ===== */
.sidebar-brand .brand-logo {
  width: 100%;
  max-width: 180px;
  height: auto;
  display: block;
}
.mobile-topbar .mobile-brand-badge {
  display: inline-flex;
  align-items: center;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.mobile-topbar .mobile-brand-badge img {
  height: 17px;
  width: auto;
  display: block;
}
.login-brand .logo-h {
  width: 240px;
  height: auto;
  margin: 0 auto 16px;
  display: block;
}
@media (max-width: 768px) {
  .login-brand .logo-h { width: 200px; }
  .sidebar-brand { padding: 14px 14px; }
  .sidebar-brand .brand-logo { max-width: 150px; }
}

/* 加载页横版 logo（深色背景加白色胶囊） */
.loading-logo {
  width: auto;
  height: 30px;
  max-width: 70vw;
  display: block;
  background: #fff;
  padding: 9px 15px;
  border-radius: 10px;
}

/* ===== 教练排班 ===== */
.sched-table th { white-space: nowrap; }
.sched-table td { text-align: center; padding: 9px 10px; }
.sched-date { white-space: nowrap; font-weight: 600; color: var(--text-secondary); text-align: left !important; }
.sched-td { font-size: 12.5px; }
.sched-empty { color: var(--text-tertiary); }
.sched-rest { color: #B0B4BB; background: #FAFAFB; }
.sched-normal { color: var(--text); }
.sched-duty { background: #FDF3E0; color: #B57E1E; font-weight: 600; }
.sched-store2 { background: #E6F1FB; color: #185FA5; font-weight: 600; }
.sched-clickable { cursor: pointer; }
.sched-clickable:hover { outline: 2px solid var(--brand); outline-offset: -2px; }
.sched-manual {
  font-size: 10px; color: #fff; background: var(--brand);
  border-radius: 3px; padding: 0 3px; margin-left: 3px;
}

/* ============================================================
   门店选择（顶栏 / 侧栏 / 手机顶栏 / 排班页快捷切换）
   ============================================================ */
.sidebar-store-label {
  font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-tertiary); margin: 0 2px 6px;
}
.store-pick { display: inline-flex; align-items: center; gap: 8px; }
.store-pick-label { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }
.store-pick .store-switch { min-width: 150px; }
.store-scope-tag {
  display: inline-block; padding: 1px 8px; border-radius: 999px;
  background: var(--brand-light); color: var(--brand-dark);
  font-weight: 600; font-size: 12px;
}

/* 手机顶栏门店按钮 */
.m-store-btn {
  display: inline-flex; align-items: center; gap: 5px;
  height: 30px; max-width: 44vw; padding: 0 10px;
  border-radius: 999px; cursor: pointer;
  background: var(--brand-light); color: var(--brand-dark);
  border: 1px solid #F2DFC0;
  font-size: 12.5px; font-weight: 600;
}
.m-store-btn.is-all {
  background: #F1F3F6;
  border-color: #E2E6EC;
  color: var(--text-secondary);
}
.m-store-btn #m-store-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-store-ic { font-size: 13px; flex-shrink: 0; }
.m-store-caret { font-size: 10px; opacity: .7; flex-shrink: 0; }

/* 门店选择底部抽屉 */
.store-sheet-body { display: flex; flex-direction: column; gap: 10px; padding: 6px 18px 22px; }
.store-opt {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 14px 15px; border-radius: 14px; text-align: left; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface);
}
.store-opt.active { border-color: var(--brand); background: var(--brand-light); }
.store-opt-ic { font-size: 20px; flex-shrink: 0; }
.store-opt-main { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.store-opt-name { font-size: 14.5px; font-weight: 600; color: var(--text); }
.store-opt-desc { font-size: 12px; color: var(--text-tertiary); }
.store-opt-check { color: var(--brand-dark); font-weight: 700; flex-shrink: 0; }

/* 排班页门店快捷切换 */
.store-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.store-chip {
  padding: 7px 14px; border-radius: 999px; font-size: 12.5px; cursor: pointer;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-secondary);
}
.store-chip.active { background: var(--dark); color: #fff; border-color: var(--dark); }

/* 单店视角下的异店班次 */
.sched-other { opacity: .6; }
.sched-other-tag {
  font-size: 9px; color: #185FA5; background: #DCEAF8;
  border-radius: 3px; padding: 0 3px; margin-left: 3px;
}

@media (max-width: 768px) {
  .store-pick { display: none; }
  .store-scope-tag { font-size: 11.5px; }
  .store-chip { padding: 8px 14px; }
}

@media (max-width: 380px) {
  .mobile-topbar .mobile-brand-badge { padding: 0; }
  .mobile-topbar .mobile-brand-badge img { height: 15px; }
  .m-store-btn { padding: 0 8px; font-size: 12px; gap: 4px; }
}

/* ============================================================
   业绩看板 · 目标完成情况
   ============================================================ */
.perf-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.perf-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 16px);
  padding: 18px 20px 16px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column;
  min-width: 0; overflow: hidden;
}
.perf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.perf-title { font-size: 15px; font-weight: 600; letter-spacing: .2px; }
.perf-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 4px; }

.perf-brand { display: flex; align-items: center; gap: 20px; }
.perf-ring {
  --pct: 0; --ring: #E8A33D;
  width: 128px; height: 128px; border-radius: 50%; flex-shrink: 0;
  background: conic-gradient(var(--ring) calc(var(--pct) * 1%), #EEF0F3 0);
  display: grid; place-items: center; position: relative;
}
.perf-ring::after {
  content: ''; position: absolute; inset: 13px;
  background: var(--surface); border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(16,24,40,.03);
}
.perf-ring-in { position: relative; z-index: 1; text-align: center; line-height: 1.2; }
.perf-ring-in strong { display: block; font-size: 25px; font-weight: 700; color: var(--text); letter-spacing: -.5px; }
.perf-ring-in span { display: block; font-size: 11px; color: var(--text-tertiary); margin-top: 2px; }

.perf-brand-info { flex: 1; min-width: 0; }
.perf-brand-rows { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 12px; }
.perf-brand-row { display: flex; flex-direction: column; gap: 3px; }
.perf-brand-row span { font-size: 11.5px; color: var(--text-tertiary); }
.perf-brand-row strong { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.perf-brand-row strong.hl { color: var(--brand-dark); }

.perf-track {
  position: relative; height: 10px; border-radius: 999px;
  background: #EEF0F3; margin-bottom: 8px;
}
.perf-track > i {
  display: block; height: 100%; border-radius: 999px;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.perf-track.sm { height: 7px; margin-bottom: 0; }
.perf-track-mark {
  position: absolute; top: -4px; bottom: -4px; width: 2px;
  background: #141414; opacity: .35; border-radius: 2px;
}
.perf-track-note { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.5; }

.perf-coach-head {
  display: flex; align-items: center; justify-content: space-between;
  margin: 18px 0 8px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 12.5px; font-weight: 600; color: var(--text-secondary);
}
.perf-coach-count { font-size: 12px; font-weight: 500; color: var(--text-tertiary); }

.perf-list { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.perf-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 6px; border-radius: 10px;
}
.perf-row:hover { background: #FAFBFC; }
.perf-rank {
  width: 20px; height: 20px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 6px;
  font-size: 11px; font-weight: 600; color: var(--text-tertiary);
  background: #F3F5F8;
}
.perf-rank.top { background: var(--brand-light); color: var(--brand-dark); }
.perf-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.perf-row-top { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: wrap; row-gap: 4px; }
.perf-name { font-size: 13.5px; font-weight: 600; white-space: nowrap; }
.perf-tag {
  font-size: 10.5px; font-weight: 600; padding: 1px 7px; border-radius: 999px;
  white-space: nowrap;
}
.perf-tag.muted { color: var(--text-tertiary); background: #F1F3F6; }
.perf-amount {
  margin-left: auto; font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.perf-amount em { font-style: normal; font-weight: 400; color: var(--text-tertiary); font-size: 11.5px; }
.perf-pct {
  width: 46px; text-align: right; flex-shrink: 0;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
}

.perf-legend {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-secondary);
}
.perf-legend > span { display: inline-flex; align-items: center; gap: 5px; }
.perf-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.perf-legend-mute { color: var(--text-tertiary); flex: 1 1 100%; line-height: 1.5; }

/* 目标设置弹窗 */
.perf-modal-hint {
  font-size: 12.5px; color: var(--text-secondary); line-height: 1.7;
  background: #F8FAFC; border: 1px solid var(--border);
  border-radius: 10px; padding: 10px 12px; margin-bottom: 16px;
}
.perf-modal-sec { margin-bottom: 18px; }
.perf-modal-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.perf-modal-title .mute { font-weight: 400; color: var(--text-tertiary); }
.perf-modal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.perf-modal-row {
  display: grid; grid-template-columns: 72px 1fr 1fr;
  gap: 10px; align-items: center; margin-bottom: 8px;
}
.perf-modal-name { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.perf-modal-row input, .perf-modal-grid input { width: 100%; }
.perf-modal-tip { font-size: 11.5px; color: var(--text-tertiary); margin-top: 6px; }

@media (max-width: 1100px) {
  .perf-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  /* 手机端：完成情况整块改为纵向堆叠，任何一行都不超出屏宽 */
  .perf-grid { gap: 12px; }
  .perf-card { padding: 16px 14px 14px; max-width: 100%; }
  .perf-head { flex-direction: column; align-items: stretch; gap: 10px; }
  .perf-head .btn { align-self: flex-start; }
  .perf-brand { flex-direction: column; align-items: stretch; gap: 14px; }
  .perf-ring { width: 92px; height: 92px; align-self: center; }
  .perf-ring::after { inset: 10px; }
  .perf-ring-in strong { font-size: 19px; }
  .perf-ring-in span { font-size: 10px; }
  .perf-brand-rows {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px; margin-bottom: 10px;
  }
  .perf-brand-row span { font-size: 11px; }
  .perf-brand-row strong { font-size: 13px; word-break: break-all; }
  .perf-track-note { font-size: 11px; }

  .perf-coach-head { margin-top: 14px; }
  .perf-row { gap: 8px; padding: 10px 4px; align-items: flex-start; }
  .perf-rank { width: 18px; height: 18px; font-size: 10px; margin-top: 1px; }
  .perf-row-top { gap: 6px; row-gap: 3px; }
  .perf-name { font-size: 13px; }
  .perf-tag { font-size: 10px; padding: 1px 6px; }
  .perf-amount { margin-left: 0; width: 100%; font-size: 12.5px; }
  .perf-amount em { font-size: 11px; }
  .perf-pct { width: 38px; font-size: 12.5px; padding-top: 1px; }

  .perf-legend { gap: 8px 12px; font-size: 11px; }
  .perf-modal-grid { grid-template-columns: 1fr; }
  .perf-modal-row { grid-template-columns: 64px minmax(0, 1fr) minmax(0, 1fr); gap: 8px; }
  .perf-modal-name { font-size: 12.5px; }
}

/* ============================================================
   账号管理 · 角色卡与权限矩阵
   ============================================================ */
.perm-role-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(186px, 1fr));
  gap: 12px; margin-bottom: 16px;
}
.perm-role-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; min-width: 0;
}
.perm-role-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.perm-role-head strong { font-size: 13.5px; color: var(--brand-dark); }
.perm-role-head span { font-size: 11.5px; color: var(--text-tertiary); white-space: nowrap; }
.perm-role-card p { font-size: 11.5px; color: var(--text-secondary); line-height: 1.6; }

.perm-table th { text-align: center; white-space: nowrap; }
.perm-table th:first-child, .perm-table td:first-child { text-align: left; }
.perm-table td { text-align: center; font-size: 12.5px; padding: 8px 10px; }
.perm-label { color: var(--text); line-height: 1.5; }
.perm-group-row td {
  background: #F8FAFC; font-size: 11.5px; font-weight: 600;
  color: var(--text-tertiary); letter-spacing: .04em;
  text-align: left !important; padding: 7px 12px;
}
.perm-yes { color: #1D9E75; font-weight: 700; }
.perm-no { color: #C9CED6; }

@media (max-width: 1100px) {
  .perm-role-grid { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
}
@media (max-width: 768px) {
  .perm-role-grid { grid-template-columns: 1fr; gap: 10px; }
  .perm-role-card { padding: 12px 14px; }
  .perm-table { min-width: 520px; }
  .perm-table td, .perm-table th { padding: 7px 6px; font-size: 12px; }
  .perm-label { font-size: 12px; }
}

/* 角色下拉按层级着色 */
.role-select.role-admin { color: var(--brand-dark); font-weight: 600; }
.role-select.role-manager { color: #185FA5; font-weight: 600; }
.role-select.role-coach { color: #1D9E75; }
.role-select.role-member { color: var(--text-secondary); }

/* 角色徽章（只读视图用） */
.role-chip {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: #F1F3F6; color: var(--text-secondary);
}
.role-chip.role-admin { background: var(--brand-light); color: var(--brand-dark); }
.role-chip.role-gm { background: #EEE9FA; color: #5B45B0; }
.role-chip.role-manager { background: #E6F1FB; color: #185FA5; }
.role-chip.role-coach { background: #E4F5EE; color: #1D9E75; }
.role-select.role-gm { color: #5B45B0; font-weight: 600; }

/* 账号名旁的改名按钮 */
.acc-rename {
  margin-left: 6px; padding: 0 4px; border: 0; background: transparent;
  color: var(--text-tertiary); font-size: 12px; line-height: 1;
  cursor: pointer; border-radius: 4px;
}
.acc-rename:hover { color: var(--brand-dark); background: var(--brand-light); }

/* ============================================================
   今日概览 · 今日课程
   ============================================================ */
.cls-list {
  display: flex; flex-direction: column;
  max-height: 380px; overflow-y: auto;
  padding: 6px 10px 10px;
}
.cls-row {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 6px; border-radius: 10px;
}
.cls-row:hover { background: #FAFBFC; }
.cls-row + .cls-row { border-top: 1px solid #F4F6F9; }
.cls-time {
  width: 50px; flex-shrink: 0; display: flex; flex-direction: column;
  font-size: 13px; font-weight: 600; line-height: 1.25;
  font-variant-numeric: tabular-nums; color: var(--text);
}
.cls-time em { font-style: normal; font-size: 10.5px; font-weight: 400; color: var(--text-tertiary); }
.cls-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cls-title {
  font-size: 13.5px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cls-meta {
  font-size: 11.5px; color: var(--text-tertiary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cls-tag {
  flex-shrink: 0; font-size: 11px; font-weight: 600;
  padding: 2px 9px; border-radius: 999px; white-space: nowrap;
}
.cls-tag.ok { background: #E4F5EE; color: #1D9E75; }
.cls-tag.live { background: var(--brand-light); color: var(--brand-dark); }
.cls-tag.wait { background: #F1F3F6; color: var(--text-secondary); }
.cls-tag.mute { background: #F6F7F9; color: #A6ACB6; }
.cls-more { font-size: 11.5px; color: var(--text-tertiary); padding: 4px 16px 10px; }

@media (max-width: 768px) {
  .cls-list { max-height: 320px; padding: 4px 8px 8px; }
  .cls-row { gap: 9px; padding: 8px 4px; }
  .cls-time { width: 44px; font-size: 12.5px; }
  .cls-title { font-size: 13px; }
  .cls-tag { font-size: 10.5px; padding: 2px 7px; }
}

/* 今日课程 · 签到标签与统计 */
.cls-tag.bad { background: #FBE9E9; color: #C13B3A; }
.cls-sum { font-size: 11.5px; color: var(--text-tertiary); margin-left: auto; padding-right: 4px; }
.cls-sum b { color: #1D9E75; font-weight: 700; font-size: 13px; }

/* 同步延迟提示 */
.sync-stale {
  display: inline-block; margin-left: 2px; padding: 1px 7px;
  border-radius: 999px; background: #FDF0E3; color: #B26A00;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}

/* 员工日报 · 结构化填报 */
.rep-month {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, rgba(0, 0, 0, .07));
  border-radius: 14px; padding: 16px; margin-bottom: 16px;
}
.rep-month-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; row-gap: 8px; }
/* 汇总页「查看月份」：可翻看上月及更早月份 */
.rep-month-pick-wrap { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-tertiary); flex: 0 0 auto; }
.rep-month-pick { padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px; font-size: 13px; font-family: inherit; background: #fff; color: var(--text-primary); max-width: 150px; }
.rep-month-head strong { font-size: 15px; }
.rep-sub { font-size: 12px; color: var(--text-tertiary); margin-left: 8px; }
.rep-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.rep-kpi { background: rgba(0, 0, 0, .025); border-radius: 10px; padding: 10px 12px; }
.rep-k { font-size: 12px; color: var(--text-tertiary); }
.rep-v { font-size: 17px; font-weight: 700; margin: 2px 0 6px; }
.rep-v em { font-size: 11px; font-weight: 500; color: var(--text-tertiary); font-style: normal; }
.rep-bar { height: 5px; border-radius: 3px; background: rgba(0, 0, 0, .08); overflow: hidden; }
.rep-bar span { display: block; height: 100%; background: linear-gradient(90deg, #C9A227, #E6C65C); }
.rep-p { font-size: 11px; color: var(--text-tertiary); margin-top: 3px; }
.rep-lines { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 12px; color: var(--text-secondary); margin-top: 10px; }
.rep-lines b { color: var(--text-primary); font-weight: 600; }
.rep-wl { font-size: 11px; color: var(--text-tertiary); white-space: nowrap; }
.rep-calc { font-size: 20px; font-weight: 700; padding: 4px 0; }

/* 日报汇总视图 · 切换与表格 */
.rep-tabs { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; }
.rep-tab {
  padding: 6px 14px; border-radius: 999px; border: 1px solid var(--border);
  background: transparent; font-size: 13px; color: var(--text-secondary);
  cursor: pointer; font-family: inherit;
}
.rep-tab.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.rep-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.rep-table th, .rep-table td {
  padding: 9px 10px; border-bottom: 1px solid var(--border);
  text-align: right; white-space: nowrap;
}
.rep-table th:first-child, .rep-table td:first-child { text-align: left; }
.rep-table th {
  font-weight: 600; color: var(--text-tertiary); font-size: 12px;
  cursor: pointer; user-select: none;
}
.rep-table th:first-child { cursor: default; }
.rep-table tbody tr:hover { background: rgba(0, 0, 0, .02); }
.rep-table tfoot td { font-weight: 600; border-top: 2px solid var(--border); }
.rep-muted { color: var(--text-tertiary); font-size: 12px; }
.fin-cat {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; border-bottom: 1px dashed var(--border); font-size: 13px;
}
.fin-cat:last-child { border-bottom: none; }
.fin-cat b { font-weight: 600; }
.fin-cat em {
  font-style: normal; font-size: 11px; color: var(--text-tertiary);
  margin-left: 8px; min-width: 34px; display: inline-block; text-align: right;
}
.rep-bulk {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 8px; margin-bottom: 10px;
}
.rep-bulk input {
  padding: 6px 8px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; font-family: inherit; background: var(--surface); color: var(--text-primary);
}
.rep-tgt-input {
  width: 78px; padding: 5px 7px; border: 1px solid var(--border); border-radius: 7px;
  font-size: 13px; font-family: inherit; text-align: right;
  background: var(--surface); color: var(--text-primary);
}
@media (max-width: 640px) {
  .rep-bulk { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 640px) {
  .rep-kpis { grid-template-columns: 1fr 1fr; }
}

/* ===== 今日值班（紧凑置顶） ===== */
.duty-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 14px;
  margin-bottom: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color .15s;
}
.duty-strip:hover { border-color: var(--brand); }
.duty-ic { font-size: 14px; line-height: 1; }
.duty-label { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.duty-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 600;
}
.duty-chip i { font-style: normal; font-weight: 500; font-size: 11px; opacity: .65; }
.duty-none { font-size: 13px; color: var(--text-tertiary); }
.duty-go { margin-left: auto; color: var(--text-tertiary); font-size: 13px; }

/* ===== 耗课条（合并进课程卡片） ===== */
.consume-bar {
  display: flex;
  align-items: stretch;
  padding: 12px 16px;
  background: linear-gradient(90deg, rgba(201,162,77,.07), rgba(201,162,77,.01));
  border-bottom: 1px solid var(--border);
}
.consume-item { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.consume-item span { font-size: 12px; color: var(--text-tertiary); }
.consume-item strong { font-size: 21px; font-weight: 700; color: var(--brand-dark); line-height: 1.25; }
.consume-item em { font-style: normal; font-size: 11px; color: var(--text-tertiary); }
/* 耗课是「结算口径」，与顶部签到数不是同一件事，加一行小字说明避免误读 */
.consume-hint { font-style: normal; font-size: 10px; color: var(--text-tertiary); opacity: .8; line-height: 1.3; }
.consume-divider { width: 1px; background: var(--border); margin: 2px 20px; }

@media (max-width: 640px) {
  .consume-item strong { font-size: 18px; }
  .consume-divider { margin: 2px 12px; }
  .duty-strip { padding: 8px 11px; gap: 7px; }
  .duty-chip { font-size: 12px; padding: 2px 8px; }
}

/* ===== 概览卡片排序按钮 ===== */
.ov-drag { position: relative; }
.ov-drag-bar {
  position: absolute;
  top: 7px;
  right: 9px;
  z-index: 9;
  display: flex;
  gap: 6px;
  opacity: .55;
  transition: opacity .15s;
}
.ov-drag:hover .ov-drag-bar { opacity: 1; }
.ov-move {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.96);
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.ov-move:hover { color: var(--brand-dark); border-color: var(--brand); background: var(--brand-light); }
.ov-move-hit { background: var(--brand-light) !important; border-color: var(--brand) !important; color: var(--brand-dark) !important; transform: scale(.92); }

@media (hover: none) {
  .ov-drag-bar { opacity: .95; }
}

@media (max-width: 640px) {
  .ov-drag-bar { top: 6px; right: 7px; gap: 5px; opacity: 1; }
  .ov-move { width: 36px; height: 36px; font-size: 16px; border-radius: 11px; }
}

/* ===== 财务看板卡片 ===== */
.rep-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}
.rep-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  #fin-body > div[style*="grid-template-columns:1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* ===== 概览业绩 3×2 布局（今日一排 / 本月一排） ===== */
.kpi-3x2 { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }

/* 日报卡片：教练姓名突出 */
.report-name {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
  letter-spacing: .2px;
}

/* ===== 训练计划 ===== */
.tp-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px;
  background: #F4F5F7;
  border-radius: 12px;
  width: fit-content;
}
.tp-tab {
  padding: 9px 22px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  transition: all .15s;
  -webkit-tap-highlight-color: transparent;
}
.tp-tab.on {
  background: #fff;
  color: var(--text-primary);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.tp-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 18px;
  align-items: start;
}
.tp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tp-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 18px;
}
.tp-block-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}
/* 区块标题右侧的「已填 N 项」：内容有没有被截断，一眼看得出来 */
.tp-cnt {
  font-style: normal;
  font-weight: 500;
  font-size: 11.5px;
  color: var(--text-tertiary);
  margin-left: -2px;
}
.tp-cnt:empty { display: none; }
.tp-step {
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--brand-light);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.tp-block-hint {
  margin-left: auto;
  font-style: normal;
  font-size: 11.5px;
  font-weight: 400;
  color: var(--text-tertiary);
}
.tp-add-btn { margin-top: 10px; width: 100%; }
.tp-block .tp-field:last-child { margin-bottom: 0; }
.tp-field { margin-bottom: 14px; }
.tp-field label {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}
.tp-field input,
.tp-field select,
.tp-field textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text-primary);
  box-sizing: border-box;
}
.tp-field input:focus,
.tp-field select:focus,
.tp-field textarea:focus {
  outline: none;
  border-color: var(--brand);
}
.tp-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tp-chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* 锁定的学员：从会员页进来时不用再搜一遍，但要看得出是谁、能换 */
.tp-person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FAFAFA;
}
.tp-person-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.tp-person-tx strong { font-size: 15px; color: var(--text-primary); }
.tp-person-tx span { font-size: 12px; color: var(--text-secondary); }

/* ===== 下拉式多选 ===== */
.tp-select { position: relative; }
.tp-select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  transition: border-color .15s;
}
.tp-select.open .tp-select-trigger,
.tp-select-trigger:hover { border-color: var(--brand); }
.tp-select-val {
  flex: 1;
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.4;
  word-break: break-all;
}
.tp-select-val.ph { color: #A8AEB8; }
.tp-select-arrow {
  font-size: 11px;
  color: var(--text-tertiary);
  transition: transform .15s;
}
.tp-select.open .tp-select-arrow { transform: rotate(180deg); }
.tp-select-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(0,0,0,.12);
  max-height: 62vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.tp-chip {
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text-secondary);
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
  transition: all .12s;
  white-space: nowrap;
}
.tp-chip:active { transform: scale(.96); }
.tp-chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(201,162,77,.32);
}
.tp-warm-add { display: flex; gap: 8px; margin-bottom: 10px; }
.tp-warm-add input {
  flex: 1;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  font-family: inherit;
  box-sizing: border-box;
  background: #fff;
  color: var(--text-primary);
}
.tp-warm-add input:focus { outline: none; border-color: var(--brand); }
.tp-line {
  display: grid;
  /* 顺序与出图一致：动作 / 负荷(重量) / 次数 / 组数 / 删除 */
  grid-template-columns: 1fr 84px 52px 52px 30px;
  gap: 6px;
  align-items: center;
  margin-bottom: 8px;
}
.tp-line input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13.5px;
  box-sizing: border-box;
  font-family: inherit;
}
.tp-line select {
  width: 100%;
  padding: 8px 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  box-sizing: border-box;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  appearance: auto;
}
/* 有氧动作行：时长 + 单位(分钟/秒) + 模式 + 强度，列数与力量动作不同 */
.tp-line.cd { grid-template-columns: 1fr 64px 74px 84px 88px 30px; }
.tp-line select.tp-unit { padding: 8px 2px; font-size: 12px; text-align: center; color: var(--text-secondary); }
.tp-x { text-align: center; color: var(--text-tertiary); font-size: 12px; }
.tp-del {
  width: 30px;
  height: 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text-tertiary);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
.tp-del:hover { color: var(--danger); border-color: var(--danger); }
.tp-preview {
  position: sticky;
  top: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  text-align: center;
}
.tp-preview canvas { display: block; margin: 0 auto; border-radius: 10px; }
.tp-img {
  display: block;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
  border-radius: 10px;
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.tp-canvas-wrap { position: relative; }
/* 生成后的成图必须能被隐藏：
   .tp-img 写了 display:block，会盖掉 HTML 的 hidden 属性，
   导致改完字段回到画布预览时，下面那张旧图还在，看起来像「预览没更新」 */
.tp-img[hidden] { display: none !important; }
.tp-actions { margin-top: 12px; }
/* 版本号：手机端缓存导致「改了没生效」时，一眼能确认跑的是哪一版 */
.tp-ver {
  margin-top: 8px;
  text-align: center;
  font-size: 11px;
  letter-spacing: .4px;
  color: var(--text-tertiary);
}
.tp-hint {
  display: block;
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--text-tertiary);
}

@media (max-width: 900px) {
  .tp-grid { grid-template-columns: 1fr; }
  .tp-preview { position: static; }
}
@media (max-width: 480px) {
  .tp-line { grid-template-columns: 1fr 66px 42px 42px 28px; gap: 4px; }
  .tp-line.cd { grid-template-columns: 1fr 44px 54px 58px 62px 28px; gap: 4px; }
  .tp-line select.tp-unit { padding: 7px 0; font-size: 11.5px; }
  .tp-line input { padding: 7px 8px; font-size: 13px; }
}

@media (max-width: 640px) {
  .kpi-3x2 {
    gap: 7px !important;
    margin-bottom: 12px !important;
  }
  .kpi-3x2 .kpi {
    padding: 9px 7px !important;
    min-width: 0;
    overflow: hidden;
  }
  .kpi-3x2 .kpi span {
    font-size: 10.5px !important;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .kpi-3x2 .kpi strong {
    font-size: 14px !important;
    line-height: 1.3;
    letter-spacing: -.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}


/* ===== 登录密码可见切换 ===== */
.pwd-wrap { position: relative; width: 100%; }
.pwd-wrap #pwd-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 46px 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s;
}
.pwd-wrap #pwd-input:focus { border-color: var(--brand); }
.pwd-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.pwd-eye:hover { opacity: 1; background: rgba(0, 0, 0, 0.05); }
.pwd-eye:active { opacity: 1; background: rgba(0, 0, 0, 0.09); }

/* ===== 教练姓名为可点击链接（查历史日报） ===== */
.rep-coach-link {
  color: var(--brand-dark);
  text-decoration: none;
  border-bottom: 1px dashed rgba(0, 0, 0, 0.25);
  cursor: pointer;
}
.rep-coach-link:hover { border-bottom-style: solid; }

/* 账号管理：窄屏把「操作」列固定在右侧，避免横向滑动才能看到按钮 */
@media (max-width: 900px) {
  .table-card table.acc-table th:last-child,
  .table-card table.acc-table td:last-child {
    position: sticky;
    right: 0;
    background: #FFFFFF;
    box-shadow: -8px 0 12px rgba(15, 23, 42, 0.06);
    z-index: 2;
  }
  .table-card table.acc-table tbody tr:hover td:last-child { background: #FAFAFA; }
}

/* ===== 训练计划 · 姓名搜索建议 ===== */
.tp-sug-wrap { position: relative; }
.tp-sug {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 40;
  max-height: 252px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, .16);
}
.tp-sug-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tp-sug-item:active { background: rgba(201, 162, 77, .16); }
.tp-sug-item .nm {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tp-sug-item .co {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}
.tp-sug-empty {
  padding: 12px 10px;
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
}

/* ===== AI 私教助手 ===== */
.aipt-tabs {
  display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap;
  background: var(--surface); padding: 5px; border-radius: 10px;
  border: 1px solid var(--border);
}
.aipt-tab {
  flex: 1; min-width: 96px; padding: 8px 14px; border-radius: 7px;
  font-size: 13px; color: var(--text-secondary); font-weight: 500;
}
.aipt-tab.on { background: var(--dark); color: #fff; font-weight: 600; }

.aipt-board { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; align-items: start; }
.aipt-sub { font-size: 12px; color: var(--text-tertiary); }

.aipt-actions-list { display: flex; flex-direction: column; gap: 10px; padding: 12px; }
.aipt-card {
  border: 1px solid var(--border); border-left: 3px solid var(--border-strong);
  border-radius: 10px; padding: 12px 14px; background: var(--surface);
}
.aipt-band-s { border-left-color: var(--danger); }
.aipt-band-a { border-left-color: var(--warning); }
.aipt-band-r { border-left-color: #9AA3AF; }
.aipt-band-b { border-left-color: #B9BEC7; }
.aipt-band-c { border-left-color: var(--success); }

.aipt-channels {
  display: flex; gap: 6px; padding: 12px 12px 0; flex-wrap: wrap;
}
.aipt-channel {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--surface); font-size: 13px; color: var(--text-secondary);
}
.aipt-channel em {
  font-style: normal; font-size: 11px; font-weight: 600;
  background: var(--bg); border-radius: 10px; padding: 1px 7px; color: var(--text-tertiary);
}
.aipt-channel.on { background: var(--dark); border-color: var(--dark); color: #fff; font-weight: 600; }
.aipt-channel.on em { background: rgba(255,255,255,.2); color: #fff; }

.aipt-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.aipt-card-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aipt-card-name strong { font-size: 15px; color: var(--text); }
.aipt-score { font-size: 20px; font-weight: 700; color: var(--dark); line-height: 1; }
.aipt-score em { font-size: 11px; font-style: normal; font-weight: 400; color: var(--text-tertiary); margin-left: 2px; }
.aipt-card-meta { font-size: 12px; color: var(--text-secondary); margin-top: 6px; line-height: 1.6; }
.aipt-card-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.aipt-card-action {
  margin-top: 8px; font-size: 12.5px; color: var(--text);
  background: var(--bg); border-radius: 7px; padding: 7px 10px; line-height: 1.6;
}
.aipt-last { margin-top: 6px; font-size: 11.5px; color: var(--text-tertiary); }
.aipt-card-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.aipt-tag {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 11.5px; font-weight: 500; line-height: 1.6;
}
.aipt-tag-danger { background: #FCEBEB; color: #C0392B; }
.aipt-tag-warn { background: #FFF6E5; color: #B57E1E; }
.aipt-tag-muted { background: #F1F2F4; color: #7A8089; }
.aipt-tag-ok { background: #E8F5E9; color: #2E7D32; }

.aipt-toolbar { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.aipt-toolbar input, .aipt-toolbar select {
  padding: 8px 10px; border: 1px solid var(--border-strong); border-radius: 8px;
  background: var(--surface); font-size: 13px; color: var(--text);
}
.aipt-toolbar input { flex: 1; min-width: 160px; }

.aipt-chips { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.aipt-chip {
  padding: 6px 12px; border-radius: 20px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 12.5px; color: var(--text-secondary);
  display: inline-flex; align-items: center; gap: 6px;
}
.aipt-chip em {
  font-style: normal; font-size: 11px; color: var(--text-tertiary);
  background: var(--bg); border-radius: 10px; padding: 1px 6px;
}
.aipt-chip.on { background: var(--dark); color: #fff; border-color: var(--dark); }
.aipt-chip.on em { background: rgba(255,255,255,.18); color: #fff; }

.aipt-score-big {
  width: 84px; height: 84px; border-radius: 50%; display: flex;
  flex-direction: column; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700; line-height: 1.1; flex-shrink: 0;
}
.aipt-score-big em { font-size: 10px; font-style: normal; font-weight: 400; }
.aipt-score-danger { background: #FCEBEB; color: #C0392B; }
.aipt-score-warn { background: #FFF6E5; color: #B57E1E; }
.aipt-score-muted { background: #F1F2F4; color: #7A8089; }
.aipt-score-ok { background: #E8F5E9; color: #2E7D32; }

.aipt-detail-top { display: flex; align-items: center; gap: 16px; margin-bottom: 4px; }
.aipt-detail-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.aipt-section-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  margin: 18px 0 8px; padding-left: 8px; border-left: 3px solid var(--brand);
}
.aipt-dims { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; }
.aipt-dim-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-secondary); margin-bottom: 4px; }
.aipt-dim-head strong { font-size: 13px; }
.aipt-dim-head em { font-style: normal; font-size: 11px; color: var(--text-tertiary); font-weight: 400; }
.aipt-dim-danger { color: var(--danger); }
.aipt-dim-warn { color: #B57E1E; }
.aipt-dim-ok { color: var(--success); }
.aipt-bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.aipt-bar i { display: block; height: 100%; border-radius: 3px; }
.aipt-bar-danger { background: var(--danger); }
.aipt-bar-warn { background: var(--warning); }
.aipt-bar-ok { background: var(--success); }

.aipt-floor {
  margin-top: 10px; font-size: 12px; color: #B57E1E;
  background: #FFFBF0; border-radius: 7px; padding: 7px 10px;
}
.aipt-action-box {
  font-size: 13px; line-height: 1.7; background: var(--bg);
  border-radius: 8px; padding: 10px 12px; color: var(--text);
}
.aipt-script {
  font-size: 13px; line-height: 1.85; color: var(--text);
  background: #FAFAF7; border: 1px dashed var(--border-strong);
  border-radius: 8px; padding: 12px; white-space: pre-wrap;
}
.aipt-inline-btns { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

.aipt-follow-list { display: flex; flex-direction: column; gap: 8px; }
.aipt-follow-item { border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; }
.aipt-follow-head { display: flex; justify-content: space-between; gap: 10px; font-size: 12.5px; }
.aipt-follow-head span { color: var(--text-tertiary); font-size: 11.5px; white-space: nowrap; }
.aipt-follow-body { font-size: 12.5px; color: var(--text-secondary); margin-top: 4px; line-height: 1.7; }

.aipt-plan-form {
  display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px; margin-bottom: 14px;
}
.aipt-plan-field { display: flex; flex-direction: column; gap: 6px; min-width: 160px; flex: 1; }
.aipt-plan-field label { font-size: 12px; color: var(--text-tertiary); }
.aipt-plan-field select {
  padding: 9px 10px; border: 1px solid var(--border-strong);
  border-radius: 8px; background: var(--surface); font-size: 13px; color: var(--text);
}
.aipt-plan-meta {
  display: flex; gap: 14px; flex-wrap: wrap; padding: 0 16px 12px;
  font-size: 12.5px; color: var(--text-secondary);
}
.aipt-base {
  margin: 0 16px 12px; padding: 9px 12px; border-radius: 8px;
  background: var(--bg); font-size: 12.5px; color: var(--text-secondary);
}
.aipt-base-warn { background: #FFFBF0; color: #B57E1E; }
.aipt-cycles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; padding: 0 16px 8px; }
.aipt-cycle { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.aipt-cycle-head {
  display: flex; justify-content: space-between; align-items: baseline; gap: 10px;
  padding: 9px 12px; background: var(--bg); font-size: 13px;
}
.aipt-cycle-head span { font-size: 11.5px; color: var(--text-tertiary); }
.aipt-session { padding: 10px 12px; border-top: 1px solid var(--border); }
.aipt-session-head { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 5px; }
.aipt-session-warm { font-size: 11.5px; color: var(--text-tertiary); margin-bottom: 6px; }
.aipt-session-items { margin: 0 0 6px 0; padding-left: 0; list-style: none; }
.aipt-session-items li {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 12.5px; color: var(--text); padding: 3px 0;
}
.aipt-session-items em { font-style: normal; font-size: 11.5px; color: var(--text-secondary); white-space: nowrap; }
.aipt-session-tail { font-size: 11.5px; color: var(--text-tertiary); line-height: 1.6; }
.aipt-nutrition { padding: 0 16px 12px; }
.aipt-nutrition ul { margin: 0; padding-left: 18px; }
.aipt-nutrition li { font-size: 12.5px; color: var(--text-secondary); line-height: 1.8; }
.aipt-plan-tip {
  margin: 0 16px 16px; padding: 9px 12px; border-radius: 8px;
  background: var(--brand-50); font-size: 12px; color: #8A6A28; line-height: 1.7;
}

.modal-wide { max-width: 720px; width: 92vw; }

@media (max-width: 900px) {
  .aipt-board { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .aipt-tab { min-width: 72px; padding: 7px 8px; font-size: 12.5px; }
  .aipt-dims { grid-template-columns: 1fr; }
  .aipt-cycles { grid-template-columns: 1fr; padding: 0 12px 8px; }
  .aipt-detail-top { gap: 12px; }
  .aipt-score-big { width: 70px; height: 70px; font-size: 22px; }
  .aipt-plan-form { padding: 12px; }
  .aipt-plan-field { min-width: 100%; }
  .aipt-card-btns .btn { flex: 1; }
  .modal-wide { width: 100vw; max-width: 100vw; }
}

/* ===== 私教名单：搜索与排序 ===== */
.pt-toolbar { margin-bottom: 12px; }
.pt-search {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  box-sizing: border-box;
}
.pt-search:focus { outline: none; border-color: var(--brand); }
.pt-sortbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}
.pt-sortbar::-webkit-scrollbar { display: none; }
.pt-sorts { display: flex; gap: 8px; flex: 0 0 auto; }
.pt-sort {
  padding: 6px 13px;
  border-radius: 999px;
  font-size: 12.5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: all .15s ease;
}
.pt-sort:hover { border-color: var(--brand); color: var(--brand-dark); }
.pt-sort.on { background: var(--dark); border-color: var(--dark); color: #fff; }
.pt-match {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ===== 私教全周期（试用入口）===== */
.fc-tabs {
  display: flex; gap: 8px; margin-bottom: 16px;
  overflow-x: auto; padding-bottom: 4px; scrollbar-width: none;
}
.fc-tabs::-webkit-scrollbar { display: none; }
.fc-tab {
  flex: 0 0 auto; padding: 7px 15px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text-secondary); font-size: 13px; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: all .15s ease;
}
.fc-tab:hover { border-color: var(--brand); color: var(--brand-dark); }
.fc-tab.on { background: var(--dark); border-color: var(--dark); color: #fff; }

/* 卡片容器：本模块内部使用，与既有 .table-card 互不影响 */
.fc-tabs ~ #fc-body .card,
#fc-body .card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}
#fc-body .card-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border);
}
#fc-body .card-head .title { font-size: 14.5px; font-weight: 600; color: var(--text-primary); }
#fc-body .card-head .sub { font-size: 12px; color: var(--text-tertiary); }
#fc-body .card-body { padding: 18px; }
#fc-body .banner {
  padding: 12px 16px; border-radius: 10px; font-size: 12.5px; line-height: 1.75;
  background: #FFF7E8; border: 1px solid #F3E0BE; color: #7A5A18;
}
#fc-body .banner.blue { background: #EAF2FB; border-color: #CFE0F2; color: #2A5A8A; }
#fc-body .banner.gray { background: #F7F8FA; border-color: var(--border); color: var(--text-secondary); }
#fc-body .search-box {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 9px; font-size: 13.5px; font-family: inherit;
  background: var(--surface); color: var(--text-primary); box-sizing: border-box;
}
#fc-body .search-box:focus { outline: none; border-color: var(--brand); }
#fc-body .pill-info { background: #EAF2FB; color: #2A6AA8; }

/* 今日课程 */
.fc-class {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px; border-bottom: 1px solid var(--border);
}
.fc-class:last-child { border-bottom: 0; }
.fc-class.done { background: #FAFBFC; }
.fc-time {
  flex: 0 0 62px; font-size: 15px; font-weight: 600; color: var(--text-primary);
  line-height: 1.3;
}
.fc-time em { display: block; font-style: normal; font-size: 11px; font-weight: 400; color: var(--text-tertiary); }
.fc-main { flex: 1; min-width: 0; }
.fc-nm { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fc-sub { font-size: 12px; color: var(--text-tertiary); margin-top: 2px; }
.fc-act { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

/* 学员档案 */
.fc-split { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 860px) { .fc-split { grid-template-columns: 1fr; } }
.fc-picks { max-height: 620px; overflow-y: auto; }
.fc-pick {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 11px 16px; border-bottom: 1px solid var(--border); cursor: pointer;
}
.fc-pick:last-child { border-bottom: 0; }
.fc-pick:hover { background: #FAFBFC; }
.fc-pick.on { background: rgba(232, 163, 61, .10); }
.fc-pk-n { font-size: 13.5px; font-weight: 600; color: var(--text-primary); }
.fc-pk-s { font-size: 11.5px; color: var(--text-tertiary); margin-top: 2px; }
.fc-go { color: var(--text-tertiary); font-size: 16px; }
.fc-bar { height: 8px; border-radius: 999px; background: #F1F3F6; overflow: hidden; margin: 12px 0 0; }
.fc-bar i { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.fc-warn {
  margin-top: 12px; padding: 10px 13px; border-radius: 9px;
  background: #FEF3F2; border: 1px solid #FADBD8; color: #A33A32; font-size: 12.5px; line-height: 1.7;
}
.fc-ok { margin-top: 12px; font-size: 12.5px; color: #1E7B4F; }
.fc-tl { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.fc-tl:last-child { border-bottom: 0; }
.fc-tl-d { flex: 0 0 8px; height: 8px; border-radius: 50%; margin-top: 6px; background: var(--brand); }
.fc-tl-d.ok { background: #1E9E6A; }
.fc-tl-d.warn { background: #E8A33D; }
.fc-tl-h { font-size: 13px; font-weight: 600; color: var(--text-primary); display: flex; gap: 8px; align-items: center; }
.fc-tl-n { font-size: 12.5px; color: var(--text-secondary); margin-top: 3px; line-height: 1.6; }

/* 体测 */
.fc-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; margin-bottom: 14px; }
.fc-metric {
  background: var(--surface); border: 1px solid var(--border); border-radius: 11px;
  padding: 13px 15px; cursor: pointer; transition: all .15s ease;
}
.fc-metric.on { border-color: var(--brand); background: #FFFDF8; }
.fc-m-l { font-size: 11.5px; color: var(--text-tertiary); }
.fc-m-v { font-size: 21px; font-weight: 600; color: var(--text-primary); margin-top: 4px; }
.fc-m-v span { font-size: 11px; font-weight: 400; color: var(--text-tertiary); margin-left: 2px; }

/* AI 阶段规划 */
.fc-phase { padding: 14px 0; border-bottom: 1px dashed var(--border); }
.fc-phase:last-child { border-bottom: 0; }
.fc-ph-h { display: flex; align-items: baseline; justify-content: space-between; }
.fc-ph-n { font-size: 14px; font-weight: 600; color: var(--text-primary); }
.fc-ph-w { font-size: 12px; color: var(--text-tertiary); }
.fc-ph-f { font-size: 12.5px; color: var(--brand-dark); margin-top: 4px; }
.fc-ph-ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.85; color: var(--text-secondary); }

/* ===== 私教管理（v2）沉浸模式 =====
   手机端顶部有三层：56px 菜单栏（☰）、页面标题栏、横向导航条。
   三层叠起来占掉近 170px，私教管理自己的界面被压成一小条，
   「返回名单」按钮和教练筛选条根本没地方显示。
   进入私教管理时收起标题栏与导航条，只留 ☰ 菜单栏用于回其他模块。 */
@media (max-width: 768px) {
  body.ptv2-mode .topbar,
  body.ptv2-mode .mobile-nav-chips { display: none !important; }
}
body.ptv2-mode .content { padding: 0 !important; }

/* ===== 今日概览 · 手机端占比优化（2026-11-01）
   现象：右侧内容被裁掉一截。
   原因：KPI 卡片是 flex column，子项默认 min-width:auto，
   「本月 ¥123,456（89 节）」这种不可断的长串会把网格列撑宽，
   超出 .content 宽度后右侧就被裁掉（手机不显示横向滚动条，看起来像"消失"）。
   处理：允许收缩 + 长串断行，并把手机端字号/间距收紧，让两列正好放下。 */
.kpi { min-width: 0; }
.kpi > * { min-width: 0; }
.kpi .kpi-sub { overflow-wrap: anywhere; word-break: break-word; white-space: normal; }

@media (max-width: 768px) {
  /* KPI 条：两列、收紧间距，避免撑破 */
  .kpi-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
  }
  .kpi { padding: 12px 12px; border-radius: 12px; }
  .kpi span { font-size: 11.5px; }
  .kpi strong { font-size: 19px; line-height: 1.25; }
  .kpi .kpi-sub { font-size: 10.5px; line-height: 1.35; }

  /* 概览区块：单列，标题与条目都不要溢出 */
  .ov-grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .ov-section { min-width: 0; }
  .ov-section-head { padding: 12px 14px; gap: 6px; }
  .ov-title { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ov-item { min-width: 0; }
  .ov-item > * { min-width: 0; }
}

/* 概览条目：标签不参与压缩，文字列可收缩断行（防 overflow:hidden 裁掉右侧） */
.ov-item-meta { min-width: 0; }
.ov-tag { flex-shrink: 0; }
.ov-item-name { flex-shrink: 0; }

/* ===== AI 助手（仅老板） ===== */
.ai-wrap { display: flex; flex-direction: column; height: calc(100vh - 180px); min-height: 520px; max-height: 900px; }
.ai-head { padding: 2px 2px 14px; }
.ai-title { font-size: 20px; font-weight: 700; color: var(--text); }
.ai-sub { font-size: 12.5px; color: var(--text-tertiary); margin-top: 4px; }
.ai-body { flex: 1; overflow-y: auto; padding: 4px 2px 16px; display: flex; flex-direction: column; gap: 10px; }
.ai-msg { display: flex; }
.ai-msg.ai-user { justify-content: flex-end; }
.ai-msg.ai-bot { justify-content: flex-start; }
.ai-bubble { max-width: 78%; padding: 10px 14px; border-radius: 14px; font-size: 14px; line-height: 1.65; word-break: break-word; white-space: normal; }
.ai-bot .ai-bubble { background: var(--surface); border: 1px solid var(--border); color: var(--text); border-top-left-radius: 4px; }
.ai-user .ai-bubble { background: var(--brand); color: #141414; border-top-right-radius: 4px; }
.ai-thinking { color: var(--text-tertiary); }
.ai-foot { display: flex; gap: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.ai-input { flex: 1; height: 44px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); font-size: 14px; background: var(--surface); color: var(--text); }
.ai-input:focus { outline: none; border-color: var(--brand); }
.ai-foot .btn { height: 44px; flex-shrink: 0; }
@media (max-width: 640px) {
  .ai-wrap { height: calc(100vh - 150px); min-height: 420px; }
  .ai-bubble { max-width: 88%; }
}
