/* ============================================
   招生管理系统 - 移动端自适应样式
   ============================================ */

/* CSS 变量 */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --primary-bg: #eef2ff;
  --secondary: #7c3aed;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0891b2;
  --info-bg: #ecfeff;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-card: 0 2px 8px rgba(79,70,229,0.06), 0 1px 3px rgba(0,0,0,0.04);

  --tab-bar-height: 60px;
  --header-height: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
  padding-bottom: calc(var(--tab-bar-height) + var(--safe-bottom));
  overflow-x: hidden;
}

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

/* ===== 头部 ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.3);
}

.app-header h1 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-header .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.app-header .sync-status {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0.9;
}

.app-header .sync-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade80;
}

.app-header .sync-dot.offline {
  background: #fb923c;
}

/* ===== 底部导航 ===== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(var(--tab-bar-height) + var(--safe-bottom));
  background: var(--card-bg);
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--gray-400);
  cursor: pointer;
  transition: color 0.2s;
  position: relative;
  text-decoration: none;
}

.tab-item.active {
  color: var(--primary);
}

.tab-item .tab-icon {
  font-size: 22px;
  line-height: 1;
}

.tab-item .tab-label {
  font-size: 10px;
  font-weight: 500;
}

.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--primary);
  border-radius: 0 0 3px 3px;
}

/* ===== 页面容器 ===== */
.page {
  display: none;
  padding: 12px;
  animation: fadeIn 0.25s ease;
}

.page.active {
  display: block;
}

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

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

/* ===== 统计卡片 ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: linear-gradient(135deg, var(--card-bg) 0%, var(--gray-50) 100%);
  border-radius: var(--radius);
  padding: 16px 14px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  border-left: 3px solid transparent;
}
.stat-card:active {
  transform: scale(0.98);
}
.stat-card.primary { border-left-color: var(--primary); background: linear-gradient(135deg, #ffffff 0%, #eef2ff 100%); }
.stat-card.success { border-left-color: var(--success); background: linear-gradient(135deg, #ffffff 0%, #f0fdf4 100%); }
.stat-card.warning { border-left-color: var(--warning); background: linear-gradient(135deg, #ffffff 0%, #fffbeb 100%); }
.stat-card.danger  { border-left-color: var(--danger);  background: linear-gradient(135deg, #ffffff 0%, #fef2f2 100%); }

.stat-card .stat-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: 32px;
  opacity: 0.12;
}

.stat-card .stat-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}

.stat-card .stat-value {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.stat-card.primary .stat-value { color: var(--primary); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger .stat-value { color: var(--danger); }

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  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='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.97);
}

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

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:active {
  background: var(--gray-50);
}

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

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* ===== 标签 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-bg); color: var(--primary); }
.badge-cyan { background: var(--info-bg); color: var(--info); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }
.badge-purple { background: #faf5ff; color: #9333ea; }

/* ===== 列表项 ===== */
.list-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.1s;
}

.list-item:active {
  transform: scale(0.98);
  box-shadow: var(--shadow);
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.list-item-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

.list-item-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* ===== 搜索栏 ===== */
.search-bar {
  position: relative;
  margin-bottom: 12px;
}

.search-bar input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  font-size: 14px;
  outline: none;
}

.search-bar input:focus {
  border-color: var(--primary);
}

.search-bar::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
}

/* ===== 筛选栏 ===== */
.filter-bar {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.filter-bar::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== 批量操作工具栏 ===== */
.batch-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.batch-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.batch-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.batch-select-all {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}

.batch-select-all input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

.batch-count {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.batch-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}

.list-item.batch-mode {
  cursor: pointer;
}

.list-item.batch-mode.selected {
  background: color-mix(in srgb, var(--primary) 8%, var(--card-bg));
  border-color: var(--primary);
}

.batch-entry-btn {
  flex-shrink: 0;
  padding: 6px 12px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}

.batch-entry-btn:active {
  background: var(--danger);
  color: #fff;
  border-color: var(--danger);
}
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.modal-footer .btn {
  flex: 1;
}

.confirm-modal {
  border-radius: 16px;
  max-width: 320px;
  margin: auto;
  align-self: center;
  transform: scale(0.9);
  transition: transform 0.25s;
}

.modal-overlay.show .confirm-modal {
  transform: scale(1);
}

/* ===== 收据预览 ===== */
.receipt-preview {
  text-align: center;
}

.receipt-img {
  width: 100%;
  max-width: 380px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  margin-bottom: 16px;
}

.receipt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.receipt-tip {
  font-size: 12px;
  color: var(--gray-400);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--gray-800);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s;
  max-width: 300px;
}

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

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

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

/* ===== FAB 浮动按钮 ===== */
.fab {
  position: fixed;
  bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 16px);
  right: 16px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  border: none;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.fab:active {
  transform: scale(0.92);
}

/* ===== 详情面板 ===== */
.detail-section {
  margin-bottom: 16px;
}

.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 13px;
}

.detail-label {
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 80px;
}

.detail-value {
  color: var(--text);
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}

/* ===== 图片上传 ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-area:active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.upload-area .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-area .upload-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-preview {
  position: relative;
  margin-top: 10px;
}

.upload-preview img {
  width: 100%;
  border-radius: var(--radius-sm);
  max-height: 200px;
  object-fit: cover;
}

.upload-preview .upload-delete {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.3s;
}

/* ===== 时间线 ===== */
.timeline {
  position: relative;
  padding-left: 20px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 16px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -19px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card-bg);
}

.timeline-item .timeline-time {
  font-size: 11px;
  color: var(--gray-400);
  margin-bottom: 2px;
}

.timeline-item .timeline-content {
  font-size: 13px;
  color: var(--text);
}

/* ===== 分段控制 ===== */
.segment-control {
  display: flex;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 12px;
}

.segment-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.segment-item.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ===== 家长端登录 ===== */
.parent-login {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.parent-login .login-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.parent-login h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.parent-login p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.parent-login .login-form {
  width: 100%;
  max-width: 320px;
}

/* ===== 登录页面 ===== */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.login-container {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: loginSlideUp 0.4s ease;
}

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

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-icon {
  font-size: 52px;
  margin-bottom: 8px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.role-selector {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-bottom: 20px;
}

.role-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 12px;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--card-bg);
}

.role-card:active {
  transform: scale(0.95);
}

.role-card.active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.role-card .role-icon {
  font-size: 24px;
}

.role-card .role-name {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 500;
  text-align: center;
}

.role-card.active .role-name {
  color: var(--primary);
  font-weight: 600;
}

.login-form-area .form-group {
  margin-bottom: 14px;
}

.login-form-area .login-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.login-form-area .login-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.login-form-area .login-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.login-form-area .login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 12px;
}

.login-form-area .login-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--gray-300);
  font-size: 12px;
}

.login-form-area .login-divider::before,
.login-form-area .login-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.login-form-area .switch-role-link {
  text-align: center;
  margin-top: 12px;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
}

.login-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.login-footer p {
  font-size: 11px;
  color: var(--gray-400);
  text-align: center;
  line-height: 1.8;
}

/* 已登录用户徽章 */
.user-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s;
}

.user-badge:active {
  background: rgba(255, 255, 255, 0.35);
}

.user-badge-icon {
  font-size: 16px;
}

.user-badge-name {
  font-size: 12px;
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 用户菜单弹窗 */
.user-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  background: rgba(0, 0, 0, 0.3);
}

.user-menu {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 1501;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  animation: menuSlide 0.2s ease;
}

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.user-menu-header .menu-role {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.user-menu-header .menu-name {
  font-size: 16px;
  font-weight: 600;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}

.user-menu-item:last-child {
  border-bottom: none;
}

.user-menu-item:active {
  background: var(--gray-50);
}

.user-menu-item.danger {
  color: var(--danger);
}

/* 账号列表项 */
.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.account-item-info {
  flex: 1;
}

.account-item-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}

.account-item-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.account-item-actions {
  display: flex;
  gap: 6px;
}

.role-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
}

.role-badge-admin { background: #fef2f2; color: #dc2626; }
.role-badge-counselor { background: #eef2ff; color: #4f46e5; }
.role-badge-receptionist { background: #ecfeff; color: #0891b2; }
.role-badge-finance { background: #f0fdf4; color: #16a34a; }
.role-badge-parent { background: #faf5ff; color: #7c3aed; }

/* ===== 表格（桌面端） ===== */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--gray-50);
  position: sticky;
  top: 0;
}

.data-table td {
  color: var(--text);
}

/* ===== 平板/桌面适配 ===== */
@media (min-width: 768px) {
  .page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .modal {
    border-radius: 16px;
    max-width: 560px;
    align-self: center;
    margin: auto;
    transform: scale(0.9);
  }

  .modal-overlay.show .modal {
    transform: scale(1);
  }

  .list-item {
    padding: 18px;
  }

  .fab {
    bottom: calc(var(--tab-bar-height) + var(--safe-bottom) + 24px);
    right: 24px;
  }
}

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

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

/* ===== 工具类 ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }

/* ===== 滑动时间选择器 ===== */
.scroller-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1100;
  background: rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  animation: scrollerFadeIn 0.2s;
}
@keyframes scrollerFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.scroller-panel {
  background: var(--bg-white);
  border-radius: 16px 16px 0 0;
  animation: scrollerSlideUp 0.25s ease-out;
}
@keyframes scrollerSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.scroller-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
}
.scroller-cancel {
  font-size: 15px;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}
.scroller-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}
.scroller-confirm {
  font-size: 15px;
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
}
.scroller-display {
  text-align: center;
  padding: 12px 20px;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  border-bottom: 1px solid var(--border);
}
.scroller-wheels {
  display: flex;
  padding: 8px 12px 20px;
  height: 220px;
  position: relative;
  justify-content: center;
  gap: 4px;
}
.scroller-highlight {
  position: absolute;
  top: 8px;
  left: 12px;
  right: 12px;
  height: 44px;
  margin-top: 88px;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  background: rgba(79,70,229,0.04);
  pointer-events: none;
}
.scroller-wheel {
  flex: 1;
  max-width: 70px;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  position: relative;
  z-index: 1;
  /* Hide scrollbar */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.scroller-wheel::-webkit-scrollbar {
  display: none;
}
.scroller-item {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--gray-400);
  scroll-snap-align: center;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
}
.scroller-item.selected {
  color: var(--text-primary);
  font-weight: 700;
  font-size: 20px;
}
.scroller-item-placeholder {
  height: calc((220px - 44px) / 2);
  scroll-snap-align: none;
  pointer-events: none;
}

/* 预约时间显示 */
.appt-display {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 14px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: border-color 0.2s;
}
.appt-display:active {
  border-color: var(--primary);
}
.appt-display.empty {
  color: var(--gray-400);
}
.text-muted { color: var(--text-secondary); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-xl { font-size: 20px; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ===== 角色多选 checkbox 样式 ===== */
.role-checkbox {
  transition: all 0.15s ease;
  user-select: none;
}
.role-checkbox:active {
  transform: scale(0.96);
}
.role-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
}

/* ===== 快捷操作高端样式 ===== */
.quick-action {
  text-align: center;
  padding: 14px 8px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--gray-50) 0%, #ffffff 100%);
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.quick-action:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
}
.quick-action:active {
  transform: scale(0.96);
  background: var(--primary-bg);
}

/* ===== 操作日志折叠面板 ===== */
#audit-log-panel .card-header {
  padding: 4px 0;
  margin-bottom: 0;
}

/* ===== 时间线精致化 ===== */
.timeline-item {
  transition: background 0.15s;
  border-radius: 6px;
  padding: 10px 0;
}
.timeline-item:hover {
  background: var(--gray-50);
}
.timeline-item::before {
  box-shadow: 0 0 0 3px var(--card-bg);
}

/* ===== 筛选 chip 精致化 ===== */
.filter-chip {
  transition: all 0.15s ease;
}
.filter-chip:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

/* ===== 页面切换动画优化 ===== */
.page {
  animation: pageEnter 0.25s ease-out;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
