@charset "UTF-8";
/* ==========================================================================
   上课预约系统 · 全局样式表（唯一手写样式表，PC + H5 双主题）
   --------------------------------------------------------------------------
   设计依据：docs/PHP-ARCHITECTURE.md §4.2（CSS 变量）/ §4.3（组件类名清单）
   硬性约束：
     1) 零外部请求：不引 CDN / Google Fonts / 外链图片，字体用系统字体栈；
     2) 零 CSS 框架：所有样式手写本文件，不使用工具类库；
     3) 类名严格按 §4.3 清单，补充类统一放在「§90 补充扩展」区块并注明；
     4) 响应式断点：>=1280 宽屏 / 768~1279 常规 / <768 抽屉 + 单列；
     5) 支持打印：隐藏侧边栏、顶栏、按钮，凭证区独占一页。

   目录
     §00  设计令牌（:root）
     §01  重置与基础排版
     §02  通用工具类（.sr-only / .divider / .grid-2 ...）
     §03  应用外壳（.app-shell / .main / .content）
     §04  侧边栏品牌区与导航（.sidebar / .nav / .nav-item）
     §05  抽屉与遮罩（.drawer / .drawer-mask，<768px）
     §06  顶栏（.topbar / .breadcrumb / .bell / .user-menu）
     §07  卡片（.card / .card__head / .card__body）
     §08  统计卡（.stat-grid / .stat-card）
     §09  表格（.table-wrap / .table / .table--compact / .table-empty）
     §10  表单（.form / .form-row / .input / .select / .textarea ...）
     §11  按钮（.btn 及修饰符）
     §12  徽章与标签（.badge 及状态色 / .chip）
     §13  页签（.tabs / .tab / .tab__count）
     §14  提示条（.flash / .alert / .toast）
     §15  空状态（.empty）
     §16  分页（.pager）
     §17  凭证区（.voucher / .code-text）
     §18  移动端列表（.m-list / .m-item / .m-card）
     §19  课表网格（.timetable）
     §20  登录 / 错误页（.auth-wrap / .auth-card）
     §21  加载骨架（.skeleton）
     §22  H5 主题覆盖（body.theme-h5）
     §23  H5 布局（.h5-shell / .h5-body / .tabbar；.h5-header 仅 $showHeader 显式开启时渲染，v1.1.6 起默认无顶栏）
     §24  响应式断点
     §25  打印样式
     §90  补充扩展（清单外但对页面必要的辅助类，均已在此注明）
   ========================================================================== */

/* ==========================================================================
   §00 设计令牌（严格对齐 §4.2，禁止在组件里另写魔数颜色）
   ========================================================================== */
:root {
  /* —— 品牌色（PC 商务蓝） —— */
  --c-primary: #0E7FD9;
  --c-primary-600: #0A66B2;
  --c-primary-050: #E8F3FC;
  /* —— 学员端主色（H5 天蓝 / 青） —— */
  --c-h5-primary: #38BDF8;
  --c-h5-primary-600: #0EA5E9;
  --c-h5-accent: #06B6D4;
  /* —— 语义色 —— */
  --c-success: #16A34A;
  --c-warn: #D97706;
  --c-danger: #DC2626;
  --c-info: #2563EB;
  /* —— 中性色 —— */
  --c-bg: #F5F7FB;
  --c-surface: #FFFFFF;
  --c-text: #0F172A;
  --c-text-2: #475569;
  --c-text-3: #94A3B8;
  --c-border: #E2E8F0;
  --c-border-2: #CBD5E1;
  /* —— 圆角 —— */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-full: 999px;
  /* —— 阴影 —— */
  --sh-1: 0 1px 2px rgba(15, 23, 42, .06);
  --sh-2: 0 8px 24px rgba(15, 23, 42, .08);
  /* —— 间距（4 的倍数） —— */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  /* —— 字号 —— */
  --fs-xs: 12px;
  --fs-sm: 13px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 28px;
}

/* ==========================================================================
   §01 重置与基础排版
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  height: 100%;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--c-bg);
  color: var(--c-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Hiragino Sans GB", "Helvetica Neue", Arial, "Noto Sans CJK SC", sans-serif;
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-3);
  font-weight: 600;
  line-height: 1.35;
  color: var(--c-text);
}

h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); }
h4 { font-size: var(--fs-md); }
h5, h6 { font-size: var(--fs-sm); }

p {
  margin: 0 0 var(--sp-3);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--c-primary);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  color: var(--c-primary-600);
  text-decoration: underline;
}

ul, ol {
  margin: 0 0 var(--sp-3);
  padding-left: var(--sp-5);
}

ul:last-child,
ol:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

strong, b {
  font-weight: 600;
}

code, kbd, samp, pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: .95em;
}

code {
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: #F1F5F9;
  color: var(--c-text-2);
}

pre {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: #F8FAFC;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

hr {
  height: 0;
  margin: var(--sp-4) 0;
  border: 0;
  border-top: 1px solid var(--c-border);
}

img, svg {
  max-width: 100%;
  vertical-align: middle;
}

/* 表单元素统一继承系统字体，避免 Windows 下宋体回退 */
input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
  color: inherit;
}

/* 键盘可见焦点（无障碍：不隐藏 outline，只统一形状） */
:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

::selection {
  background: var(--c-primary-050);
  color: var(--c-primary-600);
}

/* ==========================================================================
   §02 通用工具类
   ========================================================================== */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.divider {
  height: 1px;
  margin: var(--sp-4) 0;
  background: var(--c-border);
  border: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

.kv {
  display: grid;
  grid-template-columns: minmax(88px, max-content) minmax(0, 1fr);
  gap: var(--sp-2) var(--sp-4);
  align-items: baseline;
  font-size: var(--fs-md);
}

.kv__k {
  color: var(--c-text-3);
  font-size: var(--fs-sm);
  white-space: nowrap;
}

.kv__v {
  color: var(--c-text);
  word-break: break-word;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--r-full);
  background: var(--c-primary-050);
  color: var(--c-primary-600);
  font-size: var(--fs-sm);
  font-weight: 600;
  flex: 0 0 auto;
  user-select: none;
}

.avatar--lg {
  width: 44px;
  height: 44px;
  font-size: var(--fs-lg);
}

.progress {
  position: relative;
  height: 8px;
  border-radius: var(--r-full);
  background: #EEF2F7;
  overflow: hidden;
}

.progress__bar {
  display: block;
  height: 100%;
  border-radius: var(--r-full);
  background: var(--c-primary);
  transition: width .3s ease;
}

.progress--warn .progress__bar { background: var(--c-warn); }
.progress--danger .progress__bar { background: var(--c-danger); }

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.toolbar__left,
.toolbar__right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.toolbar__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.text-2 { color: var(--c-text-2); }
.text-3 { color: var(--c-text-3); }
.text-danger { color: var(--c-danger); }
.text-success { color: var(--c-success); }
.text-warn { color: var(--c-warn); }
.text-nowrap { white-space: nowrap; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.mono { font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace; }

.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

/* ==========================================================================
   §03 应用外壳（PC 三端：adm / reg / stf 共用）
   ========================================================================== */
.app-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  background: var(--c-bg);
}

.main {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0; /* 关键：允许内部表格横向滚动而不撑破 flex */
  min-height: 100vh;
}

.content {
  flex: 1 1 auto;
  width: 100%;
  max-width: 1360px; /* >=1280 宽屏内容最大 1360 居中 */
  margin: 0 auto;
  padding: var(--sp-5) var(--sp-5) var(--sp-6);
}

.content > *:first-child {
  margin-top: 0;
}

.content--flush {
  padding: 0;
}

/* 页面标题区（内容区首部，与面包屑形成视觉层级） */
.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-bottom: var(--sp-4);
}

.page-head__title {
  margin: 0;
  font-size: var(--fs-xl);
  font-weight: 600;
  letter-spacing: -.2px;
}

.page-head__desc {
  margin: var(--sp-1) 0 0;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
}

.page-head__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ==========================================================================
   §04 侧边栏品牌区与导航
   ========================================================================== */
.sidebar {
  position: relative;
  z-index: 30;
  display: flex;
  flex-direction: column;
  flex: 0 0 224px;
  width: 224px;
  background: #0B2137; /* 深色导航：与商务蓝同色系，保证白字对比度 */
  color: #E2E8F0;
  border-right: 1px solid rgba(255, 255, 255, .06);
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 60px;
  padding: 0 var(--sp-4);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  flex: 0 0 auto;
}

.sidebar__brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: var(--c-primary);
  color: #fff;
  flex: 0 0 auto;
}

.sidebar__brand-text {
  min-width: 0;
}

.sidebar__brand-name {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar__brand-sub {
  display: block;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #7D93A8;
}

.nav {
  flex: 1 1 auto;
  padding: var(--sp-3) var(--sp-2) var(--sp-5);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav__group {
  margin: var(--sp-4) var(--sp-3) var(--sp-2);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  color: #5F7892;
  text-transform: uppercase;
}

.nav__group:first-child {
  margin-top: var(--sp-1);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 9px var(--sp-3);
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: #C6D3E0;
  font-size: var(--fs-md);
  line-height: 1.45;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.nav-item:hover {
  background: rgba(255, 255, 255, .07);
  color: #fff;
  text-decoration: none;
}

.nav-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  color: #8FA6BB;
}

.nav-item__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.nav-item__text {
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item__badge {
  flex: 0 0 auto;
  min-width: 20px;
  padding: 0 6px;
  border-radius: var(--r-full);
  background: var(--c-danger);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  line-height: 18px;
  text-align: center;
}

.nav-item.is-active {
  background: var(--c-primary);
  color: #fff;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(14, 127, 217, .35);
}

.nav-item.is-active .nav-item__icon {
  color: #fff;
}

.sidebar__footer {
  flex: 0 0 auto;
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid rgba(255, 255, 255, .08);
  font-size: var(--fs-xs);
  color: #6B8299;
}

/* ==========================================================================
   §05 抽屉与遮罩（<768px 生效，由布局内联脚本切 .is-open）
   ========================================================================== */

/* 通用抽屉容器：宽屏时保持文档流内布局（由 .sidebar 提供具体样式），
   窄屏时变为离屏抽屉。布局里 <aside class="sidebar drawer"> 同时带两个类。 */
.drawer {
  /* 宽屏无特殊样式；遮罩与开关见下方媒体查询 */
}

.drawer-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, .48);
  opacity: 0;
  transition: opacity .2s ease;
  -webkit-tap-highlight-color: transparent;
}

.drawer-mask.is-open {
  opacity: 1;
  display: block;
}

/* 汉堡按钮：仅窄屏出现 */
.topbar__burger {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  margin-right: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text-2);
  cursor: pointer;
  flex: 0 0 auto;
}

.topbar__burger svg {
  width: 20px;
  height: 20px;
}

/* ==========================================================================
   §06 顶栏
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 60px;
  padding: 0 var(--sp-5);
  background: rgba(255, 255, 255, .92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--c-border);
  flex: 0 0 auto;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
  min-width: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-3);
}

.breadcrumb li {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 0;
  white-space: nowrap;
}

.breadcrumb li + li::before {
  content: "/";
  color: var(--c-border-2);
  font-size: var(--fs-xs);
}

.breadcrumb a {
  color: var(--c-text-2);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--c-primary);
}

.breadcrumb__current {
  color: var(--c-text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__spacer {
  flex: 1 1 auto;
}

.topbar__org {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 320px;
  padding: 4px 10px;
  border-radius: var(--r-full);
  background: var(--c-primary-050);
  color: var(--c-primary-600);
  font-size: var(--fs-xs);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__right {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex: 0 0 auto;
}

/* 通知铃铛 */
.bell {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  color: var(--c-text-2);
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.bell:hover {
  background: #F1F5F9;
  color: var(--c-primary);
  text-decoration: none;
}

.bell svg {
  width: 19px;
  height: 19px;
}

.bell__dot {
  position: absolute;
  top: 3px;
  right: 2px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: var(--r-full);
  background: var(--c-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  border: 2px solid var(--c-surface);
  box-sizing: content-box;
}

/* 窄屏专用退出按钮（宽屏隐藏，改由用户菜单承担） */
.topbar__exit {
  display: none;
  margin: 0;
}

/* 用户菜单（纯 CSS hover 展开，零 JS） */
.user-menu {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 4px 8px 4px 4px;
  border-radius: var(--r-full);
  cursor: default;
}

.user-menu:hover,
.user-menu:focus-within {
  background: #F1F5F9;
}

.user-menu__name {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--c-text);
  line-height: 1.2;
  white-space: nowrap;
}

.user-menu__role {
  display: block;
  font-size: 11px;
  color: var(--c-text-3);
  line-height: 1.3;
  white-space: nowrap;
}

.user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 35;
  /* v1.1.5：原 min-width:200px 下 .kv 数值列仅 ~64px，角色徽章（nowrap ~97px）
     顶破面板右缘（用户截图「出界/被裁切」）、组织名被劈行。改为按内容撑开，
     并用 max-width 兜底窄屏不越出视口。 */
  width: max-content;
  min-width: 224px;
  max-width: min(320px, calc(100vw - 48px));
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--sh-2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.user-menu:hover .user-menu__panel,
.user-menu:focus-within .user-menu__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu__panel .kv {
  padding: var(--sp-2) var(--sp-2) var(--sp-2);
  border-bottom: 1px solid var(--c-border);
  margin-bottom: var(--sp-2);
  font-size: var(--fs-sm);
  /* 标签列收窄到 72px，数值列让位给徽章/组织名/大区名 */
  grid-template-columns: minmax(72px, max-content) minmax(0, 1fr);
}

.user-menu__link,
.user-menu__logout {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  width: 100%;
  padding: 8px var(--sp-2);
  border: 0;
  border-radius: var(--r-sm);
  background: none;
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.user-menu__link:hover,
.user-menu__logout:hover {
  background: var(--c-primary-050);
  color: var(--c-primary-600);
  text-decoration: none;
}

.user-menu__logout {
  color: var(--c-danger);
}

.user-menu__logout:hover {
  background: #FEF2F2;
  color: var(--c-danger);
}

.user-menu__form {
  margin: 0;
}

/* ==========================================================================
   §06.5 高德地址选点器（后台组织/校区表单，partials/amap_picker.php）
   ========================================================================== */
.ap-search {
  display: flex;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
}

.ap-search .input {
  flex: 1 1 auto;
  min-width: 0;
}

.ap-map {
  width: 100%;
  max-width: 560px;
  height: 260px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--c-bg);
}

/* 选点确认条（v1.2.6）：拖动/点击只移动 marker，点「确认选点」才写经纬度 */
.ap-pickbar {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  max-width: 560px;
  margin-top: var(--sp-2);
}

.ap-pickbar .btn[disabled] {
  opacity: .45;
  cursor: not-allowed;
}

.ap-pickbar__hint {
  flex: 1 1 auto;
  min-width: 0;
  color: var(--c-text-3);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* 有未确认的移动时，提示变成强调色，提醒用户还得点按钮 */
.ap-pickbar.is-dirty .ap-pickbar__hint {
  color: var(--c-warn-700, #B45309);
  font-weight: 600;
}

.ap-result {
  max-width: 560px;
  max-height: 176px;
  overflow-y: auto;
  margin-top: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}

.ap-result:empty {
  display: none;
}

.ap-poi {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  background: none;
  color: var(--c-text);
  font-size: var(--fs-sm);
  text-align: left;
  cursor: pointer;
}

.ap-poi:hover {
  background: var(--c-primary-050);
}

.ap-poi__addr {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.ap-coords {
  display: flex;
  gap: 8px;
}

/* ==========================================================================
   §07 卡片
   ========================================================================== */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  margin-bottom: var(--sp-4);
  overflow: hidden;
}

.card:last-child {
  margin-bottom: 0;
}

.card--flat {
  box-shadow: none;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}

.card__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.card__desc {
  margin: 2px 0 0;
  font-size: var(--fs-sm);
  color: var(--c-text-3);
}

.card__extra {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

.card__body {
  padding: var(--sp-5);
}

.card__body--tight {
  padding: var(--sp-4);
}

.card__body--flush {
  padding: 0;
}

.card__foot {
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: #FCFDFE;
}

/* ==========================================================================
   §08 统计卡
   ========================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-bottom: var(--sp-4);
}

.stat-grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stat-card {
  position: relative;
  padding: var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--sh-1);
  overflow: hidden;
}

.stat-card::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--c-primary);
  opacity: .85;
}

.stat-card--success::after { background: var(--c-success); }
.stat-card--warn::after { background: var(--c-warn); }
.stat-card--danger::after { background: var(--c-danger); }
.stat-card--info::after { background: var(--c-info); }

.stat-card__label {
  display: block;
  margin-bottom: var(--sp-2);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
}

.stat-card__value {
  display: block;
  font-size: var(--fs-3xl);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.5px;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

.stat-card__value small {
  margin-left: 4px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-3);
}

.stat-card__hint {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: var(--sp-2);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.stat-card__hint--up { color: var(--c-success); }
.stat-card__hint--down { color: var(--c-danger); }

.stat-card__icon {
  position: absolute;
  top: var(--sp-4);
  right: var(--sp-4);
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-md);
  background: var(--c-primary-050);
  color: var(--c-primary);
}

.stat-card__icon svg {
  width: 18px;
  height: 18px;
}

/* 趋势图占位（真实图表由 Support/Chart.php 输出服务端 SVG） */
.chart-box {
  position: relative;
  min-height: 220px;
  padding: var(--sp-3) 0 0;
}

.chart-box svg {
  display: block;
  width: 100%;
  height: auto;
}

.chart-legend {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-2);
}

.chart-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-legend__swatch {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--c-primary);
}

/* ==========================================================================
   §09 表格
   ========================================================================== */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-md);
}

.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-md);
  background: var(--c-surface);
}

.table th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: var(--sp-3) var(--sp-4);
  background: #F8FAFC;
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  vertical-align: middle;
}

.table tbody tr:last-child td {
  border-bottom: 0;
}

.table tbody tr:hover td {
  background: #FAFCFE;
}

.table--compact th {
  padding: 8px var(--sp-3);
}

.table--compact td {
  padding: 7px var(--sp-3);
  font-size: var(--fs-sm);
}

.table--bordered th,
.table--bordered td {
  border-right: 1px solid var(--c-border);
}

.table--bordered th:last-child,
.table--bordered td:last-child {
  border-right: 0;
}

.table .is-num,
.table th.is-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .is-center,
.table th.is-center {
  text-align: center;
}

.table__sub {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.table__primary {
  font-weight: 500;
}

.table-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: nowrap;
}

.table-actions form {
  margin: 0;
  display: inline-flex;
}

/* 表格空状态 */
.table-empty {
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}

.table-empty__icon {
  margin: 0 auto var(--sp-3);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: #F1F5F9;
  color: var(--c-text-3);
}

.table-empty__icon svg {
  width: 22px;
  height: 22px;
}

.table-empty__text {
  margin-bottom: var(--sp-3);
}

/* 行内状态点（列表里表达「已上架/待审」等轻量状态） */
.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 6px;
  border-radius: var(--r-full);
  background: var(--c-text-3);
  vertical-align: middle;
}

.dot--success { background: var(--c-success); }
.dot--warn { background: var(--c-warn); }
.dot--danger { background: var(--c-danger); }
.dot--info { background: var(--c-info); }

/* ==========================================================================
   §10 表单
   ========================================================================== */
.form {
  display: block;
  max-width: 880px;
}

.form--wide {
  max-width: none;
}

.form-section {
  padding: 0 0 var(--sp-5);
  margin-bottom: var(--sp-5);
  border-bottom: 1px solid var(--c-border);
}

.form-section:last-of-type {
  padding-bottom: 0;
  margin-bottom: var(--sp-4);
  border-bottom: 0;
}

.form-section__title {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
}

.form-section__title span {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-3);
}

.form-row {
  margin-bottom: var(--sp-4);
}

.form-row:last-child {
  margin-bottom: 0;
}

.form-row--2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}

.form-row--3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--sp-4);
}

/* 标签 + 控件：单选/复选组也用同一套 label */
.label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--c-text-2);
}

.label__req {
  margin-left: 2px;
  color: var(--c-danger);
}

.label__tip {
  margin-left: var(--sp-2);
  font-size: var(--fs-xs);
  font-weight: 400;
  color: var(--c-text-3);
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  padding: 8px var(--sp-3);
  border: 1px solid var(--c-border-2);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text);
  font-size: var(--fs-md);
  line-height: 1.5;
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none;
  -webkit-appearance: none;
}

.input {
  height: 38px;
}

.select {
  height: 38px;
  padding-right: 30px;
  /* 内联 SVG 箭头（data URI 本地编码，零外部请求） */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8.4 1.6 4h8.8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 10px;
}

.textarea {
  min-height: 92px;
  resize: vertical;
  line-height: 1.6;
}

.input:hover,
.select:hover,
.textarea:hover {
  border-color: var(--c-text-3);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(14, 127, 217, .14);
  outline: none;
}

.input::placeholder,
.textarea::placeholder {
  color: #B6C2D2;
}

.input:disabled,
.select:disabled,
.textarea:disabled,
.input[readonly] {
  background: #F8FAFC;
  color: var(--c-text-3);
  cursor: not-allowed;
}

.input--sm,
.select--sm {
  height: 32px;
  font-size: var(--fs-sm);
}

.input--code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* 大号输码框（核销页：扫码枪键盘输入 / 手输编号） */
.input--xl {
  height: 56px;
  padding: 0 var(--sp-4);
  border-radius: var(--r-md);
  font-size: var(--fs-xl);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-align: center;
}

/* 错误态：以 .is-error 标记控件 / 容器 */
.is-error > .input,
.is-error > .select,
.is-error > .textarea,
.input.is-error,
.select.is-error,
.textarea.is-error {
  border-color: var(--c-danger);
  background: #FFFBFB;
}

.is-error > .input:focus,
.input.is-error:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, .14);
}

.field-error {
  display: block;
  margin-top: 6px;
  color: var(--c-danger);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

.field-hint {
  display: block;
  margin-top: 6px;
  color: var(--c-text-3);
  font-size: var(--fs-xs);
  line-height: 1.5;
}

/* 单选 / 复选 */
.checkbox {
  display: inline-flex;
  align-items: flex-start;
  gap: var(--sp-2);
  font-size: var(--fs-md);
  color: var(--c-text);
  cursor: pointer;
  user-select: none;
  line-height: 1.5;
}

.checkbox input[type="checkbox"],
.checkbox input[type="radio"] {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  accent-color: var(--c-primary);
  cursor: pointer;
  flex: 0 0 auto;
}

.checkbox + .checkbox {
  margin-left: var(--sp-4);
}

.radio-group {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  padding-top: 6px;
}

.radio-group--stack {
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-2);
}

/* 表单底部操作区 */
.form-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
}

.form-actions__hint {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.form-actions__spacer {
  flex: 1 1 auto;
}

/* 输入框 + 按钮 的组合（如「发送验证码」） */
.input-group {
  display: flex;
  align-items: stretch;
  gap: var(--sp-2);
}

.input-group > .input {
  flex: 1 1 auto;
}

.input-group > .btn {
  flex: 0 0 auto;
}

/* 筛选条（partials/filters.php） */
.filters {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: #FCFDFE;
}

.filters__item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 150px;
}

.filters__item--grow {
  flex: 1 1 220px;
  min-width: 200px;
}

.filters__item .label {
  margin-bottom: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.filters__actions {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding-bottom: 1px;
}

/* ==========================================================================
   §11 按钮
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 var(--sp-4);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: #EEF2F7;
  color: var(--c-text);
  font-size: var(--fs-md);
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
  user-select: none;
}

.btn:hover {
  text-decoration: none;
  filter: brightness(.97);
}

.btn:active {
  transform: translateY(.5px);
}

.btn svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
}

.btn--primary {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(14, 127, 217, .3);
}

.btn--primary:hover {
  background: var(--c-primary-600);
  border-color: var(--c-primary-600);
  color: #fff;
  filter: none;
}

.btn--secondary {
  background: var(--c-surface);
  border-color: var(--c-border-2);
  color: var(--c-text-2);
}

.btn--secondary:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: var(--c-primary-050);
  filter: none;
}

.btn--danger {
  background: var(--c-danger);
  border-color: var(--c-danger);
  color: #fff;
}

.btn--danger:hover {
  background: #B91C1C;
  border-color: #B91C1C;
  color: #fff;
  filter: none;
}

.btn--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--c-primary);
  padding: 0 var(--sp-2);
}

.btn--ghost:hover {
  background: var(--c-primary-050);
  filter: none;
}

.btn--sm {
  height: 29px;
  padding: 0 var(--sp-3);
  font-size: var(--fs-sm);
  border-radius: var(--r-sm);
}

.btn--sm svg {
  width: 14px;
  height: 14px;
}

.btn--lg {
  height: 44px;
  padding: 0 var(--sp-5);
  font-size: var(--fs-lg);
  border-radius: var(--r-md);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn[disabled],
.btn.is-disabled {
  opacity: .55;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.btn--link {
  height: auto;
  padding: 0;
  background: none;
  border: 0;
  color: var(--c-primary);
  font-weight: 400;
}

.btn--link:hover {
  background: none;
  text-decoration: underline;
  filter: none;
}

/* ==========================================================================
   §12 徽章与标签
   状态色口径：待审=橙、通过=绿、驳回=红、下架=灰、已约=蓝
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 1px 8px;
  border-radius: var(--r-full);
  background: #F1F5F9;
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
  vertical-align: middle;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: var(--r-full);
  background: currentColor;
  opacity: .8;
}

.badge--plain::before,
.badge--no-dot::before {
  display: none;
}

.badge--success {
  background: #ECFDF3;
  color: var(--c-success);
}

.badge--warn {
  background: #FFF7ED;
  color: var(--c-warn);
}

.badge--danger {
  background: #FEF2F2;
  color: var(--c-danger);
}

.badge--info {
  background: #EFF6FF;
  color: var(--c-info);
}

.badge--neutral {
  background: #F1F5F9;
  color: var(--c-text-3);
}

.badge--primary {
  background: var(--c-primary-050);
  color: var(--c-primary-600);
}

.badge--lg {
  padding: 3px 10px;
  font-size: var(--fs-sm);
  line-height: 20px;
}

/* 角色徽章（顶栏用户菜单用） */
.badge--role {
  background: rgba(14, 127, 217, .1);
  color: var(--c-primary-600);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  line-height: 18px;
  white-space: nowrap;
}

.chip--active {
  border-color: var(--c-primary);
  background: var(--c-primary-050);
  color: var(--c-primary-600);
}

.chip__close {
  border: 0;
  background: none;
  padding: 0;
  color: inherit;
  cursor: pointer;
  opacity: .6;
  font-size: 13px;
  line-height: 1;
}

.chip__close:hover {
  opacity: 1;
}

.chips {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
}

/* ==========================================================================
   §13 页签
   ========================================================================== */
.tabs {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0 var(--sp-5);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: var(--sp-3) var(--sp-3);
  color: var(--c-text-2);
  font-size: var(--fs-md);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}

.tab:hover {
  color: var(--c-primary);
  text-decoration: none;
}

.tab.is-active {
  color: var(--c-primary);
  font-weight: 600;
  border-bottom-color: var(--c-primary);
}

.tab__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: #F1F5F9;
  color: var(--c-text-2);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.tab.is-active .tab__count {
  background: var(--c-primary-050);
  color: var(--c-primary-600);
}

/* ==========================================================================
   §14 提示条
   ========================================================================== */
.flash {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  margin-bottom: var(--sp-4);
  border: 1px solid var(--c-border);
  border-left-width: 3px;
  border-radius: var(--r-sm);
  background: var(--c-surface);
  font-size: var(--fs-md);
  line-height: 1.55;
  animation: flash-in .2s ease;
}

@keyframes flash-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.flash__icon {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.flash__icon svg {
  width: 18px;
  height: 18px;
  display: block;
}

.flash__body {
  flex: 1 1 auto;
  min-width: 0;
}

.flash__title {
  display: block;
  font-weight: 600;
  margin-bottom: 2px;
}

.flash--success {
  border-color: #BBF7D0;
  border-left-color: var(--c-success);
  background: #F0FDF4;
  color: #14532D;
}

.flash--success .flash__icon { color: var(--c-success); }

.flash--error {
  border-color: #FECACA;
  border-left-color: var(--c-danger);
  background: #FEF2F2;
  color: #7F1D1D;
}

.flash--error .flash__icon { color: var(--c-danger); }

.flash--info {
  border-color: #BFDBFE;
  border-left-color: var(--c-info);
  background: #EFF6FF;
  color: #1E3A8A;
}

.flash--info .flash__icon { color: var(--c-info); }

.flash__close {
  flex: 0 0 auto;
  border: 0;
  background: none;
  padding: 0 2px;
  color: inherit;
  opacity: .45;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
}

.flash__close:hover {
  opacity: .9;
}

/* 页内静态提示（不自动消失，用于表单顶部说明 / 核销结果） */
.alert {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: #F8FAFC;
  color: var(--c-text-2);
  font-size: var(--fs-md);
  line-height: 1.6;
  margin-bottom: var(--sp-4);
}

.alert:last-child {
  margin-bottom: 0;
}

.alert__title {
  display: block;
  margin-bottom: 2px;
  font-weight: 600;
  color: var(--c-text);
}

.alert--info {
  border-color: #BFDBFE;
  background: #EFF6FF;
  color: #1E40AF;
}

.alert--warn {
  border-color: #FDE68A;
  background: #FFFBEB;
  color: #92400E;
}

.alert--danger {
  border-color: #FECACA;
  background: #FEF2F2;
  color: #991B1B;
}

.alert--success {
  border-color: #BBF7D0;
  background: #F0FDF4;
  color: #166534;
}

/* 页内轻提示（.toast 为静态定位的提示块，非浮层脚本） */
.toast {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 6px var(--sp-3);
  border-radius: var(--r-sm);
  background: #0F172A;
  color: #fff;
  font-size: var(--fs-sm);
  line-height: 1.5;
}

.toast--success { background: var(--c-success); }
.toast--error { background: var(--c-danger); }
.toast--info { background: var(--c-info); }

/* 核销结果横幅（六种结果之一，页内大号展示） */
.verify-result {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  border-radius: var(--r-md);
  border: 1px solid var(--c-border);
  background: var(--c-surface);
  margin-bottom: var(--sp-4);
}

.verify-result__icon {
  flex: 0 0 auto;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: #F1F5F9;
  color: var(--c-text-2);
}

.verify-result__icon svg {
  width: 26px;
  height: 26px;
}

.verify-result__title {
  margin: 0 0 2px;
  font-size: var(--fs-xl);
  font-weight: 700;
}

.verify-result__desc {
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--c-text-2);
}

.verify-result--success {
  border-color: #BBF7D0;
  background: #F0FDF4;
}

.verify-result--success .verify-result__icon {
  background: var(--c-success);
  color: #fff;
}

.verify-result--success .verify-result__title { color: #14532D; }

.verify-result--warn {
  border-color: #FDE68A;
  background: #FFFBEB;
}

.verify-result--warn .verify-result__icon {
  background: var(--c-warn);
  color: #fff;
}

.verify-result--warn .verify-result__title { color: #92400E; }

.verify-result--danger {
  border-color: #FECACA;
  background: #FEF2F2;
}

.verify-result--danger .verify-result__icon {
  background: var(--c-danger);
  color: #fff;
}

.verify-result--danger .verify-result__title { color: #991B1B; }

/* ==========================================================================
   §15 空状态
   ========================================================================== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--sp-6) var(--sp-4);
  text-align: center;
}

.empty__icon {
  width: 64px;
  height: 64px;
  margin-bottom: var(--sp-4);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-full);
  background: #F1F5F9;
  color: var(--c-text-3);
}

.empty__icon svg {
  width: 28px;
  height: 28px;
}

.empty__text {
  max-width: 420px;
  margin-bottom: var(--sp-4);
  color: var(--c-text-3);
  font-size: var(--fs-sm);
  line-height: 1.7;
}

.empty__text strong {
  display: block;
  margin-bottom: 4px;
  color: var(--c-text-2);
  font-size: var(--fs-md);
}

.empty__action {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* ==========================================================================
   §16 分页
   ========================================================================== */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
  padding: var(--sp-3) var(--sp-5);
  border-top: 1px solid var(--c-border);
  background: #FCFDFE;
  font-size: var(--fs-sm);
}

.pager__list {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pager__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  background: var(--c-surface);
  color: var(--c-text-2);
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.pager__link:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  text-decoration: none;
}

.pager__link.is-active {
  background: var(--c-primary);
  border-color: var(--c-primary);
  color: #fff;
  font-weight: 600;
}

.pager__link.is-disabled {
  color: var(--c-border-2);
  background: #F8FAFC;
  pointer-events: none;
}

.pager__gap {
  display: inline-flex;
  align-items: flex-end;
  justify-content: center;
  min-width: 22px;
  height: 32px;
  color: var(--c-text-3);
}

.pager__info {
  color: var(--c-text-3);
  font-size: var(--fs-sm);
}

.pager__info strong {
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   §17 凭证区（预约凭证：QR + 条码 + 大号编号同屏）
   ========================================================================== */
.voucher {
  max-width: 420px;
  margin: 0 auto;
  padding: var(--sp-5);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-2);
  text-align: center;
}

.voucher__head {
  padding-bottom: var(--sp-4);
  border-bottom: 1px dashed var(--c-border-2);
  margin-bottom: var(--sp-4);
}

.voucher__title {
  margin: 0 0 4px;
  font-size: var(--fs-lg);
  font-weight: 600;
}

.voucher__sub {
  margin: 0;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.voucher__qr {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
  margin: 0 auto var(--sp-4);
  padding: var(--sp-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: #fff;
}

.voucher__qr svg,
.voucher__qr img {
  display: block;
  width: 100%;
  height: 100%;
}

.voucher__bar {
  margin: 0 auto var(--sp-4);
  padding: var(--sp-2) 0;
  max-width: 320px;
  overflow: hidden;
}

.voucher__bar svg,
.voucher__bar img {
  display: block;
  width: 100%;
  height: auto;
}

.voucher__code {
  margin-bottom: var(--sp-4);
}

.code-text {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--c-text);
  font-variant-numeric: tabular-nums;
  word-break: break-all;
}

.code-text--sm {
  font-size: var(--fs-lg);
  letter-spacing: .04em;
  font-weight: 600;
}

.voucher__meta {
  padding-top: var(--sp-4);
  border-top: 1px dashed var(--c-border-2);
  text-align: left;
}

.voucher__hint {
  margin-top: var(--sp-4);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  line-height: 1.7;
}

/* ==========================================================================
   §18 移动端列表（PC 窄屏折叠 / H5 卡片列表复用）
   ========================================================================== */
.m-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
  list-style: none;
}

.m-item {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-4);
  border-bottom: 1px solid var(--c-border);
  background: var(--c-surface);
}

.m-item:last-child {
  border-bottom: 0;
}

.m-item__main {
  flex: 1 1 auto;
  min-width: 0;
}

.m-item__title {
  display: block;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 2px;
  word-break: break-word;
}

.m-item__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  line-height: 1.6;
}

.m-item__action {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  align-self: center;
}

.m-card {
  display: block;
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
  box-shadow: var(--sh-1);
  color: inherit;
  text-decoration: none;
}

.m-card:hover {
  text-decoration: none;
  border-color: var(--c-border-2);
  box-shadow: var(--sh-2);
}

.m-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-bottom: var(--sp-2);
}

.m-card__title {
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
}

.m-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
  font-size: var(--fs-sm);
  color: var(--c-text-2);
}

.m-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

/* ==========================================================================
   §19 课表网格（服务端渲染：日期 × 时间，表头吸顶）
   ========================================================================== */
.timetable-wrap {
  width: 100%;
  overflow: auto;
  max-height: 70vh;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface);
}

.timetable {
  width: 100%;
  min-width: 760px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-sm);
}

.timetable th,
.timetable td {
  border-right: 1px solid var(--c-border);
  border-bottom: 1px solid var(--c-border);
  padding: 0;
  vertical-align: top;
}

.timetable thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: var(--sp-3) var(--sp-2);
  background: #F8FAFC;
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

/* 左上角固定单元格（时段列头） */
.timetable thead th:first-child,
.timetable tbody th {
  position: sticky;
  left: 0;
  z-index: 3;
  min-width: 88px;
  background: #F8FAFC;
  border-right: 1px solid var(--c-border-2);
  color: var(--c-text-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
}

.timetable thead th:first-child {
  top: 0;
  z-index: 4;
}

.timetable tbody th {
  vertical-align: middle;
  padding: var(--sp-2);
}

.timetable td {
  min-width: 108px;
  height: 62px;
}

.timetable tr:last-child th,
.timetable tr:last-child td {
  border-bottom: 0;
}

.timetable th:last-child,
.timetable td:last-child {
  border-right: 0;
}

.timetable__cell {
  display: block;
  padding: 6px 8px;
  min-height: 60px;
  color: var(--c-text-2);
  text-decoration: none;
  line-height: 1.45;
}

a.timetable__cell:hover {
  background: var(--c-primary-050);
  text-decoration: none;
}

.timetable__campus {
  display: block;
  font-size: var(--fs-xs);
  font-weight: 600;
  color: var(--c-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.timetable__count {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: var(--c-text-3);
  font-variant-numeric: tabular-nums;
}

.timetable__cell.is-full {
  background: #FFF7ED;
}

.timetable__cell.is-full .timetable__count {
  color: var(--c-warn);
  font-weight: 600;
}

.timetable__cell.is-past {
  background: #F8FAFC;
  opacity: .62;
}

.timetable__cell.is-cancelled {
  background: #FEF2F2;
}

.timetable__cell.is-cancelled .timetable__campus {
  color: var(--c-danger);
  text-decoration: line-through;
}

.timetable__empty {
  display: block;
  min-height: 60px;
  background:
    repeating-linear-gradient(45deg, #FCFDFE, #FCFDFE 6px, #F8FAFC 6px, #F8FAFC 12px);
}

.timetable__legend {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-wrap: wrap;
  margin-top: var(--sp-3);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.timetable__legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.timetable__legend i {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid var(--c-border);
  display: inline-block;
}

/* ==========================================================================
   §20 登录 / 错误页（blank 布局）
   ========================================================================== */
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: var(--sp-5);
  background:
    radial-gradient(1000px 480px at 12% -10%, #E8F3FC 0%, rgba(232, 243, 252, 0) 62%),
    radial-gradient(900px 460px at 100% 0%, #EEF6FF 0%, rgba(238, 246, 255, 0) 58%),
    var(--c-bg);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: var(--sp-6);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: var(--sh-2);
}

.auth-card--wide {
  max-width: 520px;
}

.auth-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

.auth-brand__logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  background: var(--c-primary);
  color: #fff;
}

.auth-brand__text {
  text-align: left;
}

.auth-brand__name {
  display: block;
  font-size: var(--fs-lg);
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
}

.auth-brand__sub {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

.auth-title {
  margin: 0 0 4px;
  font-size: var(--fs-xl);
  font-weight: 600;
  text-align: center;
}

.auth-desc {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--c-text-3);
  text-align: center;
}

.auth-card .form-row {
  margin-bottom: var(--sp-4);
}

.auth-foot {
  margin-top: var(--sp-5);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-border);
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  text-align: center;
  line-height: 1.7;
}

/* 错误页（403 / 404 / 500） */
.err-code {
  display: block;
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -2px;
  color: var(--c-primary);
  text-align: center;
  margin-bottom: var(--sp-2);
}

.err-code--warn { color: var(--c-warn); }
.err-code--danger { color: var(--c-danger); }

.err-title {
  margin: 0 0 var(--sp-2);
  font-size: var(--fs-lg);
  font-weight: 600;
  text-align: center;
}

.err-text {
  margin: 0 0 var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--c-text-2);
  text-align: center;
  line-height: 1.7;
}

.err-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}

/* ==========================================================================
   §21 加载骨架（服务端渲染页面极少用到，保留给耗时较长的统计块占位）
   ========================================================================== */
.skeleton {
  display: block;
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, #EEF2F7 25%, #F6F8FB 37%, #EEF2F7 63%);
  background-size: 400% 100%;
  animation: skeleton-shine 1.4s ease infinite;
}

.skeleton--text {
  height: 12px;
  margin-bottom: var(--sp-2);
}

.skeleton--title {
  height: 20px;
  width: 40%;
  margin-bottom: var(--sp-3);
}

.skeleton--block {
  height: 120px;
}

@keyframes skeleton-shine {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

/* ==========================================================================
   §22 主题切换：PC 主题显式声明 + H5 主题覆盖（body.theme-h5，严格按 §4.2）
   ========================================================================== */

/* PC 主题：:root 的默认令牌即 PC 口径，此处显式声明一次，
   便于后续做「同一页面双主题」时对照阅读，也可被页面级样式安全覆盖。 */
body.theme-pc {
  --c-primary: #0E7FD9;
  --c-primary-600: #0A66B2;
  background: var(--c-bg);
  color: var(--c-text);
}

body.theme-h5 {
  --c-primary: var(--c-h5-primary);
  --c-primary-600: var(--c-h5-primary-600);
  --r-md: 14px;
  --r-lg: 18px;
  --r-xl: 22px;
  --c-bg: #F0F9FF;
}

body.theme-h5 .btn--primary {
  background: linear-gradient(135deg, var(--c-h5-primary) 0%, var(--c-h5-primary-600) 100%);
  border-color: var(--c-h5-primary-600);
  box-shadow: 0 6px 16px rgba(56, 189, 248, .32);
}

body.theme-h5 .btn--primary:hover {
  background: var(--c-h5-primary-600);
  border-color: var(--c-h5-primary-600);
}

body.theme-h5 .badge--primary {
  background: rgba(56, 189, 248, .14);
  color: #0369A1;
}

body.theme-h5 .card,
body.theme-h5 .m-card {
  border-radius: var(--r-lg);
  border-color: rgba(56, 189, 248, .16);
}

body.theme-h5 .input,
body.theme-h5 .select,
body.theme-h5 .textarea {
  border-radius: var(--r-md);
}

body.theme-h5 .tab.is-active {
  border-bottom-color: var(--c-h5-primary-600);
}

/* ==========================================================================
   §23 H5 布局（学员端：移动优先，最大宽度 480px 居中）
   ========================================================================== */
.h5-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--c-bg);
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .04);
  position: relative;
}

.h5-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  height: 48px;
  padding: 0 var(--sp-3);
  /* v1.1.6：去掉蓝色渐变（原 linear-gradient(135deg, --c-h5-primary ...)） */
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  color: var(--c-text);
  flex: 0 0 auto;
}

.h5-header__back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: -6px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--c-bg);
  color: var(--c-text-2);
  cursor: pointer;
  flex: 0 0 auto;
  text-decoration: none;
}

.h5-header__back:hover {
  background: #EEF2F7;
  color: var(--c-text);
  text-decoration: none;
}

.h5-header__back svg {
  width: 18px;
  height: 18px;
}

.h5-header__title {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.h5-header__right {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-width: 32px;
  justify-content: flex-end;
}

.h5-header__action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: var(--r-full);
  background: var(--c-bg);
  color: var(--c-text-2);
  text-decoration: none;
}

.h5-header__action svg {
  width: 18px;
  height: 18px;
}

.h5-body {
  flex: 1 1 auto;
  padding: var(--sp-4) var(--sp-4) var(--sp-5);
  /* 底部安全区 + TabBar 高度，避免内容被遮挡 */
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

.h5-body--notab {
  padding-bottom: calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
}

/* 底部 TabBar（四个入口，图标为内联 SVG） */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 25;
  display: flex;
  align-items: stretch;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, .97);
  backdrop-filter: saturate(180%) blur(10px);
  border-top: 1px solid rgba(56, 189, 248, .2);
}

.tabbar__item {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 52px;
  padding: 6px 0 4px;
  color: #7C9CB4;
  font-size: 11px;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: color .15s ease;
}

.tabbar__item:hover {
  color: var(--c-h5-primary-600);
  text-decoration: none;
}

.tabbar__item svg {
  width: 22px;
  height: 22px;
  display: block;
}

.tabbar__item.is-active {
  color: var(--c-h5-primary-600);
  font-weight: 600;
}

.tabbar__item.is-active svg {
  transform: translateY(-1px);
}

.tabbar__label {
  line-height: 1;
}

/* H5 首页卡片（置顶校区 / 最近课程） */
.h5-hero {
  padding: var(--sp-5) var(--sp-4);
  margin-bottom: var(--sp-4);
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--c-h5-primary) 0%, var(--c-h5-accent) 100%);
  color: #fff;
  box-shadow: 0 10px 24px rgba(56, 189, 248, .28);
}

.h5-hero__title {
  margin: 0 0 4px;
  font-size: var(--fs-xl);
  font-weight: 700;
  color: #fff;
}

.h5-hero__sub {
  margin: 0;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, .9);
}

.h5-section {
  margin-bottom: var(--sp-4);
}

.h5-section__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  padding: 0 2px;
}

.h5-section__title {
  margin: 0;
  font-size: var(--fs-md);
  font-weight: 600;
  color: var(--c-text);
}

.h5-section__more {
  font-size: var(--fs-xs);
  color: var(--c-h5-primary-600);
  text-decoration: none;
}

.h5-card {
  display: block;
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  border-radius: var(--r-lg);
  background: var(--c-surface);
  box-shadow: 0 2px 10px rgba(15, 23, 42, .05);
  color: inherit;
  text-decoration: none;
}

.h5-card:last-child {
  margin-bottom: 0;
}

.h5-card:hover {
  text-decoration: none;
}

.h5-card__title {
  margin: 0 0 4px;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--c-text);
}

.h5-card__meta {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-wrap: wrap;
  font-size: var(--fs-xs);
  color: #6B8CA6;
}

.h5-card__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  margin-top: var(--sp-3);
  padding-top: var(--sp-3);
  border-top: 1px solid rgba(56, 189, 248, .16);
}

.h5-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: var(--sp-3);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, #E0F2FE 0%, #CFFAFE 100%);
  overflow: hidden;
}

.h5-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.h5-fixed-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 24;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: var(--sp-3) var(--sp-4);
  padding-bottom: calc(var(--sp-3) + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .98);
  border-top: 1px solid rgba(56, 189, 248, .2);
  box-shadow: 0 -4px 16px rgba(15, 23, 42, .06);
}

/* ==========================================================================
   §24 响应式断点
   —— >=1280：内容最大 1360 居中（.content 已设置）
   —— 768~1279：侧边栏收窄、统计卡两列
   —— <768：侧边栏变抽屉、单列、表格横向滚动
   ========================================================================== */

/* 1280 以上：更宽松的留白 */
@media (min-width: 1280px) {
  .content {
    padding-left: var(--sp-6);
    padding-right: var(--sp-6);
  }

  .sidebar {
    flex-basis: 236px;
    width: 236px;
  }
}

/* 1024~1279：侧边栏收窄、统计卡 2×2 */
@media (max-width: 1279px) {
  .sidebar {
    flex-basis: 200px;
    width: 200px;
  }

  .nav-item {
    padding: 8px 10px;
    font-size: var(--fs-sm);
  }

  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .content {
    padding: var(--sp-4);
  }

  .grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 小于 1024：表单两列降为单列 */
@media (max-width: 1023px) {
  .form-row--2,
  .form-row--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .grid-2 {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 小于 768：PC 布局折叠为抽屉 */
@media (max-width: 767px) {
  /* 侧边栏变成离屏抽屉 */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 45;
    width: 264px;
    flex-basis: 264px;
    transform: translateX(-100%);
    transition: transform .24s ease;
    box-shadow: 4px 0 24px rgba(15, 23, 42, .18);
  }

  .sidebar.is-open,
  .drawer.is-open {
    transform: translateX(0);
  }

  /* 通用 .drawer（非侧边栏用法）：窄屏同样变离屏抽屉 */
  .drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 45;
    transform: translateX(-100%);
    transition: transform .24s ease;
  }

  /* 窄屏兜底：用户菜单的 hover 面板在触屏上不易触达，改用独立退出按钮 */
  .user-menu__panel {
    display: none;
  }

  .topbar__exit {
    display: flex;
    align-items: center;
  }

  .topbar__burger {
    display: inline-flex;
  }

  .topbar {
    height: 52px;
    padding: 0 var(--sp-3);
  }

  .content {
    padding: var(--sp-3) var(--sp-3) var(--sp-5);
  }

  /* 面包屑在窄屏只保留最后一级，省空间 */
  .breadcrumb li:not(:last-child) {
    display: none;
  }

  .breadcrumb li + li::before {
    display: none;
  }

  .user-menu__name,
  .user-menu__role {
    display: none;
  }

  .topbar__org {
    max-width: 150px;
  }

  /* 单列化 */
  .stat-grid,
  .stat-grid--3,
  .grid-2,
  .grid-3,
  .form-row--2,
  .form-row--3 {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card {
    padding: var(--sp-4);
  }

  .stat-card__value {
    font-size: var(--fs-2xl);
  }

  .card__head,
  .card__body,
  .card__foot {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .filters,
  .pager {
    padding-left: var(--sp-4);
    padding-right: var(--sp-4);
  }

  .filters__item {
    width: 100%;
    min-width: 0;
  }

  .filters__actions {
    width: 100%;
  }

  .filters__actions .btn {
    flex: 1 1 auto;
  }

  /* 表格横向滚动（窄屏下保持列结构可读） */
  .table-wrap {
    border-radius: var(--r-sm);
    overflow-x: auto;
  }

  .table {
    min-width: 640px;
  }

  .table th,
  .table td {
    padding: 10px var(--sp-3);
  }

  /* 分页在窄屏堆叠 */
  .pager {
    flex-direction: column;
    align-items: flex-start;
  }

  .pager__list {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .page-head {
    flex-direction: column;
    align-items: stretch;
  }

  .page-head__actions {
    width: 100%;
  }

  .page-head__actions .btn {
    flex: 1 1 auto;
  }

  .form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
  }

  .auth-wrap {
    padding: var(--sp-4);
    align-items: flex-start;
    padding-top: var(--sp-6);
  }

  .auth-card {
    padding: var(--sp-5) var(--sp-4);
  }

  .voucher {
    padding: var(--sp-4);
    border-radius: var(--r-md);
  }

  .voucher__qr {
    width: 176px;
    height: 176px;
  }

  .code-text {
    font-size: 24px;
  }

  .err-code {
    font-size: 44px;
  }

  .verify-result {
    flex-direction: column;
    text-align: center;
    padding: var(--sp-4);
  }

  .timetable thead th:first-child,
  .timetable tbody th {
    min-width: 72px;
  }
}

/* 超窄屏（<=375，H5 基准宽度）进一步压缩留白 */
@media (max-width: 375px) {
  .h5-body {
    padding-left: var(--sp-3);
    padding-right: var(--sp-3);
  }

  .h5-card {
    padding: var(--sp-3);
  }

  .code-text {
    font-size: 21px;
  }

  .stat-card {
    padding: var(--sp-3);
  }
}

/* 用户偏好减少动效（无障碍） */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   §25 打印样式（凭证 / 报表可直接打印）
   ========================================================================== */
@media print {
  /* 隐藏导航与所有交互控件 */
  .sidebar,
  .topbar,
  .drawer,
  .drawer-mask,
  .tabbar,
  .h5-header,
  .h5-fixed-bar,
  .btn,
  .pager,
  .tabs,
  .filters,
  .flash,
  .form-actions,
  .table-actions,
  .topbar__burger,
  .nav,
  .no-print {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 12pt;
  }

  .app-shell,
  .main,
  .h5-shell {
    display: block !important;
    min-height: 0 !important;
    box-shadow: none !important;
    max-width: none !important;
  }

  .content,
  .h5-body {
    padding: 0 !important;
    max-width: none !important;
  }

  .card {
    border: 1px solid #999 !important;
    box-shadow: none !important;
    page-break-inside: avoid;
  }

  .card__head {
    background: #f2f2f2 !important;
  }

  /* 凭证区独占一页 */
  .voucher {
    border: 1px dashed #666 !important;
    box-shadow: none !important;
    page-break-before: always;
    page-break-inside: avoid;
    max-width: 100%;
  }

  .voucher__qr {
    border: 0 !important;
  }

  .table {
    font-size: 10pt;
  }

  .table th {
    background: #eee !important;
    color: #000 !important;
    position: static !important;
  }

  .table th,
  .table td {
    border-bottom: 1px solid #bbb !important;
  }

  .table-wrap,
  .timetable-wrap {
    overflow: visible !important;
    max-height: none !important;
    border: 1px solid #999 !important;
  }

  .timetable thead th,
  .timetable tbody th {
    position: static !important;
    background: #eee !important;
  }

  .badge {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
  }

  a {
    color: #000 !important;
    text-decoration: none !important;
  }

  /* 打印时展开链接地址（便于纸质留档） */
  .print-url a::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #444;
  }
}

/* ==========================================================================
   §90 补充扩展（清单外、但对页面必要；全部集中在此，避免散落）
   --------------------------------------------------------------------------
   说明：以下类名不在 §4.3 清单内，是落地页面时不可避免的辅助类，
         命名沿用 BEM 风格与清单保持一致，禁止在其它区块重复定义。
   ========================================================================== */

/* 90.1 空数据占位行（表格内单独使用） */
.is-empty td {
  text-align: center;
  color: var(--c-text-3);
  padding: var(--sp-6) var(--sp-4);
}

/* 90.2 内容分栏（左主区 + 右侧栏，如课程详情页） */
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--sp-4);
  align-items: start;
}

@media (max-width: 1023px) {
  .split {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 90.3 键值横向列表（详情页信息条） */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--sp-3) var(--sp-4);
}

.meta-grid__item {
  min-width: 0;
}

.meta-grid__k {
  display: block;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  margin-bottom: 2px;
}

.meta-grid__v {
  display: block;
  font-size: var(--fs-md);
  color: var(--c-text);
  word-break: break-word;
}

/* 90.4 徽章组（一行多个状态） */
.badge-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* 90.5 站内提示小字（表单底部安全提示 / 只读说明） */
.note {
  font-size: var(--fs-xs);
  color: var(--c-text-3);
  line-height: 1.7;
}

/* 90.6 分割线（虚线，用于凭证与详情区） */
.divider--dashed {
  height: 0;
  border-top: 1px dashed var(--c-border-2);
  background: none;
}

/* 90.7 代码块内联复制按钮布局（后期若加复制功能不必改结构） */
.copy-row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

/* 90.8 大号点击区（H5 与触屏 PC，符合 44px 触控最小尺寸） */
.tap {
  min-height: 44px;
  display: flex;
  align-items: center;
}

/* 90.9 表格固定操作列（宽表格横向滚动时保持操作可见） */
.table--sticky-actions th:last-child,
.table--sticky-actions td:last-child {
  position: sticky;
  right: 0;
  background: var(--c-surface);
  box-shadow: -6px 0 12px -8px rgba(15, 23, 42, .18);
}

.table--sticky-actions tbody tr:hover td:last-child {
  background: #FAFCFE;
}

/* 90.10 页脚版权（PC 布局底部） */
.app-foot {
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--c-text-3);
}

/* —— 样式表结束 —— */

/* =============================================================================
 * 安装向导 install.php（独立页面，不走 app 布局，但复用同一设计变量）
 * ============================================================================= */
.install {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
.install__steps {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  list-style: none;
  margin: 0 0 1.75rem;
  padding: 0;
}
.install__step {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .4rem .7rem .4rem .45rem;
  border: 1px solid var(--c-border);
  border-radius: 999px;
  background: var(--c-surface);
  font-size: .85rem;
  color: var(--c-text-3);
}
.install__no {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--c-border);
  color: var(--c-text-2);
  font-size: .78rem;
  font-weight: 600;
}
.install__step.is-current {
  border-color: var(--c-primary);
  color: var(--c-primary);
  font-weight: 600;
}
.install__step.is-current .install__no {
  background: var(--c-primary);
  color: #fff;
}
.install__step.is-done {
  border-color: var(--c-success);
  color: var(--c-success);
}
.install__step.is-done .install__no {
  background: var(--c-success);
  color: #fff;
}

/* 安装页里的面板：直接复用 .card，这里只补标题层级 */
.install .card__title { font-size: 1.05rem; }
.install .form-actions { margin-top: 1.25rem; }

/* 演示数据二选一 */
.choices { display: grid; gap: .75rem; margin: 1rem 0 1.5rem; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: .7rem;
  padding: .9rem 1rem;
  border: 1px solid var(--c-border);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.choice:hover { border-color: var(--c-primary); }
.choice:has(input:checked) {
  border-color: var(--c-primary);
  background: color-mix(in srgb, var(--c-primary) 6%, #fff);
}
.choice input { margin-top: .25rem; }
.choice__body { display: grid; gap: .2rem; }
.choice__body strong { font-size: .95rem; }
.choice__body em { font-style: normal; font-size: .82rem; color: var(--c-text-3); }

/* 装完待办列表 */
.todo { margin: .5rem 0 1rem; padding-left: 1.4rem; }
.todo li { margin-bottom: .35rem; }

/* =============================================================================
 * 服务端 SVG 趋势图（零 JS）
 * ============================================================================= */
.chart { width: 100%; height: auto; display: block; }
.chart__grid { stroke: var(--c-border); stroke-width: 1; }
.chart__axis { stroke: var(--c-border-2); stroke-width: 1; }
.chart__bar { fill: var(--c-primary); }
.chart__x { fill: var(--c-text-3); font-size: 11px; }
.chart__v { fill: var(--c-text-2); font-size: 11px; font-weight: 600; }

/* 工作台待办条 */
.todos { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.todos__item {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .7rem .9rem;
  border: 1px solid var(--c-border);
  border-radius: 10px;
}
.todos__num {
  min-width: 2.4rem;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--c-primary);
}
.todos__text { flex: 1; font-size: .9rem; }
.todos__link { font-size: .85rem; color: var(--c-primary); text-decoration: none; }
.todos__link:hover { text-decoration: underline; }

/* 通用小工具类（视图里高频用到的几个） */
.muted { color: var(--c-text-3); font-size: .88rem; }

/* —— 安装向导·版本闸门页（PHP < 8.0 时由 install.php 最前面渲染） —— */
.install__title { font-size: 1.45rem; line-height: 1.4; margin: 0 0 .35rem; }
.install__subtitle { color: var(--c-text-3); font-size: .92rem; margin: 0 0 1.5rem; }
.install__hints {
  margin: 1.5rem 0 0;
  padding-left: 1.35rem;
  font-size: .92rem;
  line-height: 1.85;
}
.install__hints li { margin-bottom: .6rem; }
.install__hints code {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 4px;
  padding: .05rem .3rem;
  font-size: .88em;
}

/* §19 组织管理（分组树形卡片，v1.2.2） */
.org-filter { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.org-filter .input { flex: 1; min-width: 200px; }
.org-region { border: 1px solid var(--c-border); border-radius: 12px; overflow: hidden; margin-bottom: 16px; background: var(--c-surface); }
.org-region__head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--c-border); border-left: 3px solid var(--c-warn); }
.org-region__name { font-size: 14px; font-weight: 500; }
.org-region.is-off { opacity: .7; }
.org-region__act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.org-body { padding: 12px 16px 16px 28px; display: flex; flex-direction: column; gap: 10px; }
.org-sub { border: 1px solid var(--c-border); border-radius: 8px; padding: 10px 12px; border-left: 3px solid var(--c-info); background: var(--c-bg); }
.org-sub.is-off { opacity: .65; }
.org-sub__head { display: flex; align-items: center; gap: 10px; }
.org-sub__name { font-size: 14px; font-weight: 500; }
.org-sub__act { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.org-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.org-campus .chip__act { margin-left: 6px; color: var(--c-primary-600); text-decoration: none; font-size: 12px; line-height: 1; }
.org-campus .chip__act--danger { color: var(--c-danger); }
.org-campus form { margin: 0; }
.org-empty { display: none; padding: 32px; text-align: center; color: var(--c-text-3); font-size: 13px; }

/* §19.1 组织管理 v1.2.3：社区折叠 + 校区网格卡 + 二维码弹窗 */
.md-a, .md-o { display: inline-block; width: 7px; height: 7px; border-radius: 50%; flex: none; }
.md-a { background: var(--c-success); }
.md-o { background: #CBD5E1; }
.org-sub > summary { list-style: none; cursor: pointer; }
.org-sub > summary::-webkit-details-marker { display: none; }
.org-sub__chev { flex: none; color: var(--c-text-3); font-size: 13px; line-height: 1; transition: transform .15s ease; }
.org-sub[open] .org-sub__chev { transform: rotate(90deg); }
.org-sub__body { padding-top: 10px; }
.org-sub__none { padding: 8px 0; font-size: 12px; color: var(--c-text-3); }
.org-campus-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.org-campus { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--c-border); border-radius: 10px; background: var(--c-surface); }
.org-campus.is-off { opacity: .6; }
.org-campus__head { display: flex; align-items: center; gap: 8px; min-width: 0; }
.org-campus__name { flex: 1; min-width: 0; font-size: 13px; font-weight: 500; color: var(--c-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.org-campus__act { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.org-campus__link { padding: 0; border: 0; background: none; font-size: 12px; line-height: 1; color: var(--c-primary-600); text-decoration: none; cursor: pointer; }
.org-campus__link:hover { text-decoration: underline; }
.org-campus__link--danger { color: var(--c-danger); }
.qr-modal { position: fixed; inset: 0; z-index: 120; display: none; }
.qr-modal.is-open { display: block; }
.qr-modal__mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .45); }
.qr-modal__box { position: relative; z-index: 1; width: min(92vw, 360px); margin: 8vh auto 0; padding: 22px 22px 18px; border-radius: 16px; background: #fff; text-align: center; box-shadow: 0 20px 50px rgba(15, 23, 42, .25); }
.qr-modal__close { position: absolute; top: 6px; right: 10px; padding: 4px; border: 0; background: none; font-size: 22px; line-height: 1; color: var(--c-text-3); cursor: pointer; }
.qr-modal__title { margin-bottom: 12px; font-size: 15px; font-weight: 600; color: #1E3A5F; }
.qr-modal__img { display: inline-flex; padding: 12px; border: 1px solid var(--c-border); border-radius: 12px; background: #fff; }
.qr-modal__img img { display: block; width: 240px; height: 240px; }
.qr-modal__tip { margin-top: 12px; font-size: 13px; color: var(--c-text-2); }
.qr-modal__url { margin-top: 6px; font-size: 11px; color: var(--c-text-3); word-break: break-all; }
