/* ============================================================
   校园快递代取平台 - 设计系统
   深色侧边栏 · 玻璃拟态登录 · 卡片化内容 · 渐变主色
   ============================================================ */
/* 说明: 本文件已按功能分区(共 22 个区); VS 里按 Ctrl+M 再按 O 可把整个
   样式表折叠成一份「目录」, 点每个区标题左边的 + 展开对应代码;
   Ctrl+M 再按 L 恢复全部展开。 */


:root {
  --primary: #6366f1;
  --primary-2: #8b5cf6;
  --grad: linear-gradient(135deg, #6366f1, #8b5cf6);
  --bg: #f1f5f9;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --danger: #ef4444;
  --ok: #10b981;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(15, 23, 42, .06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);
  --side-w: 236px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  /* 已按"App"使用, 不要网页那套双指缩放/双击缩放(误触一下界面就放大, 缩放后还会卡在半截位置)。
     pan-x pan-y = 只允许单指滚动, 把 pinch-zoom 从手势里剔掉(安卓/微信内核走这条);
     iOS Safari 认不认这条都另有保底 —— app.js 里拦掉了 Safari 专属的 gesture 事件。
     例外: 聊天里点开的大图允许缩放(打开大图时 body 会挂 .img-zoom 放开限制), 见 .img-viewer。 */
  touch-action: pan-x pan-y;
}

.hidden { display: none !important; }

/* #region 1 登录页 */
/* ==================== 登录页 ==================== */
#login-page {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #312e81 0%, #5b21b6 45%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: .55;
  animation: float 12s ease-in-out infinite;
  /* 大半径模糊的层一旦提升为合成层, 之后只做平移/缩放就不再重算模糊 */
  will-change: transform;
}
.blob-1 { width: 420px; height: 420px; background: #a5b4fc; top: -120px; left: -80px; }
.blob-2 { width: 380px; height: 380px; background: #f0abfc; bottom: -140px; right: -60px; animation-delay: -4s; }
.blob-3 { width: 260px; height: 260px; background: #67e8f9; top: 40%; left: 62%; animation-delay: -8s; opacity: .35; }

@keyframes float {
  /* 无限循环里缩放幅度压到 5%: 模糊层在缩放比例变化大时会被反复重新光栅化,
     5% 的变化观察不出来(本来就是一团模糊), 但省掉了一轮轮的重算 */
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(40px, -30px) scale(1.05); }
}

.login-card {
  position: relative;
  width: 400px;
  /* 不挂 backdrop-filter: 卡片背后是三个持续漂浮的模糊光斑, 每帧都要把卡片的背景重新模糊
     —— 登录页的入场动画(rise)因此被拖慢。底色本来就是 95% 白, 磨砂效果看不出来, 直接去掉。 */
  background: rgba(255, 255, 255, .95);
  border-radius: 22px;
  padding: 36px 34px 26px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .35);
  animation: rise .5s ease;
}

@keyframes rise {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.login-logo {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 18px;
  background: var(--grad);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  box-shadow: 0 8px 24px rgba(99, 102, 241, .4);
}

.login-card h1 {
  text-align: center;
  font-size: 21px;
  letter-spacing: 1px;
  color: #1e1b4b;
}

.login-sub {
  text-align: center;
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 22px;
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 13px;
  color: #334155;
  margin-bottom: 6px;
  font-weight: 500;
}

.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #fbfcfe;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, .15);
  background: #fff;
}

.captcha-row { display: flex; gap: 12px; align-items: flex-end; }
.captcha-input { flex: 1; }
.captcha-box {
  width: 130px;
  height: 45px;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: #fff;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.captcha-box img { width: 100%; height: 100%; display: block; }

.login-foot {
  margin-top: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}
.login-foot a { color: var(--primary); text-decoration: none; font-weight: 500; }
.login-foot .hint { color: #94a3b8; }

/* 「记住账号密码」: 勾选后账号密码存在本机(localStorage), 下次打开自动填上, 点登录即可 */
.login-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: -2px 0 14px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  width: fit-content;
}
.login-remember input {
  width: 16px;
  height: 16px;
  flex: none;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

/* 密码显示/隐藏切换: 平时藏起来, 鼠标移到输入框这一片才浮出来, 不挡视线也不误点 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 42px; }
.pwd-eye {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: #64748b;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .18s, background .15s, color .15s;
}
.pwd-wrap:hover .pwd-eye,
.pwd-eye:focus-visible { opacity: 1; }
.pwd-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.pwd-eye:hover { background: #eef2ff; color: var(--primary); }
.pwd-eye svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.pwd-eye .eye-off { display: none; }              /* 密码显示中 → 换成带斜杠的眼睛 */
.pwd-eye.on .eye-open { display: none; }
.pwd-eye.on .eye-off { display: block; }

/* #endregion */

/* #region 2 布局(侧边栏 / 顶栏 / 内容区) */
/* ==================== 布局 ==================== */
/* ⚠️ 这里**不能**用 display:flex —— 侧边栏是 fixed 定位(脱离文档流), #app 里就只剩
   .main 一个在流内的子项, flex 会把它按"整屏宽"拉伸, 再叠加 .main 自己的 margin-left
   之后整页横向溢出 236px(整页在底部出现横向滚动条)。用块级布局, .main 的宽度自然
   等于"整屏 - 侧边栏"。 */
#app { min-height: 100vh; }

.sidebar {
  width: var(--side-w);
  min-height: 100vh;
  background: linear-gradient(180deg, #1e1b4b 0%, #312e81 55%, #3730a3 100%);
  display: flex;
  flex-direction: column;
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
}

.side-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.side-logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
}
.side-title { color: #fff; font-size: 15px; font-weight: 600; letter-spacing: 1px; }

/* 菜单区保留滚动能力, 但不显示滚动条: 菜单在常见窗口高度下本来就放得下, 而 Windows 缩放(125%)时
   会因几像素的溢出冒出一根几乎满轨的滚动条, 比它"挡住的内容"更扎眼。
   矮窗口(投影 720p)里滚轮/触控板仍可滚动, 只是不画那根条。 */
.side-nav {
  flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column;
  scrollbar-width: none;      /* Firefox */
  -ms-overflow-style: none;   /* 旧 Edge */
}
.side-nav::-webkit-scrollbar { width: 0; height: 0; }   /* Chromium / Edge / Chrome */

/* 学生视图菜单组少: 菜单仍靠上排布, 组间比管理员视图略松一点即可,
   不要 space-evenly 把各组拉伸到整条侧边栏(会显得很散) */
.side-nav.nav-sparse .nav-group { margin-bottom: 22px; }

.nav-group { margin-bottom: 16px; }
.nav-group-title {
  color: #6366f1;
  font-size: 11px;
  letter-spacing: 2px;
  padding: 0 10px 6px;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: #c7d2fe;
  cursor: pointer;
  font-size: 14px;
  margin-bottom: 3px;
  transition: background .15s, color .15s, transform .1s;
  user-select: none;
}
.nav-item:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.nav-item.active {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(99, 102, 241, .45);
}
.nav-item .ico { font-size: 16px; width: 22px; text-align: center; }

/* 侧边栏最底部的固定入口(「我的」), 独立于中间滚动区 */
.side-bottom {
  padding: 10px 12px 14px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}
.side-bottom .nav-group { margin-bottom: 0; }

.main {
  /* 侧边栏是 fixed, 这里靠 margin-left 给它让位; 块级布局下宽度 = 整屏 - 侧边栏宽度 */
  margin-left: var(--side-w);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  /* 顶栏是 sticky 的: 带 backdrop-filter 时, 页面每滚动一帧都要把整条顶栏后面的
     内容重新模糊一次(全宽去重采样), 滚动会明显发涩 —— 而 90% 白底下这层模糊几乎看不见。
     所以去掉模糊、把底色提到 .96, 观感不变, 滚动不再有每帧的全宽重绘。 */
  background: rgba(255, 255, 255, .96);
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 40;
}

.page-title { font-size: 17px; font-weight: 700; color: #1e293b; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 5px 12px 5px 6px;
  border-radius: 999px;
  background: #f1f5f9;
}
.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}
.user-meta { line-height: 1.25; }
.user-meta > div:first-child { font-weight: 600; font-size: 13px; }
.user-role { font-size: 11px; color: var(--muted); }

#content { flex: 1; padding: 22px 24px 40px; }

/* #endregion */

/* #region 3 过渡动画(选项切换 / 页面入场) */
/* ==================== 选项切换的内容出场 ====================
   点标签(订单大厅四个 tab、统计类型)或重新查询后, 新出现的那块内容也播一遍出场动画。
   元素本身没有重建(只是 innerHTML 换了), 所以由 JS 摘掉类 → 强制回流 → 再加回来重播。 */
@keyframes swap-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
/* 选择器要压过上面的 #content > *(同为 #content 下的元素, 用 ID+类提高优先级) */
#content .swap-in { animation: swap-in .38s cubic-bezier(.22, 1, .36, 1) both; }

/* ==================== 页面入场过渡 ====================
   每页渲染出来的顶层块依次淡入上浮(与管理员数据总览同一套节奏),
   换页、刷新、弹窗关闭后重新渲染都会走一遍; 列表内部的小更新(刷新表格)不受影响。 */
#content > * { animation: page-in .5s cubic-bezier(.22, 1, .36, 1) both; }
#content > *:nth-child(2) { animation-delay: .06s; }
#content > *:nth-child(3) { animation-delay: .12s; }
#content > *:nth-child(4) { animation-delay: .18s; }
#content > *:nth-child(5) { animation-delay: .24s; }
#content > *:nth-child(n+6) { animation-delay: .3s; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* #endregion */

/* #region 4 按钮 */
/* ==================== 按钮 ==================== */
.btn-primary, .btn, .btn-danger, .btn-ghost {
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: transform .1s, box-shadow .15s, filter .15s, background .15s;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
.btn-primary {
  background: var(--grad);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 16px rgba(99, 102, 241, .35);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(99, 102, 241, .45); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn {
  background: #fff;
  color: #334155;
  border: 1.5px solid var(--border);
  font-weight: 500;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }

.btn-danger { background: #fef2f2; color: var(--danger); border: 1.5px solid #fecaca; font-weight: 500; }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-ghost { background: transparent; color: #475569; }
.btn-ghost:hover { background: #f1f5f9; color: #1e293b; }

.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; padding: 12px; font-size: 15px; letter-spacing: 4px; }

/* #endregion */

/* #region 5 卡片 / 通用 */
/* ==================== 卡片 / 通用 ==================== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;          /* 标题旁边放按钮时留出间距(帮助页的「联系管理员」按钮) */
  margin-bottom: 14px;
}
.card-head h2 { font-size: 16px; color: #1e293b; }

.hero {
  background: linear-gradient(120deg, #4338ca 0%, #6d28d9 55%, #9333ea 100%);
  border-radius: 16px;
  padding: 26px 28px;
  color: #fff;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(79, 70, 229, .35);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hero::after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
  right: -60px;
  top: -100px;
}
.hero-main { position: relative; z-index: 1; min-width: 0; }
.hero h2 { font-size: 21px; letter-spacing: 1px; }
.hero p { opacity: .85; font-size: 13px; margin-top: 6px; }
/* 横幅右上角的实时时间日期 */
.hero-clock { position: relative; z-index: 1; flex: 0 0 auto; text-align: right; }
.hero-clock-time {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .18);
}
.hero-clock-date { font-size: 12.5px; opacity: .82; margin-top: 3px; }

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.kpi {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform .15s, box-shadow .15s;
}
.kpi:hover { box-shadow: var(--shadow-lg); }
.kpi.kpi-link { cursor: pointer; }
.kpi.kpi-link:hover .kpi-label { color: var(--primary); }
/* 提示文字固定占位(始终占据高度), hover 仅淡入, 避免卡片高度变化引起上下抖动 */
.kpi .kpi-label::after {
  content: '点击查看明细 →';
  display: block;
  font-size: 11px;
  color: var(--primary);
  opacity: 0;
  max-height: 16px;
  overflow: hidden;
  transition: opacity .15s;
}
.kpi.kpi-link:hover .kpi-label::after { opacity: .85; }
.kpi .kpi-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}
.kpi .kpi-num { font-size: 24px; font-weight: 800; color: #1e293b; line-height: 1.1; }
.kpi .kpi-label { font-size: 12px; color: var(--muted); margin-top: 3px; }

.kpi-indigo .kpi-icon { background: #eef2ff; }
.kpi-amber .kpi-icon { background: #fffbeb; }
.kpi-blue .kpi-icon { background: #eff6ff; }
.kpi-green .kpi-icon { background: #ecfdf5; }

/* #endregion */

/* #region 6 表格 */
/* ==================== 表格 ==================== */
.tbl-wrap {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow-x: auto;
}

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.tbl th {
  background: #f8fafc;
  color: #64748b;
  font-weight: 600;
  font-size: 12.5px;
  text-align: left;
  padding: 11px 14px;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.tbl td {
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  color: #334155;
  white-space: nowrap;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl tbody tr { transition: background .12s; }
.tbl tbody tr:hover { background: #f8faff; }
.tbl .actions { display: flex; gap: 6px; }

/* ---------- 宽表格收窄: 不定长的文本列允许折行, 不出现横向滚动条 ---------- */
/* 学生管理的「学院/专业」、知识库的「关键词/正文摘要」都是不定长的中文文本, 默认的
   td{white-space:nowrap} 会把它们撑成一条超长横线 —— 窗口不够宽时整张表就横向溢出。
   这里只放开这四列折行(其余列保持 nowrap, 学号/时间这类折行反而难读),
   学生表列多再略收一点横向内边距。 */
.tbl-stu td:nth-child(4), .tbl-stu td:nth-child(5),
.tbl-kb td:nth-child(3), .tbl-kb td:nth-child(4) { white-space: normal; }
.tbl-stu th, .tbl-stu td { padding: 10px 9px; }

/* ---------- 订单大厅「我发布的/我代取的」: 窄列叠放 ---------- */
/* 驿站+送达地点、期望+送达时间、对方+评价 两两叠进同一格(11 列并成 8 列),
   表格不再横向溢出, 「操作」列始终完整可见。操作按钮多时自动换行。 */
.tbl-mine .cell-stack { display: flex; flex-direction: column; gap: 3px; }
.tbl-mine .cell-stack .ln-lbl {
  display: inline-block;
  font-size: 11px;
  color: #94a3b8;
  margin-right: 5px;
}
.tbl-mine .cell-stack .ln-b { font-size: 12px; color: #64748b; white-space: normal; }
.tbl-mine .actions { flex-wrap: wrap; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-wait { background: #fef3c7; color: #b45309; }
.badge-sending { background: #dbeafe; color: #1d4ed8; }
.badge-delivered { background: #ccfbf1; color: #0f766e; }
.badge-done { background: #dcfce7; color: #15803d; }
.badge-cancel { background: #f1f5f9; color: #64748b; }
.badge-timeout { background: #fee2e2; color: #b91c1c; }
.badge-normal { background: #dcfce7; color: #15803d; }
.badge-off { background: #fee2e2; color: #b91c1c; }

/* #endregion */

/* #region 7 工具栏 / 筛选(含大厅实时刷新开关) */
/* ==================== 工具栏 / 筛选 ==================== */
.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar input, .toolbar select {
  padding: 9px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); }
.toolbar input { width: 170px; }

/* ---------- 订单大厅: 实时刷新开关 ---------- */
/* 标签组 / 查询框 /「实时刷新」胶囊并排靠左, 发布按钮仍独占右侧 */
.hall-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* 查询框(一个关键字查当前标签; 关键字按标签分别记忆, 见 app.js 的 hallKwOf) */
.hall-search { display: flex; align-items: center; gap: 6px; }
.hall-search input {
  width: 148px;
  padding: 8px 11px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.hall-search input:focus { border-color: var(--primary); }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border: 1px solid #bbf7d0;
  border-radius: 999px;
  background: #f0fdf4;
  color: #15803d;
  font-size: 12.5px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}
.live-pill:hover { border-color: #86efac; }
/* 呼吸的绿点 = "正在自动刷新" */
.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, .5);
  animation: live-pulse 1.8s ease-out infinite;
}
@keyframes live-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .5); }
  70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
.live-pill.paused { border-color: var(--border); background: #f8fafc; color: #94a3b8; }
.live-pill.paused .live-dot { background: #cbd5e1; animation: none; box-shadow: none; }

.radio-pills {
  display: inline-flex;
  background: #eef2ff;
  border-radius: 9px;
  padding: 3px;
  gap: 2px;
}
.radio-pills label {
  padding: 6px 14px;
  border-radius: 7px;
  font-size: 13px;
  color: #475569;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.radio-pills input { display: none; }
.radio-pills input:checked + span { color: var(--primary); font-weight: 700; }
.radio-pills label:has(input:checked) { background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .1); }

.tabs {
  display: inline-flex;
  gap: 6px;
  background: #e2e8f0;
  border-radius: 11px;
  padding: 4px;
}
.tabs button {
  position: relative;   /* 给「我代取的」右上角的超时角标当定位参照(.timeout-badge) */
  border: none;
  background: transparent;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  color: #475569;
  font-weight: 500;
  /* 无过渡: 高亮与内容同步瞬时切换 */
}
.tabs button.active {
  background: #fff;
  color: var(--primary);
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(15, 23, 42, .1);
}

/* #endregion */

/* #region 8 订单卡片(含「新」标动画) */
/* ==================== 订单卡片 ==================== */
.order-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}

.order-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  transition: transform .15s, box-shadow .15s;
  position: relative;
}
.order-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
/* 期望时间已过、但还在 24 小时宽限期内: 仍然可抢, 用琥珀色描边 + 说明行提示一下 */
.order-card.order-card-overdue { border: 1px solid #fcd34d; }
.oc-row.oc-overdue {
  gap: 6px;
  font-size: 11.5px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 4px 9px;
}

.order-card .oc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.oc-no { color: #94a3b8; font-size: 12px; }

.oc-row { display: flex; align-items: center; gap: 8px; color: #475569; font-size: 13.5px; }
.oc-row .lbl { color: #94a3b8; width: 34px; flex-shrink: 0; }

.oc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
  margin-top: 2px;
}
.reward { color: #d97706; font-size: 19px; font-weight: 800; }
.oc-reward { display: inline-flex; align-items: baseline; gap: 5px; }
.oc-reward-lbl { font-size: 11.5px; color: #94a3b8; }
.reward small { font-size: 12px; color: #94a3b8; font-weight: 500; }
.publisher { color: #64748b; font-size: 12.5px; }

/* ---------- 实时刷新: 新冒出来的单闪一下 + 打「新」标 ---------- */
/* 卡片底色是白的(--card), 表格行本来透明 —— 淡蓝闪一下再回到各自本色, 动画结束不跳色。
   「新」标 3 分钟后由 hallIsNew() 自动摘掉(见 app.js) */
.oc-new-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 15px;
  vertical-align: 1px;
}
.order-card-new { animation: hall-flash-card 2.2s ease-out 1; }
@keyframes hall-flash-card {
  0% { background-color: #dbeafe; }
  100% { background-color: var(--card); }
}
tr.row-new { animation: hall-flash-row 2.2s ease-out 1; }
@keyframes hall-flash-row {
  0% { background-color: #dbeafe; }
  100% { background-color: transparent; }
}

/* #endregion */

/* #region 9 弹窗 */
/* ==================== 弹窗 ==================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  /* 不挂 backdrop-filter: 弹窗打开时它要把整屏后面的内容持续重新模糊,
     背后只要有动画(数据总览的呼吸灯/网格扫描)就是每帧一次全屏重采样, 直接掉帧。
     深色蒙层本身已经足够压住背景, 去掉模糊观感几乎无差。 */
  background: rgba(15, 23, 42, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  /* 弹窗必须压在所有浮层之上: 聊天面板(160)、小邮面板(151)、AI 图标(152)都比它低,
     否则从聊天框里点「清空聊天记录」时, 确认框会被聊天面板盖在下面(还在最顶上, 见 #toast)。 */
  z-index: 190;
}
.modal {
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
  width: 520px;
  max-width: 92vw;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  animation: rise .25s ease;
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 12px;
}
.modal-head h3 { font-size: 16px; color: #1e293b; }
.modal-close {
  border: none;
  background: #f1f5f9;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  color: #64748b;
  font-size: 14px;
  transition: all .15s;
}
.modal-close:hover { background: #fee2e2; color: var(--danger); }
/* 滚到底不再把滚动"接力"给背后的页面(JS 侧另有兜底, 见 app.js「小窗滚动隔离」) */
.modal-body { padding: 6px 22px 22px; overflow-y: auto; overscroll-behavior: contain; }
/* 弹窗内表格适当压缩, 保证列完整显示 */
.modal-body .tbl th, .modal-body .tbl td { padding: 10px 11px; }
.modal-body .tbl { min-width: 0; }

.modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 18px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }

/* #endregion */

/* #region 10 评价系统 */
/* ==================== 评价系统 ==================== */
.ev-pick { display: flex; gap: 6px; font-size: 24px; line-height: 1; }
.ev-star { cursor: pointer; color: #e2e8f0; user-select: none; transition: color .12s, transform .12s; }
.ev-star.on { color: #f59e0b; }
.ev-star:hover { transform: scale(1.15); }
.ev-score-text { font-size: 12px; color: #64748b; margin-top: 5px; }
.ev-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-tag {
  padding: 5px 13px;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12.5px;
  color: #475569;
  transition: all .12s;
}
.ev-tag:has(input:checked) { background: #eef2ff; border-color: var(--primary); color: var(--primary); }
.ev-tag input { display: none; }
.ev-stars { color: #f59e0b; letter-spacing: 1px; font-size: 13px; }
.ev-brief { color: #64748b; font-size: 12px; margin-left: 6px; }

/* #endregion */

/* #region 11 我的页: 钱包卡片 */
/* ==================== 我的页: 钱包卡片 ==================== */
.me-wallet {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #047857 0%, #10b981 55%, #34d399 100%);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: #fff;
  box-shadow: 0 12px 32px rgba(5, 150, 105, .3);
}
.me-wallet::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  width: 210px;
  height: 210px;
  background: rgba(255, 255, 255, .08);
  top: -100px;
  right: 26%;
}
.mw-left { position: relative; z-index: 1; }
.mw-label { font-size: 13px; color: rgba(255, 255, 255, .88); letter-spacing: 1px; }
.mw-balance {
  font-size: 42px;
  font-weight: 800;
  line-height: 1.25;
  margin: 4px 0 14px;
  font-variant-numeric: tabular-nums;
}
.mw-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.mw-btn {
  border: none;
  cursor: pointer;
  background: #fff;
  color: #047857;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  padding: 10px 24px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
  transition: transform .12s, box-shadow .12s;
}
.mw-btn:hover { transform: translateY(-1px); box-shadow: 0 9px 22px rgba(0, 0, 0, .2); }
.mw-note { font-size: 12px; color: rgba(255, 255, 255, .82); }
.mw-stats { display: flex; gap: 12px; flex-wrap: wrap; position: relative; z-index: 1; }
.mw-stat { min-width: 92px; text-align: center; padding: 10px 12px; border-radius: 12px; transition: background .15s, transform .15s; }
.mw-num { font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.mw-stat-link { cursor: pointer; }
.mw-stat-link:hover { background: rgba(255, 255, 255, .16); transform: translateY(-2px); }
.mw-cap { font-size: 12px; color: rgba(255, 255, 255, .82); margin-top: 4px; }
.mw-stat-link .mw-cap::after { content: ' ›'; opacity: .8; }

/* 充值弹窗 */
.rc-bal {
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 14px;
}
.rc-bal b { color: #059669; font-size: 15px; }
.rc-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.rc-chip {
  text-align: center;
  padding: 11px 0;
  border-radius: 10px;
  cursor: pointer;
  border: 1.5px solid var(--border);
  font-size: 15px;
  font-weight: 700;
  color: #334155;
  background: #fbfcfe;
  transition: border-color .12s, background .12s, color .12s;
  user-select: none;
}
.rc-chip:hover { border-color: #a5b4fc; }
.rc-chip.on { background: #eef2ff; border-color: var(--primary); color: var(--primary); }
.rc-pays { display: flex; gap: 9px; flex-wrap: wrap; }
.rc-pay {
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  border: 1.5px solid var(--border);
  color: #475569;
  background: #fbfcfe;
  transition: border-color .12s, background .12s, color .12s;
  user-select: none;
}
.rc-pay.on { background: #eef2ff; border-color: var(--primary); color: var(--primary); font-weight: 600; }
.rc-tip { font-size: 12px; color: #94a3b8; margin-top: 10px; }

/* #endregion */

/* #region 12 信用分详情弹窗(含超时扣分规则表) */
/* ==================== 信用分详情弹窗 ==================== */
.credit-hero {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  border: 1.5px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 22px;
  margin-bottom: 16px;
}
/* 弹窗一打开先"蓄力"再定住: 起手略小、快速顶到略大、再落回原大小, 配 app.js 里那段快进的圆环动画
   (时长取 .5s, 比圆环/数字的 850ms 略短, 数字还没停圆环先稳住, 收尾更利落)
   ⚠️ 不要加 fill-mode(尤其 both): 动画在"还没轮到跑"时会把元素钉在 0% 的 scale(.9) 上,
   一旦动画因为后台标签页被节流/祖先元素当时还 display:none 而没起步, 圆环就会永远小一圈。
   不写 fill, 静止态 = 100% = 原大小, 动画跑不跑都不会变形。 */
.credit-ring-wrap {
  position: relative; width: 190px; height: 190px; flex-shrink: 0;
  animation: cr-punch .5s cubic-bezier(.22, 1.35, .45, 1);
}
@keyframes cr-punch {
  0% { transform: scale(.9); }
  55% { transform: scale(1.035); }
  100% { transform: scale(1); }
}
.credit-ring { transform: rotate(-90deg); }
.cr-track { fill: none; stroke: #e2e8f0; stroke-width: 13; }
.cr-bar {
  fill: none;
  stroke-width: 13;
  stroke-linecap: round;
  /* 原有一层 drop-shadow 发光 + JS 逐帧改 stroke-dashoffset: 滤镜元素每帧都要重新套一遍滤镜,
     数字滚动那 0.85 秒就一直在重算。去掉发光(描边本身是渐变, 已经够醒目), 让描边动画只重绘路径。 */
}
.credit-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}
.credit-num {
  font-size: 52px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.credit-unit { font-size: 12.5px; color: #94a3b8; letter-spacing: 2px; }
.credit-side { display: flex; flex-direction: column; gap: 9px; min-width: 170px; }
.credit-level {
  align-self: flex-start;
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}
.credit-meta { font-size: 13.5px; color: #475569; }
.credit-meta b { color: #0f172a; }
.credit-meta-sm { font-size: 11.5px; color: #94a3b8; line-height: 1.7; margin-top: 2px; }

.credit-rules { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.cr-card {
  border-radius: 14px;
  padding: 15px 17px;
  font-size: 13px;
  line-height: 1.7;
}
.cr-good { background: #ecfdf5; border: 1px solid #a7f3d0; }
.cr-bad  { background: #fef2f2; border: 1px solid #fecaca; }
.cr-card-head { font-size: 14px; font-weight: 700; margin-bottom: 8px; color: #0f172a; }
.cr-card ul { list-style: none; }
.cr-card li { color: #475569; padding: 3px 0 3px 16px; position: relative; }
.cr-good li::before { content: '·'; position: absolute; left: 4px; color: #10b981; font-weight: 800; }
.cr-bad li::before { content: '·'; position: absolute; left: 4px; color: #ef4444; font-weight: 800; }
.cr-card b { color: #0f172a; }
.cr-warn {
  margin-top: 9px;
  font-size: 12.5px;
  color: #b91c1c;
  background: #fff;
  border: 1px dashed #fca5a5;
  border-radius: 9px;
  padding: 7px 11px;
}
@media (max-width: 700px) { .credit-rules { grid-template-columns: 1fr; } }

/* ---------- 信用分: 超时扣分规则表 + 信用分流水(credit modal) ---------- */
.cr-tier-box { margin-top: 2px; }
.cr-tier {
  display: flex; align-items: center; gap: 10px;
  padding: 5px 9px; margin: 4px 0;
  background: #fff; border: 1px solid #fee2e2; border-radius: 8px;
  font-size: 12.5px;
}
.cr-tier-free { border-color: #bbf7d0; background: #f0fdf4; }
.cr-tier-when { flex: 1; color: #334155; }
.cr-tier-pts { font-weight: 700; color: #dc2626; white-space: nowrap; }
.cr-tier-free .cr-tier-pts { color: #16a34a; }
.cr-tier-note { color: #94a3b8; font-size: 11.5px; }
.cr-tier-foot { margin-top: 7px; font-size: 11.5px; color: #94a3b8; line-height: 1.6; }

.cr-log-head { margin: 16px 0 8px; font-size: 14px; font-weight: 700; color: #0f172a; }
.cr-log-box { font-size: 12.5px; }
.cr-log-now { color: #475569; margin-bottom: 7px; }
.cr-log-now b { font-size: 15px; color: #0f172a; }
.cr-log-empty { color: #64748b; background: #f8fafc; border-radius: 9px; padding: 12px; text-align: center; }
.cr-log-list { max-height: 240px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; }
.cr-log-item {
  display: grid; grid-template-columns: 78px 96px 1fr 58px 62px;
  gap: 8px; align-items: center;
  padding: 7px 11px; border-bottom: 1px solid #f1f5f9;
}
.cr-log-item:last-child { border-bottom: none; }
.cr-log-time { color: #94a3b8; font-size: 11.5px; }
.cr-log-reason { color: #334155; font-weight: 600; }
.cr-log-reason em { font-style: normal; color: #64748b; font-weight: 400; font-size: 11.5px; }
.cr-log-detail { color: #64748b; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cr-log-change { text-align: right; font-weight: 700; color: #64748b; }
.cr-log-change.down { color: #dc2626; }
.cr-log-change.up { color: #16a34a; }
.cr-log-after { color: #94a3b8; font-size: 11.5px; text-align: right; }
/* 学生管理列表里可点的信用分 */
.credit-link { color: var(--primary); cursor: pointer; border-bottom: 1px dashed currentColor; }
.credit-link:hover { opacity: .75; }
@media (max-width: 700px) {
  .cr-log-item { grid-template-columns: 70px 1fr 52px; }
  .cr-log-detail, .cr-log-after { display: none; }
}

/* 订单详情卡片(钱包流水点击查看) */
.od-card { background: #fff; border: 1.5px solid var(--border); border-radius: 14px; padding: 18px; }
.od-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.od-no { font-size: 17px; font-weight: 700; color: #0f172a; letter-spacing: .3px; }
.od-route {
  display: flex; align-items: center; gap: 10px;
  background: #f8fafc; border-radius: 10px; padding: 11px 14px;
  font-size: 13.5px; color: #334155; margin-bottom: 12px;
}
.od-arrow { color: #94a3b8; }
.od-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.od-cell { background: #f8fafc; border-radius: 10px; padding: 10px 14px; font-size: 13px; color: #334155; }
.od-lbl { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 3px; }
.od-people { font-size: 13px; color: #334155; margin-bottom: 12px; }
.od-timeline {
  font-size: 12.5px; color: #64748b; line-height: 1.9;
  border-top: 1px dashed var(--border); padding-top: 10px; margin-bottom: 10px;
}
.od-eval { font-size: 13px; color: #334155; line-height: 1.8; border-top: 1px dashed var(--border); padding-top: 10px; }

/* 抢单确认弹窗: 订单信息(复用 od-card) + 义务清单 + 勾选承诺 */
.claim-remain { font-size: 12px; color: #d97706; margin-top: 4px; }
.claim-warn {
  margin-top: 12px; font-size: 12.5px; line-height: 1.7; color: #b45309;
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 10px; padding: 9px 12px;
}
.claim-rules { list-style: none; margin-top: 14px; font-size: 13px; line-height: 1.85; color: #475569; }
.claim-rules li { position: relative; padding-left: 18px; }
.claim-rules li::before { content: '·'; position: absolute; left: 6px; color: var(--primary); font-weight: 800; }
.claim-rules b { color: #0f172a; }
.claim-ack {
  display: flex; align-items: flex-start; gap: 9px; cursor: pointer;
  margin-top: 14px; padding: 11px 13px;
  background: #f8fafc; border: 1.5px solid var(--border); border-radius: 10px;
  font-size: 13px; line-height: 1.6; color: #334155;
  transition: background .15s, border-color .15s, color .15s;
}
.claim-ack:hover { border-color: #c7d2fe; }
.claim-ack:has(input:checked) { background: #eef2ff; border-color: var(--primary); color: #3730a3; }
.claim-ack input { flex: 0 0 auto; width: 15px; height: 15px; margin-top: 2px; accent-color: var(--primary); cursor: pointer; }
.claim-ack b { color: #0f172a; }
.claim-hint { margin-top: 10px; text-align: right; font-size: 12px; color: #94a3b8; }

/* #endregion */

/* #region 13 AI 小助手 / 站内消息聊天窗口 */
/* ==================== AI 小助手 ==================== */
/* 图标常驻: 打开面板时图标不消失, 再次点击它即可收起(所以面板留在图标上方, 不盖住图标) */
.ai-fab {
  position: fixed;
  right: 26px;
  bottom: 26px;
  width: 58px;
  height: 58px;
  border: none;
  border-radius: 50%;
  background: var(--grad);
  color: #fff;
  font-size: 26px;
  cursor: pointer;
  /* 手指按住图标拖动 = 挪图标本身(app.js 的 initFabDrag): 交给 JS 处理, 别让浏览器当成"滚页面"
     (否则拖动会被滚动抢走)。图标很小, 不会有"想在这里滚页面"的场景。 */
  touch-action: none;
  /* 只留一层很淡的中性投影把按钮托起来; 原先那圈紫色光晕(浅色圆圈)已按需求去掉 */
  box-shadow: 0 4px 14px rgba(15, 23, 42, .18);
  z-index: 152;   /* 始终在面板之上, 保证"点图标收起"点得到 */
  /* 常态就是原大小(没有"面板开着时缩小一点"的中间态, 否则松手会先弹到中间态再弹到原大小 = 两段式)。
     松手这一下走回弹曲线: 略微冲过目标值再落回来, 手电筒那种"弹一下"的手感 */
  transition: transform .24s cubic-bezier(.34, 1.56, .64, 1), box-shadow .24s ease;
}
.ai-fab:hover { filter: brightness(1.08); }
/* 按下即缩, 松手由上面的过渡一步弹回原大小。
   .ai-fab-press 是给快捷键(左/右 Alt)用的"按键态": 键盘按不出 :active, 由 JS 加/摘这个类,
   取值与 :active 完全一致 —— 鼠标点图标和按快捷键的动效才是同一个 */
.ai-fab:active, .ai-fab.ai-fab-press {
  transform: scale(.82);
  transition-duration: .1s;
  transition-timing-function: ease-out;
}
/* ---------- 站内消息: 聊天窗口 + 信封入口 + 订单卡上的联系按钮 ---------- */
/* 聊天窗口: 屏幕正中, 尺寸比小邮面板略大(聊天要看历史记录, 给足高度) */
.msg-panel {
  position: fixed;
  left: 50%;
  top: 50%;
  /* translate 只做"还没被 JS 钉位前"的兜底居中。奇数视口下 translate(-50%,-50%) 会把面板
     停在半像素上, 文字光栅化发虚(拖一下触发重绘才变清) —— 打开时 JS 会立刻钉成整数
     left/top 并挂 .msg-anim/.msg-moved 摘掉它, 播完动画也不交回(见 msgUnpin), 别依赖它。 */
  transform: translate(-50%, -50%);
  width: 560px;
  max-width: calc(100vw - 40px);
  height: 620px;
  max-height: calc(100vh - 80px);
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .28);
  border: 1px solid var(--border);
  z-index: 160;   /* 高于小邮面板(151)与侧边栏, 保证居中弹窗在最上层 */
  overflow: hidden;
  /* 进出场动效与小邮面板同一套(时长/曲线/关键帧都复用 aiFlyIn/aiFlyOut)。
     但飞出的**起点不同**: 小邮固定在右下角, 它的面板从图标里长出来; 聊天窗口是居中的,
     触发它的是列表里那个「打开」按钮 —— 所以原点是那个按钮的位置(JS 每次打开时按按钮实测写进
     --msg-fly-x/y, 就是按钮圆心相对面板中心的偏移)。
     位置用 left:50%/top:50% + translate(-50%,-50%) 兜底居中, 而 keyframes 里的 transform: scale()
     会覆盖掉 translate —— 所以动画期间 JS 会改成钉 left/top 的**整数**坐标并挂 .msg-anim,
     播完也保持钉死不交回(交回 translate 居中会落半像素, 文字发虚, 见 msgUnpin)。
     动画只碰 transform/opacity(合成层属性), will-change + contain 提前提升图层、限定重绘范围,
     缩放时才不会每帧重排/重绘整块界面 —— 这是"看起来流畅"的前提, 别删。 */
  transform-origin: calc(50% + var(--msg-fly-x, 0px)) calc(50% + var(--msg-fly-y, 0px));
  contain: paint;
}
/* will-change 只在动画期间挂: 常驻会把面板永久留在合成层里, 半像素偏移的光栅结果
   一直糊着不重新光栅化; 播完摘掉, 浏览器按普通渲染路径重排文字, 一打开就是实的。 */
.msg-panel.msg-opening,
.msg-panel.msg-closing { will-change: transform, opacity; }
/* 拖动过 / 被 JS 钉位(动画中或播完后): 位置由 JS 写的整数 left/top 决定, 摘掉兜底的 translate 偏移 */
.msg-panel.msg-moved,
.msg-panel.msg-anim { transform: none; }
.msg-panel.msg-opening { animation: aiFlyIn .36s cubic-bezier(.2, 1.3, .35, 1) both; }
.msg-panel.msg-closing { animation: aiFlyOut .28s cubic-bezier(.15, .8, .3, 1) both; pointer-events: none; }
.msg-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--grad);
  color: #fff;
}
.msg-head-main { flex: 1; min-width: 0; }
.msg-head-title { font-size: 14.5px; font-weight: 700; }
.msg-head-sub { font-size: 11.5px; opacity: .88; margin-top: 2px; }
.msg-hbtn {
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  height: 24px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
}
.msg-hbtn:hover { background: rgba(255, 255, 255, .3); }
/* 查找聊天记录: 标题栏的 🔍 展开这一条, 输入关键词后消息区只列命中的消息 */
.msg-searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.msg-searchbar input {
  flex: 1;
  min-width: 0;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
}
.msg-searchbar input:focus { border-color: var(--primary); }
.msg-search-count { font-size: 12px; color: #64748b; white-space: nowrap; }
.msg-search-cancel {
  border: none;
  background: #e2e8f0;
  color: #475569;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.msg-search-cancel:hover { background: #cbd5e1; }
/* 命中的关键词高亮 */
.msg-hl { background: #fde68a; color: #7c2d12; border-radius: 3px; padding: 0 1px; }

/* 查找结果: 每条消息都能点(点了跳回完整列表的对应位置) */
.msg-searching .msg-row { cursor: pointer; }
.msg-searching .msg-row:hover .msg-bubble { outline: 2px solid #c7d2fe; outline-offset: 1px; }
/* 跳转到位后闪一下, 帮眼睛快速定位到那条消息 */
.msg-jump .msg-bubble,
.ai-msg.msg-jump { animation: msgJump 1.5s ease; }
@keyframes msgJump {
  0% { box-shadow: 0 0 0 3px rgba(99, 102, 241, .6); }
  60% { box-shadow: 0 0 0 3px rgba(99, 102, 241, .38); }
  100% { box-shadow: 0 0 0 3px rgba(99, 102, 241, 0); }
}
/* AI 面板的查找结果同样可点(点一条跳回完整记录) */
.ai-msgs.searching .ai-msg { cursor: pointer; }
.ai-msgs.searching .ai-msg:hover { outline: 2px solid #c7d2fe; outline-offset: 1px; }
.msg-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  background: #f8fafc;
}
.msg-empty { text-align: center; color: #64748b; font-size: 13px; padding: 34px 10px; line-height: 1.9; }
.msg-empty span { color: #94a3b8; font-size: 12px; }
.msg-day { text-align: center; font-size: 11px; color: #94a3b8; margin-bottom: 10px; }
.msg-row { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px; }
.msg-row.mine { align-items: flex-end; }
.msg-bubble {
  max-width: 78%;
  padding: 8px 11px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--border);
  font-size: 13.5px;
  line-height: 1.6;
  color: #0f172a;
  word-break: break-word;
  white-space: pre-wrap;
}
.msg-row.mine .msg-bubble { background: var(--primary); border-color: var(--primary); color: #fff; }
.msg-meta { font-size: 10.5px; color: #94a3b8; margin-top: 3px; display: flex; gap: 6px; }
.msg-read { color: #cbd5e1; }
.msg-row.mine .msg-read { color: #94a3b8; }
.msg-input {
  display: flex;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.msg-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 11px;
  font-size: 13.5px;
  outline: none;
}
.msg-input input:focus { border-color: var(--primary); }
.msg-input input:disabled { background: #f1f5f9; color: #94a3b8; }
.msg-input button {
  border: none;
  background: var(--primary);
  color: #fff;
  border-radius: 10px;
  padding: 0 16px;
  font-size: 13.5px;
  cursor: pointer;
}
.msg-input button:disabled { background: #cbd5e1; cursor: not-allowed; }

/* 订单卡上的「联系…」按钮 + 未读小红点 */
.msg-btn { position: relative; }
.msg-btn-dot {
  display: inline-block;
  margin-left: 4px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
/* 会话总览(点信封图标) */
.conv-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 11px;
  margin-bottom: 8px;
  background: #fff;
  /* 整行可点(点框框就开聊天): 悬停给个"抬起来"的反馈 */
  cursor: pointer;
  transition: transform .15s cubic-bezier(.22, 1, .36, 1), border-color .15s, background .15s;
}
.conv-item:hover {
  transform: translateY(-1px);
  border-color: #c7d2fe;
  background: #f8faff;
}
.conv-item:active { transform: translateY(0); }
.conv-item.conv-unread { border-color: #fca5a5; background: #fff7f7; }
.conv-main { flex: 1; min-width: 0; }
.conv-title { font-size: 13.5px; font-weight: 700; color: #0f172a; display: flex; align-items: center; gap: 7px; }
.conv-role {
  font-size: 10.5px;
  font-weight: 400;
  color: #64748b;
  background: #f1f5f9;
  border-radius: 7px;
  padding: 1px 6px;
}
.conv-dot { font-size: 10.5px; font-weight: 700; color: #dc2626; }
.conv-line { font-size: 11.5px; color: #64748b; margin-top: 3px; }
.conv-last {
  font-size: 12.5px;
  color: #334155;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.conv-time { font-size: 10.5px; color: #94a3b8; margin-top: 2px; }

/* #endregion */

/* #region 14 学生咨询(管理员的会话列表) */
/* ---------- 学生咨询(管理员): 搜索框 + 微信式会话列表 ---------- */
.dm-search { position: relative; margin-bottom: 12px; }
.dm-search input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid var(--border);
  border-radius: 11px;
  padding: 11px 42px 11px 14px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  background: #f8fafc;
  transition: border-color .15s, background .15s;
}
.dm-search input:focus { border-color: var(--primary); background: #fff; }
.dm-search-clear {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: #e2e8f0;
  color: #475569;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.dm-search-clear:hover { background: #cbd5e1; }
/* 会话整行可点(微信那种): 悬停整行高亮, 未读行悬停用偏红底色 */
.dm-conv { cursor: pointer; transition: background .12s, border-color .12s; }
.dm-conv:hover { background: #f8faff; border-color: #c7d2fe; }
.dm-conv.conv-unread:hover { background: #fff1f1; border-color: #fca5a5; }
/* 头像: 圆角方块(比正圆更像聊天的头像), 颜色按学生固定分配 */
.dm-ava {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  user-select: none;
}
.dm-empty-tip { font-size: 12.5px; color: #94a3b8; }

/* 窄屏: 居中的弹窗改为近全屏。⚠️ 这里只调尺寸, 不能动 left/right/bottom ——
   基类的 left:50%/top:50% + translate(-50%,-50%) 只是 JS 钉位前的兜底居中, 面板可见时
   位置由内联整数 left/top(.msg-anim/.msg-moved)接管, 改成 left/right 定位会和钉位逻辑打架。 */
@media (max-width: 700px) {
  .msg-panel {
    width: calc(100vw - 16px);
    height: calc(100vh - 90px);
    max-width: none;
    max-height: none;
  }
}

/* 「我的消息」页面 + 侧边栏菜单未读角标 */
.msg-page-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-bottom: 14px;
}
.msg-page-title { font-size: 16px; font-weight: 700; color: #0f172a; }
/* 标题 + 查询框挨在一起(整行两端对齐: 这一组在左, 「刷新」在右) */
.msg-page-head-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
/* 「我的消息」顶部的会话查询框(按对方姓名 / 订单号 / 最后一条消息筛选, 前端即时过滤)
   宽度按提示词实际长度定(搜对方姓名 / 订单号 / 消息 = 10 个汉字 + 两段 " / " ≈ 180px):
   窄了会把提示词截断成"搜对方姓名 / 订单号 / 消", 换文案/字号时记得同步量一下 */
.msg-page-search {
  width: 210px;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13.5px;
  font-family: inherit;
  background: #fff;
  outline: none;
}
.msg-page-search:focus { border-color: var(--primary); }
.msg-page-sub { font-size: 12.5px; color: #94a3b8; margin-top: 4px; }
.msg-page-sum { font-size: 12.5px; color: #64748b; margin-bottom: 10px; }
.msg-page-group {
  font-size: 12px; font-weight: 700; color: #94a3b8;
  margin: 14px 0 7px; letter-spacing: .3px;
}
/* 菜单项上的未读角标: 靠右对齐, 和「我的」那种底部项也不冲突 */
.nav-item { position: relative; }
/* 红色小角标: 未读(.nav-unread)与超时提醒(.timeout-badge)共用同一套尺寸与配色,
   两处红点长得一模一样, 只有位置各由下面两条规则决定 */
.nav-unread,
.timeout-badge {
  position: absolute;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  /* ⚠️ 这里的行高故意比圆点高度(18px)小 1px: 数字才会落在**几何圆心**上, 别改成 18px。
     原理: 行盒的半行距按字体的 ascent/descent 算 —— Segoe UI 粗体 11px 是 12/3(内容高 15px),
     line-height 17px → 半行距 1px → 基线落在 13px; 数字墨迹从基线往上 8px, 墨迹中心正好 9px = 圆心。
     写成 18px 时基线在 13.5px, 数字整体偏下 0.5px —— 放大看就是"歪"(真踩过)。
     ⚠️ 这个值跟着字体度量走: 改 font-family 或字号要重新校(数字换成中文字也一样)。 */
  line-height: 17px;
  text-align: center;
}
/* 挂在菜单项上时(我的消息的未读 / 订单大厅的超时): 右对齐 + 竖直居中, 位置逐像素一致 */
.nav-unread,
.nav-item .timeout-badge {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

/* #endregion */

/* #region 15 超时提醒(角标 / 提醒标 / 提醒清单) */
/* ---------- 超时提醒: 入口角标 + 订单卡上的提醒标 + 提醒清单 ---------- */
/* 红色角标 = 代取超时提醒条数, 挂在两个入口: 侧边栏「订单大厅」菜单项、大厅页「我代取的」标签
   (原来是挂在右下角 AI 图标上, 已按需求改到这两个位置)。
   尺寸/配色在 .nav-unread 那条规则里和未读角标共用, 挂菜单项上的位置也逐像素一致
   —— 侧边栏里「订单大厅」和「我的消息」两个红点必须对齐(不要白圈、不要脉冲动画)。 */
.timeout-badge { cursor: pointer; }   /* 只有它可点(点开提醒清单), 未读角标不可点 */
/* 「我代取的」标签按钮只有一行高, 塞不下竖直居中的角标, 所以单独把它贴到按钮右上角 */
.tabs button .timeout-badge { top: -6px; right: -6px; }

.rm-mark {
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  padding: 3px 7px;
  border-radius: 7px;
  white-space: normal;
}
.rm-soon    { color: #0369a1; background: #e0f2fe; }
.rm-urgent  { color: #b45309; background: #fef3c7; font-weight: 600; }
.rm-overdue { color: #b91c1c; background: #fee2e2; font-weight: 700; }
tr.row-overdue > td { background: #fff5f5; }
.rm-item {
  border: 1px solid #fecaca;
  background: #fff5f5;
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 9px;
}
.rm-item.rm-overdue { border-color: #fca5a5; background: #ffecec; }
.rm-no { font-weight: 700; color: #0f172a; margin-bottom: 3px; }
.rm-line { font-size: 12.5px; color: #475569; }
.rm-warn { margin-top: 5px; font-size: 12.5px; font-weight: 700; color: #b91c1c; }
.rm-foot { margin-top: 4px; font-size: 11.5px; color: #94a3b8; line-height: 1.7; }
.ai-panel {
  position: fixed;
  right: 26px;
  bottom: 98px;   /* 恰好让出右下角的图标(58px + 26px 边距 + 14px 间隙) */
  width: 372px;
  max-width: calc(100vw - 40px);
  height: 540px;
  max-height: calc(100vh - 140px);
  min-width: 300px;
  min-height: 320px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 60px rgba(15, 23, 42, .28);
  display: flex;
  flex-direction: column;
  z-index: 151;
  overflow: hidden;
  /* 飞出/飞入: 位移向量由 JS 按图标实际位置写进 --ai-fly-x/--ai-fly-y
     --ai-fly-x/y 同时是缩放的 transform-origin: 原点钉在**图标圆心**上, 面板才像从图标里长出来/被吸回去 */
  transform-origin: calc(50% + var(--ai-fly-x, 0px)) calc(50% + var(--ai-fly-y, 0px));
  /* 动画只碰 transform/opacity(合成层属性), 再加上 will-change 提前提升为独立图层、contain 限定重绘范围,
     缩放时才不会每帧重排/重绘整块界面 —— 这是"看起来流畅"的前提, 别删 */
  will-change: transform, opacity;
  contain: paint;
}
/* 右下角缩放控件(鼠标拖动改变窗口大小) */
.ai-resize {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 18px;
  height: 18px;
  cursor: nwse-resize;
  z-index: 3;
}
.ai-resize::after {
  content: '';
  position: absolute;
  right: 3px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border-right: 2px solid #cbd5e1;
  border-bottom: 2px solid #cbd5e1;
  border-radius: 0 0 4px 0;
}
.ai-resize:hover::after { border-color: var(--primary); }
/* 面板的出现/消失: 从图标圆心那一点"炸开" / 收回那一点(缩放原点是图标圆心, 见 .ai-panel 的 transform-origin)。
   面板是完整界面, 缩到很小时内容会糊成一团 —— 所以节奏必须这样配, 让糊的那几帧根本来不及被看见:
   1) 起步极快: 曲线 y1 > 1(x1 很小), 0.02 → 0.6 只花前 12% 的时间, 糊的帧只有两三帧;
   2) 淡入压在更短的前 12% 里完成, 最难看的一段正好被透明度盖住;
   3) 末端 y1=1.3 带来约 3% 的过冲再落回 —— "弹一下"的手感, 不至于像玩具。
   退场反过来: 起步快、一路收那一点, 后 62% 边收边淡出(半透明的糊比实心的糊不显眼)。
   时长入场 .36s / 退场 .28s: 用户要"再慢一点、更跟手", 而且 60Hz 屏上时长越短分摊到的帧越少(显得跳),
   放慢后同样的位移铺在更多帧上, 观感更顺。想更快就同步缩短, 但别低于 .2s。
   改时长要同步 aiOpen()/aiClose() 里的兜底 setTimeout(现为 420ms, 略长于 .36s)。 */
@keyframes aiFlyIn {
  0%   { opacity: 0; transform: scale(.02); }
  12%  { opacity: 1; }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes aiFlyOut {
  0%   { opacity: 1; transform: scale(1); }
  38%  { opacity: 1; }
  100% { opacity: 0; transform: scale(.02); }
}
.ai-panel.ai-opening { animation: aiFlyIn .36s cubic-bezier(.2, 1.3, .35, 1) both; }
.ai-panel.ai-closing { animation: aiFlyOut .28s cubic-bezier(.15, .8, .3, 1) both; pointer-events: none; }
.ai-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: var(--grad);
  color: #fff;
}
/* 标题会让位: 按钮保持完整, 标题过长时省略号截断(不然窄宽度下按钮里的字会被挤到换行) */
.ai-title {
  font-weight: 700;
  font-size: 14.5px;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 头部按钮: 与聊天面板的 .msg-hbtn 完全同一套尺寸/形状(胶囊), 两个面板看起来才一致。
   原来是 26×26 的圆形(只为纯图标设计), 加了"查找/清空"文字后字会挤成两行。 */
.ai-hbtn {
  border: none;
  background: rgba(255, 255, 255, .18);
  color: #fff;
  height: 24px;
  padding: 0 9px;
  border-radius: 12px;
  font-size: 11.5px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.ai-hbtn:hover { background: rgba(255, 255, 255, .32); }
.ai-msgs {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;   /* 消息区滚到底/装得下时, 不带动背后的页面 */
  padding: 14px 14px 10px;   /* 底部留白, 最后一条消息不贴边 */
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ai-msg { max-width: 82%; padding: 9px 13px; border-radius: 13px; font-size: 13.5px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.ai-msg.bot { align-self: flex-start; background: #fff; color: #334155; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); border-top-left-radius: 4px; }
.ai-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-top-right-radius: 4px; }
/* 小邮回复里的轻量 Markdown(加粗/列表/行内代码): 由 app.js 的 aiRenderRich() 生成,
   白名单标签只有 b/i/code/ul/li/div —— 模型输出的 HTML 会先被转义, 不会被当成标签执行 */
.ai-msg.bot b { color: #0f172a; font-weight: 700; }
.ai-msg.bot i { color: #475569; font-style: italic; }
.ai-msg.bot code { background: #f1f5f9; color: #0f172a; padding: 1px 5px; border-radius: 5px; font-size: 12.5px; font-family: Consolas, Monaco, monospace; }
.ai-msg.bot ul { margin: 3px 0; padding-left: 17px; list-style: none; }
.ai-msg.bot li { position: relative; margin: 2px 0; }
.ai-msg.bot li::before { content: '·'; position: absolute; left: -12px; color: #94a3b8; font-weight: 700; }
.ai-msg.bot .ai-gap { height: 7px; }
/* 回答末尾的「依据：《卡片》」—— A′ 检索增强的溯源行: 灰色小字 + 上分隔线, 不抢正文 */
.ai-msg.bot .ai-src {
  margin-top: 9px; padding-top: 7px; border-top: 1px dashed #e2e8f0;
  color: #94a3b8; font-size: 12px; line-height: 1.7;
}
.ai-msg.bot .ai-src b { color: #64748b; font-weight: 600; }
.ai-msg.bot > div:first-child { margin-top: 0; }
.ai-typing { display: inline-flex; gap: 4px; align-items: center; padding: 3px 2px; min-height: 20px; }
.ai-typing i { width: 6px; height: 6px; border-radius: 50%; background: #94a3b8; animation: aiBlink 1.2s infinite; }
.ai-typing i:nth-child(2) { animation-delay: .2s; }
.ai-typing i:nth-child(3) { animation-delay: .4s; }
@keyframes aiBlink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 7px 12px 5px; background: #f8fafc; }
.ai-chip {
  border: 1.2px solid #c7d2fe;
  background: #eef2ff;
  color: var(--primary);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}
.ai-chip:hover { background: #e0e7ff; }
.ai-input { display: flex; gap: 8px; padding: 10px 12px 12px; background: #f8fafc; border-top: 1px solid var(--border); }
.ai-input input {
  flex: 1;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
}
.ai-input input:focus { border-color: var(--primary); }
.ai-input button {
  border: none;
  background: var(--grad);
  color: #fff;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.ai-input button:disabled { opacity: .55; cursor: not-allowed; }

/* #endregion */

/* #region 16 Toast */
/* ==================== Toast ==================== */
#toast {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast-item {
  min-width: 240px;
  max-width: 380px;
  padding: 13px 18px;
  border-radius: 12px;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slidein .3s ease;
  white-space: pre-line;
  line-height: 1.6;
}
.toast-ok { background: linear-gradient(135deg, #10b981, #059669); }
.toast-err { background: linear-gradient(135deg, #f43f5e, #dc2626); }

@keyframes slidein {
  from { transform: translateX(40px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* #endregion */

/* #region 17 统计图表 */
/* ==================== 统计图表 ==================== */
.chart {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}
.bar-row {
  display: grid;
  grid-template-columns: 150px 1fr 90px;
  align-items: center;
  gap: 12px;
}
.bar-label {
  font-size: 13px;
  color: #475569;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-track {
  background: #eef2ff;
  border-radius: 999px;
  height: 20px;
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--grad);
  border-radius: 999px;
  min-width: 4px;
  transition: width .6s ease;
  box-shadow: 0 2px 8px rgba(99, 102, 241, .4);
}
.bar-value { font-size: 13px; font-weight: 700; color: #4338ca; }

/* #endregion */

/* #region 18 其他 */
/* ==================== 其他 ==================== */
.empty {
  text-align: center;
  color: #94a3b8;
  padding: 46px 0;
  font-size: 14px;
}

.ann-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 4px;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .12s;
  border-radius: 8px;
}
.ann-item:hover { background: #f8faff; }
.ann-item:last-child { border-bottom: none; }
.ann-item .ann-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--grad); flex-shrink: 0; }
.ann-item .ann-title { flex: 1; font-size: 14px; color: #1e293b; }
.ann-item .ann-time { color: #94a3b8; font-size: 12px; }

/* 公告管理(管理员表): 整行可点开全文 —— 标题做成"看起来能点"的样子, 行悬停沿用 .tbl 的底色 */
.ann-row { cursor: pointer; }
.ann-row .ann-link { color: var(--primary); border-bottom: 1px dashed currentColor; }
.ann-row:hover .ann-link { opacity: .75; }

.panel-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel-grid .span-2 { grid-column: span 2; }

.check-list {
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.check-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all .15s;
  user-select: none;
}
.check-item:hover { border-color: var(--primary); }
.check-item.checked {
  border-color: var(--primary);
  background: #eef2ff;
}
.check-item input { display: none; }
.check-item .ck-name { font-weight: 600; font-size: 13.5px; }
.check-item .ck-desc { color: #94a3b8; font-size: 12px; }

/* 操作输出: 浅色控制台面板, 与白色卡片同一套配色(不要深色终端框) */
.log-panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  background: #f8fafc;
}
.log-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--muted);
}
.log-panel-head::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary);
}

.log-box {
  padding: 12px 16px;
  font-family: Consolas, "Cascadia Mono", monospace;
  font-size: 13px;
  line-height: 1.85;
  color: #334155;
  min-height: 110px;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.role-row { cursor: pointer; }
.role-row.active { background: #eef2ff !important; }
.role-row.active td { color: #4338ca; font-weight: 600; }

/* #endregion */

/* #region 19 我的页: 个人信息横幅 / 帮助 */
/* ==================== 我的页: 个人信息横幅 / 帮助 ==================== */
.me-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #4338ca 0%, #6366f1 48%, #8b5cf6 100%);
  border-radius: var(--radius);
  padding: 26px 28px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  color: #fff;
  box-shadow: 0 12px 32px rgba(79, 70, 229, .35);
}
.me-hero::before,
.me-hero::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, .08);
}
.me-hero::before { width: 230px; height: 230px; top: -120px; right: 70px; }
.me-hero::after { width: 150px; height: 150px; bottom: -80px; left: 32%; }
.me-hero-main { display: flex; align-items: center; gap: 18px; position: relative; z-index: 1; }
.me-avatar-lg {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  flex-shrink: 0;
  background: rgba(255, 255, 255, .18);
  border: 2px solid rgba(255, 255, 255, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  font-weight: 700;
}
.me-id { flex: 1; min-width: 200px; }
.me-name { font-size: 22px; font-weight: 800; color: #fff; }
.me-no { font-size: 13px; font-weight: 500; color: rgba(255, 255, 255, .75); margin-left: 6px; }
.me-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.me-chip {
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
}
.me-hero-right {
  display: flex;
  align-items: center;
  gap: 16px;
  position: relative;
  z-index: 1;
  /* 原来这层有一记 backdrop-filter: blur(4px)。卡片底下是**平滑的线性渐变**, 模糊它等于没模糊;
     但这块卡片跟着页面入场动画一起位移, 每帧都要把背后的渐变重算一遍模糊, 白付 0.5 秒的代价。
     用略高一点的白色替代, 观感一致。 */
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .2);
  border-radius: 16px;
  padding: 14px 22px;
}
.me-ring { position: relative; width: 76px; height: 76px; flex-shrink: 0; }
.me-ring-num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
}
.me-ring-meta .big { font-size: 15px; font-weight: 700; }
.me-ring-meta .sm { font-size: 12px; color: rgba(255, 255, 255, .82); margin-top: 5px; line-height: 1.7; }
.me-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin-bottom: 18px; }
.me-block { padding: 18px 20px; display: flex; flex-direction: column; }
.me-block-head { font-size: 14.5px; font-weight: 700; color: #1e293b; margin-bottom: 12px; }
.me-rows { flex: 1; margin-bottom: 12px; }
.me-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 7px 0; font-size: 13.5px; color: #64748b;
  border-bottom: 1px dashed #f1f5f9;
}
.me-row:last-child { border-bottom: none; }
.me-row b { color: #1e293b; font-size: 14px; }

/* 联系我们: 标签与内容左对齐排列 */
.me-rows.contact .me-row { justify-content: flex-start; gap: 18px; }
.me-rows.contact .me-row span:first-child { min-width: 74px; flex-shrink: 0; }
.me-rows.contact .me-row b { font-weight: 600; }

/* 可点击的行(信用分等) */
.me-row-link { cursor: pointer; border-radius: 8px; margin: 0 -6px; padding-left: 6px !important; padding-right: 6px !important; transition: background .12s; }
.me-row-link:hover { background: #f1f5f9; }
.me-tip {
  font-size: 12px; color: #94a3b8; line-height: 1.8;
  background: #f8fafc; border-radius: 10px; padding: 10px 12px;
}
.card.me-block { box-shadow: var(--shadow); background: var(--card); border-radius: var(--radius); }

/* #endregion */

/* #region 20 管理员首页: 数据总览(浅色科技风) */
/* ============================================================
   管理员首页: 数据总览(浅色科技风)
   — 每个管理员角色按权限拼装自己的面板; data-theme 决定主色
   ============================================================ */
.ck {
  --ck1: 139, 92, 246;      /* 主色( rgb 分量, 便于拼 alpha ) */
  --ck2: 34, 211, 238;      /* 辅色 */
  --ckd: #6d28d9;           /* 深主色( 浅底上保证文字可读 ) */
  margin: -22px -24px -40px;
  padding: 22px 24px 40px;
  min-height: calc(100vh - 60px);
  color: #334155;
  background:
    radial-gradient(1100px 520px at 8% -12%, rgba(var(--ck1), .14), transparent 62%),
    radial-gradient(900px 460px at 102% -6%, rgba(var(--ck2), .10), transparent 58%),
    linear-gradient(180deg, #f7f9ff 0%, #eef2fb 55%, #f5f7fd 100%);
}
/* 主题色同时作用于面板(.ck)与下钻弹窗内容(.ck-mdl), 让弹窗配色跟着当前角色走 */
.ck-mdl { --ck1: 139, 92, 246; --ck2: 192, 132, 252; --ckd: #6d28d9; }
.ck[data-theme="violet"], .ck-mdl[data-theme="violet"]   { --ck1: 139, 92, 246;  --ck2: 192, 132, 252; --ckd: #6d28d9; }
.ck[data-theme="cyan"], .ck-mdl[data-theme="cyan"]       { --ck1: 34, 211, 238;  --ck2: 56, 189, 248;  --ckd: #0e7490; }
.ck[data-theme="emerald"], .ck-mdl[data-theme="emerald"] { --ck1: 16, 185, 129;  --ck2: 52, 211, 153; --ckd: #047857; }
.ck[data-theme="amber"], .ck-mdl[data-theme="amber"]     { --ck1: 245, 158, 11;  --ck2: 251, 191, 36;  --ckd: #b45309; }
.ck[data-theme="rose"], .ck-mdl[data-theme="rose"]       { --ck1: 244, 63, 94;   --ck2: 251, 113, 133; --ckd: #be123c; }
.ck[data-theme="pink"], .ck-mdl[data-theme="pink"]       { --ck1: 236, 72, 153;  --ck2: 244, 114, 182; --ckd: #be185d; }
.ck[data-theme="indigo"], .ck-mdl[data-theme="indigo"]   { --ck1: 99, 102, 241;  --ck2: 129, 140, 248; --ckd: #4338ca; }
.ck[data-theme="sky"], .ck-mdl[data-theme="sky"]         { --ck1: 14, 165, 233;  --ck2: 125, 211, 252; --ckd: #0369a1; }
.ck[data-theme="slate"], .ck-mdl[data-theme="slate"]     { --ck1: 100, 116, 139; --ck2: 148, 163, 184; --ckd: #475569; }

/* ---------- 顶部横幅 ---------- */
.ck-hero {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  padding: 22px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  background: linear-gradient(120deg, rgba(var(--ck1), .16), rgba(var(--ck2), .08) 62%, rgba(255, 255, 255, .55));
  border: 1px solid rgba(var(--ck1), .22);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .10), inset 0 1px 0 rgba(255, 255, 255, .8);
  animation: ck-up .6s ease both;
}
.ck-hero-glow {
  position: absolute;
  inset: -45% -15%;
  /* 原来是两层径向渐变再套 filter: blur(26px) —— 渐变本身就很柔和, 这层模糊只是白烧
     大块光栅(还是 15s 无限缩放的层)。去掉模糊, 只留渐变, 观感一致、代价大降。 */
  background:
    radial-gradient(closest-side, rgba(var(--ck1), .30), transparent 70%) 22% 40% / 55% 90% no-repeat,
    radial-gradient(closest-side, rgba(var(--ck2), .22), transparent 70%) 78% 62% / 50% 85% no-repeat;
  animation: ck-drift 15s ease-in-out infinite;
  will-change: transform;
  pointer-events: none;
}
.ck-hero-grid {
  position: absolute;
  inset: 0;
  /* 网格线挪到 ::before 上做 transform 平移(见下), 这里只留固定的渐隐遮罩并裁掉溢出,
     遮罩不再跟着动, 视觉和原来完全一致 */
  -webkit-mask-image: radial-gradient(120% 130% at 50% 0, #000 25%, transparent 78%);
  mask-image: radial-gradient(120% 130% at 50% 0, #000 25%, transparent 78%);
  overflow: hidden;
  opacity: .6;
  pointer-events: none;
}
/* 网格扫描: 以前动画的是 background-position —— 每帧都要把整块遮罩区域重绘一次,
   低配机上这是最典型的一处掉帧源。改成只对伪元素做 translateY 平移:
   图案周期正好等于一格 36px, 平移一格后无缝循环; 上下各多铺一格保证平移时不露边。
   transform 走合成层, 不再产生任何重绘。 */
.ck-hero-grid::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  top: -36px;
  bottom: -36px;
  background-image:
    linear-gradient(rgba(15, 23, 42, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, .05) 1px, transparent 1px);
  background-size: 36px 36px;
  animation: ck-scan 9s linear infinite;
  will-change: transform;
}
.ck-hero-main { position: relative; z-index: 1; flex: 1 1 auto; min-width: 0; }
.ck-hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  letter-spacing: 1.5px;
  color: var(--ckd);
  background: rgba(255, 255, 255, .75);
  border: 1px solid rgba(var(--ck1), .28);
  border-radius: 999px;
  padding: 4px 12px;
}
.ck-hi { font-size: 23px; font-weight: 700; letter-spacing: 1px; margin: 12px 0 6px; color: #0f172a; }
.ck-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ck-chip {
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 9px;
  color: #334155;
  background: rgba(255, 255, 255, .8);
  border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
  transition: transform .2s, border-color .2s, background .2s;
}
.ck-chip:hover { transform: translateY(-2px); border-color: rgba(var(--ck1), .5); background: rgba(var(--ck1), .08); }
.ck-chip b { color: #0f172a; font-weight: 600; }

.ck-clock { position: relative; z-index: 1; text-align: right; min-width: 200px; flex: 0 0 auto; margin-left: auto; }
.ck-clock-time {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 2px;
  font-variant-numeric: tabular-nums;
  color: #0f172a;
  text-shadow: 0 0 18px rgba(var(--ck1), .28);
}
.ck-clock-date { font-size: 12.5px; color: #64748b; margin-top: 2px; }
.ck-live { display: inline-flex; align-items: center; gap: 7px; margin-top: 10px; font-size: 12px; color: #475569; }
.ck-refresh { margin-top: 11px; }
.ck-btn {
  font-family: inherit;
  font-size: 12.5px;
  color: #fff;
  background: linear-gradient(135deg, rgb(var(--ck1)), rgb(var(--ck2)));
  border: none;
  border-radius: 9px;
  padding: 6px 14px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(var(--ck1), .35);
  transition: filter .2s, transform .15s;
}
.ck-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }

/* 呼吸指示灯: 原实现动画 box-shadow 的扩散半径 —— box-shadow 不进合成层, 每帧都要重绘;
   总览页同时有 9 个在转, 持续占着重绘预算。改成伪元素"扩散环": 圆环 scale + 淡出,
   只碰 transform/opacity, 走合成层。环与圆点同色且叠在圆点上, 观感与原来的阴影扩散一致。 */
.ck-pulse {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgb(var(--ck2));
  flex-shrink: 0;
}
.ck-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgb(var(--ck2));
  animation: ck-pulse 2s ease-out infinite;
}
.ck-pulse.warn { background: #fbbf24; }
.ck-pulse.warn::after { background: #fbbf24; }
.ck-pulse.err { background: #fb7185; }
.ck-pulse.err::after { background: #fb7185; }

/* ---------- 指标卡 ---------- */
.ck-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); gap: 16px; margin: 16px 0; }
.ck-kpi {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  padding: 15px 17px 13px;
  display: flex;
  flex-direction: column;
  justify-content: center;   /* 同行卡片等高时, 内容垂直居中不留空档 */
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e6eaf3;
  box-shadow: var(--shadow);
  animation: ck-up .55s both;
  animation-delay: calc(var(--i) * 70ms);
  transition: transform .25s, border-color .25s, box-shadow .25s;
}
.ck-kpi:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--ck1), .45);
  box-shadow: 0 14px 30px rgba(15, 23, 42, .12);
}
.ck-kpi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ck-kpi-ico { font-size: 17px; opacity: .95; }
.ck-kpi-num {
  font-size: 29px;
  font-weight: 700;
  letter-spacing: .5px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(180deg, #0f172a 30%, var(--ckd));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.ck-kpi-num .u { font-size: 16px; margin-right: 1px; }
.ck-kpi-label { font-size: 12.5px; color: #64748b; margin-top: 3px; }
.ck-spark { display: block; width: 100%; height: 30px; margin-top: 8px; opacity: .9; }
.ck-spark path {
  fill: none;
  stroke: rgb(var(--ck1));
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  animation: ck-draw 1.5s .35s ease forwards;
}

/* ---------- 卡片 ---------- */
.ck-row { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 16px; }
.ck-row:last-child { margin-bottom: 0; }
.ck-card {
  flex: 1 1 330px;
  min-width: 0;
  border-radius: 16px;
  padding: 16px 18px;
  background: rgba(255, 255, 255, .92);
  border: 1px solid #e6eaf3;
  box-shadow: var(--shadow);
  animation: ck-up .6s both;
  animation-delay: calc(var(--i) * 70ms);
  transition: border-color .25s, box-shadow .25s;
}
.ck-card:hover { border-color: rgba(var(--ck1), .4); box-shadow: 0 14px 32px rgba(15, 23, 42, .12); }
.ck-w2 { flex-grow: 1.7; }
.ck-w3 { flex-grow: 2.6; }
.ck-full { flex-basis: 100%; }
.ck-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.ck-title { font-size: 14px; font-weight: 600; color: #0f172a; display: flex; align-items: center; gap: 8px; letter-spacing: .5px; }
.ck-title::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgb(var(--ck2)), rgb(var(--ck1)));
  box-shadow: 0 0 8px rgba(var(--ck1), .5);
}
.ck-note { font-size: 11.5px; color: #94a3b8; }

/* 环形图 */
.ck-donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.ck-donut { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ck-donut svg { transform: rotate(-90deg); }
.ck-donut circle { fill: none; stroke-width: 11; }
.ck-donut .ck-track { stroke: #eef2f7; }
.ck-seg { transition: stroke-dasharray 1s cubic-bezier(.2, .8, .2, 1); }
.ck-donut-mid {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.ck-donut-mid b { font-size: 26px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.ck-donut-mid span { font-size: 11.5px; color: #94a3b8; }
.ck-legend { flex: 1; min-width: 158px; display: flex; flex-direction: column; gap: 9px; }
.ck-legend-item { display: flex; align-items: center; gap: 9px; font-size: 12.5px; color: #334155; }
.ck-legend-dot { width: 9px; height: 9px; border-radius: 3px; flex-shrink: 0; }
.ck-legend-item b { color: #0f172a; font-variant-numeric: tabular-nums; }
.ck-legend-bar { flex: 1; height: 5px; border-radius: 3px; background: #edf1f7; overflow: hidden; }
/* 进度条从 width 过渡改成 transform: scaleX —— width 每帧都要重排重绘, scaleX 走合成层。
   属性选择器只圈"带动画"的那支(带 data-w): 静态渲染的那支靠内联 width 定宽, 不加 scale。 */
.ck-legend-bar i { display: block; height: 100%; width: 100%; border-radius: 3px; }
.ck-legend-bar i[data-w] {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}

/* 柱状趋势 */
.ck-bars { display: flex; align-items: flex-end; gap: 10px; height: 158px; }
.ck-bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 7px; height: 100%; }
.ck-bar-track { width: 100%; flex: 1; display: flex; align-items: flex-end; }
.ck-bar-fill {
  width: 100%;
  height: 100%;
  align-self: stretch;   /* 铺满轨道高度, 再靠 scaleY 表现"长出来" */
  border-radius: 7px 7px 3px 3px;
  background: linear-gradient(180deg, rgb(var(--ck2)), rgba(var(--ck1), .45));
  box-shadow: 0 0 16px rgba(var(--ck2), .30);
}
/* 柱状图从 height 过渡改成 scaleY(合成层动画), 底部为原点向上长 */
.ck-bar-fill[data-h] {
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}
.ck-bar:hover .ck-bar-fill { box-shadow: 0 0 22px rgba(var(--ck1), .5); }
.ck-bar-val { font-size: 12px; color: #334155; font-variant-numeric: tabular-nums; }
.ck-bar-lbl { font-size: 11px; color: #94a3b8; }

/* 排行榜 */
.ck-rank { display: flex; flex-direction: column; gap: 11px; }
.ck-rank-item { display: flex; align-items: center; gap: 10px; }
.ck-rank-no {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11.5px;
  font-weight: 700;
  color: #475569;
  background: #e8edf5;
}
.ck-rank-item:nth-child(1) .ck-rank-no { background: linear-gradient(135deg, #fde047, #f59e0b); box-shadow: 0 0 14px rgba(251, 191, 36, .55); }
.ck-rank-item:nth-child(2) .ck-rank-no { background: linear-gradient(135deg, #e2e8f0, #94a3b8); }
.ck-rank-item:nth-child(3) .ck-rank-no { background: linear-gradient(135deg, #fdba74, #c2703f); }
.ck-rank-main { flex: 1; min-width: 0; }
.ck-rank-top { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.ck-rank-name { color: #0f172a; font-weight: 600; }
.ck-rank-sub { color: #94a3b8; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ck-rank-val { margin-left: auto; color: var(--ckd); font-size: 12px; font-variant-numeric: tabular-nums; }
.ck-rank-bar { height: 5px; border-radius: 3px; background: #edf1f7; margin-top: 6px; overflow: hidden; }
.ck-rank-bar i {
  display: block;
  height: 100%;
  width: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, rgb(var(--ck1)), rgb(var(--ck2)));
}
/* 同 .ck-legend-bar: 动画支用 scaleX, 静态支(内联 width)不加 transform */
.ck-rank-bar i[data-w] {
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .9s cubic-bezier(.2, .8, .2, 1);
}

/* 动态流: 不限高, 条目全部直接显示在卡片内 */
.ck-feed { display: flex; flex-direction: column; gap: 2px; }
.ck-feed-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  border-radius: 9px;
  font-size: 12.5px;
  color: #334155;
  border-bottom: 1px dashed rgba(15, 23, 42, .08);
  animation: ck-in .5s both;
  animation-delay: calc(var(--i) * 55ms);
  transition: background .2s;
}
.ck-feed-item:hover { background: rgba(var(--ck1), .07); }
.ck-feed-item:last-child { border-bottom: none; }
.ck-feed-time { margin-left: auto; font-size: 11px; color: #94a3b8; white-space: nowrap; }
.ck-tagx {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(var(--ck1), .10);
  border: 1px solid rgba(var(--ck1), .25);
  color: var(--ckd);
  white-space: nowrap;
}
.ck-tagx.muted { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }

/* 迷你指标 */
.ck-mini { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 10px; }
.ck-mini-item {
  border-radius: 11px;
  padding: 10px 12px;
  background: #f8fafc;
  border: 1px solid #edf1f7;
  transition: transform .2s, border-color .2s;
}
.ck-mini-item:hover { transform: translateY(-3px); border-color: rgba(var(--ck1), .45); }
.ck-mini-val { font-size: 19px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.ck-mini-lbl { font-size: 11.5px; color: #64748b; margin-top: 2px; }

/* 公告 */
.ck-ann { display: flex; flex-direction: column; }
.ck-ann-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13px;
  color: #334155;
  border-bottom: 1px dashed rgba(15, 23, 42, .08);
  animation: ck-in .5s both;
  animation-delay: calc(var(--i) * 55ms);
  transition: background .2s, padding-left .2s;
}
.ck-ann-item:hover { background: rgba(var(--ck1), .07); padding-left: 14px; }
.ck-ann-item:last-child { border-bottom: none; }
.ck-ann-dot { width: 6px; height: 6px; border-radius: 50%; background: rgb(var(--ck1)); box-shadow: 0 0 6px rgba(var(--ck1), .6); flex-shrink: 0; }
.ck-ann-time { margin-left: auto; font-size: 11px; color: #94a3b8; }

/* 系统状态 */
.ck-sys { display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; }
.ck-sys-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #475569; }
.ck-sys-item b { color: #0f172a; font-variant-numeric: tabular-nums; }
.ck-empty { text-align: center; padding: 24px 10px; color: #94a3b8; font-size: 13px; line-height: 1.9; }

/* ---------- 动画 ---------- */
@keyframes ck-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes ck-in { from { opacity: 0; transform: translateX(-10px); } to { opacity: 1; transform: none; } }
@keyframes ck-drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(5%, -4%) scale(1.1); }
}
@keyframes ck-scan { from { transform: translateY(0); } to { transform: translateY(36px); } }
@keyframes ck-draw { to { stroke-dashoffset: 0; } }
@keyframes ck-pulse {
  /* 8px 圆点扩到约 26px(阴影 9px 扩散半径的等价尺寸)并淡出, 与旧版 box-shadow 观感一致 */
  0% { transform: scale(1); opacity: .55; }
  70% { transform: scale(3.25); opacity: 0; }
  100% { transform: scale(3.25); opacity: 0; }
}

@media (max-width: 900px) {
  .ck { margin: -16px -14px -24px; padding: 16px 14px 24px; }
  .ck-hero { flex-wrap: wrap; }
  .ck-clock { text-align: left; }
  .ck-hi { font-size: 20px; }
  .hero { flex-wrap: wrap; gap: 14px; }
  .hero-clock { text-align: left; }
  .hero-clock-time { font-size: 25px; }
}

/* 尊重系统"减少动态效果"设置 */
@media (prefers-reduced-motion: reduce) {
  .ck, .ck *, #content > *, #content .swap-in { animation-duration: .001ms !important; animation-delay: 0ms !important; transition-duration: .001ms !important; }
}

/* #endregion */

/* #region 21 数据总览: 点击下钻 */
/* ============================================================
   数据总览: 点击下钻
   — 面板与弹窗里的 data-drill 元素统一给出手型光标与悬停反馈,
     弹窗内容(.ck-mdl)复用面板的配色变量与表格样式
   ============================================================ */
[data-drill] { cursor: pointer; }
/* 总览「学生咨询」卡片里的一行: 可点(点开与该学生的聊天) */
[data-consult] { cursor: pointer; }
/* 未读会话前面的小红点 */
.ck-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ef4444;
  flex-shrink: 0;
}

.ck-chip-go { margin-left: 5px; font-style: normal; font-weight: 700; opacity: .45; transition: transform .18s, opacity .18s; }
.ck-chip:hover .ck-chip-go { opacity: 1; transform: translateX(2px); }
.ck-kpi .ck-kpi-top::after {
  content: '明细 ›';
  font-size: 10.5px;
  color: #94a3b8;
  opacity: 0;
  transition: opacity .18s;
}
.ck-kpi:hover .ck-kpi-top::after { opacity: 1; }
.ck-legend-item:hover { color: var(--ckd); }
.ck-legend-item:hover .ck-legend-bar i { filter: brightness(1.08); }
.ck-seg { cursor: pointer; }
.ck-seg:hover { stroke-width: 13.5; }
.ck-sys-item:hover { color: var(--ckd); }
.ck-donut-mid:hover b { color: var(--ckd); }

/* ---------- 下钻弹窗内容 ---------- */
.ck-mdl { color: #334155; }
.ck-mdl-hd { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }

/* #endregion */

/* #region 22 学生资料卡 */
/* ============================================================
   学生资料卡(点名字看) —— showStudentProfile()
   见 app.js; 4 个数据格子 + 下面的明细行
   ============================================================ */
.sp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.sp-cell {
  background: #f8fafc; border: 1px solid #eef2f7; border-radius: 11px;
  padding: 10px 8px; text-align: center;
}
.sp-lbl { font-size: 11.5px; color: #94a3b8; margin-bottom: 5px; }
.sp-val { font-size: 18px; font-weight: 700; color: #1e293b; line-height: 1.25; }
/* 平均评价那格内容长(星星+分数+次数), 放大会撑破, 单独缩小 */
.sp-val-sm { font-size: 13px; font-weight: 600; }
.sp-stars { color: #f59e0b; letter-spacing: -1px; }
.sp-sub { font-size: 11.5px; font-weight: 400; color: #94a3b8; }
.sp-self {
  font-size: 11.5px; font-weight: 600; color: #4338ca; background: #eef2ff;
  border-radius: 6px; padding: 2px 6px; margin-left: 8px; vertical-align: middle;
}
.sp-off {
  font-size: 11.5px; font-weight: 600; color: #b91c1c; background: #fef2f2;
  border-radius: 6px; padding: 2px 6px; margin-left: 8px; vertical-align: middle;
}
/* 可点击的学生姓名(达人榜、订单里的发布人/代取人、我发布的里的代取人) */
.name-link {
  color: #4338ca; font-weight: 600; cursor: pointer;
  border-bottom: 1px dashed #c7d2fe; transition: color .15s, border-color .15s;
}
.name-link:hover { color: #6d28d9; border-bottom-color: #6d28d9; }
.txt-dim { color: #cbd5e1; }
.txt-ok { color: #0f766e; font-size: 12.5px; }

.ck-mdl-ico {
  width: 42px; height: 42px; flex-shrink: 0;
  border-radius: 12px; display: grid; place-items: center; font-size: 20px;
  background: rgba(var(--ck1), .12);
  border: 1px solid rgba(var(--ck1), .22);
}
.ck-mdl-name { font-size: 17.5px; font-weight: 700; color: #0f172a; }
.ck-mdl-code { font-size: 13px; color: #94a3b8; margin-top: 3px; }
.ck-mdl-title { font-size: 17.5px; font-weight: 700; color: #0f172a; margin-bottom: 6px; }
.ck-mdl-text { font-size: 14.5px; color: #334155; line-height: 1.9; white-space: pre-wrap; }
.ck-mdl-note { font-size: 13.5px; color: #64748b; line-height: 1.9; margin-bottom: 10px; }
.ck-mdl-lock {
  font-size: 13.5px; line-height: 1.8;
  color: #b45309; background: #fffbeb;
  border: 1px solid #fde68a; border-radius: 9px;
  padding: 9px 12px; margin-top: 14px;
}
.ck-mdl-sec {
  display: flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 600; color: #0f172a;
  margin: 18px 0 10px;
}
.ck-mdl-sec::before { content: ''; width: 3px; height: 13px; border-radius: 2px; background: rgb(var(--ck1)); }
.ck-mdl-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(126px, 1fr)); gap: 10px; }
.ck-mdl-stat { background: #f8fafc; border: 1px solid #eef2f7; border-radius: 11px; padding: 10px 12px; }
.ck-mdl-stat b { display: block; font-size: 19px; font-weight: 700; color: #0f172a; font-variant-numeric: tabular-nums; }
.ck-mdl-stat span { font-size: 12.5px; color: #64748b; }
.ck-mdl-feats { display: flex; flex-direction: column; gap: 8px; }
.ck-mdl-feat { display: flex; gap: 9px; font-size: 13.5px; line-height: 1.75; }
.ck-mdl-feat b { color: rgb(var(--ck1)); }
.ck-mdl-kv { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 6px 20px; }
.ck-mdl-kvi {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: 13.5px; color: #334155;
  border-bottom: 1px dashed #eef2f7; padding: 8px 0;
}
.ck-mdl-kvi span { color: #94a3b8; }
.ck-mdl .ck-legend { margin-top: 2px; }
.ck-mdl .ck-legend-item { padding: 4px 0; border-radius: 7px; }
.ck-td-wrap { white-space: normal; display: inline-block; max-width: 300px; }
/* 弹窗里的表格也跟着放大一档, 行高更松快 */
.ck-mdl .tbl { font-size: 14.5px; }
.ck-mdl .tbl th, .ck-mdl .tbl td { padding: 12px 13px; }
.ck-rowlink:hover td { background: rgba(var(--ck1), .07); }

/* 弹窗表格: 被点中的那一行 / 合计行 */
.ck-mdl .ck-row-hl td {
  background: rgba(var(--ck1), .14);
  color: var(--ckd);
  font-weight: 700;
}
.ck-mdl .ck-row-hl td:first-child { box-shadow: inset 3px 0 0 rgb(var(--ck1)); }
.ck-mdl .ck-row-total td {
  background: #f8fafc;
  font-weight: 700;
  color: #0f172a;
  border-top: 1px solid var(--border);
}

/* #endregion */

/* #region 23 移动端适配(手机 / 平板 / 触摸屏)
   ------------------------------------------------------------
   设计原则:
     1) 桌面端观感一个像素都不动 —— 全部改动都关在媒体查询里;
     2) ≤820px: 侧边栏变成"抽屉"(汉堡按钮 + 遮罩), 顶栏收紧;
     3) ≤700px: 弹窗/聊天窗/小邮面板改成"底部卡片(近全屏)", 表单单列,
        输入框字号 ≥16px(否则 iOS Safari 会自动放大页面);
     4) 触摸屏(pointer: coarse): 加大可点区域, 去掉只能用鼠标的交互
        (拖动缩放窗口等, 见 app.js 的移动端分支)。
   断点说明: 820 用于"横向宽度不够放侧边栏+内容"的平板竖屏;
             700 用于手机(横向真的放不下两列表单/居中小窗)。
   ============================================================ */

/* ---------- 移动端才用到的元素(桌面端不显示) ---------- */
.menu-btn {
  display: none;                        /* 桌面端隐藏, ≤820px 显示 */
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #334155;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex: none;
}
.menu-btn:active { background: #eef2ff; border-color: var(--primary); color: var(--primary); }

.topbar-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-left .page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sb-overlay { display: none; }          /* 抽屉遮罩: 只在 ≤820px 且抽屉开着时出现 */

/* ---------- 视口高度: 手机上用 dvh 规避"地址栏吃掉 100vh" ---------- */
@supports (height: 100dvh) {
  #app, .main, .sidebar { min-height: 100dvh; }
}

/* ---------- 触摸屏(手机/平板): 加大可点区域 ---------- */
@media (pointer: coarse) {
  .nav-item { padding: 13px 12px; }
  .btn-sm { padding: 9px 12px; }
  .tabs button { padding: 10px 15px; }
  .ai-hbtn, .msg-hbtn { height: 32px; padding: 0 12px; font-size: 12.5px; }
  .modal-close { width: 38px; height: 38px; font-size: 16px; }
  .pwd-eye { width: 44px; }
  .ev-star { font-size: 30px; }
  .rc-chip { padding: 12px 0; }
  .credit-link { display: inline-block; padding: 3px 0; }
  /* 拖动/缩放手柄是鼠标专属交互, 触摸设备隐藏(见 app.js 的移动端分支) */
  .ai-resize { display: none; }
  .ai-head, .msg-head { cursor: default !important; }
}

/* ==================== ≤820px: 抽屉式侧边栏 ==================== */
@media (max-width: 820px) {
  /* 侧边栏: 移出屏幕外, 打开时滑入。z-index 抬到顶栏/图标之上, 压住悬浮按钮 */
  .sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(78vw, 300px);
    z-index: 170;
    transform: translateX(-100%);
    transition: transform .26s cubic-bezier(.3, .9, .3, 1);
    box-shadow: 0 0 0 rgba(15, 23, 42, 0);
  }
  .sidebar.mobile-open {
    transform: none;
    box-shadow: 0 18px 60px rgba(15, 23, 42, .45);
  }
  /* 抽屉遮罩: 点一下收起菜单 */
  .sb-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 165;
  }

  .main { margin-left: 0; }

  .menu-btn { display: inline-flex; }

  .topbar {
    height: 54px;
    padding: 0 12px;
    gap: 8px;
  }
  .user-chip { padding: 4px 6px; }
  .topbar-right { gap: 6px; }
  .topbar-right .user-meta { display: none; }      /* 只留头像, 省横向空间 */
  .topbar-right .btn-label { display: none; }      /* 「修改密码/退出登录」只留图标 */

  #content {
    padding: 14px 12px calc(96px + env(safe-area-inset-bottom, 0px));
  }

  /* 工具栏里的定宽输入框改成弹性宽度, 不再横向溢出 */
  .toolbar input { width: auto; flex: 1 1 130px; min-width: 0; }
  .hall-search { flex: 1 1 100%; }
  .hall-search input { width: auto; flex: 1; min-width: 0; }

  /* 双栏面板(角色与权限等: .panel-grid 的「角色列表 | 权限分配」): 手机上收成单列。
     ⚠️ 卡片必须 min-width:0 —— grid 子项默认 min-width:auto, 会被里面的表格(最小 640px)
     顶宽, 卡片跟着撑到 600px+, 整页横向滚动(实测角色页溢出 369px)。 */
  .panel-grid { grid-template-columns: 1fr; }
  .panel-grid .span-2 { grid-column: auto; }
  .panel-grid > .card { min-width: 0; }
  .card-head { flex-wrap: wrap; }
  .card-head h2 { min-width: 0; }

  /* 兜底: 手机上任何页面都不整页横向滚动。
     用 overflow-x: clip 而不是 hidden —— clip 不会把 #content 变成滚动容器,
     window 的纵向滚动与"刷新后恢复滚动位置"的逻辑都保持不变。 */
  #content { overflow-x: clip; }

  /* 标签组(订单大厅四个 tab 这类): 放不下就横向滑动, 不换行挤压 */
  .tabs {
    display: flex;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .tabs::-webkit-scrollbar { width: 0; height: 0; }
  .tabs button { white-space: nowrap; flex: none; }

  /* 订单大厅: 标签组独占一整行并在内部横滑, 搜索框/实时刷新换行, 发布按钮通栏。
     ⚠️ 必须给 .tabs 加 min-width: 0 + flex-basis 100%: flex 子项默认不会缩到内容宽以下,
     标签按内容宽(约 500px)把整行撑破, 会让**整个页面**横向滚动 —— 实测踩到过。 */
  .toolbar { width: 100%; }
  .hall-left { width: 100%; flex: 1 1 100%; }
  .hall-left .tabs { flex: 1 1 100%; min-width: 0; }
  .toolbar > #btn-publish { flex: 1 1 100%; }

  /* 弹窗里的大表格(数据总览下钻等)跟着窄屏收窄 */
  .modal-body .tbl { min-width: 520px; }

  /* 首页/工作台的指标卡: 4 列在手机上每张只剩 ~84px, 文字会被挤成一列一个字的"竖排"。
     改成 2×2, 并把图标和内边距收一档, 数字仍然醒目。 */
  .kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .kpi { padding: 14px; gap: 10px; }
  .kpi .kpi-icon { width: 40px; height: 40px; font-size: 18px; border-radius: 11px; }
  .kpi .kpi-num { font-size: 21px; }
}

/* ==================== ≤700px: 手机(竖屏) ==================== */
@media (max-width: 700px) {
  /* ---------- 登录页: 卡片贴满宽度, 键盘弹出时可滚动 ---------- */
  #login-page {
    padding: 18px 14px calc(18px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
  }
  .login-card {
    width: 100%;
    max-width: 430px;
    margin: auto;                      /* 用 margin:auto 居中: 内容超高时顶部也能滚到 */
    padding: 26px 20px 20px;
    border-radius: 20px;
  }
  .login-logo { width: 54px; height: 54px; font-size: 27px; border-radius: 15px; }
  .login-card h1 { font-size: 19px; }
  .login-sub { font-size: 12.5px; }
  .captcha-box { width: 112px; }
  .login-foot a { display: inline-block; padding: 6px 2px; }

  /* ---------- 字号: 输入框 ≥16px, 否则 iOS 聚焦时自动放大整页 ---------- */
  input, select, textarea { font-size: 16px; }
  .toolbar input, .toolbar select, .hall-search input { font-size: 16px; }

  /* ---------- 弹窗: 底部卡片, 近全屏, 按钮通栏(拇指好点) ---------- */
  .modal-overlay { align-items: flex-end; }
  .modal {
    /* !important: openModal(wide) 会给 .modal 写内联 width:960px, 内联样式优先于媒体查询 */
    width: 100vw !important;
    max-width: 100vw !important;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    animation: sheet-up .28s cubic-bezier(.22, 1, .36, 1);
  }
  @keyframes sheet-up {
    from { transform: translateY(28px); opacity: .6; }
    to { transform: none; opacity: 1; }
  }
  .modal-head { padding: 16px 16px 10px; }
  .modal-head h3 { font-size: 15.5px; }
  .modal-body {
    padding: 4px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    -webkit-overflow-scrolling: touch;
  }
  .modal-body .tbl { min-width: 460px; }
  .modal-actions { flex-direction: column; }
  .modal-actions .btn, .modal-actions .btn-primary, .modal-actions .btn-danger {
    width: 100%;
    padding: 13px;
    font-size: 15px;
  }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .span-2 { grid-column: auto; }

  /* ---------- 表格: 收窄列距, 保留横向滑动(表格列多的页面还是滑着看最清楚) ---------- */
  .tbl { min-width: 560px; font-size: 13px; }
  .tbl th, .tbl td { padding: 9px 10px; }
  .tbl-stu th, .tbl-stu td { padding: 9px 8px; }
  .tbl-wrap { -webkit-overflow-scrolling: touch; }

  /* ---------- 小邮(AI 助手): 底部卡片 ---------- */
  .ai-panel {
    /* !important: 桌面端 JS 会写内联 left/top/width/height(拖动/缩放用), 手机上全部作废。
       max-width 也要一起覆盖: 基类的 calc(100vw - 40px) 会把底部卡片收窄 40px, 右边留缝。 */
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    /* 键盘弹起时 --kb 会被 JS 写成键盘高度(app.js 的 syncKeyboardLayout): 整张卡片抬到键盘上方,
       输入行正好压在键盘上沿, 输入框上方就是最新一条消息 —— 否则键盘会把输入行和消息一起盖住。
       没弹键盘时 --kb 是 0, 与原来的 bottom: 0 完全一致。 */
    bottom: var(--kb, 0px) !important;
    width: auto !important;
    max-width: none !important;
    height: 76dvh;
    height: min(76dvh, calc(100dvh - var(--kb, 0px)));   /* 老浏览器不认 min() 就用上一行 */
    max-height: 92dvh;
    min-width: 0;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .ai-input input { font-size: 16px; }
  .ai-fab {
    right: 16px;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 54px;
    height: 54px;
    font-size: 24px;
  }

  /* ---------- 站内消息/聊天窗: 底部卡片(压过原有的"近全屏居中") ---------- */
  .msg-panel {
    width: 100vw;
    height: 86dvh;
    border-radius: 18px 18px 0 0;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .msg-input input { font-size: 16px; }
  .dm-search input { font-size: 16px; }

  /* ---------- 侧边栏抽屉: 手机上加宽一点, 更接近原生抽屉手感 ---------- */
  .sidebar { width: min(84vw, 320px); }
  .side-logo { padding: 16px 16px 14px; }
  .side-nav { padding: 12px 10px; }

  /* 学生资料卡的 4 个数据格子 → 2×2(窄屏 4 列会把"平均评价"那格挤破) */
  .sp-grid { grid-template-columns: repeat(2, 1fr); }
}

/* #endregion */

/* #region 24 手机端体验重做(底部导航 / 更小的图标 / 微信式聊天 / 表格转卡片)
   ------------------------------------------------------------
   用户反馈(2026-10-10):
     1) 手机上图标/字号整体偏大 —— 手机离眼睛近, 不能照搬桌面的尺寸;
     2) 切页面要点左上角 ☰, 希望改成主流 App 那样"底部固定一栏";
     3) 聊天要参考微信;
     4) 「所有订单」不要一行显示全部信息(竖屏放不下)。
   本区的规则**全部只在 ≤820px / ≤700px 生效**, 桌面端一个像素都不动。
   ============================================================ */

/* ---------- 底部导航栏(≤820px 显示; 桌面端由 .tabbar{display:none} 隐藏) ---------- */
.tabbar { display: none; }

@media (max-width: 820px) {
  .tabbar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    /* ⚠️ 高度必须把"底部安全区"加在 52px **之外**(height + padding-bottom 那种写法都不行):
       全局 * { box-sizing: border-box } 下, 52px 里再塞 safe-area(iPhone 带指示条是 34px),
       留给图标的就只有 18px —— 图标被上下裁一半、文字标签整个挤出屏幕(用户拿 iPhone 反馈过)。
       现在整条 = 52px 图标区 + 34px 安全区, 图标仍居中在 52px 里。 */
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, .97);
    border-top: 1px solid var(--border);
    box-shadow: 0 -2px 14px rgba(15, 23, 42, .06);
    z-index: 90;   /* 内容之上; 抽屉(170)/小邮(151)/聊天(160)/弹窗(190) 都在它之上, 会盖住它是正常的 */
  }
  .tab-item {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    position: relative;
    border: none;
    background: none;
    padding: 0;
    font-family: inherit;
    color: #94a3b8;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tab-item .tab-ico {
    font-size: 17px;
    line-height: 1;
    /* 未选中时去彩(灰度) + 淡一点: 主流 App 底栏就是这个观感, 选中项才"亮"起来 */
    filter: grayscale(1) opacity(.6);
    transition: filter .15s, transform .15s;
  }
  .tab-item .tab-lbl { font-size: 10.5px; line-height: 1.1; }
  .tab-item.active { color: var(--primary); }
  .tab-item.active .tab-lbl { font-weight: 700; }
  .tab-item.active .tab-ico { filter: none; transform: translateY(-1px); }
  /* 角标: 挪到图标右上角(底栏没有"右侧对齐"这一说) */
  .tab-item .nav-unread,
  .tab-item .timeout-badge {
    right: auto;
    left: 50%;
    top: 3px;
    margin-left: 5px;
    transform: none;
  }

  /* 底栏占掉最下面一条: 内容留出空间, 小邮悬浮钮抬到底栏上方 */
  #content { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  .ai-fab { bottom: calc(62px + env(safe-area-inset-bottom, 0px)); }
}

/* ---------- 更小的图标与字号(≤700px) ----------
   基调: 手机上把"卡片内边距 / 图标 / 标题字号"整体收一档, 信息密度提上去;
   正文与输入框保持足够大(≥13px / 16px), 不为了小牺牲可读性。 */
@media (max-width: 700px) {
  .page-title { font-size: 15.5px; }
  .card { padding: 14px; margin-bottom: 12px; border-radius: 12px; }
  .card-head h2 { font-size: 14px; }

  /* 顶部横幅(学生首页 / 管理员总览): 收高度、收字号 */
  .hero { padding: 18px 16px; margin-bottom: 12px; border-radius: 14px; }
  .hero h2 { font-size: 17px; letter-spacing: .5px; }
  .hero p { font-size: 12px; margin-top: 4px; }
  .hero-clock-time { font-size: 22px; }
  .ck { margin: -10px -10px -14px; padding: 14px 12px 18px; }
  .ck-hi { font-size: 17px; }
  .ck-hero { gap: 10px; }
  .ck-chip { font-size: 11.5px; padding: 4px 8px; }
  .ck-clock-time { font-size: 21px; }
  .ck-btn { padding: 7px 11px; font-size: 12.5px; }

  /* 指标卡: 图标与数字各收一档 */
  .kpi { padding: 12px; gap: 9px; }
  .kpi .kpi-icon { width: 34px; height: 34px; font-size: 16px; border-radius: 10px; }
  .kpi .kpi-num { font-size: 19px; }
  .kpi .kpi-label { font-size: 11px; }

  /* 订单卡: 更紧凑(手机上每屏能多看一张) */
  .order-card { padding: 13px 14px; gap: 7px; border-radius: 12px; }
  .oc-row { font-size: 13px; gap: 7px; }
  .oc-row .lbl { width: 26px; }
  .oc-no { font-size: 12.5px; }
  .reward { font-size: 17px; }
  .oc-foot { padding-top: 8px; }

  /* 按钮与标签: 收紧但不低于 34px 高(手指点得中) */
  .btn, .btn-primary, .btn-danger { padding: 9px 13px; font-size: 13px; border-radius: 9px; }
  .btn-sm { padding: 7px 10px; font-size: 12.5px; border-radius: 8px; }
  .tabs { padding: 3px; border-radius: 10px; }
  .tabs button { padding: 8px 12px; font-size: 13px; border-radius: 7px; }

  /* 侧边栏(抽屉)内部: 图标和标题同步缩小 */
  .side-logo { padding: 14px 14px 12px; gap: 8px; }
  .side-logo-icon { width: 34px; height: 34px; font-size: 17px; border-radius: 10px; }
  .side-title { font-size: 13.5px; letter-spacing: .5px; }
  .side-nav { padding: 10px 9px; }
  .nav-group { margin-bottom: 10px; }
  .nav-group-title { font-size: 10px; padding: 0 9px 4px; letter-spacing: 1.5px; }
  .nav-item { padding: 11px 10px; font-size: 13.5px; border-radius: 9px; margin-bottom: 2px; }
  .nav-item .ico { font-size: 15px; width: 20px; }
  .side-bottom { padding: 8px 9px 10px; }

  /* 顶栏: 头像与图标钮再小一点 */
  .avatar { width: 28px; height: 28px; font-size: 12.5px; }
  .menu-btn { width: 34px; height: 34px; font-size: 15px; border-radius: 9px; }

  /* 登录页 */
  .login-logo { width: 46px; height: 46px; font-size: 22px; border-radius: 13px; }
  .login-card h1 { font-size: 18px; }
  .login-card { padding: 22px 18px 18px; }

  /* 小邮悬浮钮: 46px 足够按, 又不像原来那样一大团 */
  .ai-fab { width: 46px; height: 46px; font-size: 20px; right: 14px; }
  /* 小邮面板打开时藏起悬浮钮: 否则它会压在面板底部的输入行上(面板自己有关闭按钮) */
  .ai-fab.fab-hide { opacity: 0; pointer-events: none; transform: scale(.6); }

  /* 消息页标题栏: 手机上"标题 + 搜索框 + 刷新"挤一行会把标题压成两行,
     改成"标题与刷新一行, 搜索框独占下一行" */
  .msg-page-head { flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
  .msg-page-head-left { flex: 1 1 100%; gap: 8px; }
  .msg-page-title { font-size: 14.5px; white-space: nowrap; }
  .msg-page-search { width: auto; flex: 1; min-width: 0; font-size: 16px; }

  /* 弹窗内边距与星标 */
  .modal-body { padding: 4px 14px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .modal-head { padding: 14px 14px 8px; }
  .modal-head h3 { font-size: 15px; }
  .ev-star { font-size: 26px; }
  .pwd-eye { width: 40px; }
}

/* ---------- 站内聊天: 微信式会话(左右分栏 + 头像 + 气泡尖角 + 间隔时间) ---------- */
.msg-body { background: #f2f3f5; }        /* 微信会话那种浅灰底, 白气泡才立得起来 */
.msg-row {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 12px;
}
.msg-row.mine { flex-direction: row-reverse; }
/* ⚠️ align-items 必须在这里**再写一遍**: 上面那套旧的简化气泡(见本区之前的 .msg-row 规则)里有
   `.msg-row.mine { align-items: flex-end; }`, 选择器权重比 `.msg-row` 高, 不覆盖的话自己的消息
   头像是"贴列底"对齐的 —— 头像被压到气泡下方二十多像素, 气泡尖角就高过头像了(用户反馈的就是这个)。
   微信式布局两头都该是顶对齐: 头像与气泡同一水平线, 尖角正好落在头像的垂直中线上。 */
.msg-row.mine { align-items: flex-start; }
.msg-av {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  flex: none;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
}
.msg-col { display: flex; flex-direction: column; max-width: 74%; min-width: 0; }
.msg-row.mine .msg-col { align-items: flex-end; }
.msg-bubble {
  position: relative;
  max-width: none;
  padding: 9px 12px;
  border: none;
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.5;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .07);
}
/* 气泡的小尖角: 指向说话人的头像(左白右绿, 和微信一致)。
   位置按头像的**垂直中线**对齐: 头像 34px(见 .msg-av) → 中线在 17px;
   尖角高 10px(上下各 5px 边框) → top = 17 - 5 = 12px, 尖角中心正好落在头像中线上。
   ⚠️ 头像与气泡在 .msg-row 里都是 flex-start 对齐, 所以"气泡顶部"就是"头像顶部", 可以直接用像素数。 */
.msg-bubble::after {
  content: '';
  position: absolute;
  top: 12px;
  left: -5px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-right: 6px solid #fff;
}
.msg-row.mine .msg-bubble { background: #95ec69; color: #0b1a0b; }
.msg-row.mine .msg-bubble::after {
  left: auto;
  right: -5px;
  border-right: none;
  border-left: 6px solid #95ec69;
}
.msg-meta { font-size: 10.5px; color: #94a3b8; margin-top: 3px; }
/* 间隔时间: 居中一条浅灰小胶囊(微信只在停顿较久时插一条) */
.msg-time { text-align: center; margin: 4px 0 10px; }
.msg-time span {
  display: inline-block;
  font-size: 11px;
  color: #8a8f99;
  background: rgba(15, 23, 42, .06);
  border-radius: 4px;
  padding: 2px 8px;
}
.msg-day { margin-bottom: 8px; }
/* 输入栏: 白底 + 绿色发送键(微信观感; 面板头部仍保留平台渐变, 品牌不断) */
.msg-input {
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
  gap: 8px;
  background: #f7f7f7;
  border-top: 1px solid #e6e8eb;
}
.msg-input input { border: none; border-radius: 8px; background: #fff; padding: 9px 12px; }
.msg-input input:focus { border: none; box-shadow: 0 0 0 2px rgba(7, 193, 96, .18); }
.msg-input button { background: #07c160; border-radius: 8px; padding: 0 15px; font-weight: 600; }
.msg-input button:disabled { background: #cbd5e1; }

/* ---------- 聊天: 表情包面板 + 图片消息 + 大图查看(2026-10 新增) ---------- */
/* 工具按钮(表情/图片): 白底圆形, 和绿色发送键同一排。
   ⚠️ 选择器要写 `.msg-input .msg-tool` —— 上面那条 `.msg-input button`(绿色发送键样式)
      的优先级是"类+标签", 单写 `.msg-tool` 压不过它, 按钮会变成绿色大方块把输入行挤到换行(真踩过)。 */
.msg-input .msg-tool {
  flex: none;
  width: 36px;
  height: 36px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform .12s, background .15s, color .15s;
}
.msg-input .msg-tool svg {
  width: 22px;
  height: 22px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.msg-input .msg-tool:hover { background: #eef0f3; color: #111827; }
.msg-input .msg-tool:active { transform: scale(.92); }
.msg-input .msg-tool.on { background: #e6f7ee; color: #07c160; }
/* 表情面板: 输入栏上方, 6 列网格(触摸友好)。
   格子里的图缩小过一档(44→36px): 一屏能看清全部表情, 面板也不至于占掉半个聊天窗 */
.stk-panel { background: #f7f7f7; border-top: 1px solid #e6e8eb; padding: 8px 10px 2px; }
.stk-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 4px; }
.stk-cell {
  padding: 4px 0;
  border: none;
  background: transparent;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .12s, background .15s;
}
.stk-cell img { width: 36px; height: 36px; display: block; pointer-events: none; }
.stk-cell:hover { background: #ebedf0; }
.stk-cell:active { transform: scale(.88); }
.stk-tip { text-align: center; font-size: 11px; color: #9aa0a6; padding: 3px 0 4px; }
/* 图片/表情消息: 去掉气泡的框和尖角(照片/表情本身就是内容); mine 的绿底也一并覆盖 */
.msg-bubble.bub-plain { padding: 0; background: transparent; box-shadow: none; }
.msg-bubble.bub-plain::after { display: none; }
.msg-row.mine .msg-bubble.bub-plain { background: transparent; }
.msg-img { display: block; position: relative; line-height: 0; border-radius: 10px; cursor: zoom-in; }
.msg-img img {
  display: block;
  max-width: min(260px, 58vw);
  max-height: 260px;
  border-radius: 10px;
  background: #e9edf2;
}
.msg-stk-img { display: block; }
/* 发送中: 暗色遮罩 + 转圈 + 百分比 */
.msg-img.pending::after { content: ''; position: absolute; inset: 0; border-radius: 10px; background: rgba(15, 23, 42, .38); }
.msg-up {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .45);
  white-space: nowrap;
}
.msg-up i {
  display: block;
  width: 20px;
  height: 20px;
  margin: 0 auto 5px;
  border: 2.5px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: msgspin .8s linear infinite;
}
@keyframes msgspin { to { transform: rotate(360deg); } }
/* 发送失败: 红罩 + 可点击重试 */
.msg-img.failed { cursor: pointer; }
.msg-img.failed::after { content: ''; position: absolute; inset: 0; border-radius: 10px; background: rgba(220, 38, 38, .45); }
.msg-up .msg-retry { display: block; margin-top: 4px; padding: 3px 9px; border: 1px solid rgba(255, 255, 255, .8); border-radius: 999px; font-size: 11px; }
/* 大图查看: 全屏暗底; z-index 198 —— 在弹窗(190)之上、toast(200)之下, 出提示不会挡 */
.img-viewer {
  position: fixed;
  inset: 0;
  z-index: 198;
  background: rgba(10, 12, 20, .93);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  cursor: zoom-out;
  animation: msgfade .16s ease;
  /* 页面整体关掉了双指缩放(body 的 touch-action), 这里是唯一的例外:
     打开大图时 body 会挂 .img-zoom 放开限制, 本元素自身也放开 —— 看图时就是能放大看细节 */
  touch-action: auto;
}
@keyframes msgfade { from { opacity: 0; } }
.img-viewer img { max-width: 92vw; max-height: 84vh; border-radius: 8px; box-shadow: 0 18px 60px rgba(0, 0, 0, .5); }
.img-viewer.loading img { visibility: hidden; }
.img-viewer.loading::before {
  content: '加载中…';
  position: absolute;
  color: #cbd5e1;
  font-size: 13px;
}
.img-viewer-tip { color: rgba(255, 255, 255, .6); font-size: 12px; }
/* 看大图期间放开 body 上的 touch-action 限制(配合 .img-viewer 的 auto), 双指缩放这才生效 */
body.img-zoom { touch-action: auto; }
@media (max-width: 700px) {
  .msg-img img { max-width: min(240px, 64vw); }
  .stk-cell img { width: 34px; height: 34px; }
}

/* ---------- 手机: 表格转出来的卡片(生成逻辑见 app.js 的 cardifyTables) ---------- */
.mcards { display: none; }
body.mobile-cards .mcards { display: block; }
/* 卡片模式下把表格容器"卸妆": 它自己不再画白底/阴影, 交给每张卡片 */
body.mobile-cards .tbl-wrap { background: transparent; box-shadow: none; overflow: visible; border-radius: 0; }
body.mobile-cards .tbl-wrap > table.tbl { display: none; }
/* 没有表头/没有数据行的表格不做卡片, 保持表格原样(否则会两边都不显示) */
body.mobile-cards .tbl-wrap[data-card-skip] > table.tbl { display: table; }
.mcard {
  background: #fff;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 13px;
  margin-bottom: 10px;
}
.mcard-flat { text-align: center; color: var(--muted); font-size: 13px; }
.mcard-title { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 7px; word-break: break-word; }
.mcard-body { display: flex; flex-direction: column; gap: 5px; }
.mf { display: flex; gap: 8px; font-size: 13px; line-height: 1.5; }
.mf-lbl { flex: none; width: 60px; color: #94a3b8; }
.mf-val { flex: 1; min-width: 0; color: #334155; word-break: break-word; }
.mcard-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #eef2f7;
}

/* #endregion */

/* ---------- 小邮(AI)面板: 与站内聊天统一成微信式观感(bot 白气泡 / 我 绿气泡) ---------- */
.ai-msgs { background: #f2f3f5; }
.ai-msg { border-radius: 8px; box-shadow: 0 1px 2px rgba(15, 23, 42, .07); }
.ai-msg.user { background: #95ec69; color: #0b1a0b; border-top-right-radius: 8px; }
.ai-msg.bot { border-top-left-radius: 8px; }
