/* ==========================================================================
   智慧点名 · 全站唯一样式文件
   规范：SPEC.md §9（视觉 / 移动优先 / 打印）；覆盖 §9.2 全部公共类
   断点：默认移动（375px 无横向滚动）→ ≥640px 两列 → ≥1024px 后台侧栏固定
   说明：不使用 @import / 外部字体 / CDN；页面只引本文件
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 设计变量
   -------------------------------------------------------------------------- */
:root {
  /* 主色板（SPEC §9.1） */
  --c-primary: #2563eb;
  --c-primary-dark: #1d4ed8;
  --c-primary-soft: #eff6ff;
  --c-success: #16a34a;
  --c-success-soft: #dcfce7;
  --c-warning: #f59e0b;
  --c-warning-soft: #fef3c7;
  --c-danger: #dc2626;
  --c-danger-soft: #fee2e2;
  --c-purple: #8b5cf6;
  --c-purple-soft: #ede9fe;
  --c-cyan: #0ea5e9;
  --c-cyan-soft: #e0f2fe;

  /* 中性色 */
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --text-muted: #6b7280;
  --text-soft: #9ca3af;
  --border: #e5e7eb;
  --border-strong: #d1d5db;

  /* 形状与阴影 */
  --radius: 14px;
  --radius-btn: 10px;
  --radius-sm: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 8px 24px rgba(16, 24, 40, 0.06);
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 4px 12px rgba(16, 24, 40, 0.08), 0 18px 40px rgba(16, 24, 40, 0.1);

  /* 字体与布局 */
  --font: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  --topbar-h: 60px;
  --sidebar-w: 248px;
  --page-max: 1120px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* --------------------------------------------------------------------------
   2. 基础
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  font-weight: 600;
  line-height: 1.35;
}

p {
  margin: 0 0 10px;
}

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

a {
  color: var(--c-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

button,
input,
select,
textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--c-primary);
  outline-offset: 2px;
}

::selection {
  background: rgba(37, 99, 235, 0.18);
}

/* --------------------------------------------------------------------------
   3. 通用工具类
   -------------------------------------------------------------------------- */
.muted,
.text-muted {
  color: var(--text-muted) !important;
}

.text-center {
  text-align: center !important;
}

.text-right {
  text-align: right !important;
}

.nowrap {
  white-space: nowrap !important;
}

.w-full {
  width: 100% !important;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex !important;
}

.flex-wrap {
  flex-wrap: wrap !important;
}

.items-center {
  align-items: center !important;
}

.justify-between {
  justify-content: space-between !important;
}

.gap-1 {
  gap: 8px !important;
}

.gap-2 {
  gap: 16px !important;
}

.mt-0 {
  margin-top: 0 !important;
}

.mt-1 {
  margin-top: 8px !important;
}

.mt-2 {
  margin-top: 16px !important;
}

.mb-1 {
  margin-bottom: 8px !important;
}

.mb-2 {
  margin-bottom: 16px !important;
}

.link {
  color: var(--c-primary);
  font-size: 13.5px;
  font-weight: 500;
}

.link:hover {
  color: var(--c-primary-dark);
}

/* --------------------------------------------------------------------------
   4. 页面骨架：.app / .container / .main / .topbar / .footer
   -------------------------------------------------------------------------- */
.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.container {
  width: 100%;
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 14px;
  padding-right: 14px;
}

.main {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  padding-top: 20px;
  padding-bottom: 44px;
}

/* 顶部栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  width: 100%;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}

.topbar > .container,
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px 12px;
  min-height: var(--topbar-h);
}

.topbar-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}

.topbar-right form,
.logout-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.topbar-operator {
  display: inline-block;
  max-width: 34vw;
  overflow: hidden;
  color: #374151;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

.topbar-right .badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 品牌区 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 40px;
  color: var(--text);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-decoration: none;
}

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

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, #3b82f6 0%, var(--c-primary) 100%);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  overflow: hidden;
}

.brand-logo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
}

.brand-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 页脚 */
.footer {
  margin-top: auto;
  padding: 22px 14px calc(22px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.footer a {
  color: var(--text-muted);
}

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

.footer p {
  margin: 0;
}

/* 登录/入口页：主区域垂直居中 */
body.page-login .main,
body.page-entry .main,
body.page-auth .main,
body.page-landing .main {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   5. 后台骨架：.admin-shell / .sidebar / .admin-main
   -------------------------------------------------------------------------- */
.admin-shell {
  display: block;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  flex-direction: column;
  width: 272px;
  max-width: 84vw;
  background: var(--card);
  border-right: 1px solid var(--border);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-bottom: var(--safe-bottom);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
}

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

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  min-height: var(--topbar-h);
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 17px;
  font-weight: 700;
  text-decoration: none;
}

.sidebar-brand:hover {
  color: var(--text);
  text-decoration: none;
}

.sidebar-brand .brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 15px;
}

.sidebar-brand .brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
  white-space: normal;
}

.sidebar-brand .brand-text strong {
  font-size: 16px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-brand .brand-text small {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.4px;
}

.sidebar-nav {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 10px;
}

.sidebar-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  color: #374151;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.sidebar-link:hover {
  background: #f3f4f6;
  color: var(--c-primary);
  text-decoration: none;
}

.sidebar-link.is-active {
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}

.sidebar-link.is-active::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: var(--c-primary);
  transform: translateY(-50%);
}

.sidebar-link .nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 20px;
  font-size: 16px;
  line-height: 1;
  text-align: center;
}

.sidebar-foot {
  flex: 0 0 auto;
  margin-top: auto;
  padding: 12px 14px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.sidebar-foot form {
  margin: 0;
}

.sidebar-foot .chip {
  max-width: 100%;
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-foot .btn {
  width: 100%;
}

.admin-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

.admin-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-height: 56px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.97);
  border-bottom: 1px solid var(--border);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  backdrop-filter: saturate(1.4) blur(10px);
}

.admin-header > div:not(.topbar-right) {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
}

.admin-header .page-title {
  margin: 0;
  font-size: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-header .page-subtitle {
  margin: 0;
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-header .topbar-right {
  margin-left: auto;
}

.admin-content {
  flex: 1 1 auto;
  width: 100%;
  max-width: var(--page-max);
  margin-left: auto;
  margin-right: auto;
  padding: 16px 14px calc(36px + var(--safe-bottom));
}

.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: #374151;
  font-size: 18px;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.mobile-menu-btn:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

body.sidebar-open .sidebar-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 桌面：侧栏常显（grid + 页脚跨列，避免 flex 把 footer 挤成第三列） */
@media (min-width: 1024px) {
  .admin-shell {
    display: grid;
    grid-template-columns: var(--sidebar-w) minmax(0, 1fr);
    align-items: start;
  }

  .sidebar {
    position: sticky;
    top: 0;
    left: auto;
    bottom: auto;
    align-self: start;
    grid-column: 1;
    grid-row: 1;
    width: var(--sidebar-w);
    max-width: none;
    height: 100vh;
    height: 100dvh;
    z-index: 30;
    transform: none;
    box-shadow: none;
  }

  .admin-main {
    grid-column: 2;
    grid-row: 1;
    flex: 1 1 auto;
    min-width: 0;
  }

  .admin-shell > .footer {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .admin-header {
    min-height: 60px;
    padding: 10px 28px;
  }

  .admin-content {
    padding: 24px 28px 56px;
  }

  .mobile-menu-btn {
    display: none;
  }

  .sidebar-overlay {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   6. 标题 / 卡片 / 网格 / 统计
   -------------------------------------------------------------------------- */
.page-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.page-subtitle {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.page-head {
  margin: 0 0 16px;
  min-width: 0;
}

.page-head .page-title {
  margin-bottom: 4px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
}

.card {
  min-width: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.card + .card {
  margin-top: 14px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.card-title .badge {
  flex: 0 0 auto;
}

.card-body {
  padding: 16px;
  min-width: 0;
}

.card-foot {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  background: #fbfcfe;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  padding: 14px 16px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.stat-value {
  color: var(--text);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.stat-label {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.4;
}

.stat-card.is-primary .stat-value {
  color: var(--c-primary);
}

.stat-card.is-success .stat-value {
  color: var(--c-success);
}

.stat-card.is-warning .stat-value {
  color: var(--c-warning);
}

.stat-card.is-danger .stat-value {
  color: var(--c-danger);
}

.grid-2,
.grid-3 {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

@media (min-width: 640px) {
  .stat-grid {
    gap: 14px;
  }

  .page-title {
    font-size: 25px;
  }

  .card-body {
    padding: 18px 20px;
  }

  .card-head {
    padding: 14px 20px;
  }

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

@media (min-width: 1024px) {
  .stat-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

/* --------------------------------------------------------------------------
   7. 按钮 / 徽标 / 标签
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-btn);
  background: #f3f4f6;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  text-decoration: none;
}

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

.btn[disabled],
.btn:disabled,
.btn.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.is-loading {
  pointer-events: none;
  opacity: 0.75;
}

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

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

.btn-secondary {
  background: #fff;
  border-color: var(--border-strong);
  color: #374151;
}

.btn-secondary:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: #f8faff;
}

.btn-ghost {
  background: transparent;
  border-color: transparent;
  color: #374151;
}

.btn-ghost:hover {
  background: #f3f4f6;
  color: var(--c-primary);
}

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

.btn-danger:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff;
}

.btn-link {
  min-height: 36px;
  padding: 0 6px;
  background: transparent;
  border-color: transparent;
  color: var(--c-primary);
}

.btn-link:hover {
  background: transparent;
  color: var(--c-primary-dark);
  text-decoration: underline;
}

.btn-sm {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
  gap: 4px;
}

.btn-lg {
  min-height: 48px;
  padding: 0 22px;
  border-radius: 12px;
  font-size: 16px;
}

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

/* 徽标 */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 3px 9px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  white-space: nowrap;
  vertical-align: middle;
}

.badge-success {
  background: var(--c-success-soft);
  color: #15803d;
}

.badge-warning {
  background: var(--c-warning-soft);
  color: #b45309;
}

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

.badge-info {
  background: var(--c-cyan-soft);
  color: #0369a1;
}

.badge-muted {
  background: #f3f4f6;
  color: #6b7280;
}

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

/* 小标签 / 可点标签（label.chip 内含 checkbox） */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: #374151;
  font-size: 13px;
  line-height: 1.2;
  white-space: nowrap;
  vertical-align: middle;
}

label.chip {
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

label.chip:hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

label.chip:has(input[type="checkbox"]:checked) {
  border-color: var(--c-primary);
  background: var(--c-primary-soft);
  color: var(--c-primary);
  font-weight: 600;
}

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

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

/* --------------------------------------------------------------------------
   8. 表单
   -------------------------------------------------------------------------- */
.form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}

.form-row.cols-3 {
  grid-template-columns: minmax(0, 1fr);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.form-label .req {
  color: var(--c-danger);
}

/* 未加 .form-input 的裸控件兜底（:where 保证特异性最低，可被 .form-input 覆盖） */
.form :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="submit"]):not([type="button"]):not([type="reset"])),
.form :where(select),
.form :where(textarea) {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background-color: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background-color: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.4;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-soft);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.form :where(input, select, textarea):focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.form-input.is-invalid,
.form-select.is-invalid,
.form-textarea.is-invalid {
  border-color: var(--c-danger);
}

.form-select {
  -webkit-appearance: none;
  appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%236b7280' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}

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

.form-hint {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.55;
}

.form-hint.is-ok {
  color: var(--c-success);
}

.form-hint.is-warn {
  color: #b45309;
}

.form-error {
  color: var(--c-danger);
  font-size: 12.5px;
  font-weight: 500;
  line-height: 1.5;
}

.form-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.form-actions-right {
  justify-content: flex-end;
}

.form-actions .spacer {
  flex: 1 1 auto;
}

.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  color: #374151;
  font-size: 14px;
  cursor: pointer;
}

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

/* 登录卡片里未加 .form 的裸 form */
.auth-card form:not(.form) {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 输入框 + 按钮组合（令牌复制、密码显隐） */
.input-group {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-width: 0;
}

.input-group > * {
  border-radius: 0;
  min-width: 0;
}

.input-group > :first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.input-group > :last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.input-group .form-input,
.input-group .form-select {
  flex: 1 1 auto;
  min-height: 42px;
  border-radius: 0;
}

.input-group > :first-child.form-input,
.input-group > :first-child.form-select {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.input-group > :last-child.form-input,
.input-group > :last-child.form-select {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.input-group .btn {
  flex: 0 0 auto;
  min-height: 42px;
  border-radius: 0;
}

.input-group > .btn:last-child {
  border-top-right-radius: 10px;
  border-bottom-right-radius: 10px;
}

.input-group > .btn:first-child {
  border-top-left-radius: 10px;
  border-bottom-left-radius: 10px;
}

.input-group > * + * {
  margin-left: -1px;
}

.input-group .btn:hover,
.input-group .btn:focus {
  z-index: 1;
}

/* 密码切换按钮处于“明文可见”状态时的提示 */
.js-password-toggle.is-visible {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: #f8faff;
}

@media (min-width: 640px) {
  .form-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

/* --------------------------------------------------------------------------
   9. 表格
   -------------------------------------------------------------------------- */
.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.table-wrap::-webkit-scrollbar {
  height: 8px;
}

.table-wrap::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 8px;
}

/* 卡片内的表格不再重复描边（表格自身在 .card-body 内） */
.card .table-wrap {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.5;
}

.table th,
.table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

.table thead th {
  background: #f9fafb;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

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

.table tbody tr:hover {
  background: #f8fafc;
}

.table td .num,
.table .num {
  font-variant-numeric: tabular-nums;
}

.table td.table-actions {
  text-align: right;
  white-space: nowrap;
}

.table td.table-actions .btn,
.table td.table-actions .table-action-form {
  margin-left: 6px;
  vertical-align: middle;
}

.table-action-form {
  display: inline-flex;
  align-items: center;
  margin: 0;
}

.table-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

/* T2 历史页把 .table-actions 直接写在 <a> 上：保持按钮外观 */
.btn.table-actions {
  display: inline-flex;
  justify-content: center;
}

.table-actions .btn {
  min-height: 34px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 13px;
}

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 40px 18px;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
}

.empty-state .empty-icon {
  font-size: 30px;
  line-height: 1;
  opacity: 0.85;
}

.empty-state .btn {
  margin-top: 8px;
}

/* 移动端：带 data-label 的表格自动卡片化（未加 data-label 时保持横向滚动） */
@media (max-width: 639px) {
  .table-wrap:has(td[data-label]) {
    overflow-x: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .table-wrap:has(td[data-label]) .table {
    display: block;
    min-width: 0;
  }

  .table-wrap:has(td[data-label]) .table thead {
    display: none;
  }

  .table-wrap:has(td[data-label]) .table tbody,
  .table-wrap:has(td[data-label]) .table tr,
  .table-wrap:has(td[data-label]) .table td {
    display: block;
    width: auto;
  }

  .table-wrap:has(td[data-label]) .table tr {
    margin-bottom: 10px;
    padding: 4px 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
  }

  .table-wrap:has(td[data-label]) .table tr:last-child {
    margin-bottom: 0;
  }

  .table-wrap:has(td[data-label]) .table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 7px 0;
    border-bottom: 1px dashed var(--border);
    overflow-wrap: anywhere;
    text-align: left;
    white-space: normal;
  }

  .table-wrap:has(td[data-label]) .table td:last-child {
    border-bottom: 0;
  }

  .table-wrap:has(td[data-label]) .table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-muted);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1.7;
  }

  .table-wrap:has(td[data-label]) .table td:not([data-label])::before {
    content: none;
  }

  .table-wrap:has(td[data-label]) .table td.table-actions {
    justify-content: space-between;
    text-align: left;
  }

  .table-wrap:has(td[data-label]) .table td.table-actions .btn,
  .table-wrap:has(td[data-label]) .table td.table-actions .table-action-form {
    margin-left: 0;
  }
}

/* --------------------------------------------------------------------------
   10. Flash 提示 / 轻提示 Toast
   -------------------------------------------------------------------------- */
.flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.55;
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-wrap: anywhere;
}

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

.flash-success {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #166534;
}

.flash-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.flash-info {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.flash-warning {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.flash.is-hiding {
  opacity: 0;
  transform: translateY(-4px);
}

/* 关闭按钮：视觉 28px，热区 44px */
.flash-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  margin: -10px -12px -10px 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  opacity: 0.65;
  cursor: pointer;
}

.flash-close:hover {
  opacity: 1;
  background: rgba(0, 0, 0, 0.06);
}

.toast-wrap {
  position: fixed;
  left: 50%;
  bottom: calc(20px + var(--safe-bottom));
  z-index: 1300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: calc(100vw - 32px);
  transform: translateX(-50%);
  pointer-events: none;
}

.toast {
  max-width: min(90vw, 430px);
  padding: 10px 16px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.5;
  text-align: center;
  overflow-wrap: anywhere;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  background: #15803d;
}

.toast-error {
  background: #b91c1c;
}

.toast-info {
  background: #1f2937;
}

/* --------------------------------------------------------------------------
   11. 点名页 /roll/people.php + /roll/index.php
   -------------------------------------------------------------------------- */
.roll-form {
  margin: 0;
  min-width: 0;
}

.roll-header {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
  min-width: 0;
}

.roll-header > .badge {
  align-self: flex-start;
}

.course-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding: 16px 16px 16px 19px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 62%);
  border: 1px solid #dbeafe;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.course-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 4px;
  background: var(--c-primary);
}

/* roll/index.php 把 .course-card 用在 <section class="card course-card"> 上 */
.card.course-card {
  display: block;
  gap: 0;
  padding: 0;
  background: var(--card);
  border-color: var(--border);
}

.course-name {
  margin: 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.course-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.55;
  min-width: 0;
}

.course-meta > * {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.course-card .badge {
  align-self: flex-start;
}

/* 进度 */
.roll-progress {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
}

.roll-progress-text,
.roll-progress > .js-progress-text,
.roll-progress .js-progress-text {
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}

.progress-track {
  position: relative;
  width: 100%;
  height: 9px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, #3b82f6 0%, var(--c-primary) 100%);
  border-radius: 999px;
  transition: width 0.25s ease;
}

/* 顶部工具条 / 筛选条 */
.roll-toolbar,
.toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 12px;
  min-width: 0;
}

.roll-toolbar .roll-progress {
  flex: 1 1 100%;
}

.roll-toolbar-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
}

.roll-toolbar-actions .btn {
  flex: 1 1 0;
  min-width: 0;
}

.roll-toolbar .btn,
.toolbar .btn {
  flex: 0 0 auto;
}

.roll-toolbar-actions .btn {
  flex: 1 1 0;
}

.filter-bar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  margin: 0 0 14px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  min-width: 0;
}

.filter-bar .form-group {
  flex: 1 1 150px;
  min-width: 0;
  gap: 4px;
}

.filter-bar .form-label {
  font-size: 12.5px;
}

.filter-bar .form-input,
.filter-bar .form-select {
  min-height: 40px;
}

.filter-bar .form-actions {
  flex: 0 0 auto;
  margin-top: 2px;
}

.filter-bar .form-actions .btn {
  flex: 0 1 auto;
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 学生卡片列表 */
.student-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
}

.student-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, background-color 0.15s ease,
    box-shadow 0.15s ease;
}

.student-card.is-complete {
  border-color: #86efac;
  background: #f7fef9;
  box-shadow: inset 3px 0 0 var(--c-success), 0 0 0 2px rgba(22, 163, 74, 0.1);
}

.student-card.is-complete::after {
  content: "✓";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c-success);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  pointer-events: none;
}

.student-card.is-missing {
  border-color: var(--c-danger);
  background: #fff7f7;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.student-info {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 10px;
  min-width: 0;
  padding-right: 18px;
}

.student-name {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.student-meta {
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.4;
}

.student-no {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

/* 5 个状态按钮：手机一行 5 个等分 */
.status-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 4px;
  width: 100%;
  min-width: 0;
}

.status-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 40px;
  padding: 4px 2px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: #4b5563;
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.15s ease, border-color 0.15s ease,
    color 0.15s ease, box-shadow 0.15s ease;
}

.status-btn:hover:not(.is-selected) {
  border-color: var(--c-primary);
  color: var(--c-primary);
  background: #f8faff;
}

.status-btn:active {
  transform: translateY(1px);
}

.status-btn.is-selected {
  border-color: var(--s-color, var(--c-primary));
  background: var(--s-color, var(--c-primary));
  color: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.16);
}

/* 状态色（按钮选中填充；也可用于徽标） */
.s-present {
  --s-color: var(--c-success);
  --s-soft: var(--c-success-soft);
}

.s-late_not_arrived {
  --s-color: var(--c-warning);
  --s-soft: var(--c-warning-soft);
}

.s-late_arrived {
  --s-color: var(--c-cyan);
  --s-soft: var(--c-cyan-soft);
}

.s-absent {
  --s-color: var(--c-danger);
  --s-soft: var(--c-danger-soft);
}

.s-leave {
  --s-color: var(--c-purple);
  --s-soft: var(--c-purple-soft);
}

.badge.s-present,
.badge.s-late_not_arrived,
.badge.s-late_arrived,
.badge.s-absent,
.badge.s-leave {
  background: var(--s-soft);
  color: var(--s-color);
}

/* 固定底部操作栏（含 iOS 安全区） */
.roll-actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  padding: 10px 14px calc(10px + var(--safe-bottom));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 18px rgba(16, 24, 40, 0.08);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.roll-actionbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
}

.roll-actionbar-text {
  flex: 1 1 100%;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  white-space: nowrap;
}

.roll-actionbar-inner .btn {
  flex: 1 1 0;
  min-width: 0;
}

.roll-actionbar-inner .roll-progress {
  flex: 1 1 100%;
}

/* 底部操作栏占位（roll.js 给 body 加 has-roll-actionbar） */
body.has-roll-actionbar .main,
body:has(.roll-actionbar) .main {
  padding-bottom: calc(132px + var(--safe-bottom));
}

body.has-roll-actionbar .footer,
body:has(.roll-actionbar) .footer {
  padding-bottom: calc(96px + var(--safe-bottom));
}

@media (max-width: 374px) {
  .status-btn {
    padding: 4px 1px;
    border-radius: 6px;
    font-size: 11px;
  }

  .student-card {
    padding: 10px;
  }
}

@media (min-width: 640px) {
  .student-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .student-card {
    padding: 14px;
  }

  .status-btn {
    min-height: 42px;
    padding: 4px 4px;
    font-size: 13px;
  }

  .filter-bar {
    flex-direction: row;
    align-items: flex-end;
    flex-wrap: wrap;
    padding: 14px;
  }

  .roll-toolbar .roll-progress {
    flex: 1 1 220px;
  }

  .roll-toolbar-actions {
    flex: 0 0 auto;
    width: auto;
  }

  .roll-toolbar-actions .btn {
    flex: 0 0 auto;
  }

  .roll-actionbar-text {
    flex: 0 0 auto;
    margin-right: auto;
    text-align: left;
  }

  .roll-actionbar-inner .btn {
    flex: 0 0 auto;
  }
}

@media (min-width: 1024px) {
  .status-btn {
    min-height: 42px;
  }
}

/* --------------------------------------------------------------------------
   12. 报告页 /roll/report.php
   -------------------------------------------------------------------------- */
.report-page {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.report-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.report-toolbar .btn {
  flex: 0 0 auto;
}

.report-sheet {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 24px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: #111827;
  min-width: 0;
}

.report-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 2px;
  line-height: 1.4;
  text-align: center;
}

.report-meta {
  margin: 0 0 18px;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
  overflow-wrap: anywhere;
}

.report-lines {
  margin: 0;
}

.report-table {
  width: 100%;
  margin: 16px 0;
  border-collapse: collapse;
  font-size: 13.5px;
  line-height: 1.5;
}

.report-table th,
.report-table td {
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  text-align: left;
  vertical-align: middle;
}

.report-table th {
  background: #f9fafb;
  font-weight: 600;
  white-space: nowrap;
}

.report-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  color: #111827;
  font-size: 14.5px;
  line-height: 1.9;
}

.report-label {
  flex: 0 0 auto;
  min-width: 84px;
  color: #111827;
  font-weight: 600;
  white-space: nowrap;
}

.report-value {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}

.report-sign {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 36px;
  padding-top: 8px;
  color: #111827;
  font-size: 14px;
  line-height: 1.8;
}

.report-sign .sign-line {
  display: inline-block;
  min-width: 140px;
  border-bottom: 1px solid #111827;
}

.report-operator {
  margin: 14px 0 0;
  color: #374151;
  font-size: 13.5px;
  line-height: 1.7;
  text-align: right;
}

/* 早退标记区：<section class="card early-list no-print"> */
.early-list {
  margin: 0;
}

.early-items {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 14px;
}

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

.early-btn {
  max-width: 100%;
  white-space: normal;
}

@media (min-width: 640px) {
  .report-sheet {
    padding: 40px 44px;
  }

  .report-title {
    font-size: 24px;
    letter-spacing: 3px;
  }

  .report-line {
    font-size: 15px;
  }

  .report-label {
    min-width: 96px;
  }
}

/* --------------------------------------------------------------------------
   13. 入口页 /（index.php：landing 结构）
   -------------------------------------------------------------------------- */
.landing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
  padding: 12px 0 calc(8px + var(--safe-bottom));
}

.landing-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
}

.landing-logo {
  flex: 0 0 auto;
  width: 56px;
  height: 56px;
  border-radius: 16px;
}

.landing-title {
  margin: 0;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1.5px;
  line-height: 1.25;
}

.landing-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.5;
}

.landing-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  padding: 22px 20px;
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.landing-card > form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0;
}

.landing-card-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
}

.landing-hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}

.landing-welcome {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  margin-bottom: 4px;
  min-width: 0;
}

.landing-welcome .badge {
  margin-bottom: 2px;
}

.landing-welcome h2 {
  margin: 0;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.landing-exit {
  margin: 0;
}

.landing-links {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.8;
  text-align: center;
}

.landing-foot {
  margin: 0;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: center;
  overflow-wrap: anywhere;
}

@media (min-width: 640px) {
  .landing {
    max-width: 460px;
    gap: 20px;
  }

  .landing-logo {
    width: 64px;
    height: 64px;
  }

  .landing-title {
    font-size: 30px;
  }

  .landing-card {
    padding: 26px 24px;
  }
}

/* --------------------------------------------------------------------------
   14. 登录页 /admin/login.php（.auth-*）与通用登录卡片兜底
   -------------------------------------------------------------------------- */
.login-wrap,
.entry-wrap,
.auth-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: calc(100vh - 150px);
  min-height: calc(100dvh - 150px);
  padding: 24px 14px calc(24px + var(--safe-bottom));
}

.auth-card,
.login-card,
.entry-card {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 26px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-lg);
}

.auth-brand,
.login-brand,
.entry-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  text-align: center;
}

.auth-logo,
.login-brand .brand-logo,
.entry-brand .brand-logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: transparent;
  font-size: 22px;
}

.auth-title,
.login-title,
.entry-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  text-align: center;
}

.auth-sub,
.login-sub,
.entry-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: center;
}

.auth-links,
.login-links,
.entry-links {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.8;
  text-align: center;
}

.auth-links .link + .link {
  margin-left: 12px;
}

.token-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.entry-actions,
.login-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

.auth-footer,
.login-footer,
.entry-footer {
  margin-top: 18px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.8;
  text-align: center;
}

@media (min-width: 640px) {
  .auth-card,
  .login-card,
  .entry-card {
    padding: 34px 30px;
  }

  .auth-title,
  .login-title,
  .entry-title {
    font-size: 24px;
  }
}

/* --------------------------------------------------------------------------
   14. 分页 / 列表元信息
   -------------------------------------------------------------------------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin: 16px 0 4px;
  padding: 8px 0;
}

.pagination a,
.pagination > span:not(.form-hint):not(.page-info) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #374151;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1;
  text-decoration: none;
}

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

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

.pagination .is-disabled,
.pagination .disabled {
  opacity: 0.5;
  pointer-events: none;
}

.pagination .page-info {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
}

/* 历史页 .pager：容器内已有 .btn/.form-hint，仅做排列，避免覆盖按钮样式 */
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
  padding: 4px 0;
}

.pager .form-hint {
  margin: 0 0 0 auto;
  text-align: right;
}

.pager a:not(.btn) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #374151;
  font-size: 13.5px;
  text-decoration: none;
}

.pager a:not(.btn):hover {
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.list-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 14px;
  color: var(--text-muted);
  font-size: 13px;
}

/* --------------------------------------------------------------------------
   14.5 移动端可点尺寸：所有可点元素 ≥ 40px 高（SPEC §9.1）
   -------------------------------------------------------------------------- */
@media (max-width: 639px) {
  .btn-sm,
  .table-actions .btn,
  .table td.table-actions .btn {
    min-height: 40px;
    padding-left: 12px;
    padding-right: 12px;
    font-size: 13.5px;
  }

  label.chip,
  .chip.is-active {
    min-height: 40px;
  }

  .pagination a,
  .pagination > span:not(.form-hint):not(.page-info),
  .pager a:not(.btn) {
    min-height: 40px;
  }

  .filter-bar .btn {
    min-height: 42px;
  }
}

/* --------------------------------------------------------------------------
   15. 打印：只保留报告内容（SPEC §8 / §9.1）
   -------------------------------------------------------------------------- */
@media print {
  @page {
    size: A4;
    margin: 18mm;
  }

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

  /* 隐藏导航、操作栏、按钮、页脚 */
  .topbar,
  .footer,
  .sidebar,
  .sidebar-overlay,
  .admin-header,
  .mobile-menu-btn,
  .report-toolbar,
  .roll-toolbar,
  .toolbar,
  .roll-actionbar,
  .early-list,
  .no-print,
  [data-no-print],
  .flash,
  .toast-wrap,
  .pagination,
  .pager {
    display: none !important;
  }

  /* 版心重置 */
  .app,
  .main,
  .container,
  .admin-shell,
  .admin-main,
  .admin-content,
  .report-page {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    box-shadow: none !important;
  }

  .report-sheet {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    color: #000 !important;
  }

  .report-title {
    margin: 0 0 6pt;
    color: #000;
    font-size: 20pt;
    letter-spacing: 4pt;
  }

  .report-meta {
    margin-bottom: 14pt;
    color: #000;
    font-size: 10.5pt;
  }

  .report-line {
    padding: 0;
    color: #000;
    font-size: 12pt;
    line-height: 1.9;
  }

  .report-label {
    min-width: 76pt;
    color: #000;
  }

  .report-value {
    color: #000;
  }

  .report-table {
    color: #000;
    font-size: 10.5pt;
  }

  .report-table th,
  .report-table td {
    padding: 4pt 6pt;
    border: 1px solid #000;
    color: #000;
  }

  .report-table th {
    background: #fff;
  }

  .report-sign {
    margin-top: 36pt;
    color: #000;
    font-size: 12pt;
  }

  .report-sign .sign-line {
    border-bottom-color: #000;
  }

  .report-operator {
    margin-top: 10pt;
    color: #000;
    font-size: 11pt;
  }

  .page-title,
  .page-subtitle,
  .page-head {
    display: none !important;
  }

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

  .report-sheet,
  .report-line,
  .report-title,
  .report-sign {
    page-break-inside: avoid;
  }
}

/* --------------------------------------------------------------------------
   16. 减少动效偏好
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
