﻿/* 启炼总后台 · 商务蓝运营界面 */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; padding: 0; }

:root {
  color-scheme: light;
  --bg: #f2f6fb;
  --surface: #fff;
  --surface-soft: #f7f9fc;
  --side: #123b63;
  --side-raised: #174c7d;
  --side-line: rgba(255,255,255,.13);
  --primary: #1769aa;
  --primary-d: #10558e;
  --primary-soft: #e8f1fb;
  --accent: #3b82c4;
  --line: #dce6f0;
  --text: #20364d;
  --muted: #71849a;
  --danger: #bd5148;
  --danger-soft: #fbefed;
  --ok: #417b70;
  --ok-soft: #edf5f3;
  --warn: #416d98;
  --warn-soft: #edf4fa;
  --shadow-sm: 0 2px 8px rgba(40, 71, 103, .045);
  --shadow-md: 0 14px 40px rgba(40, 71, 103, .12);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html { min-width: 320px; min-height: 100%; }
body {
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .nav-item:focus-visible {
  outline: 3px solid rgba(76, 126, 175, .22);
  outline-offset: 2px;
}
.hidden { display: none !important; }

/* 加载与权限提示 */
.center-view {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 24px;
  background: var(--bg);
}
.boot-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #dce8f4;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.boot-text { color: var(--muted); font-size: 13px; }
.noperm-card {
  width: min(100%, 480px);
  padding: 40px 36px 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md);
  text-align: center;
}
.noperm-title { margin-bottom: 10px; font-size: 19px; font-weight: 650; letter-spacing: -.02em; }
.noperm-desc { color: var(--muted); font-size: 13px; line-height: 1.9; }
.noperm-diag {
  margin-top: 18px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: #65778a;
  font-size: 12px;
  line-height: 1.75;
  text-align: left;
  word-break: break-all;
}
.noperm-diag b { color: var(--text); font-weight: 650; }
.noperm-diag .diag-hint { color: var(--warn); }
.noperm-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }

/* 登录 */
.login-view {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: auto;
  padding: 32px 20px;
  background-color: #edf4fc;
  background-image:
    radial-gradient(ellipse at 14% 18%, rgba(47,112,177,.13), transparent 33%),
    radial-gradient(ellipse at 90% 86%, rgba(92,145,198,.10), transparent 36%),
    linear-gradient(145deg, #f4f8fd 0%, #eaf2fb 55%, #f7faff 100%);
}
.login-view::before {
  display: none;
}
.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 38px 38px 30px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 24px 68px rgba(20,57,94,.17);
}
.login-logo { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: 22px; font-weight: 700; letter-spacing: -.035em; }
.login-logo img { display: block; width: 82px; height: 82px; object-fit: contain; border: 1px solid #edf1f6; border-radius: 12px; background: #fff; }
.login-sub { margin: 8px 0 25px; color: var(--muted); font-size: 13px; }
.tab-switch {
  display: flex;
  gap: 3px;
  margin-bottom: 8px;
  padding: 4px;
  border: 1px solid #e6edf4;
  border-radius: 10px;
  background: #f2f7fc;
}
.tab-btn {
  flex: 1;
  min-height: 36px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #71869a;
  cursor: pointer;
  font-size: 13px;
  transition: background .18s ease, color .18s ease, box-shadow .18s ease;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active { background: #fff; color: var(--primary-d); font-weight: 650; box-shadow: 0 1px 4px rgba(40,71,103,.1); }
.lf-label { display: block; margin: 15px 0 7px; color: #526579; font-size: 12px; font-weight: 600; }
.login-card input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #dfe7ef;
  border-radius: 9px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.login-card input::placeholder, .field input::placeholder, .field textarea::placeholder, .toolbar .search::placeholder { color: #9aabbb; }
.login-card input:focus, .field input:focus, .field textarea:focus, .field select:focus, .toolbar .search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(76,126,175,.1);
}
.lf-row { display: flex; gap: 9px; }
.lf-row input { min-width: 0; flex: 1; }
.btn-code {
  flex-shrink: 0;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #dce7f1;
  border-radius: 9px;
  background: #f5f9fd;
  color: var(--primary-d);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color .18s ease, background .18s ease;
}
.btn-code:hover:not(:disabled) { border-color: #afc9e2; background: var(--primary-soft); }
.btn-code:disabled { color: #99a8b6; cursor: not-allowed; }
.lf-err { min-height: 16px; margin-top: 4px; color: var(--danger); font-size: 12px; }
.btn-login {
  width: 100%;
  height: 46px;
  margin-top: 19px;
  border: 0;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  font-weight: 650;
  letter-spacing: .08em;
  transition: background .18s ease, transform .18s ease, box-shadow .18s ease;
}
.btn-login:hover:not(:disabled) { transform: translateY(-1px); background: var(--primary-d); box-shadow: 0 7px 16px rgba(76,126,175,.2); }
.btn-login:active:not(:disabled) { transform: translateY(0); }
.btn-login:disabled { opacity: .58; cursor: not-allowed; }
.login-err { min-height: 18px; margin-top: 10px; color: var(--danger); font-size: 12px; }
.login-foot { margin-top: 18px; padding-top: 16px; border-top: 1px solid #e6edf4; color: #8093a7; font-size: 11px; line-height: 1.85; text-align: center; }

/* 后台框架 */
.app-view { display: flex; width: 100%; height: 100vh; height: 100dvh; min-height: 540px; overflow: hidden; }
.sidebar {
  display: flex;
  width: 238px;
  flex: 0 0 238px;
  flex-direction: column;
  color: #e7f0f8;
  background: linear-gradient(165deg, #123b63 0%, #143f68 55%, #174a76 100%);
}
.brand {
  display: flex;
  height: 78px;
  flex: 0 0 78px;
  align-items: center;
  gap: 11px;
  padding: 0 17px;
  border-bottom: 1px solid var(--side-line);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: .015em;
}
.brand-logo { display: block; width: 60px; height: 60px; flex: 0 0 60px; object-fit: contain; border-radius: 9px; background: #fff; }
.sidebar nav { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 12px 12px 18px; scrollbar-color: rgba(255,255,255,.22) transparent; scrollbar-width: thin; }
.nav-group-title { margin: 8px 5px 5px; padding: 10px 10px 5px; color: #9ab7d2; font-size: 11px; font-weight: 750; letter-spacing: .09em; }
.nav-group-title:not(:first-child) { margin-top: 13px; border-top: 1px solid rgba(255,255,255,.12); }
.nav-item {
  position: relative;
  display: flex;
  min-height: 40px;
  align-items: center;
  gap: 0;
  margin: 2px 4px;
  padding: 0 14px;
  border-radius: 7px;
  color: #d5e3ef;
  cursor: pointer;
  font-size: 13px;
  transition: background .16s ease, color .16s ease;
}
.nav-item:hover { background: rgba(255,255,255,.09); color: #fff; }
.nav-item.active { background: #fff; color: #155b96; font-weight: 700; box-shadow: 0 3px 10px rgba(3,25,48,.18); }
.nav-item.active::before { position: absolute; top: 8px; bottom: 8px; left: 0; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); content: ""; }
.sidebar-foot { padding: 15px 20px 18px; border-top: 1px solid var(--side-line); }
.su-name { overflow: hidden; color: #f1f6fb; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.su-role { overflow: hidden; margin-top: 3px; color: #9ab2c9; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.main { display: flex; min-width: 0; min-height: 0; flex: 1; flex-direction: column; background: var(--bg); }
.topbar {
  z-index: 2;
  display: flex;
  min-height: 64px;
  flex: 0 0 64px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 0 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255,255,255,.96);
}
.crumb { color: #485c70; font-size: 13px; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 9px; }
.admin-name { display: flex; align-items: center; margin-right: 7px; color: #667b90; font-size: 12px; }
.content { width: 100%; max-width: 1880px; min-height: 0; flex: 1; align-self: center; overflow: auto; padding: 25px 32px 36px; }
.page-heading { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 21px; padding-bottom: 17px; border-bottom: 1px solid #dce7f2; }
.page-kicker { margin-bottom: 3px; color: #6486a9; font-size: 12px; font-weight: 650; }
.page-title { color: #254566; font-size: 26px; font-weight: 750; letter-spacing: -.035em; line-height: 1.25; }

/* 列表工具栏与按钮 */
.toolbar { display: flex; min-height: 40px; align-items: center; gap: 9px; margin-bottom: 15px; }
.toolbar .search {
  width: min(100%, 350px);
  height: 40px;
  flex: 1 1 260px;
  padding: 0 13px;
  border: 1px solid #dfe7f0;
  border-radius: 8px;
  outline: none;
  background: var(--surface);
  color: var(--text);
  transition: border-color .18s ease, box-shadow .18s ease;
}
/* 字段搜索：多个独立小输入框（如会员列表：教练名称 / 会员昵称 / 手机号），替代单条长搜索 */
.toolbar .search.filter-input { width: min(100%, 210px); flex: 0 1 210px; }
.btn-primary, .btn-ghost, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease, transform .16s ease;
}
.btn-primary { min-height: 40px; padding: 0 16px; border: 1px solid var(--primary); background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { border-color: var(--primary-d); background: var(--primary-d); box-shadow: 0 4px 10px rgba(76,126,175,.16); }
.btn-primary:active:not(:disabled), .btn-ghost:active:not(:disabled), .btn-danger:active:not(:disabled) { transform: translateY(1px); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-ghost { min-height: 38px; padding: 0 13px; border: 1px solid #dce5ee; background: #fff; color: #4c6175; }
.btn-ghost:hover:not(:disabled) { border-color: #aac5df; background: #f5f9fd; color: var(--primary-d); }
.btn-danger { min-height: 30px; padding: 0 10px; border: 1px solid #efd5d2; background: #fff; color: var(--danger); font-size: 12px; }
.btn-danger:hover:not(:disabled) { border-color: var(--danger); background: var(--danger-soft); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12px; }
.toolbar > .btn-primary { min-height: 42px; padding: 0 19px; box-shadow: 0 4px 10px rgba(23,105,170,.18); }

/* 数据表格 */
.panel { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface); box-shadow: var(--shadow-sm); }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 13px 16px; border-bottom: 1px solid #eaf0f5; text-align: left; white-space: nowrap; }
th { background: #f6f9fc; color: #75869a; font-size: 11px; font-weight: 650; letter-spacing: .025em; }
td { color: #435669; font-size: 12px; }
tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .14s ease; }
tbody tr:hover { background: #f7fafe; }
td.actions { min-width: 172px; white-space: nowrap; }
td.actions .btn-ghost, td.actions .btn-danger { margin: 1px 3px 1px 0; }
.tag {
  display: inline-flex;
  min-height: 23px;
  align-items: center;
  margin-right: 4px;
  padding: 2px 8px;
  border: 1px solid #e4ebf2;
  border-radius: 999px;
  background: #f3f7fb;
  color: #5d7083;
  font-size: 11px;
  line-height: 1.2;
  vertical-align: middle;
}
.tag.active { border-color: #cfe3f8; background: #eaf4ff; color: #3476b8; }
.tag.inactive { border-color: #f0d8d5; background: var(--danger-soft); color: var(--danger); }
.tag.warn { border-color: #d9e6f2; background: var(--warn-soft); color: var(--warn); }
.tag.info { border-color: #d9e6f2; background: #eef5fb; color: #3476b8; }
.tag.purple { border-color: #e3d9f2; background: #f4eefb; color: #7346b8; }
.tag.danger { border-color: #f0d8d5; background: var(--danger-soft); color: var(--danger); }

/* 操作日志详情（logdetail） */
.log-changes { display: flex; flex-direction: column; gap: 6px; }
.log-change { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; font-size: 12px; line-height: 1.7; }
.lc-field { font-weight: 600; color: #3d5066; }
.lc-from { color: #9aa7b3; text-decoration: line-through; }
.lc-arrow { color: #b9c4ce; }
.lc-to { color: #3476b8; font-weight: 600; }
.log-kv { font-size: 12px; color: #52677b; margin: 2px 0; }

/* 分页 */
.pager { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; color: var(--muted); font-size: 12px; }
.pager > span { margin-right: auto; }
.pager-size { display: flex; align-items: center; gap: 6px; margin-left: auto; margin-right: 4px; }
.pager-size span { color: #71849a; }
.pager-size select { min-height: 33px; padding: 0 8px; border: 1px solid #dfe7ef; border-radius: 7px; background: #fff; color: #52677b; cursor: pointer; font-size: 12px; transition: border-color .18s ease, box-shadow .18s ease; }
.pager-size select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(76,126,175,.1); }

/* 教练菠菜授权列表 */
.ba-toolbar { flex-wrap: wrap; }
.ba-toolbar .search { max-width: 360px; }
.ba-filter, .ba-page-size select {
  min-height: 38px;
  padding: 0 11px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #fff;
  color: #52677b;
}
.ba-filter:focus, .ba-page-size select:focus {
  border-color: var(--primary);
  outline: none;
  box-shadow: 0 0 0 3px rgba(76,126,175,.1);
}
.ba-panel { margin-bottom: 14px; }
.ba-empty { height: 86px; color: var(--muted); text-align: center; }
.ba-pager { justify-content: flex-end; }
.ba-page-size { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.ba-page-size select { min-height: 33px; }
.ba-pager button:disabled { cursor: not-allowed; opacity: .5; }

@media (max-width: 640px) {
  .ba-toolbar { align-items: stretch; }
  .ba-toolbar .search { flex-basis: 100%; max-width: none; }
  .ba-filter { flex: 1 1 150px; }
  .ba-pager { justify-content: flex-start; }
  .ba-page-size { margin-left: 0; }
}
.pager button { min-height: 33px; padding: 0 11px; border: 1px solid #dfe7ef; border-radius: 7px; background: #fff; color: #52677b; cursor: pointer; font-size: 12px; transition: border-color .16s ease, color .16s ease, background .16s ease; }
.pager button:hover:not(:disabled) { border-color: #aac5df; background: #f5f9fd; color: var(--primary-d); }
.pager button:disabled { color: #aeb8b1; cursor: not-allowed; }
.pager button.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-d); font-weight: 650; }

/* 弹窗、编辑表单与详情 */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal.importing .modal-mask { pointer-events: none; }
.modal-mask { position: absolute; inset: 0; background: rgba(31,53,76,.48); backdrop-filter: blur(3px); }
.modal-card { position: relative; display: flex; width: 560px; max-width: min(100%, 680px); max-height: min(88vh, 900px); max-height: min(88dvh, 900px); flex-direction: column; overflow: hidden; border: 1px solid rgba(255,255,255,.82); border-radius: 15px; background: var(--surface); box-shadow: 0 24px 70px rgba(28,54,82,.2); }
.modal-head { display: flex; min-height: 61px; align-items: center; justify-content: space-between; gap: 15px; padding: 0 22px; border-bottom: 1px solid var(--line); color: var(--text); font-size: 15px; font-weight: 650; }
.modal-x { display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 8px; background: transparent; color: #8999a8; cursor: pointer; font-size: 22px; line-height: 1; transition: background .16s ease, color .16s ease; }
.modal-x:hover { background: #edf4fb; color: var(--text); }
.modal-body { overflow-y: auto; padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 14px 22px; border-top: 1px solid var(--line); background: #f9fbfd; }
.field { margin-bottom: 17px; }
.field:last-child { margin-bottom: 0; }
.field label { display: block; margin-bottom: 7px; color: #50657a; font-size: 12px; font-weight: 600; }
.field label .req { margin-left: 2px; color: var(--danger); }
.field input, .field textarea, .field select {
  width: 100%;
  min-height: 40px;
  padding: 9px 12px;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  outline: none;
  background: #fff;
  color: var(--text);
  font-size: 13px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.65; }
.field select { cursor: pointer; }
.field-fixed { display: flex; min-height: 40px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: #f5f8fc; color: #586d82; }
.detail-field { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 18px; padding: 13px 0; border-bottom: 1px solid #eaf0f5; }
.detail-field:first-child { padding-top: 0; }
.detail-field:last-child { padding-bottom: 0; border-bottom: 0; }
.detail-label { color: #788b9f; font-size: 12px; }
.detail-value { color: #2b4055; font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.equipment-import-status { margin: 0 0 14px; padding: 10px 12px; border: 1px solid #dce7f1; border-radius: 8px; background: #f5f9fd; color: #4e6883; font-size: 12px; line-height: 1.7; }
.equipment-import-status.error { border-color: #efd5d2; background: var(--danger-soft); color: var(--danger); }
.equipment-import-errors { margin-bottom: 14px; padding: 10px 12px; border: 1px solid #efd5d2; border-radius: 8px; background: var(--danger-soft); color: var(--danger); font-size: 12px; line-height: 1.8; }
.equipment-import-caption { margin: 15px 0 8px; color: #60758b; font-size: 12px; font-weight: 650; }
.perm-picker { margin-top: 9px; padding-top: 15px; border-top: 1px dashed #dce6ef; }
.perm-title { margin-bottom: 10px; color: #50657a; font-size: 12px; font-weight: 600; }
.perm-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.perm-item { display: flex; min-height: 38px; align-items: center; gap: 9px; padding: 0 10px; border: 1px solid #e4ebf2; border-radius: 8px; background: #fbfdff; color: #4b6074; cursor: pointer; font-size: 12px; transition: border-color .16s ease, background .16s ease; }
.perm-item:hover { border-color: #b7cde2; background: #f4f8fc; }
.perm-item input { width: 15px; height: 15px; accent-color: var(--primary); }
.field .lf-row { display: flex; gap: 9px; }
.field .lf-row input { min-width: 0; flex: 1; }
.field .btn-code { height: auto; min-height: 40px; }
.pwd-tabs { display: flex; gap: 4px; margin-bottom: 20px; padding: 4px; border: 1px solid #e7edf3; border-radius: 9px; background: #f3f7fb; }
.pwd-tab { flex: 1; min-height: 35px; padding: 7px 10px; border: 0; border-radius: 7px; background: transparent; color: #71869a; cursor: pointer; font-size: 12px; transition: background .16s ease, color .16s ease, box-shadow .16s ease; }
.pwd-tab:hover { color: var(--text); }
.pwd-tab.active { background: #fff; color: var(--primary-d); font-weight: 650; box-shadow: 0 1px 4px rgba(40,71,103,.1); }
.otp-phone { padding: 10px 12px; border: 1px solid #e1eaf2; border-radius: 8px; background: #f6f9fc; color: #4b6177; font-size: 13px; letter-spacing: .04em; }
.pwd-hint { margin-top: 5px; padding: 11px 13px; border: 1px solid #dce8f3; border-radius: 8px; background: #f2f7fc; color: #5f748a; font-size: 12px; line-height: 1.7; }
.pwd-hint b { color: var(--primary-d); }

/* ---- 微信绑定码弹窗（教练行的「绑定码」按钮） ---------------------------- */
.bind-row { display: flex; align-items: baseline; gap: 10px; padding: 7px 0; border-bottom: 1px dashed #eef2f7; font-size: 13px; }
.bind-row:last-of-type { border-bottom: none; }
.bind-k { flex: 0 0 76px; color: #8a94a6; }
.bind-v { flex: 1; color: #2a3542; word-break: break-all; }
/* 绑定码要能被「照着念」，所以放大 + 拉开字距，并用等宽字体避免 0/O 混淆 */
.bind-code-box { margin: 14px 0 4px; padding: 16px 14px; border: 1px solid #cfe0f2; border-radius: 10px; background: #f7fbff; text-align: center; }
.bind-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 30px; font-weight: 700; letter-spacing: .32em; color: var(--primary-d); line-height: 1.2; text-indent: .32em; }
.bind-code-exp { margin-top: 7px; font-size: 12px; color: #8a94a6; }
.bind-actions { margin-top: 14px; display: flex; gap: 10px; }
.bind-hint { margin-top: 10px; padding: 11px 13px; border: 1px solid #dce8f3; border-radius: 8px; background: #f2f7fc; color: #5f748a; font-size: 12px; line-height: 1.7; }
.bind-hint b { color: var(--primary-d); }
.bind-err { border-color: #f3d6d6; background: #fdf3f3; color: #a8453f; }

/* 列表加载骨架屏 */
.sk-bar {
  display: block;
  height: 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, #e9eff5 25%, #f5f8fb 37%, #e9eff5 63%);
  background-size: 400% 100%;
  animation: sk-shimmer 1.4s ease infinite;
}
.sk-bar-sm { width: 64px; height: 26px; border-radius: 8px; }
@keyframes sk-shimmer {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sk-bar { animation: none; background: #e9eff5; }
}

/* 空状态、提示与状态开关 */
.empty { padding: 54px 20px; color: #8495a5; font-size: 13px; line-height: 1.9; text-align: center; }
.empty code { padding: 3px 7px; border: 1px solid #e1e9f1; border-radius: 5px; background: #f2f6fa; color: #50677c; font-size: 11px; }
.note { margin-bottom: 16px; padding: 12px 15px; border: 1px solid #dce8f3; border-left: 3px solid var(--accent); border-radius: 8px; background: #f5f9fd; color: #5f748b; font-size: 12px; line-height: 1.75; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; vertical-align: middle; }
.switch input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.switch .slider { position: absolute; inset: 0; border-radius: 999px; background: #cbd5ce; cursor: pointer; transition: background .2s ease; }
.switch .slider::before { position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.18); content: ""; transition: transform .2s ease; }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(16px); }
.switch input:focus-visible + .slider { outline: 3px solid rgba(76,126,175,.24); outline-offset: 2px; }
.switch input:disabled + .slider { opacity: .55; cursor: default; }
.toast { position: fixed; top: 20px; left: 50%; z-index: 100; max-width: min(92vw, 520px); padding: 11px 17px; transform: translateX(-50%); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; background: #344f6a; box-shadow: 0 8px 24px rgba(28,54,82,.2); color: #fff; font-size: 13px; text-align: center; }
.toast.err { background: #a7443e; }
.toast.ok { background: #3f719c; }

@media (max-width: 980px) {
  .sidebar { width: 212px; flex-basis: 212px; }
  .topbar { padding-right: 22px; padding-left: 22px; }
  .content { padding-right: 22px; padding-left: 22px; }
}

@media (max-width: 700px) {
  .app-view { height: auto; min-height: 100vh; min-height: 100dvh; overflow: visible; flex-direction: column; }
  .sidebar { width: 100%; flex: 0 0 auto; }
  .brand { height: 64px; flex-basis: 64px; padding: 0 13px; }
  .brand-logo { width: 44px; height: 44px; flex-basis: 44px; }
  .sidebar nav { display: grid; max-height: 48vh; grid-template-columns: repeat(2, minmax(0, 1fr)); flex: 0 0 auto; gap: 2px 5px; overflow-x: hidden; overflow-y: auto; padding: 8px 12px 11px; }
  .nav-group-title { grid-column: 1 / -1; margin: 7px 4px 2px; padding: 7px 9px 3px; }
  .nav-item { min-height: 37px; gap: 0; margin: 0; padding: 0 10px; font-size: 12px; }
  .sidebar-foot { display: none; }
  .main { min-height: calc(100vh - 94px); min-height: calc(100dvh - 94px); }
  .topbar { min-height: 57px; flex-basis: 57px; padding: 0 16px; }
  .topbar-right { gap: 6px; }
  .admin-name { max-width: 130px; overflow: hidden; margin-right: 3px; text-overflow: ellipsis; white-space: nowrap; }
  .content { overflow: visible; padding: 20px 15px 28px; }
  .page-heading { margin-bottom: 17px; padding-bottom: 13px; }
  .page-title { font-size: 23px; }
  .toolbar { flex-wrap: wrap; }
  .toolbar .search { flex-basis: 180px; }
  .toolbar .search.filter-input { flex-basis: 150px; }
  .toolbar > div[style*="margin-left"] { display: none; }
  .toolbar .btn-primary, .toolbar > .tag { margin-left: auto; }
  .panel { max-width: 100%; }
  .modal { padding: 12px; }
  .modal-card { max-height: 94vh; max-height: 94dvh; }
}

@media (max-width: 460px) {
  .login-card { padding: 31px 24px 25px; border-radius: 16px; }
  .login-logo { font-size: 21px; }
  .login-logo img { width: 72px; height: 72px; }
  .topbar { align-items: flex-start; flex-direction: column; justify-content: center; gap: 5px; padding-top: 8px; padding-bottom: 8px; }
  .topbar-right { width: 100%; justify-content: flex-end; }
  .admin-name { margin-right: auto; }
  .btn-sm { min-height: 30px; padding: 0 9px; }
  .toolbar .search { flex-basis: 100%; }
  .toolbar .search.filter-input { flex-basis: 100%; }
  .toolbar .btn-primary, .toolbar > .tag { margin-left: 0; }
  .detail-field { grid-template-columns: 1fr; gap: 4px; }
  .perm-grid { grid-template-columns: 1fr; }
  .modal-head { padding-right: 15px; padding-left: 18px; }
  .modal-body { padding: 18px; }
  .modal-foot { padding-right: 18px; padding-left: 18px; }
  .noperm-card { padding: 32px 22px 26px; }
  .noperm-actions { flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------------- 用户反馈 · 详情截图 ---------------- */
.fb-img-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.fb-img-item {
  display: block; width: 132px; height: 132px; border-radius: var(--radius-sm);
  overflow: hidden; border: 1px solid var(--line); background: var(--surface-soft);
}
.fb-img-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-img-item:hover { border-color: var(--accent); }
.fb-img-fail {
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted);
}

/* ---------------- 用户反馈 · 已处理/待处理标记按钮 ---------------- */
.fb-mark-on {
  background: var(--primary-soft);
  color: var(--primary-d);
  border-color: var(--accent);
  font-weight: 600;
}
.fb-mark:disabled { opacity: .55; cursor: default; }

/* ---------------- 用户反馈 · 缩略图放大灯箱 ---------------- */
.fb-img-thumb { cursor: zoom-in; }
.fb-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15, 30, 48, .82);
  display: flex; align-items: center; justify-content: center;
  cursor: zoom-out;
}
.fb-lightbox img {
  max-width: 92vw; max-height: 92vh;
  border-radius: var(--radius-md); box-shadow: var(--shadow-md);
  background: #fff;
}

/* ===========================================================================
   会话管理（chat-sessions.js）—— 列表工具栏 / 标题双行 / 对话抽屉 / 消息气泡
   =========================================================================== */
.cs-toolbar { flex-wrap: wrap; }
.cs-toolbar .cs-input { width: 150px; flex: 0 1 150px; }
.cs-sep { color: var(--muted); font-size: 12px; }
.cs-date {
  height: 34px; padding: 0 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--text); font-size: 12px;
}
.cs-select { height: 34px; padding: 0 26px 0 10px; cursor: pointer; }
.cs-check { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; }
.cs-check input { margin: 0; }

.cs-title-cell { white-space: normal; min-width: 260px; max-width: 420px; }
.cs-title { color: var(--text); font-size: 12px; font-weight: 500; }
.cs-snippet { margin-top: 2px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.cs-sub { margin-left: 6px; color: var(--muted); font-size: 11px; }

.cs-mask {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(15, 30, 48, .42);
  display: flex; justify-content: flex-end;
}
.cs-drawer {
  display: flex; flex-direction: column;
  width: min(760px, 96vw); height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-md);
}
.cs-drawer-head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.cs-drawer-title {
  flex: 1; min-width: 0;
  color: var(--text); font-size: 14px; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cs-drawer-meta {
  display: flex; flex-wrap: wrap; gap: 6px 16px;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--muted); font-size: 11px;
}
.cs-drawer-body { flex: 1; overflow: auto; padding: 16px 18px 28px; background: var(--bg); }

.cs-warn {
  margin-bottom: 12px; padding: 8px 12px;
  border: 1px solid #f0d8d5; border-radius: 8px;
  background: var(--danger-soft); color: var(--danger); font-size: 12px;
}

.cs-msg { margin-bottom: 12px; }
.cs-msg-head {
  display: flex; align-items: center; gap: 8px; margin-bottom: 4px;
  color: var(--muted); font-size: 11px;
}
.cs-role { color: var(--text); font-size: 11px; font-weight: 500; }
.cs-msg-body {
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface);
  color: var(--text); font-size: 12px; line-height: 1.7;
}
.cs-msg-user .cs-msg-body { border-color: #cfe3f8; background: #f4f9ff; }
.cs-msg-assistant .cs-msg-body { border-left: 2px solid var(--primary); }
.cs-text { white-space: pre-wrap; word-break: break-word; }
.cs-muted { color: var(--muted); }

.cs-proto { margin-top: 6px; }
.cs-proto > summary {
  cursor: pointer; color: var(--primary); font-size: 11px;
  list-style: none;
}
.cs-proto > summary::-webkit-details-marker { display: none; }
.cs-proto > summary::before { content: '▸ '; }
.cs-proto[open] > summary::before { content: '▾ '; }
.cs-proto pre {
  margin: 6px 0 0; padding: 8px 10px; max-height: 260px; overflow: auto;
  border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-soft); color: #435669;
  font-size: 11px; line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}

.cs-card {
  margin-top: 8px; padding: 8px 10px;
  border: 1px dashed var(--line); border-radius: 8px;
  background: var(--surface-soft);
}
.cs-card-title { margin-bottom: 4px; color: var(--primary); font-size: 11px; font-weight: 500; }
.cs-line { color: #435669; font-size: 11px; line-height: 1.7; }

.cs-imgs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.cs-img { margin: 0; width: 132px; }
.cs-img img {
  width: 132px; height: 96px; object-fit: cover;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface-soft);
}
.cs-img img.cs-img-fail {
  display: block; height: 96px; border-style: dashed;
  background: repeating-linear-gradient(45deg, #f7f9fc, #f7f9fc 6px, #eef3f8 6px, #eef3f8 12px);
}
.cs-img figcaption {
  margin-top: 3px; color: var(--muted); font-size: 10px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------------- 回答评价：会话详情角标 ---------------- */
.cs-rate { padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 600; }
.cs-rate-up { background: var(--ok-soft); color: var(--ok); }
.cs-rate-down { background: var(--danger-soft); color: var(--danger); }
.cs-rate-reason { color: var(--muted); font-size: 10px; }
.cs-msg-hl .cs-msg-body {
  box-shadow: 0 0 0 2px var(--primary-soft), 0 0 0 1px var(--primary);
}

/* ---------------- 回答评价：统计模块 ---------------- */
.mr-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px; margin: 0 0 14px;
}
.mr-stat {
  padding: 12px 14px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-md); box-shadow: var(--shadow-sm);
}
.mr-stat .k { color: var(--muted); font-size: 12px; }
.mr-stat .v { margin-top: 2px; color: var(--text); font-size: 24px; font-weight: 650; }
.mr-stat .v.ok { color: var(--ok); }
.mr-stat .v.danger { color: var(--danger); }
.mr-stat .s { margin-top: 2px; color: var(--muted); font-size: 11px; }

.mr-reasons { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.mr-reason {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text); font-size: 12px;
}
.mr-reason b { color: var(--primary); font-weight: 650; }
.mr-reason.mr-reason-empty { color: var(--muted); border-style: dashed; }

/* 评价人：姓名（教练·手机号）——不换行，避免姓名与号码被拆到两行看不清 */
.mr-rater { white-space: nowrap; color: var(--text); font-size: 12px; }

.mr-snippet {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  max-width: 420px; overflow: hidden;
  color: #435669; font-size: 12px; line-height: 1.6;
}
.mr-snippet-empty { color: var(--muted); }
.mr-toolbar { flex-wrap: wrap; }
@media (max-width: 900px) {
  .mr-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

