/* ============================================================
 * 校园网自助办理系统 · 共享样式（浅色 · 校园清爽风）
 * ============================================================ */
:root {
  --primary: #0b6fd6;
  --primary-dark: #0857a8;
  --primary-soft: #e8f2fd;
  --teal: #0aa19c;
  --teal-soft: #e4f7f6;
  --gold: #e8960c;
  --gold-soft: #fdf3e0;
  --green: #1a9e5c;
  --green-soft: #e5f6ec;
  --red: #d64545;
  --red-soft: #fdeaea;
  --gray-900: #1c2733;
  --gray-700: #43536a;
  --gray-500: #7c8aa0;
  --gray-300: #c8d2df;
  --gray-100: #eef2f7;
  --bg: #f4f7fb;
  --card: #ffffff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 2px 10px rgba(28, 39, 51, 0.06), 0 8px 28px rgba(28, 39, 51, 0.05);
  --shadow-lg: 0 12px 40px rgba(28, 39, 51, 0.14);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--primary); text-decoration: none; }

/* ---------- 顶部 ---------- */
.hero {
  background: linear-gradient(135deg, #0b6fd6 0%, #0aa19c 100%);
  color: #fff;
  padding: 34px 20px 52px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.18), transparent 45%);
}
.hero h1 { font-size: 26px; font-weight: 700; letter-spacing: 1px; position: relative; }
.hero p { margin-top: 6px; font-size: 14px; opacity: 0.92; position: relative; }

/* ---------- 步骤条 ---------- */
.steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: -26px auto 0;
  padding: 0 16px;
  max-width: 760px;
  position: relative;
  z-index: 2;
}
.step-item {
  flex: 1;
  background: var(--card);
  border-radius: 12px;
  padding: 10px 6px;
  box-shadow: var(--shadow);
  text-align: center;
  font-size: 13px;
  color: var(--gray-500);
}
.step-item .num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gray-100); color: var(--gray-500);
  font-weight: 700; font-size: 12px; margin-right: 4px;
}
.step-item.active { color: var(--primary); font-weight: 600; }
.step-item.active .num { background: var(--primary); color: #fff; }
.step-item.done .num { background: var(--green); color: #fff; }

/* ---------- 卡片容器 ---------- */
.container { max-width: 760px; margin: 0 auto; padding: 20px 16px 60px; }
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px 20px;
  margin-bottom: 16px;
}
.card h2 {
  font-size: 17px;
  margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}
.card h2 svg { flex: none; }

/* ---------- 表单 ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 13px; color: var(--gray-700); margin-bottom: 5px; font-weight: 500; }
.field label .req { color: var(--red); margin-left: 2px; }
.field input, .field select, .field textarea {
  width: 100%;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 111, 214, 0.12);
}
.field input.err { border-color: var(--red); }
.field .hint { font-size: 12px; color: var(--gray-500); margin-top: 4px; }
.field-error { font-size: 12px; color: var(--red); margin-top: 4px; display: none; }
.field.has-error .field-error { display: block; }
.field.has-error input { border-color: var(--red); }

/* 业务类型切换 */
.biz-switch {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px;
}
.biz-opt {
  border: 1.5px solid var(--gray-300);
  border-radius: 12px;
  padding: 12px;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: all .15s;
}
.biz-opt .t { font-size: 15px; font-weight: 600; color: var(--gray-700); }
.biz-opt .d { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.biz-opt.active {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.biz-opt.active .t { color: var(--primary); }

/* 金额快捷项 */
.amount-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.chip {
  border: 1.5px solid var(--gray-300);
  border-radius: 20px;
  padding: 7px 14px;
  font-size: 14px;
  cursor: pointer;
  background: #fff;
  color: var(--gray-700);
  transition: all .15s;
}
.chip.active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); font-weight: 600; }
.chip .price { font-weight: 700; }

/* 购买月数输入 + 金额预览 */
.month-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.month-input-row input { flex: 1; }
.month-unit { color: var(--gray-500); font-size: 14px; white-space: nowrap; }
.amount-preview {
  font-size: 14px; color: var(--gray-600);
  background: var(--gray-100); border-radius: var(--radius-sm);
  padding: 8px 12px; margin-top: 2px;
}
.amount-preview b { font-size: 17px; }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  padding: 12px 18px;
  font-family: inherit;
  transition: all .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; width: 100%; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover:not(:disabled) { filter: brightness(1.06); }
.btn-ghost { background: var(--gray-100); color: var(--gray-700); }
.btn-ghost:hover:not(:disabled) { background: var(--gray-300); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 14px 20px; font-size: 16px; }
.btn-block { width: 100%; }

/* ---------- 付款面板 ---------- */
.pay-panel { text-align: center; }
.qr-box {
  width: 240px; height: 240px; margin: 8px auto 14px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: 0 0 0 6px var(--primary-soft);
  display: flex; align-items: center; justify-content: center;
  background: #fff;
}
.qr-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.qr-box canvas { display: block; max-width: 92%; height: auto; }
.amount-big { font-size: 34px; font-weight: 800; color: var(--red); margin: 6px 0 2px; }
.amount-big .cur { font-size: 18px; }
.order-no {
  display: inline-block;
  background: var(--gray-100);
  border-radius: 8px;
  padding: 8px 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16px; font-weight: 700;
  letter-spacing: 1px;
  margin: 10px 0;
}
.copy-tip { font-size: 12px; color: var(--gray-500); }
.qr-hint { font-size: 13px; color: var(--gray-700); margin-bottom: 4px; }

/* 扫码支付醒目提示：请用微信扫一扫（截屏无效，需另一台手机） */
.scan-tip {
  margin: 8px auto 6px;
  max-width: 340px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--red-soft);
  border: 2px solid var(--red);
  text-align: center;
  animation: scanTipPulse 1.6s ease-in-out infinite;
}
.scan-tip-main { font-size: 17px; font-weight: 800; color: var(--red); line-height: 1.4; }
.scan-tip-main strong { text-decoration: underline; text-underline-offset: 3px; }
.scan-tip-sub { font-size: 13px; font-weight: 600; color: var(--red); margin-top: 4px; opacity: 0.95; }
.scan-tip-sub strong { font-size: 14px; }
@keyframes scanTipPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(225, 55, 55, 0.35); }
  50% { box-shadow: 0 0 0 6px rgba(225, 55, 55, 0); }
}

/* 文件上传 */
.upload-box {
  border: 1.5px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 18px;
  text-align: center;
  cursor: pointer;
  color: var(--gray-500);
  font-size: 14px;
  transition: all .15s;
  background: #fbfcfe;
}
.upload-box:hover { border-color: var(--primary); color: var(--primary); }
.upload-box.has-file { border-color: var(--green); color: var(--green); background: var(--green-soft); }
.upload-box input[type="file"] { display: none; }
.upload-preview { margin-top: 10px; }
.upload-preview img { max-height: 160px; border-radius: 8px; box-shadow: var(--shadow); }

/* ---------- 成功面板 ---------- */
.success-panel { text-align: center; padding: 10px 0 4px; }
.success-icon {
  width: 64px; height: 64px; margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--green-soft);
  display: flex; align-items: center; justify-content: center;
}
.success-panel h3 { font-size: 19px; color: var(--green); }
.success-panel p { color: var(--gray-700); font-size: 14px; margin-top: 6px; }

/* ---------- 进度查询 ---------- */
.query-row { display: flex; gap: 10px; }
.query-row .field { flex: 1; }
.status-timeline { margin-top: 14px; text-align: left; }
.status-item { display: flex; gap: 12px; padding: 4px 0; }
.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  margin-top: 7px; flex: none;
  background: var(--gray-300);
}
.status-item.done .status-dot { background: var(--green); }
.status-item.active .status-dot { background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.status-text { font-size: 14px; color: var(--gray-500); }
.status-item.done .status-text { color: var(--gray-700); }
.status-item.active .status-text { color: var(--gray-900); font-weight: 600; }
.status-time { font-size: 12px; color: var(--gray-500); margin-left: 8px; }

/* 状态徽章 */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
}
.badge-pending { background: var(--gold-soft); color: var(--gold); }
.badge-verified { background: var(--teal-soft); color: var(--teal); }
.badge-todo { background: var(--primary-soft); color: var(--primary); }
.badge-done { background: var(--green-soft); color: var(--green); }
.badge-cancelled { background: var(--gray-100); color: var(--gray-500); }

/* 已核验标记（表格凭证列） */
.vfy-ok { color: var(--green); font-size: 12px; font-weight: 600; white-space: nowrap; }

/* ---------- 提示条 ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 14px;
  display: none;
}
.alert.show { display: flex; align-items: flex-start; gap: 8px; }
.alert-warn { background: var(--gold-soft); color: #8a5a00; }
.alert-error { background: var(--red-soft); color: var(--red); }
.alert-ok { background: var(--green-soft); color: var(--green); }
.alert code {
  background: rgba(0,0,0,0.06);
  padding: 1px 6px; border-radius: 4px;
  font-size: 12px;
}

/* ---------- 底部 ---------- */
.footer {
  text-align: center;
  padding: 10px 16px 30px;
  color: var(--gray-500);
  font-size: 12px;
}

/* ---------- 管理端 ---------- */
.admin-shell { max-width: 1280px; margin: 0 auto; padding: 20px 16px 60px; }
.admin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.admin-head h1 { font-size: 20px; display: flex; align-items: center; gap: 10px; }
.admin-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border-radius: 14px; box-shadow: var(--shadow);
  padding: 14px 16px;
}
.stat-card .k { font-size: 12px; color: var(--gray-500); }
.stat-card .v { font-size: 24px; font-weight: 800; margin-top: 2px; }
.stat-card .v.blue { color: var(--primary); }
.stat-card .v.gold { color: var(--gold); }
.stat-card .v.teal { color: var(--teal); }
.stat-card .v.green { color: var(--green); }
.stat-card .v.red { color: var(--red); }
.stat-card .sub { font-size: 11px; color: var(--gray-500); margin-top: 2px; line-height: 1.4; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.filter-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.fchip {
  border: 1.5px solid var(--gray-300); background: #fff;
  border-radius: 20px; padding: 5px 13px; font-size: 13px;
  cursor: pointer; color: var(--gray-700);
}
.fchip.active { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.toolbar input[type="search"] {
  flex: 1; min-width: 200px;
  border: 1.5px solid var(--gray-300); border-radius: 10px;
  padding: 8px 12px; font-size: 14px; font-family: inherit;
}
.toolbar input[type="search"]:focus { outline: none; border-color: var(--primary); }

.table-wrap { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 980px; }
thead th {
  text-align: left; padding: 11px 12px;
  background: var(--gray-100); color: var(--gray-700);
  font-size: 12px; font-weight: 600; white-space: nowrap;
  position: sticky; top: 0;
}
tbody td { padding: 10px 12px; border-top: 1px solid var(--gray-100); vertical-align: middle; }
tbody tr:hover { background: #fafcff; }
td.mono { font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
.td-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.thumb {
  width: 52px; height: 52px; border-radius: 8px;
  object-fit: cover; cursor: pointer;
  border: 1px solid var(--gray-300);
  background: var(--gray-100);
}
.empty-row td { text-align: center; padding: 36px; color: var(--gray-500); }

/* 登录卡片 */
.login-wrap { max-width: 380px; margin: 9vh auto; padding: 0 16px; }
.login-card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 28px 26px; }
.login-card h1 { font-size: 20px; text-align: center; margin-bottom: 4px; }
.login-card .sub { text-align: center; color: var(--gray-500); font-size: 13px; margin-bottom: 20px; }

/* ══════════════════════════════════════════════════════════
 * 动效体系（v1.7）——只动 transform / opacity，其余一概不碰
 * 时长遵守 100/300/500 规则；缓动 ease-out-quart / expo
 * ══════════════════════════════════════════════════════════ */
:root {
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-quart: cubic-bezier(0.7, 0, 0.84, 0);
  --dur-fast: 120ms;
  --dur-mid: 280ms;
  --dur-slow: 420ms;
}

/* 弹窗：常驻层 + pointer-events 开关，实现真淡入淡出（exit 更快） */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 30, 45, 0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 16px;
  opacity: 0; pointer-events: none;
  transition: opacity 180ms var(--ease-in-quart);
}
.modal-mask.show {
  opacity: 1; pointer-events: auto;
  transition: opacity 240ms var(--ease-out-quart);
}
.modal {
  background: #fff; border-radius: var(--radius);
  max-width: 560px; width: 100%;
  max-height: 86vh; overflow: auto;
  box-shadow: var(--shadow-lg);
  padding: 22px;
  transform: translateY(22px) scale(0.985);
  opacity: 0;
  transition: transform 300ms var(--ease-out-expo), opacity 240ms var(--ease-out-quart);
}
.modal-mask.show .modal { transform: none; opacity: 1; }
/* 手机端：底部滑入（drawer 手势习惯） */
@media (max-width: 768px) {
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    transform: translateY(48px);
    border-radius: 18px 18px 0 0;
    max-height: 92vh;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .modal-mask.show .modal { transform: none; }
}
.modal h3 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; justify-content: space-between; }
.modal .close { cursor: pointer; color: var(--gray-500); font-size: 22px; line-height: 1; background: none; border: none; }
.modal textarea {
  width: 100%; min-height: 210px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  padding: 12px; font-size: 13.5px; font-family: ui-monospace, Menlo, monospace;
  line-height: 1.7; resize: vertical;
}
.modal .tips { font-size: 12.5px; color: var(--gray-500); margin-top: 8px; }
.modal-body { font-size: 14px; color: var(--gray-700); }
.modal-body .confirm-box { background: var(--gray-100); border-radius: 10px; padding: 12px; margin: 10px 0; font-size: 13.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .hero { padding: 26px 16px 48px; }
  .hero h1 { font-size: 22px; }
  .form-grid { grid-template-columns: 1fr; }
  .steps { gap: 4px; }
  .step-item { font-size: 11px; padding: 8px 4px; }
  .step-item .num { width: 18px; height: 18px; font-size: 11px; }
  .qr-box { width: 100%; max-width: 320px; min-height: 60px; margin: 4px auto 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- H5 支付：微信内引导 + 立即支付按钮 ---------- */
.qr-box { width: 100%; max-width: 320px; min-height: 56px; margin: 6px auto 0; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.btn-pay { width: 100%; max-width: 320px; font-size: 17px; padding: 15px 20px; box-shadow: 0 6px 18px rgba(11,111,214,0.28); }
.wx-tip {
  width: 100%; max-width: 340px;
  background: var(--gold-soft);
  border: 1.5px dashed var(--gold);
  border-radius: var(--radius-sm);
  padding: 18px 16px;
  text-align: center;
  color: var(--gray-900);
}
.wx-tip .wx-tip-icon { font-size: 30px; line-height: 1; margin-bottom: 6px; }
.wx-tip p { margin: 4px 0; font-size: 14px; font-weight: 600; }
.wx-tip p.sub { font-size: 13px; font-weight: 400; color: var(--gray-700); }
.wx-tip .btn { margin-top: 12px; }

/* ══════════════════════════════════════════════════════════
 * 套餐角标（前台 chip 上的「最划算」等）
 * ══════════════════════════════════════════════════════════ */
.chip-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  background: #fdeaea;
  color: var(--red);
  vertical-align: middle;
}
.chip.active .chip-tag { background: var(--red); color: #fff; }

/* 体验卡/短期套餐 chip（按天）醒目标识 */
.chip-trial { border-color: var(--gold); color: #8a5a00; }
.chip-trial.active { border-color: var(--gold); background: var(--gold-soft); color: #8a5a00; }
.chip-trial .chip-tag { background: var(--gold); color: #fff; }

/* 后台配置行的「单位」窄列 + 天套餐行高亮 */
.cfg-row .c.tiny { width: 68px; }
.cfg-row.trial { background: var(--gold-soft); }

/* 公告条额外样式（蓝/信息蓝） */
.alert-info { background: var(--primary-soft); color: var(--primary); }

/* ══════════════════════════════════════════════════════════
 * 管理后台：标签页 + 配置编辑
 * ══════════════════════════════════════════════════════════ */
.admin-tabs {
  display: flex; align-items: stretch; gap: 4px;
  flex-wrap: nowrap;
  border-bottom: 1.5px solid var(--gray-100);
  margin-bottom: 16px;
  /* 窄屏兜底：万一还是装不下，可横向滑动而不是被裁掉 */
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.admin-tabs::-webkit-scrollbar { display: none; }
.atab {
  flex: 1 1 0;              /* 三个标签等分整行，手机上绝不溢出 */
  min-width: 0;
  white-space: nowrap;
  text-align: center;
  border: none; background: none; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--gray-500);
  padding: 11px 6px;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.atab:hover { color: var(--gray-700); }
.atab.active { color: var(--primary); border-bottom-color: var(--primary); }
.atab-hint { font-size: 12px; color: var(--gray-500); font-weight: 400; padding: 0 2px 10px; }

.cfg-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.cfg-grid .full { grid-column: 1 / -1; }
.cfg-grid.disabled { opacity: .45; pointer-events: none; }
.card .tips { font-size: 12.5px; color: var(--gray-500); line-height: 1.7; }

.cfg-rows { display: flex; flex-direction: column; gap: 8px; }
.cfg-row {
  display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.cfg-row.slim { align-items: center; background: #fff; border: 1.5px solid var(--gray-100); }
.cfg-row.off { opacity: .55; background: #f6f7f9; }
.cfg-row .c { display: flex; flex-direction: column; gap: 4px; }
.cfg-row .c.grow { flex: 1; min-width: 160px; }
.cfg-row .c.narrow { width: 92px; }
.cfg-row .c label { font-size: 11.5px; color: var(--gray-500); }
.cfg-row .c input, .cfg-row .c select {
  border: 1.5px solid var(--gray-300);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 14px;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
  width: 100%;
}
.cfg-row .c input:focus, .cfg-row .c select:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(11, 111, 214, 0.12);
}
.cfg-row .c-seq {
  width: 22px; height: 22px; flex: none;
  border-radius: 50%;
  background: var(--primary-soft); color: var(--primary);
  font-size: 12px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 8px;
}
.cfg-row .c-del { margin-bottom: 2px; }
.cfg-empty { padding: 18px; text-align: center; color: var(--gray-500); font-size: 13px; }
.cfg-title { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.cfg-desc { font-size: 12px; color: var(--gray-500); }

/* 开关 */
.switch-row {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; user-select: none;
  margin: 8px 0 12px;
  font-size: 14px; color: var(--gray-700);
}
.switch-row.compact { margin: 0; font-size: 12.5px; }
.switch-row input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-row .sw {
  position: relative; flex: none;
  width: 44px; height: 24px;
  border-radius: 20px;
  background: var(--gray-300);
  transition: background .18s;
}
.switch-row .sw::after {
  content: ""; position: absolute;
  top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .18s;
}
.switch-row input:checked + .sw { background: var(--primary); }
.switch-row input:checked + .sw::after { transform: translateX(20px); }
.switch-row .sw-label { min-width: 48px; text-align: right; color: var(--gray-500); font-size: 12.5px; }

@media (max-width: 640px) {
  .atab { font-size: 13px; padding: 11px 3px; }
  .atab-hint { display: none; }
  .cfg-row .c.narrow { width: calc(50% - 6px); }
  .cfg-row .c-del { width: 100%; }
}

/* ══════════════════════════════════════════════════════════
 * 多校区分管（2026-11 新增）
 * ══════════════════════════════════════════════════════════ */

/* ---------- 顶部校区切换条 ---------- */
.school-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  background: linear-gradient(135deg, #0b6fd6 0%, #0aa19c 100%);
  color: #fff;
  border-radius: 14px;
  padding: 12px 16px;
  margin-bottom: 14px;
  box-shadow: 0 6px 20px rgba(11, 111, 214, 0.18);
}
.sb-left, .sb-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sb-left { align-items: center; }
.sb-label { font-size: 12.5px; opacity: 0.88; }
.sb-select {
  font-family: inherit; font-size: 14.5px; font-weight: 600;
  color: var(--gray-900);
  background: #fff;
  border: none; border-radius: 9px;
  padding: 8px 12px;
  min-width: 200px; max-width: 320px;
  cursor: pointer;
}
.sb-select:focus { outline: 2px solid rgba(255,255,255,0.65); }
.sb-badge {
  display: inline-block;
  font-size: 11.5px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px;
  background: rgba(255,255,255,0.22);
  color: #fff;
}
.sb-badge.admin { background: rgba(255,255,255,0.28); }
.sb-badge.dist { background: rgba(255,255,255,0.18); }
.sb-link {
  font-size: 12.5px; font-weight: 600;
  color: #fff; text-decoration: none;
  background: rgba(255,255,255,0.16);
  border: none; border-radius: 8px;
  padding: 7px 11px; cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.sb-link:hover { background: rgba(255,255,255,0.28); }

/* ---------- 校区 / 账号卡片 ---------- */
.school-rows { display: flex; flex-direction: column; gap: 10px; }
.school-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  flex-wrap: wrap;
  border: 1.5px solid var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.school-card:hover { border-color: #cfdff3; box-shadow: 0 2px 10px rgba(11,111,214,.07); }
.school-card.off { opacity: .6; background: #f8f9fb; }
.sc-main { flex: 1; min-width: 240px; }
.sc-name { font-size: 15px; font-weight: 700; color: var(--gray-900); display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.sc-meta { margin-top: 6px; display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--gray-500); }
.sc-meta b { color: var(--gray-700); font-weight: 600; }
.sc-url { margin-top: 5px; font-size: 11.5px; color: var(--primary); font-family: ui-monospace, Menlo, monospace; }
.sc-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- 弹窗小标题 ---------- */
.modal .sub-h {
  font-size: 13.5px; font-weight: 700; color: var(--primary);
  margin: 20px 0 10px;
  padding-left: 9px;
  border-left: 3px solid var(--primary);
}
.modal .field .req { color: var(--red); margin-left: 2px; }
.modal code {
  background: var(--gray-100); border-radius: 4px;
  padding: 1px 5px; font-size: 12px; color: var(--gray-700);
}

/* ---------- 校区多选 ---------- */
.chk-box {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  border: 1.5px solid var(--gray-300); border-radius: var(--radius-sm);
  padding: 10px 12px;
  background: #fff;
  max-height: 200px; overflow: auto;
}
.chk-box .chk {
  display: flex; align-items: center; gap: 7px;
  font-size: 13.5px; color: var(--gray-700);
  cursor: pointer; user-select: none;
}
.chk-box .chk input { width: 15px; height: 15px; accent-color: var(--primary); cursor: pointer; }

@media (max-width: 640px) {
  .school-bar { padding: 11px 12px; }
  .sb-select { min-width: 0; width: 100%; }
  .sb-left { width: 100%; }
  .sc-actions { width: 100%; }
  .sc-actions .btn { flex: 1; }
}

/* 订单表「校区」列：汇总视图才显示，单校视图自动隐藏 */
table.no-schoolcol .col-school { display: none; }

/* ══════════════════════════════════════════════════════════
 * 手机端适配（v1.6.1）
 * 目标：360~430dp 宽的手机上不横向溢出、不缩小、不遮挡
 * ══════════════════════════════════════════════════════════ */

/* 系统栏安全区：配合 viewport-fit=cover，让内容避开刘海与手势条 */
@supports (padding: env(safe-area-inset-top)) {
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
  }
  .admin-shell { padding-bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* 防溢出改由各容器自身约束（body 级 overflow-x:hidden 在 Android WebView 上会让滚动退化到主线程，已移除） */
html { max-width: 100%; }

@media (max-width: 768px) {

  /* ── 标签页：可横向滑动，不再挤成 6 个豆丁 ── */
  .admin-tabs {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2px;
    padding-bottom: 2px;
  }
  .admin-tabs::-webkit-scrollbar { display: none; }
  .atab {
    flex: 0 0 auto;           /* 关键：不再等分，按内容宽 */
    min-width: 74px;
    font-size: 13px;
    padding: 11px 10px;
  }
  .atab-hint { display: none; }

  /* ── 顶部校区切换条：竖排，别把下拉框压扁 ── */
  .school-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 11px 12px;
  }
  .sb-left { width: 100%; }
  .sb-label { flex: 0 0 auto; }
  .sb-select {
    flex: 1;
    min-width: 0;
    width: auto;
    max-width: none;
    font-size: 14px;
  }
  .sb-right {
    width: 100%;
    justify-content: space-between;
  }
  .sb-link { flex: 1; text-align: center; font-size: 12px; padding: 8px 6px; }

  /* ── 统计卡片：2 列，数值缩小防溢出 ── */
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .stat-card { padding: 11px 12px; border-radius: 12px; }
  .stat-card .k { font-size: 11px; }
  .stat-card .v { font-size: 20px; line-height: 1.25; }
  .stat-card .v.red, .stat-card .v.green, .stat-card .v.teal { font-size: 18px; }
  .stat-card .sub { font-size: 10.5px; }

  /* ── 表格 → 卡片式（订单/总览共用） ── */
  .table-wrap {
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    overflow: visible;
  }
  table {
    min-width: 0 !important;   /* 干掉 980px 固定宽 */
    width: 100%;
    display: block;
    border-collapse: separate;
    border-spacing: 0 10px;
  }
  table thead { display: none; }   /* 表头在卡片模式下无意义 */
  table tbody, table tr, table td { display: block; width: auto; }

  table tr {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 2px 10px rgba(28,39,51,.07);
    padding: 12px 14px;
    margin-bottom: 10px;
    border: 1px solid #eef2f7;
    position: relative;
  }
  table tbody tr:hover { background: #fff; }

  table td {
    border: none;
    padding: 4px 0;
    font-size: 13.5px;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    text-align: right;
    min-height: 22px;
  }
  /* 用 data-label 做左列标签 */
  table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--gray-500);
    font-size: 12px;
    font-weight: 400;
    text-align: left;
    padding-top: 1px;
  }
  table td:empty { display: none; }

  /* 订单号做成卡片标题 */
  table td.td-no {
    font-size: 15px;
    font-weight: 700;
    padding-bottom: 8px;
    margin-bottom: 6px;
    border-bottom: 1px dashed #e8eef6;
    justify-content: flex-start;
  }
  table td.td-no::before { display: none; }

  /* 操作按钮独占一行 */
  table td.td-act {
    display: block;
    padding-top: 10px;
    margin-top: 6px;
    border-top: 1px dashed #e8eef6;
    text-align: left;
  }
  table td.td-act::before { display: none; }
  .td-actions { gap: 8px; }
  .td-actions .btn {
    flex: 1 1 calc(50% - 4px);
    min-height: 38px;
    font-size: 13px;
    padding: 9px 6px;
  }

  .empty-row td {
    display: block;
    text-align: center;
    padding: 30px 10px;
  }
  .empty-row td::before { display: none; }

  /* ── 弹窗：接近全屏，避免内容被截断 ── */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal {
    max-width: 100%;
    width: 100%;
    max-height: 92vh;
    border-radius: 18px 18px 0 0;
    padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
  }
  .modal h3 { font-size: 16px; }
  .modal .cfg-grid { grid-template-columns: 1fr; }
  .modal .field input, .modal .field select, .modal .field textarea { font-size: 16px; } /* 防 iOS/部分安卓自动放大 */

  /* ── 配置行：宽度自适应，竖排 ── */
  .cfg-row { flex-direction: column; align-items: stretch; gap: 8px; }
  .cfg-row .c, .cfg-row .c.tiny, .cfg-row .c.narrow, .cfg-row .c.grow {
    width: 100% !important;
    min-width: 0;
    flex: 1 1 auto;
  }
  .cfg-row .c-seq { margin-bottom: 0; }
  .cfg-row .c-del { align-self: flex-end; }
  .cfg-grid { grid-template-columns: 1fr; }

  /* ── 校区/账号卡片：按钮换行铺满 ── */
  .school-card { flex-direction: column; align-items: stretch; gap: 10px; }
  .sc-main { min-width: 0; }
  .sc-meta { gap: 8px 14px; }
  .sc-actions { width: 100%; }
  .sc-actions .btn { flex: 1 1 calc(50% - 4px); min-height: 36px; font-size: 12.5px; }
  .chk-box { grid-template-columns: 1fr; }

  /* ── 前台下单页（学生端）按钮加大 ── */
  .container { padding: 14px 12px 50px; }
  .card { padding: 16px 14px; border-radius: 14px; }
  .btn-lg { min-height: 48px; font-size: 16px; }
  .chip { min-height: 42px; }
  .biz-opt { padding: 12px 10px; }
  .month-input-row input { font-size: 16px; }
  .field input, .field select, .field textarea { font-size: 16px; }
}

/* 极窄屏（<360dp）：进一步压缩 */
@media (max-width: 359px) {
  .stats { grid-template-columns: 1fr; }
  .stat-card .v { font-size: 19px; }
  .atab { min-width: 66px; font-size: 12px; padding: 10px 7px; }
  .td-actions .btn { flex: 1 1 100%; }
  .sb-link { font-size: 11px; }
}

/* ══════════════════════════════════════════════════════════
 * 滚动性能（v1.6.4 修正）
 * 教训：给每张卡片 translateZ(0)/contain 会创建大量 GPU 合成层，
 * 在手机 WebView 上反而爆显存、越滑越卡。分批渲染已足够，这里只做减法。
 * ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  table tr {
    box-shadow: none !important;
    border: 1px solid #e6ecf5;
    /* 不再创建合成层 */
    transform: none !important;
    contain: none !important;
  }
  table tbody tr:hover { background: #fff !important; }
  .td-actions .btn, .btn-sm, .btn {
    /* 只放开 transform（合成属性，零重绘）：按压回弹手感 */
    transition: transform 120ms var(--ease-out-quart) !important;
    box-shadow: none !important;
    filter: none !important;
  }
  .btn:hover { filter: none !important; }
  .btn:active { transform: scale(0.97); }
  .ocard:active { background: #f7fafd; }
  .card, .stat-card, .school-card, .chip, .fchip, .atab, .sb-link {
    transition: none !important;
  }
  .school-card:hover { box-shadow: none !important; }
  html { scroll-behavior: auto !important; }
}

/* ══════════════════════════════════════════════════════════
 * 顶部工具栏：全部可见（不依赖横向滑动）
 * 6 个标签在手机上改成 3 列 × 2 行网格，一眼看全，彻底解决
 * 「最右侧看不到、又滑不动」的问题。
 * ══════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .admin-tabs {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    flex-wrap: nowrap;
    overflow: visible !important;      /* 网格不需要滚动，也避免被 WebView 吞掉手势 */
    border-bottom: none;
    margin-bottom: 12px;
  }
  .atab {
    flex: none !important;
    min-width: 0 !important;
    width: auto;
    font-size: 12.5px;
    padding: 10px 4px;
    border: 1.5px solid var(--gray-100);
    border-radius: 10px;
    background: #fff;
    margin-bottom: 0;
    border-bottom: 1.5px solid var(--gray-100) !important;
  }
  .atab.active {
    background: var(--primary-soft);
    border-color: var(--primary) !important;
    color: var(--primary);
  }
  .atab-hint { display: none; }

  /* 校区切换条：右侧按钮组单独一行、等分铺满，避免被挤出屏幕 */
  .school-bar { transform: none !important; }
  .sb-right {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
  }
  .sb-link {
    flex: none !important;
    min-width: 0;
    text-align: center;
    font-size: 11.5px;
    padding: 9px 4px;
    white-space: nowrap;
  }
  .sb-left { flex-wrap: nowrap; }
  .sb-select { flex: 1; min-width: 0; }
}

@media (max-width: 359px) {
  .admin-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .atab { font-size: 12px; }
}

/* App 内在线更新条 */
.app-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: #fff; border: 1.5px solid var(--gray-100);
  border-radius: 12px; padding: 9px 12px; margin-bottom: 12px;
}
.ab-ver { font-size: 12.5px; color: var(--gray-700); }
.ab-ver b { color: var(--primary); font-family: ui-monospace, Menlo, monospace; }
.ab-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.ab-msg { font-size: 12px; color: var(--gray-500); margin-left: auto; }
@media (max-width: 768px) {
  .app-bar { flex-direction: column; align-items: stretch; }
  .ab-actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .ab-actions .btn { min-width: 0; font-size: 12px; padding: 9px 4px; }
  .ab-msg { margin-left: 0; width: 100%; }
}

/* ══════════════════════════════════════════════════════════
 * 手机端订单卡片（v1.6.5）：纯 div，渲染快、跟手
 * ══════════════════════════════════════════════════════════ */
.ocard-list { display: flex; flex-direction: column; gap: 10px; }
.ocard {
  background: #fff;
  border: 1px solid #e6ecf5;
  border-radius: 14px;
  padding: 12px 14px;
}
.oc-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-bottom: 8px; margin-bottom: 6px;
  border-bottom: 1px dashed #e8eef6;
}
.oc-no { font-family: ui-monospace, Menlo, monospace; font-size: 14.5px; font-weight: 700; color: var(--gray-900); }
.oc-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 3px 0; font-size: 13.5px;
}
.oc-k { flex: 0 0 auto; color: var(--gray-500); font-size: 12px; }
.oc-v { text-align: right; word-break: break-all; }
.oc-act {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding-top: 9px; margin-top: 6px; border-top: 1px dashed #e8eef6;
}
.oc-act .btn { flex: 1 1 calc(50% - 4px); min-height: 38px; font-size: 13px; }
.oc-note { color: var(--gray-500); font-size: 12.5px; flex: 1; align-self: center; }
.ocard-empty {
  background: #fff; border: 1px solid #e6ecf5; border-radius: 14px;
  padding: 34px; text-align: center; color: var(--gray-500); font-size: 13.5px;
}
/* 桌面端隐藏卡片容器 */
@media (min-width: 769px) {
  .ocard-list { display: none !important; }
}

/* ══════════════════════════════════════════════════════════
 * 入场动效（交错淡入：--i 由 JS 注入，总时长封顶 ~360ms）
 * ══════════════════════════════════════════════════════════ */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
}
.ocard, table tbody tr {
  animation: cardIn 380ms var(--ease-out-quart) backwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
}
.stat-card { animation: fadeUp 320ms var(--ease-out-quart) backwards; animation-delay: calc(var(--i, 0) * 40ms); }

/* 页签切换：内容轻淡入（150ms，不位移——避免滚动位置跳变） */
@keyframes paneIn { from { opacity: 0; } }
.admin-pane { animation: paneIn 150ms ease-out; }

/* 登录卡片入场 */
@keyframes loginIn {
  from { opacity: 0; transform: translateY(16px) scale(0.99); }
}
#loginView .login-card { animation: loginIn 480ms var(--ease-out-expo) backwards; }

/* 刷新按钮加载态 */
@keyframes spin { to { transform: rotate(360deg); } }
.spinning { animation: spin 800ms linear infinite; }

/* ══════════════════════════════════════════════════════════
 * 骨架屏（加载中的体感优化：先看到结构，数据到了再替换）
 * ══════════════════════════════════════════════════════════ */
@keyframes pulse { 0%,100% { opacity: .45; } 50% { opacity: .85; } }
.sk-card {
  background: #fff; border: 1px solid #eef2f7; border-radius: 14px;
  padding: 12px 14px; margin-bottom: 10px;
}
.sk-line { height: 12px; border-radius: 6px; background: #e9eef5; animation: pulse 1.2s ease-in-out infinite; }
.sk-line.w40 { width: 40%; } .sk-line.w60 { width: 60%; } .sk-line.w85 { width: 85%; }
.sk-line + .sk-line { margin-top: 9px; }
.sk-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.sk-badge { width: 52px; height: 20px; border-radius: 10px; background: #e9eef5; animation: pulse 1.2s ease-in-out infinite; }

/* 统计卡视觉锚点：左侧品牌色条（静态，无动画成本） */
.stat-card { border-left: 3px solid transparent; }
.stat-card .v.green ~ .sub, .stat-card.blue-l { border-left-color: var(--primary); }
.stat-card:nth-child(1) { border-left-color: var(--green); }
.stat-card:nth-child(2) { border-left-color: var(--red); }
.stat-card:nth-child(3) { border-left-color: var(--gold); }
.stat-card:nth-child(4) { border-left-color: var(--teal); }
.stat-card:nth-child(5) { border-left-color: var(--primary); }
.stat-card:nth-child(6) { border-left-color: var(--primary); }
.stat-card:nth-child(7) { border-left-color: var(--green); }

/* 空状态呼吸（图标轻微浮动，纯 transform） */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.empty-emoji { display: inline-block; animation: floaty 2.6s ease-in-out infinite; }

/* 消息条出现动效 */
.alert.show { animation: fadeUp 200ms var(--ease-out-quart); }

/* ══════════════════════════════════════════════════════════
 * 无障碍：用户偏好减弱动效时全部退化为交叉淡入
 * ══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
    transition-duration: 0.01ms !important;
  }
  .ocard, table tbody tr, .stat-card { animation: none; }
}

/* 主界面进入动效（登录成功后） */
@keyframes mainIn { from { opacity: 0; transform: translateY(10px); } }
#mainView { animation: mainIn 420ms var(--ease-out-expo) backwards; }

/* 手机端页签按压反馈（transform 合成属性） */
@media (max-width: 768px) {
  .atab { transition: transform 120ms var(--ease-out-quart), background-color 120ms ease; }
  .atab:active { transform: scale(0.96); }
  .rchip { transition: transform 120ms var(--ease-out-quart); }
  .rchip:active { transform: scale(0.95); }
  .sb-link:active { transform: scale(0.96); }
}

/* ══════════════════════════════════════════════════════════
 * UI v2.1 精修层（2026-11-04）· 依据前端视觉设计规范
 * ─────────────────────────────────────────────────────────
 * 主题：校园网经营驾驶舱
 * · 保留电信蓝基因，渐变收敛为「深海军蓝→品牌蓝」单轴线
 * · 数字是主角：tabular-nums + 800 字重 + count-up
 * · 状态即导航：徽章状态点 + 订单卡状态色边
 * · 全部动效只碰 transform/opacity（合成器友好，WebView 60fps）
 * · 骨架屏替代文字占位，触控元素 touch-action: manipulation
 * ══════════════════════════════════════════════════════════ */

:root {
  --ink: #0f1d2e;
  --brand-deep: #073b6f;
  --brand-peak: #0aa19c;
  --shadow-flat: 0 1px 2px rgba(15, 29, 46, 0.05), 0 4px 14px rgba(15, 29, 46, 0.04);
  --ring: 0 0 0 3px rgba(11, 111, 214, 0.16);
  --ease-spring: cubic-bezier(0.2, 0.9, 0.3, 1.15);
}

/* ---------- 触控：消除 300ms 延迟与误触缩放，滑动零劫持 ---------- */
.btn, .atab, .chip, .fchip, .rchip, .sb-link, .sb-select,
.switch-row, .step-item, .biz-opt, .month-input-row, a {
  touch-action: manipulation;
}

/* ---------- 驾驶舱顶栏（校区切换条）---------- */
.school-bar {
  background: linear-gradient(128deg, var(--brand-deep) 0%, #0b6fd6 62%, var(--brand-peak) 145%);
  position: relative;
  overflow: hidden;
  box-shadow: 0 6px 24px rgba(7, 59, 111, 0.22);
}
.school-bar::before {
  /* 细网格纹理：静态、无动画，一次性绘制 */
  content: "";
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.045) 0 1px, transparent 1px 22px);
  pointer-events: none;
}
.school-bar::after {
  /* 右上角高光弧 */
  content: "";
  position: absolute; top: -70px; right: -60px;
  width: 240px; height: 240px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.14) 0%, transparent 68%);
  pointer-events: none;
}
.school-bar > * { position: relative; z-index: 1; }
.sb-label {
  font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; opacity: 0.75;
}
.sb-select {
  border-radius: 10px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.25);
  transition: transform 140ms var(--ease-out-quart), box-shadow 140ms ease;
}
.sb-select:active { transform: scale(0.98); }
.sb-link {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 9px;
  color: #fff;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  transition: background-color 140ms ease, transform 140ms var(--ease-out-quart);
}
.sb-link:hover { background: rgba(255, 255, 255, 0.24); color: #fff; }
.sb-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.02em;
  padding: 4px 10px; border-radius: 20px;
}
.sb-badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
}
.sb-badge.admin {
  background: linear-gradient(135deg, rgba(232,150,12,0.28), rgba(232,150,12,0.14));
  color: #ffd98a;
  box-shadow: inset 0 0 0 1px rgba(255, 217, 138, 0.5);
}
.sb-badge.dist {
  background: rgba(255, 255, 255, 0.16);
  color: #e3f2ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3);
}

/* ---------- 统计卡：主次分层，数字是主角 ---------- */
.stat-card {
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1px solid #e7edf5;
  border-left: 3px solid transparent;
  box-shadow: var(--shadow-flat);
  border-radius: 12px;
  padding: 12px 14px;
  overflow: hidden;
  position: relative;
}
.stat-card .k {
  font-size: 11px; font-weight: 600; color: var(--gray-500);
  letter-spacing: 0.02em;
}
.stat-card .v {
  font-size: 25px; font-weight: 800; line-height: 1.2;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.stat-card .sub { font-variant-numeric: tabular-nums; }
.stat-card .v.green { color: #178a4f; }
.stat-card .v.red   { color: #d64545; }
.stat-card .v.teal  { color: #088b87; }
.stat-card:nth-child(2) { border-left-color: var(--red); }   /* 收款 = 注意力主色 */

/* 收款主卡：第一眼信息 */
.stat-hero {
  grid-column: span 1;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(10,161,156,0.10) 0%, transparent 55%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  border-color: #cfe3f8;
}
.stat-hero .v { font-size: 30px; }
@media (max-width: 768px) {
  .stat-card { padding: 10px 12px; border-radius: 11px; }
  .stat-card .v { font-size: 21px; }
  .stat-hero .v { font-size: 25px; }
}
@media (min-width: 769px) { .stats .stat-hero { grid-column: span 1; } }

/* ---------- 状态徽章：状态点 + 待办呼吸 ---------- */
.badge {
  font-size: 11.5px;
  padding: 3px 9px 3px 8px;
  border-radius: 8px;
  gap: 5px;
  line-height: 1.45;
}
.badge::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-pending::before { animation: badgePulse 2.2s ease-in-out infinite; }
@keyframes badgePulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}

/* ---------- 手机订单卡：状态色边 + 按压反馈 ---------- */
.ocard {
  border-radius: 13px;
  border-color: #e6ecf5;
  position: relative;
  padding-left: 16px;
  transition: background-color 130ms ease, transform 130ms var(--ease-out-quart);
}
.ocard::before {
  content: "";
  position: absolute; left: 6px; top: 12px; bottom: 12px;
  width: 3px; border-radius: 3px;
  background: var(--gray-300);
}
.ocard[data-tone="pending"]::before  { background: var(--gold); }
.ocard[data-tone="verified"]::before { background: var(--teal); }
.ocard[data-tone="todo"]::before     { background: var(--primary); }
.ocard[data-tone="opening"]::before  { background: var(--primary); }
.ocard[data-tone="done"]::before     { background: var(--green); }
.ocard[data-tone="cancelled"]::before{ background: var(--gray-300); }
.ocard:active { background: #f5f9ff; transform: scale(0.992); }
.oc-top .oc-no { font-variant-numeric: tabular-nums; }
.oc-row .oc-k { color: var(--gray-500); }
.oc-row .oc-v { font-variant-numeric: tabular-nums; }

/* ---------- 状态变化 flash：核销/完成时一次性高亮 ---------- */
@keyframes flashOnce {
  0% { background: #e7f7ee; }
  100% { background: #fff; }
}
.flash { animation: flashOnce 900ms var(--ease-out-quart); }

/* ---------- 骨架屏升级：shimmer 用 transform 移动，零 paint ---------- */
.sk-card {
  border: 1px solid #e6ecf5;
  border-radius: 13px;
  background: #fff;
  padding: 14px;
  overflow: hidden;
}
.sk-card, .sk-line, .sk-badge { animation: none !important; }
.sk-line::after, .sk-badge::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,0.6) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: skelShimmer 1.25s var(--ease-in-quart) infinite;
}
.sk-line, .sk-badge {
  position: relative;
  overflow: hidden;
  background: #edf1f7;
}
@keyframes skelShimmer { to { transform: translateX(100%); } }

/* ---------- 页签：活动指示条弹性生长 ---------- */
.atab { position: relative; }
.atab::after {
  content: "";
  position: absolute; left: 18%; right: 18%; bottom: -1px;
  height: 3px; border-radius: 3px 3px 0 0;
  background: linear-gradient(90deg, var(--primary), var(--brand-peak));
  transform: scaleX(0);
  transition: transform 260ms var(--ease-spring);
}
.atab:hover::after { transform: scaleX(0.35); }
.atab.active::after { transform: scaleX(1); }
@media (max-width: 768px) {
  /* 手机端网格页签：改为底色+描边方案，::after 退化 */
  .atab::after { display: none; }
  .atab.active {
    background: linear-gradient(180deg, var(--primary-soft) 0%, #dcecff 100%);
    border-color: #9cc5f2 !important;
  }
}

/* ---------- 按钮：桌面 hover 提升 + 焦点环 ---------- */
.btn { font-weight: 600; }
.btn:focus-visible, .atab:focus-visible, .chip:focus-visible,
.sb-link:focus-visible, .rchip:focus-visible,
.field input:focus-visible, .field select:focus-visible {
  outline: none;
  box-shadow: var(--ring);
}
.btn-primary {
  background: linear-gradient(180deg, #1279e2 0%, #0b6fd6 100%);
  box-shadow: 0 2px 8px rgba(11, 111, 214, 0.28), inset 0 1px 0 rgba(255,255,255,0.18);
  transition: transform 130ms var(--ease-out-quart), box-shadow 160ms ease, filter 160ms ease;
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.05); box-shadow: 0 4px 14px rgba(11, 111, 214, 0.34), inset 0 1px 0 rgba(255,255,255,0.18); }
.btn-primary:active { transform: scale(0.97); }
.btn-ghost { transition: background-color 140ms ease, transform 130ms var(--ease-out-quart); }
.btn-ghost:hover:not(:disabled) { background: #eef3fa; }
@media (min-width: 769px) {
  .btn-teal, .btn-danger, .btn-ghost { transition: transform 130ms var(--ease-out-quart), background-color 140ms ease, filter 140ms ease; }
  .btn:active { transform: scale(0.97); }
}

/* ---------- 弹窗：抽屉把手 + 遮罩层次 ---------- */
.modal-mask.show { background: rgba(13, 26, 42, 0.52); }
.modal {
  box-shadow: 0 -12px 48px rgba(15, 29, 46, 0.28), 0 0 0 1px rgba(15, 29, 46, 0.04);
}
.modal::before {
  /* 手机端底部抽屉把手：暗示可下滑关闭 */
  content: "";
  display: none;
}
@media (max-width: 768px) {
  .modal::before {
    display: block;
    width: 40px; height: 4px; border-radius: 4px;
    background: #dfe6ef;
    margin: 0 auto 12px;
  }
  .modal {
    transition: transform 320ms var(--ease-out-expo), opacity 220ms var(--ease-out-quart);
  }
  .modal-mask.show .modal { animation: drawerIn 340ms var(--ease-out-expo); }
}
@keyframes drawerIn { from { transform: translateY(64px); } to { transform: translateY(0); } }

/* ---------- 提示条：弹簧入场 ---------- */
.alert.show { animation: alertIn 320ms var(--ease-spring); }
@keyframes alertIn {
  from { opacity: 0; transform: translateY(-6px) scale(0.985); }
}

/* ---------- 登录页：品牌顶栏 ---------- */
.login-wrap { margin: 7vh auto; }
.login-card h1 {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 21px; letter-spacing: 0.01em;
}
.login-card {
  border: 1px solid #e7edf5;
  box-shadow: 0 1px 2px rgba(15,29,46,0.05), 0 18px 44px rgba(15, 29, 46, 0.10);
}
.login-card .sub { letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px; font-weight: 600; }

/* ---------- 空状态：呼吸已有，文案层级精修 ---------- */
.ocard-empty, .empty-row { letter-spacing: 0.01em; }

/* ---------- 桌面滚动条 ---------- */
@media (min-width: 769px) {
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-thumb { background: #c4d2e3; border-radius: 8px; }
  ::-webkit-scrollbar-thumb:hover { background: #a9bbd2; }
  ::-webkit-scrollbar-track { background: transparent; }
}

/* ---------- 无障碍：减弱动效时全部静止 ---------- */
@media (prefers-reduced-motion: reduce) {
  .badge-pending::before,
  .skel::after,
  .modal-mask.show .modal { animation: none !important; }
  .flash { animation: none !important; }
  .atab::after { transition: none; }
  .stat-card .v, .stat-card .sub { animation: none !important; }
}

/* ---------- 手机省电：骨架 shimmer 仍保留（面积小、纯合成） ---------- */

/* ---------- 时间段筛选条（v2.1 补遗：此前类名无样式定义，裸按钮观感差） ---------- */
.range-bar {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e7edf5;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-flat);
}
.range-label {
  font-size: 11px; font-weight: 600; color: var(--gray-500);
  letter-spacing: 0.02em; flex: none;
}
.range-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.rchip {
  font-family: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--gray-700);
  background: #f0f4f9;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  line-height: 1.2;
  white-space: nowrap;
}
.rchip:hover { background: #e4ecf6; }
.rchip.active {
  background: linear-gradient(180deg, #1279e2 0%, #0b6fd6 100%);
  border-color: #0b6fd6;
  color: #fff;
  box-shadow: 0 2px 8px rgba(11, 111, 214, 0.3);
}
.range-custom { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.range-custom input[type="date"] {
  border: 1.5px solid var(--gray-300);
  border-radius: 9px;
  padding: 6px 9px;
  font-size: 13px;
  font-family: inherit;
  color: var(--gray-900);
  background: #fff;
}
.range-custom input[type="date"]:focus { outline: none; border-color: var(--primary); box-shadow: var(--ring); }
.range-tilde { color: var(--gray-500); }
.range-summary {
  margin-left: auto;
  font-size: 11.5px; color: var(--gray-500);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 768px) {
  .range-bar { padding: 9px 10px; gap: 8px; }
  .rchip { font-size: 12px; padding: 6px 11px; }
  .range-summary { margin-left: 0; width: 100%; text-align: left; }
}

/* ---------- 统计网格奇数收尾：最后一张独占整行 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
@media (max-width: 768px) {
  .stats .stat-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
