/* ========== 基础样式修复（从原始CSS恢复） ========== */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15,20,30,.45); z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}

.modal-mask.hidden {
  display: none !important;
}

/* ========== 原始CSS内容 ==========
/* ============================================================
   清华职校管理系统 - UI增强第三阶段 v3.0
   功能: 深色模式 / 快捷键 / 批量操作 / 表格优化 / 搜索历史
   设计原则: 轻量、无新依赖、不影响性能
   ============================================================ */

/* ===== 1. 深色模式 ===== */
body.dark-mode {
  --bg-primary: #1a1d23;
  --bg-secondary: #23272f;
  --bg-tertiary: #2d323b;
  --bg-card: #23272f;
  --bg-hover: #2d323b;
  --bg-active: #363c47;
  --text-primary: #e4e7ee;
  --text-secondary: #a0a6b3;
  --text-muted: #6b7280;
  --border-color: #363c47;
  --border-light: #2d323b;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --accent-blue: #4a8af5;
  --accent-green: #1a9e5c;
  --accent-orange: #e8862d;
  --accent-red: #e5484d;
  --accent-purple: #7f77dd;
}

body.dark-mode {
  background-color: var(--bg-primary) !important;
  color: var(--text-primary) !important;
}

/* 登录页深色模式 */
body.dark-mode #loginPage {
  background: linear-gradient(135deg, #1a1d23 0%, #23272f 50%, #1a1d23 100%) !important;
}

body.dark-mode .login-container-v2 {
  background: var(--bg-card) !important;
  box-shadow: 0 20px 60px var(--shadow-color) !important;
}

body.dark-mode .login-title-v2 {
  color: var(--text-primary) !important;
}

body.dark-mode .login-subtitle-v2 {
  color: var(--text-secondary) !important;
}

body.dark-mode .input-group-v2 input {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color) !important;
  color: var(--text-primary) !important;
}

body.dark-mode .input-group-v2 input:focus {
  border-color: var(--accent-blue) !important;
  background: var(--bg-secondary) !important;
}

body.dark-mode .input-group-v2 input::placeholder {
  color: var(--text-muted) !important;
}

body.dark-mode .input-icon-v2 {
  color: var(--text-muted) !important;
}

body.dark-mode .login-btn-v2 {
  background: linear-gradient(135deg, var(--accent-blue) 0%, #2f6fed 100%) !important;
}

body.dark-mode .login-footer-v2 {
  color: var(--text-muted) !important;
}

/* 侧边栏深色模式 */
body.dark-mode .sidebar {
  background: var(--bg-secondary) !important;
  border-right-color: var(--border-color) !important;
}

body.dark-mode .sidebar-logo {
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-color) !important;
}

body.dark-mode .nav-item {
  color: var(--text-secondary) !important;
}

body.dark-mode .nav-item:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

body.dark-mode .nav-item.active {
  background: var(--brand-gradient) !important;
  color: #fff !important;
  border-left-color: transparent !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25) !important;
}

body.dark-mode .nav-icon {
  color: var(--text-muted) !important;
}

body.dark-mode .nav-item.active .nav-icon {
  color: #fff !important;
}

/* 顶部栏深色模式 */
body.dark-mode .topbar {
  background: var(--bg-secondary) !important;
  border-bottom-color: var(--border-color) !important;
}

body.dark-mode .topbar-title {
  color: var(--text-primary) !important;
}

body.dark-mode .user-info {
  color: var(--text-secondary) !important;
}

body.dark-mode .user-avatar {
  background: var(--accent-blue) !important;
  color: #fff !important;
}

/* 主内容区深色模式 */
body.dark-mode .main-content {
  background: var(--bg-primary) !important;
}

body.dark-mode .page-container {
  background: var(--bg-primary) !important;
}

/* 卡片深色模式 */
body.dark-mode .card,
body.dark-mode .stat-card,
body.dark-mode .chart-card,
body.dark-mode .toolbar {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 2px 8px var(--shadow-color) !important;
}

body.dark-mode .card-title,
body.dark-mode .stat-card-title {
  color: var(--text-primary) !important;
}

body.dark-mode .stat-card-value {
  color: var(--text-primary) !important;
}

body.dark-mode .stat-card-label {
  color: var(--text-secondary) !important;
}

/* 表格深色模式 */
body.dark-mode table {
  background: var(--bg-card) !important;
}

body.dark-mode thead th {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-color) !important;
}

body.dark-mode tbody td {
  color: var(--text-secondary) !important;
  border-bottom-color: var(--border-light) !important;
}

body.dark-mode tbody tr:hover {
  background: var(--bg-hover) !important;
}

body.dark-mode tbody tr:nth-child(even) {
  background: var(--bg-secondary) !important;
}

body.dark-mode tbody tr:nth-child(even):hover {
  background: var(--bg-hover) !important;
}

/* 按钮深色模式 */
body.dark-mode .btn {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .btn:hover {
  background: var(--bg-active) !important;
  border-color: var(--accent-blue) !important;
}

body.dark-mode .btn-primary {
  background: var(--accent-blue) !important;
  color: #fff !important;
  border-color: var(--accent-blue) !important;
}

body.dark-mode .btn-primary:hover {
  background: #3a7ae5 !important;
}

body.dark-mode .btn-success {
  background: var(--accent-green) !important;
  color: #fff !important;
  border-color: var(--accent-green) !important;
}

body.dark-mode .btn-danger {
  background: var(--accent-red) !important;
  color: #fff !important;
  border-color: var(--accent-red) !important;
}

body.dark-mode .btn-warning {
  background: var(--accent-orange) !important;
  color: #fff !important;
  border-color: var(--accent-orange) !important;
}

/* 输入框深色模式 */
body.dark-mode input,
body.dark-mode select,
body.dark-mode textarea {
  background: var(--bg-tertiary) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode input:focus,
body.dark-mode select:focus,
body.dark-mode textarea:focus {
  border-color: var(--accent-blue) !important;
  background: var(--bg-secondary) !important;
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
  color: var(--text-muted) !important;
}

/* 模态框深色模式 */
body.dark-mode .modal-mask {
  background: rgba(0, 0, 0, 0.6) !important;
}

body.dark-mode .modal-box {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 20px 60px var(--shadow-color) !important;
}

body.dark-mode .modal-header {
  color: var(--text-primary) !important;
  border-bottom-color: var(--border-color) !important;
}

body.dark-mode .modal-body {
  color: var(--text-secondary) !important;
}

body.dark-mode .modal-footer {
  border-top-color: var(--border-color) !important;
}

/* 标签/徽章深色模式 */
body.dark-mode .badge,
body.dark-mode .tag {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
}

body.dark-mode .badge-success,
body.dark-mode .tag-success {
  background: rgba(26, 158, 92, 0.2) !important;
  color: var(--accent-green) !important;
}

body.dark-mode .badge-danger,
body.dark-mode .tag-danger {
  background: rgba(229, 72, 77, 0.2) !important;
  color: var(--accent-red) !important;
}

body.dark-mode .badge-warning,
body.dark-mode .tag-warning {
  background: rgba(232, 134, 45, 0.2) !important;
  color: var(--accent-orange) !important;
}

body.dark-mode .badge-info,
body.dark-mode .tag-info {
  background: rgba(74, 138, 245, 0.2) !important;
  color: var(--accent-blue) !important;
}

/* 分页深色模式 */
body.dark-mode .pagination button {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .pagination button:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

body.dark-mode .pagination button.active {
  background: var(--accent-blue) !important;
  color: #fff !important;
  border-color: var(--accent-blue) !important;
}

body.dark-mode .pagination button:disabled {
  opacity: 0.4 !important;
}

/* Toast深色模式 */
body.dark-mode .toast {
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 12px var(--shadow-color) !important;
}

/* 下拉菜单深色模式 */
body.dark-mode .dropdown-menu {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
  box-shadow: 0 4px 12px var(--shadow-color) !important;
}

body.dark-mode .dropdown-item {
  color: var(--text-secondary) !important;
}

body.dark-mode .dropdown-item:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}

/* 时间线深色模式 */
body.dark-mode .student-timeline-section {
  background: var(--bg-secondary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .student-timeline-title {
  color: var(--text-primary) !important;
}

body.dark-mode .timeline-content {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .timeline-type {
  color: var(--text-primary) !important;
}

body.dark-mode .timeline-date {
  color: var(--text-muted) !important;
}

body.dark-mode .timeline-desc {
  color: var(--text-secondary) !important;
}

/* 图表卡片深色模式 */
body.dark-mode .chart-card {
  background: var(--bg-card) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .chart-card-title {
  color: var(--text-primary) !important;
}

body.dark-mode .chart-tab-btn {
  background: var(--bg-tertiary) !important;
  color: var(--text-secondary) !important;
  border-color: var(--border-color) !important;
}

body.dark-mode .chart-tab-btn.active {
  background: var(--accent-blue) !important;
  color: #fff !important;
}

/* 空状态深色模式 */
body.dark-mode .empty-state {
  color: var(--text-muted) !important;
}

body.dark-mode .empty-state-icon {
  background: var(--bg-tertiary) !important;
}

/* 搜索历史下拉 */
.search-history-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e4e7ee;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 240px;
  overflow-y: auto;
  display: none;
}

.search-history-dropdown.show {
  display: block;
}

.search-history-item {
  padding: 8px 12px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #5c6370;
  border-bottom: 1px solid var(--bg-muted);
  transition: background 0.15s;
}

.search-history-item:hover {
  background: var(--bg-soft);
}

.search-history-item:last-child {
  border-bottom: none;
}

.search-history-clear {
  padding: 8px 12px;
  text-align: center;
  font-size: 12px;
  color: #8a91a0;
  cursor: pointer;
  border-top: 1px solid var(--bg-muted);
  transition: color 0.15s;
}

.search-history-clear:hover {
  color: #e5484d;
}

body.dark-mode .search-history-dropdown {
  background: var(--bg-card);
  border-color: var(--border-color);
}

body.dark-mode .search-history-item {
  color: var(--text-secondary);
  border-bottom-color: var(--border-light);
}

body.dark-mode .search-history-item:hover {
  background: var(--bg-hover);
}

body.dark-mode .search-history-clear {
  color: var(--text-muted);
  border-top-color: var(--border-color);
}

/* 深色模式切换按钮 */
.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  transition: background 0.2s;
  margin-right: 8px;
}

.theme-toggle-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

body.dark-mode .theme-toggle-btn:hover {
  background: var(--bg-hover);
}

/* 快捷键提示 */
.shortcut-hint {
  display: inline-block;
  padding: 2px 6px;
  background: var(--bg-muted);
  border-radius: 4px;
  font-size: 11px;
  color: #8a91a0;
  font-family: monospace;
  margin-left: 8px;
}

body.dark-mode .shortcut-hint {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* 快捷键帮助面板 */
.shortcut-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 24px;
  z-index: 10000;
  width: 480px;
  max-width: 90vw;
  display: none;
}

.shortcut-panel.show {
  display: block;
}

.shortcut-panel-title {
  font-size: 18px;
  font-weight: 600;
  color: #1a1d23;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.shortcut-panel-close {
  cursor: pointer;
  font-size: 20px;
  color: #8a91a0;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}

.shortcut-panel-close:hover {
  background: var(--bg-muted);
}

.shortcut-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.shortcut-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--bg-soft);
  border-radius: 6px;
}

.shortcut-key {
  font-family: monospace;
  font-size: 12px;
  color: #2f6fed;
  background: #e8f0fe;
  padding: 2px 8px;
  border-radius: 4px;
}

.shortcut-desc {
  font-size: 13px;
  color: #5c6370;
}

body.dark-mode .shortcut-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

body.dark-mode .shortcut-panel-title {
  color: var(--text-primary);
}

body.dark-mode .shortcut-panel-close {
  color: var(--text-muted);
}

body.dark-mode .shortcut-panel-close:hover {
  background: var(--bg-hover);
}

body.dark-mode .shortcut-item {
  background: var(--bg-tertiary);
}

body.dark-mode .shortcut-key {
  color: var(--accent-blue);
  background: rgba(74, 138, 245, 0.15);
}

body.dark-mode .shortcut-desc {
  color: var(--text-secondary);
}

.shortcut-panel-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.shortcut-panel-mask.show {
  display: block;
}

/* 表格行选中状态 */
tbody tr.row-selected {
  background: rgba(47, 111, 237, 0.08) !important;
}

body.dark-mode tbody tr.row-selected {
  background: rgba(74, 138, 245, 0.15) !important;
}

/* 批量操作栏 */
.batch-action-bar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
  padding: 12px 20px;
  display: none;
  align-items: center;
  gap: 16px;
  z-index: 1000;
  border: 1px solid #e4e7ee;
}

.batch-action-bar.show {
  display: flex;
  animation: slideUpBar 0.2s ease;
}

@keyframes slideUpBar {
  from { opacity: 0; transform: translate(-50%, 20px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

.batch-action-count {
  font-size: 14px;
  color: #5c6370;
  font-weight: 500;
}

.batch-action-count strong {
  color: #2f6fed;
  font-size: 18px;
}

.batch-action-buttons {
  display: flex;
  gap: 8px;
}

body.dark-mode .batch-action-bar {
  background: var(--bg-card);
  border-color: var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-color);
}

body.dark-mode .batch-action-count {
  color: var(--text-secondary);
}

body.dark-mode .batch-action-count strong {
  color: var(--accent-blue);
}

/* 表格列宽调整手柄 */
th.resizable {
  position: relative;
  user-select: none;
}

th .resize-handle {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 5px;
  cursor: col-resize;
  background: transparent;
  transition: background 0.15s;
}

th .resize-handle:hover,
th .resize-handle.active {
  background: #2f6fed;
}

body.dark-mode th .resize-handle:hover,
body.dark-mode th .resize-handle.active {
  background: var(--accent-blue);
}

/* ============================================================
 * 移动端全局搜索适配 (修复 ≤1023px 全局搜索被隐藏的问题)
 * 2026-08-29
 * ============================================================ */
@media (max-width: 1023px) {
  /* 布局: 侧边栏 → 顶部导航栏 */
  .app { flex-direction: column; }
  .sidebar { width: 100%; height: auto; }
  .side-brand { padding: 8px 14px; }
  .brand-sub { display: none; }
  /* 手机端导航: 默认一行(高频4个) + 箭头展开/收起; 分组标题仅桌面显示 */
  .nav-group { display: none; }   /* 手机端不显示分组标题, 宫格保持干净 */
  .side-nav {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; padding: 8px 10px 6px;
    max-height: 58px; overflow: hidden;
    transition: max-height .28s ease;   /* 展开/收起过渡动画 */
  }
  .sidebar.nav-open .side-nav { max-height: 520px; overflow: visible; }   /* 展开全部 */
  .nav-item {
    position: relative; flex-direction: column; align-items: center; justify-content: center;
    gap: 3px; padding: 8px 2px; font-size: 11.5px; text-align: center; white-space: normal;
    margin-bottom: 0; margin-right: 0; flex: 0 0 auto; border-radius: 10px;
  }
  .nav-item .nav-icon { font-size: 19px; line-height: 1; }
  .nav-badge { position: absolute; top: 3px; right: 8px; margin: 0; font-size: 10px; padding: 0 5px; }
  .nav-toggle {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: rgba(255,255,255,.07); border: none; border-radius: 10px;
    margin: 2px 12px 10px; color: var(--sidebar-text, #c3cadb);
    font-size: 13.5px; font-weight: 500; padding: 10px 12px; cursor: pointer;
  }
  .nav-toggle:active { background: rgba(255,255,255,.14); }
  .nav-toggle .nav-toggle-icon {
    font-size: 15px; line-height: 1; color: #7ab2ff;   /* 亮蓝箭头, 深色侧栏上醒目 */
    transition: transform .28s ease;
  }
  .sidebar.nav-open .nav-toggle .nav-toggle-icon { transform: rotate(180deg); }
  .sidebar.nav-open .nav-toggle { background: rgba(255,255,255,.1); }
  .side-user { display: none !important; }
  .sidebar.nav-open .side-user { display: block !important; }
  .side-user { padding: 8px 14px; }
  .user-avatar { width: 30px; height: 30px; font-size: 12px; }
  .user-phone { display: none; }
  .topbar { height: 50px; padding: 0 12px; }
  .topbar-title { font-size: 15px; }
  .topbar-date { display: none; }
  .content { padding: 12px; }
  /* 卡片 & 统计 */
  .card { padding: 14px; }
  .card-title { font-size: 14px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 13px; }
  .stat-card .stat-value { font-size: 20px; }
  /* 表格: 横向滚动 + 紧凑 */
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table { font-size: 12.5px; }
  th, td { padding: 9px 10px; }
  .actions { flex-wrap: wrap; gap: 2px; }
  .op-btn { padding: 6px 8px; }
  /* 工具栏: 换行排列 */
  .toolbar { gap: 8px; }
  .toolbar .search-input { width: 100%; }
  /* 筛选下拉: 每行 2 个, 保证文字完整显示(不平分挤压成空白) */
  .toolbar select { flex: 1 1 calc(50% - 8px); min-width: 0; width: auto; font-size: 13.5px; }
  .toolbar .spacer { display: none; }
  .toolbar .toolbar-hint { width: 100%; }
  /* 按钮: 每行约 3 个等宽排列, 文字不换行不错位 */
  .toolbar .btn { flex: 1 1 auto; min-width: 31%; max-width: 100%; padding: 0 6px; font-size: 13px; white-space: nowrap; line-height: 1.2; }
  /* 批量操作栏: 提示独占一行, 按钮双列网格 (v89 规则, 旧单行规则已移除避免覆盖) */
  .batch-bar { flex-wrap: wrap; gap: 8px; padding: 12px; align-items: stretch; margin-top: 2px; }
  .batch-bar > span { width: 100%; margin-bottom: 2px; }
  .batch-bar .btn-sm { flex: 1 1 calc(50% - 8px); min-width: 0; max-width: 100%; margin: 0; white-space: nowrap; padding: 9px 4px; font-size: 13px; }
  /* 弹窗: 底部弹出 */
  .modal-mask { padding: 0; align-items: flex-end; }
  .modal { width: 100%; max-width: 100%; border-radius: 16px 16px 0 0; max-height: 94vh; }
  .modal-sm { width: 100%; }
  .modal-head { padding: 14px 16px; }
  .modal-body { padding: 14px 16px; }
  .modal-foot { padding: 12px 16px; gap: 8px; }
  .modal-foot .btn { flex: 1; }
  /* 表单: 单列 */
  .form-grid { grid-template-columns: 1fr; gap: 12px; }
  .extra-fee-row { flex-wrap: wrap; }
  /* 批量操作栏: 提示独占一行, 按钮双列网格 (v89 规则, 旧单行规则已移除避免覆盖) */
  .batch-bar { flex-wrap: wrap; gap: 8px; padding: 12px; align-items: stretch; margin-top: 2px; }
  .batch-bar > span { width: 100%; margin-bottom: 2px; }
  .batch-bar .btn-sm { flex: 1 1 calc(50% - 8px); min-width: 0; max-width: 100%; margin: 0; white-space: nowrap; padding: 9px 4px; font-size: 13px; }
  /* 凭证: 手机端整体缩放适配屏宽(v179: transform 缩放, 布局保持 794px 不重排, 边框/章子/内容完整在框内) */
  .receipt-sheet { max-width: none; transform-origin: top left; overflow: hidden; }
  #receiptModal .modal-body { overflow-x: hidden; overflow-y: auto; padding: 10px 6px; }
  /* 登录页 */
  .login-page { padding: 16px; }
  .login-card { width: 100%; max-width: 380px; padding: 30px 24px; }
  /* 防 iOS 输入自动缩放 + 触控目标 */
  input, select, textarea { font-size: 16px; }
  .btn { min-height: 40px; }
  .btn-sm { min-height: 32px; }
  /* 其他 */
  .export-scope { gap: 12px; }
  .price-biz { padding: 12px; }
  .salary-detail table { font-size: 11.5px; }
  .toast { max-width: 88%; white-space: normal; }
  .related-tip { font-size: 12px; }
  .reminder-badge { padding: 4px 9px; font-size: 12px; }
}
@media (max-width: 400px) {
  .topbar-date { display: none; }
}

/* ============================================================
 * 手机端修复: grid/flex 子项被表格内容(min-content)撑开,
 * 导致卡片/看板超宽被右侧裁剪 (2026-08-29)
 * ============================================================ */
@media (max-width: 1023px) {
  .dash-grid > div, .dash-grid > div > .card,
  .dash-grid .card, .dash-grid .card-title, .dash-grid .table-wrap,
  .dash-grid .card * { min-width: 0; }
}

/* ============================================================
 * 增强工具: 通用打印 / 导入预览校验 / 自定义主题色 (2026-08-29)
 * ============================================================ */

/* ---------- 通用打印优化: 只打印内容区, 隐藏 UI 壳 ---------- */
.print-header { display: none; }
@media print {
  body { background: #fff !important; }
  .sidebar, .topbar, .nav-toggle, .side-user, .logout-btn, .reminder-badge,
  .notify-panel, .global-search, .toolbar, .pagination, .stu-tabs,
  .btn, .op-btn, .modal-mask, #toast, .gs-btn, .batch-bar, .print-fab,
  .topbar-date { display: none !important; }
  .main { padding: 0 !important; margin: 0 !important; }
  .content { padding: 0 !important; display: block !important; width: 100% !important; }
  .card { box-shadow: none !important; border: 1px solid #d5dbe3 !important;
    border-radius: 6px !important; break-inside: avoid; margin-bottom: 10px !important; }
  .table-wrap { max-height: none !important; overflow: visible !important; }
  thead th { position: static !important; }
  .stat-grid { grid-template-columns: repeat(5, 1fr) !important; }
  .stat-card { break-inside: avoid; }
  .print-header { display: block !important; margin-bottom: 14px; }
  .print-header h2 { margin: 0 0 6px; font-size: 20px; color: #1f2430; }
  .print-header .print-meta { font-size: 12px; color: #5c6370; }
  .no-print { display: none !important; }
}

/* ---------- 自定义主题色设置 ---------- */
.theme-options { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.theme-swatch { width: 32px; height: 32px; border-radius: 50%; border: 3px solid #fff;
  box-shadow: 0 0 0 2px #d6dbe4; cursor: pointer; transition: transform .15s, box-shadow .15s; }
.theme-swatch:hover { transform: scale(1.15); }
.theme-swatch.active { box-shadow: 0 0 0 2px #1f2430, 0 0 0 4px #fff; transform: scale(1.08); }
.theme-custom { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.theme-custom input[type=color] { width: 40px; height: 32px; padding: 0; border: 1px solid #d6dbe4; border-radius: 6px; cursor: pointer; background: none; }
.theme-custom .theme-hex { font-size: 13px; color: var(--text-2); font-family: monospace; }
.theme-reset { font-size: 12.5px; color: var(--primary); cursor: pointer; margin-left: auto; border: none; background: none; }
.theme-reset:hover { text-decoration: underline; }

/* ---------- 导入预览校验 ---------- */
.import-preview { margin-top: 14px; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.import-preview-head { padding: 8px 12px; background: var(--bg-tint); border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.import-preview-wrap { max-height: 240px; overflow: auto; }
.import-preview-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.import-preview-table th, .import-preview-table td { padding: 6px 8px; border: 1px solid #eef2f7; text-align: left; white-space: nowrap; }
.import-preview-table thead th { background: var(--bg-tint); position: sticky; top: 0; z-index: 1; }
.import-preview-table .row-err { background: #fff5f5; }
.import-preview-table .row-err td:first-child::before { content: '⚠ '; color: #c0392b; }
.import-preview-table .row-ok td:first-child::before { content: '✓ '; color: #16a34a; }
.imp-stat-err { color: var(--danger); font-weight: 600; }
.imp-stat-ok { color: var(--success); font-weight: 600; }
.imp-preview-note { padding: 8px 12px; font-size: 12px; color: var(--text-3); background: #fff; border-top: 1px solid var(--border); }

/* ---------- 顶栏打印按钮 ---------- */
#printPageBtn { display: flex; align-items: center; gap: 4px; background: #f1f5f9; color: #475569;
  border: none; border-radius: 8px; padding: 5px 10px; font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .15s; }
#printPageBtn:hover { background: var(--primary-100); color: var(--primary-600); transform: translateY(-1px); }
#printPageBtn svg { width: 14px; height: 14px; }

/* ========== 第二批: 学员卡片欠费样式 ========== */
.stu-card-owe {
  border-left: 3px solid #e5484d !important;
  background: linear-gradient(90deg, rgba(229,72,77,.04) 0%, transparent 30%) !important;
}
.stu-card-owe .sc-name { color: #e5484d; }

/* ========== 第二批: 表格行高统一 ========== */
.stu-table tbody tr { height: 52px; }
.stu-table td { padding: 8px 10px; vertical-align: middle; }
.biz-table tbody tr { height: 40px; }

/* ========== 第三批: 打印样式优化 ========== */
@media print {
  .sidebar, .topbar, .notify-panel, .modal-mask, .nav-toggle,
  .btn, .op-btn, .actions, .stu-tabs, .toolbar, .batch-bar,
  .card-title .btn, #printPageBtn, .gs-btn, .reminder-badge,
  .sc-more-btn, .sc-actions, .stu-sel, .empty-icon { display: none !important; }
  .main { margin-left: 0 !important; padding: 0 !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; break-inside: avoid; }
  .stat-grid { grid-template-columns: repeat(5, 1fr) !important; }
  .stat-card { border: 1px solid #ddd !important; }
  .dash-grid { grid-template-columns: 1fr 1fr !important; gap: 10px !important; }
  .table-wrap { max-height: none !important; overflow: visible !important; }
  .stu-table { font-size: 11px !important; }
  .stu-table tbody tr { height: auto !important; }
  }

.stu-card {
  position: relative;
}
.stu-card .sc-actions {
  position: relative;
  z-index: 20;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

/* 确保收款按钮可点击 - 提高z-index和点击区域 */
.sc-actions {
  position: relative;
  z-index: 20;
}
.sc-actions .op-btn {
  position: relative;
  z-index: 21;
  cursor: pointer;
  touch-action: manipulation;
  /* 不使用inline-flex，保持原有block布局 */
  display: inline-block !important;
  min-height: 36px;
  padding: 8px 12px;
  line-height: 1.2;
  vertical-align: middle;
}
/* 收款按钮特殊样式 */
.sc-actions .op-btn[onclick*="openPayModal"] {
  background: rgba(22, 163, 74, 0.1);
  border-radius: 8px;
  font-weight: 600;
}
.sc-actions .op-btn[onclick*="openPayModal"]:active {
  background: rgba(22, 163, 74, 0.2);
}
@media print {
  body { background: #fff !important; color: #000 !important; }
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
  .money-red { color: #c0392b !important; }
  .money-green { color: #16a34a !important; }
  .money-orange { color: #d97706 !important; }
  .tag { border: 1px solid #999 !important; }
}

/* ========== 第三批: 夜间模式优化 ========== */
/* ===== 深色模式(类驱动, 原 prefers-color-scheme) ===== */
/* dark */ body.dark-mode {
  --bg: #0f172a;
    --card-bg: #1e293b;
    --border: #334155;
    --text: #e2e8f0;
    --text-2: #94a3b8;
    --text-3: #64748b;
    --primary: #3b82f6;
    --primary-light: rgba(59,130,246,.15);
    --success: #22c55e;
    --warning: #eab308;
    --danger: #ef4444;
}
/* dark */ body.dark-mode {
  background: var(--bg); color: var(--text);
}
/* dark */ body.dark-mode .card {
  background: var(--card-bg); border-color: var(--border);
}
/* dark */ body.dark-mode .stat-card {
  background: var(--card-bg); border-color: var(--border);
}
/* dark */ body.dark-mode .stu-table th {
  background: #263449; color: var(--text);
}
/* dark */ body.dark-mode .stu-table tbody tr:hover {
  background: rgba(59,130,246,.08);
}
/* dark */ body.dark-mode .stu-card {
  background: var(--card-bg); border-color: var(--border);
}
/* dark */ body.dark-mode .stu-card-owe {
  background: linear-gradient(90deg, rgba(239,68,68,.1) 0%, transparent 30%) !important;
}
/* dark */ body.dark-mode .biz-table th {
  background: #263449;
}
/* dark */ body.dark-mode .rank-item:hover {
  background: rgba(59,130,246,.08);
}
/* dark */ body.dark-mode .tag-gray {
  background: #334155; color: #94a3b8;
}
/* dark */ body.dark-mode .tag-blue {
  background: rgba(59,130,246,.2); color: #60a5fa;
}
/* dark */ body.dark-mode .tag-green {
  background: rgba(34,197,94,.2); color: #4ade80;
}
/* dark */ body.dark-mode .tag-red {
  background: rgba(239,68,68,.2); color: #f87171;
}
/* dark */ body.dark-mode .tag-orange {
  background: rgba(234,179,8,.2); color: #facc15;
}
/* dark */ body.dark-mode input, body.dark-mode select, body.dark-mode textarea {
  background: #0f172a; color: var(--text); border-color: var(--border);
}
/* dark */ body.dark-mode .btn-plain {
  background: transparent; color: var(--text-2); border-color: var(--border);
}
/* dark */ body.dark-mode .btn-plain:hover {
  background: var(--primary-light); color: var(--primary);
}
/* dark */ body.dark-mode .global-search input {
  background: #0f172a; border-color: var(--border); color: var(--text);
}
/* dark */ body.dark-mode .topbar {
  background: var(--card-bg); border-color: var(--border);
}
/* dark */ body.dark-mode .sidebar {
  background: var(--card-bg); border-color: var(--border);
}
/* dark */ body.dark-mode .nav-item:hover {
  background: var(--primary-light);
}
/* dark */ body.dark-mode .nav-item.active {
  background: var(--primary-light); color: var(--primary);
}
/* dark */ body.dark-mode .empty {
  color: var(--text-3);
}
/* dark */ body.dark-mode .modal {
  background: var(--card-bg); border-color: var(--border);
}
/* dark */ body.dark-mode .modal-head {
  border-color: var(--border);
}
/* dark */ body.dark-mode .form-group label {
  color: var(--text-2);
}
/* dark */ body.dark-mode .table-wrap::-webkit-scrollbar-thumb {
  background: var(--border);
}


/* ========== 手动夜间模式 (通过body类名切换) ========== */
body.dark-mode {
  --bg: #0f172a;
  --card-bg: #1e293b;
  --border: #334155;
  --text: #e2e8f0;
  --text-2: #94a3b8;
  --text-3: #64748b;
  background: var(--bg);
  color: var(--text);
}
body.dark-mode .card, body.dark-mode .stat-card { background: var(--card-bg); border-color: var(--border); }
body.dark-mode .stu-table th { background: #263449; }
body.dark-mode .stu-card { background: var(--card-bg); border-color: var(--border); }
body.dark-mode input, body.dark-mode select, body.dark-mode textarea { background: #0f172a; color: var(--text); border-color: var(--border); }
body.dark-mode .topbar, body.dark-mode .sidebar { background: var(--card-bg); border-color: var(--border); }

/* ========== 第四批: 登录页美化 ========== */
.login-page {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #185FA5 100%);
  position: relative;
  overflow: hidden;
}
.login-page::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,.1) 0%, transparent 60%);
  animation: loginBgFloat 20s ease-in-out infinite;
}
@keyframes loginBgFloat {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(5%, 5%) rotate(180deg); }
}
.login-card {
  background: rgba(255,255,255,.98);
  backdrop-filter: blur(20px);
  border-radius: 20px;
  box-shadow: 0 25px 80px rgba(0,0,0,.3), 0 0 0 1px rgba(255,255,255,.5);
  padding: 40px 36px;
  max-width: 400px;
  width: 90%;
  animation: loginCardIn .6s cubic-bezier(.22,1,.36,1);
  position: relative;
  z-index: 1;
}
@keyframes loginCardIn {
  from { opacity: 0; transform: translateY(30px) scale(.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.login-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a2e;
  margin: 16px 0 4px;
  text-align: center;
  letter-spacing: .5px;
}
.login-card .login-logo {
  text-align: center;
  margin-bottom: 8px;
}
.login-card .form-group label {
  font-size: 13px;
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 6px;
}
.login-card input {
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  transition: all .2s;
  background: var(--bg-tint);
}
.login-card input:focus {
  border-color: #185FA5;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24,95,165,.1);
  outline: none;
}
.login-card .btn-primary {
  background: linear-gradient(135deg, #185FA5 0%, #2563eb 100%);
  border: none;
  border-radius: 10px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 2px;
  box-shadow: 0 4px 15px rgba(24,95,165,.3);
  transition: all .2s;
}
.login-card .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(24,95,165,.4);
}
.login-card .btn-primary:active {
  transform: translateY(0);
}

/* ========== 第四批: 空状态统一 ========== */
.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  color: var(--text-3, #94a3b8);
  text-align: center;
  min-height: 120px;
}
.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: .6;
  animation: emptyFloat 3s ease-in-out infinite;
}
@keyframes emptyFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.empty:empty::before {
  content: '📭';
  font-size: 48px;
  opacity: .5;
}
.empty:empty::after {
  content: '暂无数据';
  font-size: 14px;
  margin-top: 8px;
  color: var(--text-3, #94a3b8);
}

/* ========== 第四批: 弹窗按钮样式统一 ========== */
.modal {
  border-radius: 16px;
  box-shadow: 0 25px 80px rgba(0,0,0,.25);
  border: 1px solid rgba(0,0,0,.05);
  overflow: hidden;
  animation: modalIn .25s cubic-bezier(.22,1,.36,1);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: linear-gradient(135deg, var(--bg-tint) 0%, #fff 100%);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text, #1a1a2e);
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-3, #94a3b8);
  font-size: 20px;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-close:hover {
  background: #f1f5f9;
  color: var(--text, #1a1a2e);
  transform: rotate(90deg);
}
.modal-body {
  padding: 20px;
  max-height: 70vh;
  overflow-y: auto;
}
.modal-foot {
  padding: 14px 20px;
  border-top: 1px solid var(--border, #e2e8f0);
  background: var(--bg-tint);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 按钮统一样式 */
.btn {
  border-radius: 8px;
  font-weight: 600;
  transition: all .15s;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.btn-primary {
  background: linear-gradient(135deg, #185FA5 0%, #2563eb 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(24,95,165,.25);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(24,95,165,.35);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  border: none;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239,68,68,.25);
}
.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(239,68,68,.35);
}
.btn-plain {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  color: var(--text-2, #4a5568);
}
.btn-plain:hover {
  background: var(--bg-tint);
  border-color: #cbd5e1;
  color: var(--text, #1a1a2e);
}
.btn-sm {
  padding: 5px 12px;
  font-size: 12.5px;
}

/* 操作按钮统一样式 */
.op-btn {
  padding: 4px 10px;
  font-size: 12.5px;
  border-radius: 6px;
  border: 1px solid var(--border, #e2e8f0);
  background: #fff;
  color: var(--text-2, #4a5568);
  cursor: pointer;
  transition: all .15s;
}
.op-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
}
.op-btn.danger {
  color: #ef4444;
  border-color: #fecaca;
}
.op-btn.danger:hover {
  background: #fef2f2;
  border-color: #fca5a5;
}

/* ========== 第五批: 滚动提示箭头全面优化 ========== */
/* 覆盖原有样式，优化渐变和箭头显示 */
.scroll-hint {
  position: absolute;
  top: 0;
  bottom: 0;
  z-index: 10;
  width: 50px;
  display: flex;
  align-items: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity .3s ease;
}
.scroll-hint-right {
  right: 0;
  justify-content: flex-end;
}
.scroll-hint-left {
  left: 0;
  justify-content: flex-start;
}
.scroll-hint.on {
  opacity: 1;
  pointer-events: none;
}
/* 仅箭头按钮可点击(滚动), 容器与渐变区永不拦截下方内容点击 */
.scroll-hint .sh-arrow {
  pointer-events: auto;
}

/* 渐变遮罩 - 使用半透明背景，适配各种底色 */
.scroll-hint .sh-fade {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100%;
  pointer-events: none;
}
.sh-fade-right {
  right: 0;
  background: linear-gradient(270deg, var(--card-bg, #fff) 0%, rgba(255,255,255,0.85) 40%, transparent 100%);
}
.sh-fade-left {
  left: 0;
  background: linear-gradient(90deg, var(--card-bg, #fff) 0%, rgba(255,255,255,0.85) 40%, transparent 100%);
}

/* 箭头按钮 - 更明显、更现代 */
.scroll-hint .sh-arrow {
  position: relative;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--primary, #185FA5);
  background: var(--card-bg, #fff);
  color: var(--primary, #185FA5);
  font-size: 16px;
  font-weight: 700;
  line-height: 26px;
  text-align: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.12);
  transition: all .2s ease;
  animation: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.scroll-hint-right .sh-arrow {
  margin-right: 8px;
}
.scroll-hint-left .sh-arrow {
  margin-left: 8px;
}
.scroll-hint .sh-arrow:hover {
  background: var(--primary, #185FA5);
  color: #fff;
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(24,95,165,.35);
}
.scroll-hint .sh-arrow:active {
  transform: scale(0.95);
}

/* 首次显示时的脉冲提示动画 */
.scroll-hint.on:first-child .sh-arrow {
  animation: sh-pulse 2s ease-in-out;
}
@keyframes sh-pulse {
  0%, 100% { box-shadow: 0 2px 8px rgba(0,0,0,.12); }
  50% { box-shadow: 0 0 0 6px rgba(24,95,165,.2), 0 2px 8px rgba(0,0,0,.12); }
}

/* 手机端优化 */
@media (max-width: 1023px) {
  .scroll-hint {
    width: 44px;
  }
  .scroll-hint .sh-arrow {
    width: 34px;
    height: 34px;
    font-size: 18px;
    line-height: 30px;
  }
  .scroll-hint-right .sh-arrow {
    margin-right: 6px;
  }
  .scroll-hint-left .sh-arrow {
    margin-left: 6px;
  }
  /* 手机端页签栏的滚动提示更明显 */
  .stu-tabs .scroll-hint .sh-arrow {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
}

/* 深色模式适配 */
/* ===== 深色模式(类驱动, 原 prefers-color-scheme) ===== */
/* dark */ body.dark-mode .sh-fade-right {
  background: linear-gradient(270deg, #1e293b 0%, rgba(30,41,59,0.85) 40%, transparent 100%);
}
/* dark */ body.dark-mode .sh-fade-left {
  background: linear-gradient(90deg, #1e293b 0%, rgba(30,41,59,0.85) 40%, transparent 100%);
}
/* dark */ body.dark-mode .scroll-hint .sh-arrow {
  background: #1e293b;
    border-color: #3b82f6;
    color: #3b82f6;
}
/* dark */ body.dark-mode .scroll-hint .sh-arrow:hover {
  background: #3b82f6;
    color: #fff;
}

body.dark-mode .sh-fade-right {
  background: linear-gradient(270deg, #1e293b 0%, rgba(30,41,59,0.85) 40%, transparent 100%);
}
body.dark-mode .sh-fade-left {
  background: linear-gradient(90deg, #1e293b 0%, rgba(30,41,59,0.85) 40%, transparent 100%);
}
body.dark-mode .scroll-hint .sh-arrow {
  background: #1e293b;
  border-color: #3b82f6;
  color: #3b82f6;
}

/* ========== 第六批: 学员详情手机端Tab样式 ========== */
.stu-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  background: var(--bg-tint);
  border-radius: 10px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sdt-tab {
  flex-shrink: 0;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2, #64748b);
  border-radius: 8px;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.sdt-tab:hover {
  background: #eef2f7;
  color: var(--text, #1e293b);
}
.sdt-tab.active {
  background: var(--primary, #185FA5);
  color: #fff;
  box-shadow: 0 2px 8px rgba(24,95,165,.3);
}

/* ========== 第六批: 学员卡片快捷按钮样式 ========== */
.sc-quick-btn {
  width: 32px;
  height: 32px;
  padding: 0 !important;
  font-size: 15px !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  border-radius: 8px !important;
}
.sc-quick-btn:hover {
  transform: scale(1.1);
  background: #f0f7ff;
}

/* ========== 第六批: 手机端首页快捷操作入口 ========== */
.mobile-quick-actions {
  display: none;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.mqa-btn {
  background: #fff;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.mqa-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.1);
  border-color: var(--primary, #185FA5);
}
.mqa-btn:active {
  transform: translateY(0);
}
.mqa-icon {
  font-size: 22px;
  margin-bottom: 4px;
}
.mqa-text {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2, #475569);
}

/* 手机端显示快捷操作栏 */
@media (max-width: 1023px) {
  .mobile-quick-actions {
    display: grid;
  }
  /* 手机端学员详情Tab内容 */
  .stu-tab-content {
    display: block;
  }
  .stu-tab-content.hidden {
    display: none;
  }
}

/* 桌面端隐藏Tab，显示全部内容 */
@media (min-width: 1024px) {
  .stu-detail-tabs {
    display: none !important;
  }
  .stu-tab-content {
    display: block !important;
  }
}

/* ========== 第七批: 收款快捷金额按钮样式 ========== */
.pay-quick-amt {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.pay-amt-btn {
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 8px;
  background: var(--bg-tint);
  color: var(--text-2, #475569);
  cursor: pointer;
  transition: all .15s;
}
.pay-amt-btn:hover {
  background: var(--primary, #185FA5);
  color: #fff;
  border-color: var(--primary, #185FA5);
  transform: translateY(-1px);
}
.pay-amt-btn:active {
  transform: translateY(0);
}

/* ========== 第八批: 语音输入按钮样式 ========== */
.voice-input-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 6px;
  transition: all .15s;
  vertical-align: middle;
}
.voice-input-btn:hover {
  background: #f0f7ff;
  transform: scale(1.1);
}

/* ========== 第九批: 跟进记录时间线样式 ========== */
.follow-timeline {
  position: relative;
  padding-left: 24px;
  margin: 12px 0;
}
.follow-timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border, #e2e8f0);
}
.follow-item {
  position: relative;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-tint);
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
}
.follow-dot {
  position: absolute;
  left: -20px;
  top: 16px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--border, #e2e8f0);
}
.follow-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 6px;
  font-size: 12px;
}
.follow-type {
  font-weight: 700;
  font-size: 13px;
}
.follow-by {
  color: var(--text-2, #475569);
}
.follow-time {
  color: var(--text-3, #94a3b8);
  margin-left: auto;
}
.follow-text {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text, #1e293b);
}
.follow-next {
  margin-top: 8px;
  font-size: 12px;
  color: var(--warning, #f59e0b);
  font-weight: 600;
}

/* ========== 第九批: 工作日志样式 ========== */
.worklog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.worklog-item {
  padding: 14px;
  background: var(--bg-tint);
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
}
.worklog-header {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
}
.worklog-type {
  font-weight: 700;
  font-size: 13px;
  color: var(--primary, #185FA5);
  background: var(--primary-light, #eff6ff);
  padding: 2px 8px;
  border-radius: 6px;
}
.worklog-by {
  color: var(--text-2, #475569);
}
.worklog-time {
  color: var(--text-3, #94a3b8);
  margin-left: auto;
}
.worklog-content {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text, #1e293b);
}

/* 手机端跟进记录和工作日志优化 */
@media (max-width: 1023px) {
  .follow-header, .worklog-header {
    flex-wrap: wrap;
    gap: 6px;
  }
  .follow-time, .worklog-time {
    width: 100%;
    margin-left: 0;
  }
}

/* ============================================================
   iOS Safari 专项优化 (苹果手机显示问题修复)
   ============================================================ */

/* 1. 全局基础修复 */
* {
  -webkit-tap-highlight-color: transparent;  /* 移除点击高亮 */
  -webkit-touch-callout: none;                /* 禁用长按菜单 */
}

html {
  -webkit-text-size-adjust: 100%;             /* 防止文字自动调整 */
  text-size-adjust: 100%;
}

body {
  /* iOS 100vh 修复：使用 -webkit-fill-available */
  min-height: 100vh;
  min-height: -webkit-fill-available;
  min-height: fill-available;
  /* 优化滚动性能 */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: none;                /* 防止橡皮筋效果影响布局 */
}

/* 2. 安全区域适配 (iPhone X及以上刘海屏) */
.safe-area-top {
  padding-top: env(safe-area-inset-top);
  padding-top: constant(safe-area-inset-top);
}
.safe-area-bottom {
  padding-bottom: env(safe-area-inset-bottom);
  padding-bottom: constant(safe-area-inset-bottom);
}
.safe-area-left {
  padding-left: env(safe-area-inset-left);
  padding-left: constant(safe-area-inset-left);
}
.safe-area-right {
  padding-right: env(safe-area-inset-right);
  padding-right: constant(safe-area-inset-right);
}

/* 顶部栏安全区域 */
.topbar {
  padding-top: max(8px, env(safe-area-inset-top));
  padding-top: max(8px, constant(safe-area-inset-top));
}

/* 底部固定元素安全区域 */
.modal-foot,
.bottom-bar,
[style*="position: fixed"][style*="bottom"] {
  padding-bottom: max(12px, env(safe-area-inset-bottom));
  padding-bottom: max(12px, constant(safe-area-inset-bottom));
}

/* 3. 输入框优化 - 防止iOS自动缩放（font-size必须>=16px） */
@media (max-width: 1023px) {
  input, select, textarea {
    font-size: 16px !important;
    -webkit-appearance: none;
    appearance: none;
    border-radius: 8px;
  }
  
  /* 搜索框特殊处理 */
  .global-search input {
    font-size: 16px !important;
    height: 40px !important;
  }
  
  /* 按钮优化 */
  button {
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;  /* 消除300ms点击延迟 */
  }
  
  /* 下拉箭头重置 */
  select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
  }
}

/* 4. backdrop-filter iOS兼容 */
.login-card,
.glass-effect,
[style*="backdrop-filter"] {
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

/* 5. 固定定位元素优化 */
@media (max-width: 1023px) {
  .modal-mask {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* iOS固定定位修复 */
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
  }
  
  .modal-body {
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }
  
  /* 弹窗最大高度适配 */
  .modal-card {
    max-height: 90vh;
    max-height: calc(90vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: -webkit-fill-available;
  }
}

/* 6. 表格横向滚动优化 */
.table-wrap {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

/* 7. 图片和媒体优化 */
img {
  max-width: 100%;
  height: auto;
  -webkit-user-drag: none;
  user-drag: none;
}

/* 8. 防止iOS输入框聚焦时页面上移问题 */
@media (max-width: 1023px) {
  input:focus, select:focus, textarea:focus {
    font-size: 16px !important;
  }
  
  /* 表单容器避免被键盘遮挡 */
  .form-grid, .modal-body {
    padding-bottom: 20px;
  }
}

/* 9. 侧边栏滑动优化 */
.sidebar,
.side-menu {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* 10. 日期选择器优化 */
input[type="date"],
input[type="datetime-local"],
input[type="time"] {
  -webkit-appearance: none;
  appearance: none;
  min-height: 40px;
}

/* 11. 开关/复选框优化 */
input[type="checkbox"],
input[type="radio"] {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 4px;
  position: relative;
  cursor: pointer;
  vertical-align: middle;
}
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--primary, #185FA5);
  border-color: var(--primary, #185FA5);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="radio"] {
  border-radius: 50%;
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
}

/* 12. 滚动条隐藏（iOS风格） */
@media (max-width: 1023px) {
  .table-wrap::-webkit-scrollbar,
  .modal-body::-webkit-scrollbar,
  .sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
  }
}

/* 13. 防止文字选中（按钮和标签） */
button, .btn, .op-btn, .tab, .nav-item {
  -webkit-user-select: none;
  user-select: none;
}

/* 14. 优化触摸目标大小（iOS建议至少44px） */
@media (max-width: 1023px) {
  .btn, .nav-item, .tab, .mqa-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  
  /* op-btn保持原有布局，仅增加最小高度，不改变display */
  .op-btn {
    min-height: 36px;
    padding: 8px 12px;
    line-height: 1.2;
  }
  
  /* 学员卡片操作按钮特殊处理 */
  .sc-actions .op-btn {
    min-height: 36px;
    min-width: auto;
    padding: 6px 10px;
    font-size: 13px;
  }
  
  .sc-quick-btn {
    min-height: 36px;
    min-width: 36px;
    padding: 6px !important;
  }
  
  .pay-amt-btn, .theme-swatch {
    min-height: 36px;
    min-width: 36px;
  }
}



/* 15. 修复iOS下position: sticky的问题 */
.sticky-col,
[style*="position: sticky"] {
  position: -webkit-sticky;
  position: sticky;
}


/* ============================================================
   自定义轻量弹窗样式（替代prompt/confirm，手机端响应更快）
   ============================================================ */
.quick-input-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  /* 确保mask不会意外覆盖页面 - JS创建时才显示 */
  pointer-events: auto;
  animation: quickMaskIn 0.15s ease;
  -webkit-transform: translateZ(0);
  transform: translateZ(0);
}
@keyframes quickMaskIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.quick-input-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 20px 16px;
  width: 85%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: quickCardIn 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes quickCardIn {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.quick-input-title {
  font-size: 17px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 16px;
  text-align: center;
}
.quick-input-msg {
  font-size: 14px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
  text-align: center;
}
.quick-input-field {
  width: 100%;
  padding: 12px 14px;
  font-size: 16px !important;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  margin-bottom: 16px;
  box-sizing: border-box;
  -webkit-appearance: none;
  appearance: none;
  outline: none;
  transition: border-color 0.15s;
}
.quick-input-field:focus {
  border-color: #185FA5;
}
.quick-input-btns {
  display: flex;
  gap: 10px;
}
.quick-input-btn {
  flex: 1;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  -webkit-appearance: none;
  appearance: none;
  touch-action: manipulation;
  min-height: 44px;
}
.quick-input-btn:active {
  transform: scale(0.97);
}
.quick-input-btn.cancel {
  background: #f1f5f9;
  color: #64748b;
}
.quick-input-btn.ok {
  background: #185FA5;
  color: #fff;
}

/* 优化：减少全属性过渡，只过渡必要属性 */
@media (max-width: 1023px) {
  .btn, .op-btn, .mqa-btn, .pay-amt-btn {
    transition: background 0.1s, opacity 0.1s, transform 0.1s !important;
  }
  .btn:active, .op-btn:active, .mqa-btn:active {
    transform: scale(0.97);
    opacity: 0.85;
  }
  /* 减少弹窗动画时间 */
  .modal-card {
    animation: modalIn 0.18s cubic-bezier(0.22, 1, 0.36, 1) !important;
  }
}

/* 点击反馈：按钮按下效果 */
.btn:active, .op-btn:active, .nav-item:active, .tab:active, .mqa-btn:active {
  transform: scale(0.97);
  opacity: 0.85;
}


/* ============================================================
   最终修复：确保手机端收款按钮可点击
   ============================================================ */
@media (max-width: 1023px) {
  /* 学员卡片操作区域 - 明确flex布局 */
  .sc-actions {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 8px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 8px 0 !important;
    position: relative !important;
    z-index: 100 !important;
  }
  
  /* 操作按钮 - 明确尺寸和布局 (v18.5: inline-flex居中 + flex均分等宽) */
  .sc-actions .op-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    flex: 1 1 0% !important;
    min-width: 50px !important;
    min-height: 40px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    line-height: 1.2 !important;
    text-align: center !important;
    vertical-align: middle !important;
    position: relative !important;
    z-index: 101 !important;
    cursor: pointer !important;
    touch-action: manipulation !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    border: none !important;
    background: transparent !important;
  }
  
  /* 收款按钮 - 明确样式 */
  .sc-actions .pay-btn-mobile {
    background: rgba(22, 163, 74, 0.12) !important;
    color: #16a34a !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    min-width: 60px !important;
  }
  .sc-actions .pay-btn-mobile:active {
    background: rgba(22, 163, 74, 0.25) !important;
    transform: scale(0.95) !important;
  }
  
  /* 快捷按钮（拨号/微信） */
  .sc-actions .sc-quick-btn {
    min-width: 36px !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    font-size: 16px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
}

/* 确保按钮不被学员卡片的onclick拦截 */
.stu-card {
  position: relative;
}
.stu-card .sc-actions {
  position: relative;
  z-index: 100;
}


/* ============================================================
   全局修复：确保所有按钮可点击
   ============================================================ */
button, .btn, .op-btn {
  pointer-events: auto !important;
  cursor: pointer !important;
}

/* 确保没有元素意外覆盖按钮 */
.modal-mask.hidden,
.quick-input-mask[style*="display: none"] {
  display: none !important;
  pointer-events: none !important;
}

/* 学员卡片中的按钮确保在最上层 */
.stu-card button,
.stu-card .op-btn {
  position: relative;
  z-index: 10;
}


/* ============================================================
   学员卡片左上侧布局优化 - 防止复选框与姓名重叠
   ============================================================ */
.stu-card .sc-top {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  padding: 4px 40px 4px 12px !important;
  position: relative !important;
}

.stu-card .stu-sel {
  flex: 0 0 auto !important;
  width: 18px !important;
  height: 18px !important;
  min-height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
  accent-color: var(--primary, #185FA5) !important;
  cursor: pointer !important;
  position: relative !important;
  z-index: 2 !important;
}

.stu-card .sc-name {
  flex: 0 1 auto !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  margin: 0 !important;
  padding: 0 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  position: relative !important;
  z-index: 1 !important;
  min-width: 0 !important;
}

.stu-card .sc-status {
  margin-left: auto !important;
  flex: 0 0 auto !important;
  position: relative !important;
  z-index: 1 !important;
}

/* 手机端进一步优化 */
@media (max-width: 1023px) {
  .stu-card .sc-top {
    gap: 8px !important;
    padding: 4px 36px 4px 10px !important;
  }
  
  .stu-card .stu-sel {
    width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
  }
  
  .stu-card .sc-name {
    font-size: 14.5px !important;
  }
}

/* 确保复选框不被其他元素遮挡 - 使用自定义样式，避免与原生对勾重叠 */
.stu-card input[type="checkbox"] {
  -webkit-appearance: none !important;
  appearance: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
}

/* 自定义复选框勾选对勾 - 确保只有一个对勾显示 */
.stu-card input[type="checkbox"]:checked {
  background: var(--primary, #185FA5) !important;
  border-color: var(--primary, #185FA5) !important;
}

.stu-card input[type="checkbox"]:checked::after {
  content: '' !important;
  position: absolute !important;
  left: 4px !important;
  top: 1px !important;
  width: 5px !important;
  height: 9px !important;
  border: solid white !important;
  border-width: 0 2px 2px 0 !important;
  transform: rotate(45deg) !important;
  display: block !important;
}

/* 确保::before不显示对勾 */
.stu-card input[type="checkbox"]::before {
  content: none !important;
  display: none !important;
}


/* ============================================================
   更多操作按钮位置修复 - 确保在右上侧，与左上复选框对称
   ============================================================ */
.stu-card .sc-more-btn {
  position: absolute !important;
  top: 10px !important;
  right: 10px !important;
  left: auto !important;
  bottom: auto !important;
  z-index: 10 !important;
  width: 30px !important;
  height: 30px !important;
  line-height: 26px !important;
  text-align: center !important;
  border: 1px solid var(--border, #e4e7ee) !important;
  border-radius: 8px !important;
  background: var(--card-bg, #fff) !important;
  color: var(--text-2, #64748b) !important;
  font-size: 16px !important;
  padding: 0 !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.stu-card .sc-more-btn:hover {
  background: var(--primary-light, #eef4ff) !important;
  color: var(--primary, #185FA5) !important;
  border-color: var(--primary, #185FA5) !important;
}

.stu-card .sc-more-btn:active {
  transform: scale(0.95) !important;
}

/* 确保sc-top为右上按钮预留空间 */
.stu-card .sc-top {
  padding-right: 44px !important;
}

/* 手机端更多操作按钮尺寸 */
@media (max-width: 1023px) {
  .stu-card .sc-more-btn {
    width: 34px !important;
    height: 34px !important;
    line-height: 30px !important;
    font-size: 17px !important;
    border-radius: 9px !important;
    top: 8px !important;
    right: 8px !important;
  }
  
  .stu-card .sc-top {
    padding-right: 48px !important;
  }
}

/* ============================================================
   UI增强 v16 — 选择框(checkbox/radio)圆润化优化
   圆角增大 / 对勾更清晰 / hover与焦点反馈 / 平滑过渡
   ============================================================ */
input[type="checkbox"],
input[type="radio"] {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .1s ease;
}
/* hover: 边框变主题色 + 浅色底 */
input[type="checkbox"]:hover,
input[type="radio"]:hover {
  border-color: var(--primary, #185FA5);
  background: rgba(24, 95, 165, .06);
}
/* 焦点可见环 (键盘导航可达) */
input[type="checkbox"]:focus-visible,
input[type="radio"]:focus-visible {
  outline: 2px solid var(--primary, #185FA5);
  outline-offset: 1px;
}
/* 按下微缩放反馈 */
input[type="checkbox"]:active,
input[type="radio"]:active {
  transform: scale(.92);
}
/* checked: 主题色填充 + 投影 */
input[type="checkbox"]:checked,
input[type="radio"]:checked {
  background: var(--primary, #185FA5);
  border-color: var(--primary, #185FA5);
  box-shadow: 0 1px 4px rgba(24, 95, 165, .35);
}
/* 对勾: 更大更清晰居中 */
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4.5px;
  top: 1.5px;
  width: 5px;
  height: 9px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(1.1);
  transform-origin: center;
}
/* radio: 圆润 + 白点 */
input[type="radio"] {
  border-radius: 50%;
}
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 8px;
  height: 8px;
  background: #fff;
  border-radius: 50%;
}
/* 移动端触控: 稍微放大 */
@media (max-width: 1023px) {
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    border-radius: 7px;
  }
  input[type="checkbox"]:checked::after {
    left: 5px;
    top: 2px;
    width: 5.5px;
    height: 10px;
  }
}

/* ============================================================
   UI增强 v17 — 勾选框(卡片/表格)对勾精细化
   对勾加大加粗 / 位置居中 / 视觉更清晰
   ============================================================ */
/* 卡片勾选框: 覆盖既有 !important 规则, 对勾更大更居中 */
.stu-card input[type="checkbox"]:checked::after {
  content: '' !important;
  position: absolute !important;
  left: 6px !important;
  top: 2px !important;
  width: 6px !important;
  height: 11px !important;
  border: solid #fff !important;
  border-width: 0 2.5px 2.5px 0 !important;
  transform: rotate(45deg) !important;
  border-radius: 1px !important;
  display: block !important;
}
/* 卡片勾选框尺寸微调: 视觉更饱满 */
.stu-card input[type="checkbox"] {
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.02) !important;
}
.stu-card input[type="checkbox"]:checked {
  background: var(--primary, #185FA5) !important;
  border-color: var(--primary, #185FA5) !important;
  box-shadow: 0 1px 4px rgba(24, 95, 165, .35) !important;
}
/* 通用勾选框对勾微调: 稍大更清晰 */
input[type="checkbox"]:checked::after {
  left: 5px !important;
  top: 1.5px !important;
  width: 5.5px !important;
  height: 10px !important;
  border-width: 0 2.5px 2.5px 0 !important;
}
/* 移动端卡片勾选框: 触控更大 + 对勾适配 */
@media (max-width: 1023px) {
  .stu-card .stu-sel,
  .stu-card input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-height: 22px !important;
    border-radius: 8px !important;
  }
  .stu-card input[type="checkbox"]:checked::after {
    left: 6.5px !important;
    top: 2.5px !important;
    width: 6.5px !important;
    height: 12px !important;
    border-width: 0 2.5px 2.5px 0 !important;
  }
}

/* ============================================================
   UI增强 v18 — 勾选框统一定为正方形
   修复表格内 checkbox 被 padding 拉伸成 28x20 长方形的问题
   ============================================================ */
/* 所有勾选框: 去除横向 padding, 统一正方形 */
input[type="checkbox"] {
  width: 20px !important;
  height: 20px !important;
  min-width: 20px !important;
  min-height: 20px !important;
  max-width: 20px !important;
  max-height: 20px !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  border-radius: 6px !important;
}
/* 表格单元格内的勾选框: 强制不随 td padding 拉伸 */
td input[type="checkbox"],
td .stu-sel {
  width: 20px !important;
  height: 20px !important;
  padding: 0 !important;
}
/* 勾选后的对勾: 适配正方形 20px */
input[type="checkbox"]:checked::after {
  left: 4.5px !important;
  top: 1.5px !important;
  width: 5.5px !important;
  height: 10px !important;
  border-width: 0 2.5px 2.5px 0 !important;
}
/* 卡片勾选框: 22px 正方形 (触控友好) */
.stu-card .stu-sel,
.stu-card input[type="checkbox"] {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  border-radius: 7px !important;
}
.stu-card input[type="checkbox"]:checked::after {
  left: 6px !important;
  top: 2px !important;
  width: 6px !important;
  height: 11px !important;
  border-width: 0 2.5px 2.5px 0 !important;
}
/* 移动端: 统一 22px */
@media (max-width: 1023px) {
  input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    min-height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    border-radius: 7px !important;
  }
  td input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
  }
  input[type="checkbox"]:checked::after {
    left: 5px !important;
    top: 2px !important;
    width: 5.5px !important;
    height: 10px !important;
  }
}

/* ============================================================
   UI增强 v18.1 — 勾选框正方形修正
   移动端表格内 checkbox 统一 20x20 正方形 (避免被通用移动端规则拉到 22 高)
   ============================================================ */
@media (max-width: 1023px) {
  td input[type="checkbox"] {
    width: 20px !important;
    height: 20px !important;
    min-height: 20px !important;
    max-height: 20px !important;
  }
}

/* ============================================================
   UI增强 v18.2 — 修复 op-primary / op-success 按钮白字白底
   资金往来"付款/报销""通过"、退款管理"办理中""已付款"等按钮,
   背景被上方通用 .op-btn{background:#fff} 覆盖 → 白字白底看不见
   ============================================================ */
.op-primary {
  background: var(--brand-gradient, linear-gradient(135deg,#185FA5 0%,#2563eb 100%)) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(37,99,235,.25);
}
.op-primary:hover {
  background: var(--primary-600, #1d4ed8) !important;
  border: none !important;
  transform: translateY(-1px);
}
.op-success {
  background: var(--success, #1a9e5c) !important;
  color: #fff !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(26,158,92,.22);
}
.op-success:hover {
  background: #158a4f !important;
  border: none !important;
  transform: translateY(-1px);
}

/* ===== v18.3 按钮文字排版统一: 行内操作按钮图标统一为SVG并对齐 ===== */
.op-btn { display: inline-flex; align-items: center; justify-content: center; gap: 3px; white-space: nowrap; }
.op-btn svg.lucide, .op-btn .lucide { width: 14px; height: 14px; flex-shrink: 0; }
.btn svg.lucide, .btn .lucide { flex-shrink: 0; vertical-align: -1px; }
.btn .lucide-sm { width: 14px; height: 14px; }

/* ===== v18.4 分段选项卡(seg-tab)图标统一为SVG并对齐 ===== */
.seg-tab { display: inline-flex; align-items: center; justify-content: center; gap: 5px; white-space: nowrap; }
.seg-tab svg.lucide { width: 15px; height: 15px; flex-shrink: 0; }

/* ========== 开收据 (其他收款) 凭证打印与手机端适配 (2026-09-18) ========== */
@media (max-width: 1023px) {
  #miscReceiptModal .modal-body { overflow-x: hidden; overflow-y: auto; padding: 10px 6px; }
}
@media print {
  #miscReceiptModal { display: flex !important; visibility: visible !important; background: none !important; position: static !important; padding: 0 !important; }
  #miscReceiptModal .modal { display: block !important; box-shadow: none !important; border: none !important; max-width: none !important; max-height: none !important; width: auto !important; }
  #miscReceiptModal .modal-head, #miscReceiptModal .modal-foot { display: none !important; }
  #miscReceiptModal .modal-body { overflow: visible !important; padding: 0 !important; }
  #miscReceiptArea, #miscReceiptArea * { visibility: visible !important; }
  #miscReceiptArea {
    position: fixed; left: 0; top: 0;
    width: 794px !important; max-width: 794px !important;
    margin: 0 !important;
    border: 2px solid #1a1a1a !important;
    transform: scale(0.85) !important;
    transform-origin: top left !important;
  }
  #miscReceiptArea::before {
    content: ''; position: absolute; top: 3px; left: 3px; right: 3px; bottom: 3px;
    border: 1px solid #1a1a1a !important; pointer-events: none; z-index: 0;
  }
}
