﻿/* ========================================
   美术艺考班主任工作台 - 新拟物主义风格
   Neomorphism Design System
   自适应：PC Chrome/Edge + iPhone 13 Pro Safari
   ======================================== */

/* ===== CSS 变量 ===== */
:root {
  /* ===== 主色：蓝（适中饱和度，办公感） ===== */
  --primary: #4a7abc;
  --primary-light: #7fa8de;
  --primary-pale: #e8f0fa;
  --primary-dark: #3460a0;
  --primary-alpha: rgba(74, 122, 188, 0.12);

  /* ===== 状态色（饱和适中，保证可读性） ===== */
  /* 红 - 未开始/危险 */
  --danger: #d65050;
  --danger-light: #e88a8a;
  --danger-pale: #fbecec;
  --danger-dark: #b83a3a;

  /* 黄 - 进行中/搁置/警告 */
  --warning: #e0a030;
  --warning-light: #edc06a;
  --warning-pale: #fdf4e0;
  --warning-dark: #c48620;

  /* 绿 - 完成/成功 */
  --success: #3da570;
  --success-light: #7cc99e;
  --success-pale: #e6f5ed;
  --success-dark: #2e8a5a;

  /* ===== 中性色：6级灰阶（由浅到深） ===== */
  --gray-50: #f5f6f8;   /* 页面背景 */
  --gray-100: #ebedf0;  /* 次级背景/分割线 */
  --gray-200: #dcdfe4;  /* 边框 */
  --gray-300: #c0c4cc;  /* 次级边框/禁用 */
  --gray-500: #5c6270;  /* 次要文字 */
  --gray-700: #1f232b;  /* 主要文字 */

  /* ===== 语义化变量 ===== */
  --bg: var(--gray-50);
  --card-bg: #ffffff;
  --surface: var(--gray-100);
  --text: var(--gray-700);
  --text-secondary: var(--gray-500);
  --text-tertiary: #8a8f99;
  --border: var(--gray-200);
  --border-light: var(--gray-100);

  /* ===== 阴影 ===== */
  --shadow: 0 2px 10px rgba(122, 166, 217, 0.08);
  --shadow-lg: 0 4px 20px rgba(122, 166, 217, 0.12);
  --shadow-inset: inset 0 2px 4px rgba(0,0,0,0.03);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);

  --radius: 16px;
  --radius-sm: 12px;
  --radius-xs: 8px;
  --nav-height: 56px;
  --seat-size: 52px;
  --seat-gap: 8px;

  /* ===== 兼容别名 ===== */
  --bg-primary: var(--card-bg);
  --bg-secondary: var(--bg);
  --bg-tertiary: var(--gray-100);
  --bg-inset: var(--gray-100);
  --primary-color: var(--primary);
  --text-primary: var(--text);
  --border-color: var(--border);
  --radius-md: var(--radius);

  /* ===== 动效 ===== */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --dur-fast: 150ms;
  --dur-normal: 250ms;
  --dur-slow: 350ms;
}

/* ===== 全局重置 ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -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', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  padding-top: var(--nav-height);
  padding-bottom: env(safe-area-inset-bottom, 0);
  min-height: 100vh;
  overscroll-behavior-y: contain;
}
a { color: var(--primary); text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: inherit; }
.hidden { display: none !important; }

/* ===== 离线提示条 ===== */
.offline-banner {
  position: fixed; top: var(--nav-height); left: 0; right: 0;
  background: var(--warning); color: #fff;
  padding: 6px 16px; font-size: 0.8rem; text-align: center;
  z-index: 999; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--shadow);
  transition: opacity 0.3s, transform 0.3s;
}
.offline-banner .offline-icon {
  font-size: 0.9rem;
}
.offline-banner .offline-close {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.2);
  border: none;
  color: #fff;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 0.7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.offline-banner .offline-close:hover {
  background: rgba(255,255,255,0.35);
}
/* 低调模式：长时间离线后缩小为小图标 */
.offline-banner.offline-minimal {
  padding: 3px 12px;
  font-size: 0.72rem;
  opacity: 0.85;
}
.offline-banner.offline-minimal .offline-icon {
  font-size: 0.75rem;
}
.offline-icon { background: rgba(255,255,255,0.25); padding: 2px 10px; border-radius: var(--radius-xs); font-weight: 600; }

/* ===== 导航栏 ===== */
.nav-bar {
  position: fixed; top: 0; left: 0; right: 0; height: var(--nav-height);
  background: var(--card-bg); color: var(--text);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; z-index: 1000; box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border-light);
  padding-top: env(safe-area-inset-top, 0);
}
.nav-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); }
.nav-logo { background: var(--primary-pale); padding: 2px 10px; border-radius: var(--radius-xs); font-size: 0.85rem; color: var(--primary-dark); }
.nav-title { font-size: 1.05rem; color: var(--text); }
.nav-menu { display: flex; gap: 4px; align-items: center; }
.nav-link { color: var(--text-secondary); padding: 8px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; transition: all 0.2s; white-space: nowrap; }
.nav-link:hover, .nav-link.active { background: var(--primary-pale); color: var(--primary-dark); }
.nav-toggle { display: none; flex-direction: column; gap: 4px; padding: 8px; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: 0.3s; }

/* ===== 主容器 ===== */
.app-container { max-width: 1200px; margin: 0 auto; padding: 16px; }

/* ===== 卡片 ===== */
.card { background: var(--card-bg); border: 1px solid var(--border-light); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); transition: box-shadow 0.2s; }
.card:hover { box-shadow: var(--shadow-lg); }
.card-title { font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.card-subtitle { font-size: 0.85rem; color: var(--text-secondary); margin-bottom: 8px; }

/* ===== 表单元素 ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.form-input, .form-select, .form-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; background: var(--card-bg); transition: border-color 0.2s, box-shadow 0.2s; color: var(--text);
}
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-tertiary); opacity: 0.7; }
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}
.form-select { -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237A7A7A' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 30px;
}
input[type="date"], input[type="time"] { -webkit-appearance: none; appearance: none; }
input[type="date"]::-webkit-inner-spin-button, input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-inner-spin-button, input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: 0.5; filter: invert(0.5);
}
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }

/* ===== 按钮 ===== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 20px; border-radius: var(--radius-sm); font-size: 0.9rem; font-weight: 500; transition: all 0.2s; border: 1px solid var(--border); white-space: nowrap; background: var(--card-bg); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-secondary { background: var(--primary-pale); color: var(--primary-dark); border-color: var(--primary-light); }
.btn-secondary:hover { background: var(--primary-light); }
.btn-danger { background: var(--danger-pale); color: var(--danger-dark); border-color: var(--danger-light); }
.btn-danger:hover { background: var(--danger-light); }
.btn-success { background: var(--success-pale); color: var(--success-dark); border-color: var(--success-light); }
.btn-sm { padding: 6px 12px; font-size: 0.82rem; }
.btn-xs { padding: 3px 9px; font-size: 0.74rem; border-radius: var(--radius-xs); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== 巡班区间筛查 ===== */
.range-filter { display: flex; align-items: flex-end; gap: 12px; flex-wrap: wrap; }
.range-filter .form-group { min-width: 150px; }
.range-banner { padding: 10px 14px; border-radius: var(--radius-sm); font-size: 0.9rem; margin-bottom: 10px; line-height: 1.5; box-shadow: var(--shadow-sm); }
.range-ok { background: var(--success-light); color: var(--success); }
.range-warn { background: var(--warning-light); color: var(--warning); }
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.student-chip { padding: 6px 14px; border-radius: 999px; border: none; background: var(--card-bg); color: var(--warning); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-sm); }
.student-chip:hover { background: var(--warning-light); box-shadow: var(--shadow); }

/* ===== 设置页：绑定分组与折叠 ===== */
.binding-group .card-title { margin-bottom: 14px; }
.collapsible { border: none; border-radius: var(--radius-sm); margin-bottom: 10px; overflow: hidden; background: var(--card-bg); box-shadow: var(--shadow); }
.collapsible-header { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; background: var(--card-bg); transition: box-shadow 0.15s; }
.collapsible-header:hover { box-shadow: var(--shadow-inset); }
.collapsible-title { font-weight: 600; font-size: 0.95rem; flex: 1; }
.collapsible-status { font-size: 0.78rem; color: var(--text-tertiary); }
.collapsible-chevron { transition: transform 0.2s; color: var(--text-tertiary); font-size: 0.9rem; }
.collapsible.open .collapsible-chevron { transform: rotate(90deg); }
.collapsible-body { display: none; padding: 14px; box-shadow: inset 0 2px 4px rgba(0,0,0,0.03); }
.collapsible.open .collapsible-body { display: block; }
.patrol-missing-wrap { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.btn-outline { background: var(--card-bg); color: var(--warning); border: none; box-shadow: var(--shadow-sm); }
.btn-outline:hover { background: var(--warning-light); }
.btn-outline:active { box-shadow: var(--shadow-inset); }
.patrol-missing-btn { cursor: pointer; }

/* ===== 教室座位 ===== */
.classroom-selector { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.classroom-tab { padding: 8px 20px; border-radius: 20px; font-weight: 600; font-size: 0.9rem; background: var(--card-bg); border: none; color: var(--text-secondary); transition: all 0.2s; box-shadow: var(--shadow-sm); }
.classroom-tab.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow-inset); }
.seat-map { display: flex; flex-direction: column; gap: var(--seat-gap); align-items: center; padding: 20px; background: var(--card-bg); border-radius: var(--radius); overflow-x: auto; box-shadow: var(--shadow-inset); }
.seat-map-container { touch-action: pan-y; border-radius: var(--radius); overflow: hidden; }
.seat-row { display: flex; gap: var(--seat-gap); align-items: center; }
.seat-row-label { writing-mode: vertical-rl; text-orientation: upright; height: var(--seat-size); width: 20px; text-align: center; font-size: 0.65rem; color: var(--text-tertiary); flex-shrink: 0; display: flex; align-items: center; justify-content: center; letter-spacing: 1px; }
.seat { width: var(--seat-size); height: var(--seat-size); border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; font-size: 0.7rem; cursor: pointer; transition: all 0.15s; border: none; position: relative; overflow: hidden; flex-shrink: 0; padding: 4px; text-align: center; background: var(--card-bg); box-shadow: var(--shadow-sm); }
.seat-empty { background: transparent; border: none; box-shadow: none; cursor: default; }
.seat-blocked { background: var(--bg); cursor: not-allowed; opacity: 0.5; box-shadow: var(--shadow-sm); }
.seat-available { background: var(--success-light); box-shadow: var(--shadow-sm); }
.seat-available:hover { background: var(--success-light); transform: scale(1.05); box-shadow: var(--shadow); }

/* 空置座位 */
.seat-vacant {
  background: #f5f5f5;
  border: 2px dashed #9e9e9e;
  box-shadow: none;
  cursor: pointer;
  opacity: 0.8;
}
.seat-vacant:hover {
  opacity: 1;
  transform: scale(1.05);
}
.seat-vacant-label {
  font-size: 10px;
  color: #757575;
  font-weight: 500;
}

/* 曾有学生（已离校）的座位 */
.seat-has-history {
  background: #f5f5f5;
  border: 2px solid #bdbdbd;
  box-shadow: none;
  cursor: pointer;
  opacity: 0.7;
}
.seat-has-history:hover {
  opacity: 1;
  transform: scale(1.05);
  border-color: #9e9e9e;
}
.seat-history-hint {
  font-size: 10px;
  color: #757575;
  font-weight: 500;
  font-style: italic;
}

.seat-occupied { background: var(--card-bg); box-shadow: var(--shadow-sm); }
.seat-occupied:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.seat-focus { background: var(--danger-light) !important; box-shadow: var(--shadow-sm) !important; }
.seat-leave { background: var(--warning-light); box-shadow: var(--shadow-sm) !important; }
.seat-leave:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }

.seat-leave-red { background: #fde0e0 !important; border: 2.5px solid #d93025 !important; box-shadow: 0 0 0 3px #d93025 !important; }
.seat-leave-red:hover { transform: scale(1.05); box-shadow: 0 0 0 2px #d93025; }
.seat-leave-gray { background: #e8e8e8 !important; border: 2.5px solid #9e9e9e !important; box-shadow: 0 0 0 3px #9e9e9e !important; opacity: 0.7; }
.seat-leave-gray:hover { transform: scale(1.05); box-shadow: 0 0 0 2px #9e9e9e; }
.seat-leave-blue { background: #e0ecff !important; border: 2.5px solid #3367d6 !important; box-shadow: 0 0 0 3px #3367d6 !important; }
.seat-leave-blue:hover { transform: scale(1.05); box-shadow: 0 0 0 2px #3367d6; }
.seat-leave-orange { background: #ffe8d6 !important; border: 2.5px solid #ff6d00 !important; box-shadow: 0 0 0 3px #ff6d00 !important; }
.seat-leave-orange:hover { transform: scale(1.05); box-shadow: 0 0 0 2px #ff6d00; }

.seat-leave-gray:hover { transform: scale(1.05); box-shadow: 0 0 0 2px #9e9e9e; }
.seat-leave-purple { background: #f0e0f5 !important; border: 2.5px solid #8939b5 !important; box-shadow: 0 0 0 3px #8939b5 !important; }
.seat-leave-purple:hover { transform: scale(1.05); box-shadow: 0 0 0 2px #8939b5; }

.seat-leave-ended { background: #e8e8e8 !important; border: 2.5px solid #9e9e9e !important; box-shadow: 0 0 0 3px #9e9e9e !important; }

.seat-leave-badge { position: absolute; top: 2px; right: 2px; background: var(--warning); color: #fff; font-size: 0.5rem; line-height: 1.1; padding: 2px 3px; border-radius: 3px; font-weight: 700; letter-spacing: 0.5px; pointer-events: none; white-space: nowrap; max-width: calc(100% - 4px); overflow: hidden; text-overflow: ellipsis; }
.seat-leave-badge--red { background: #d93025; }
.seat-leave-badge--blue { background: #3367d6; }
.seat-leave-badge--orange { background: #ff6d00; }
.seat-leave-badge--gray { background: #9e9e9e; }
.seat-leave-badge--purple { background: #8939b5; }
.seat-leave-badge--withdrawn { background: #c4534d; }
.seat-leave-badge--ended { background: #9e9e9e; }

/* 座位右侧竖向请假天数标签 */
.seat-has-label { overflow: visible !important; }
.seat-leave-days {
  position: absolute;
  left: 100%;
  top: 0;
  bottom: 0;
  writing-mode: vertical-rl;
  text-orientation: upright;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 2px;
  border-radius: 0 3px 3px 0;
  white-space: nowrap;
  line-height: 1.2;
  z-index: 10;
}
.seat-leave-days--red { background: #d93025; color: #fff; }
.seat-leave-days--blue { background: #3367d6; color: #fff; }
.seat-leave-days--orange { background: #ff6d00; color: #fff; }
.seat-leave-days--gray { background: #9e9e9e; color: #fff; }
.seat-leave-days--purple { background: #8939b5; color: #fff; }
.seat-patrol-dot { position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--danger); box-shadow: 0 0 0 2px rgba(255,255,255,0.85); pointer-events: none; z-index: 2; }

/* 手机上交座位状态 */
.seat-handin {
  background: var(--success-light) !important;
  border: 2px solid var(--success) !important;
  box-shadow: var(--shadow-sm) !important;
}
.seat-handin:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg) !important;
}
.seat-nohandin {
  background: var(--danger-light) !important;
  border: 2px solid var(--danger) !important;
  box-shadow: var(--shadow-sm) !important;
}
.seat-nohandin:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg) !important;
}
.seat-handin-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--success);
  color: #fff;
  font-size: 0.55rem;
  line-height: 1.2;
  padding: 2px 4px;
  border-radius: 3px;
  font-weight: 700;
  letter-spacing: 0.5px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}
.seat-handin-badge--no {
  background: var(--danger);
}

/* 手机上交详情页事件徽章 */
.phone-event-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  min-width: 60px;
  text-align: center;
}
.phone-event-badge.success {
  background: var(--success);
}
.phone-event-badge.warning {
  background: var(--warning);
}
.phone-event-badge.primary {
  background: var(--primary);
}

/* 手机上交统计行 */
.phone-stat-row {
  display: flex;
  gap: 16px;
  margin: 16px 0;
}
.phone-stat {
  flex: 1;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.phone-stat-num {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

/* 手机事件时间线 */
.phone-event {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.phone-event:last-child {
  border-bottom: none;
}
.phone-event-time {
  flex: 1;
  max-width: 200px;
}
.phone-event-note {
  flex: 1;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* 手机上交周期列表 */
.phone-period-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.phone-period-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s;
}
.phone-period-item:hover {
  box-shadow: var(--shadow);
}
.phone-period-main {
  cursor: pointer;
  flex: 1;
}
.phone-period-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.phone-period-meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
}
.stat-success {
  color: var(--success);
  font-weight: 600;
}
.stat-danger {
  color: var(--danger);
  font-weight: 600;
}
.phone-period-actions {
  display: flex;
  gap: 8px;
}

/* 手机上交详情操作栏 */
.phone-detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== 集合点名 ===== */
.rollcall-toolbar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

/* 点名列表页 */
.rollcall-list-page {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.rollcall-date-group {
  margin-bottom: 8px;
}
.rollcall-date-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-left: 4px;
}
.rollcall-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.rollcall-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.15s;
  border: 1px solid transparent;
}
.rollcall-list-item:hover {
  box-shadow: var(--shadow);
  border-color: var(--primary-light);
  transform: translateY(-1px);
}
.rollcall-item-main {
  flex: 1;
}
.rollcall-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 4px;
}
.rollcall-item-meta {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.rollcall-item-stats {
  display: flex;
  gap: 14px;
  font-size: 0.8rem;
  flex-wrap: wrap;
}
.stat-warning {
  color: var(--warning);
  font-weight: 600;
}
.stat-primary {
  color: var(--primary);
  font-weight: 600;
}
.rollcall-item-delete {
  margin-left: 12px;
}

/* 点名编辑页 - 学生卡片列表 */
.rollcall-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 单条学生点名卡片 */
.rollcall-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  box-shadow: var(--shadow-sm);
  border: 2px solid transparent;
  transition: all 0.15s;
}
.rollcall-card:hover {
  box-shadow: var(--shadow);
}

/* 学生信息区 */
.rollcall-info {
  flex: 1;
  min-width: 0;
}
.rollcall-nickname {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.rollcall-realname {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

/* 状态按钮组 */
.rollcall-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.rollcall-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 52px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.15s;
  line-height: 1.2;
}
.rollcall-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.rollcall-btn-label {
  font-weight: 600;
}
.rollcall-btn-time {
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 2px;
}

/* 激活状态的按钮 - 不同状态不同颜色 */
.rollcall-btn.active {
  color: #fff;
  border-color: transparent;
}
.rollcall-btn.active.success {
  background: var(--success);
  border-color: var(--success);
}
.rollcall-btn.active.danger {
  background: var(--danger);
  border-color: var(--danger);
}
.rollcall-btn.active.warning {
  background: var(--warning);
  border-color: var(--warning);
}
.rollcall-btn.active.primary {
  background: var(--primary);
  border-color: var(--primary);
}

/* 卡片整体状态色边框 */
.rollcall-card.status-签到 {
  border-color: var(--success);
  background: var(--success-light);
}
.rollcall-card.status-未到 {
  border-color: var(--danger);
  background: var(--danger-light);
}
.rollcall-card.status-迟到 {
  border-color: var(--warning);
  background: var(--warning-light);
}
.rollcall-card.status-请假 {
  border-color: var(--primary);
  background: var(--primary-light);
}

.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-left: -12px; margin-bottom: 2px; pointer-events: none; }
.seat-id { font-size: 0.65rem; color: var(--text-tertiary); font-weight: 500; }
.seat-nickname { font-size: 0.78rem; font-weight: 700; color: var(--text); line-height: 1.2; margin: 2px 0; }
.seat-realname { font-size: 0.6rem; color: var(--text-tertiary); line-height: 1.1; }

/* ===== 作业统计 ===== */
.page-header { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.page-title { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.hw-legend { font-size: 0.78rem; color: var(--text-secondary); background: var(--primary-light); border-radius: var(--radius-sm); padding: 6px 12px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.hw-card { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 14px; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.15s, box-shadow 0.15s; }
.hw-card:hover { box-shadow: var(--shadow-lg); }
.hw-card:active { transform: scale(0.99); box-shadow: var(--shadow-inset); }
.hw-card-main { flex: 1; min-width: 0; }
.hw-card-title { font-size: 1rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-card-sub { font-size: 0.78rem; color: var(--text-tertiary); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hw-card-stat { flex-shrink: 0; width: 120px; text-align: right; }
.hw-stat-num { font-size: 1.1rem; font-weight: 700; }
.hw-progress { height: 6px; background: var(--card-bg); border-radius: 3px; margin: 5px 0 3px; overflow: hidden; box-shadow: var(--shadow-inset); }
.hw-progress-bar { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }
.hw-card-hint { font-size: 0.72rem; color: var(--text-tertiary); }
.hw-card-del { flex-shrink: 0; margin-left: 4px; opacity: 0.85; }
.hw-card-del:hover { opacity: 1; }
.hw-detail-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.hw-detail-title { font-size: 0.92rem; font-weight: 700; flex: 1; min-width: 0; }
.hw-detail-stat { font-size: 0.78rem; color: var(--text-secondary); background: var(--card-bg); border: none; border-radius: 20px; padding: 4px 12px; white-space: nowrap; box-shadow: var(--shadow-sm); }
.hw-group-title { font-size: 0.82rem; font-weight: 700; color: var(--success); margin: 14px 0 6px; padding-left: 8px; border-left: none; }
.hw-group-title--un { color: var(--danger); border-left: none; }
.hw-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 6px; }
.hw-stu { position: relative; min-height: 64px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 5px 4px 6px; text-align: center; cursor: pointer; transition: transform 0.15s, box-shadow 0.15s; overflow: hidden; box-shadow: var(--shadow-sm); }
.hw-stu:hover { box-shadow: var(--shadow); }
.hw-stu:active { transform: scale(0.97); box-shadow: var(--shadow-inset); }
.hw-stu-del { position: absolute; top: 2px; left: 2px; z-index: 2; padding: 0 5px; line-height: 16px; font-size: 0.56rem; opacity: 0.8; }
.hw-stu-del:hover { opacity: 1; }
.hw-stu--un { background: var(--danger-light); }
.hw-stu-name { font-size: 0.74rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.hw-stu-real { font-size: 0.58rem; color: var(--text-tertiary); line-height: 1.1; margin-top: 1px; }
.hw-stu-badge { position: absolute; top: 2px; right: 2px; font-size: 0.48rem; line-height: 1.2; padding: 1px 4px; border-radius: 3px; font-weight: 700; color: #fff; white-space: nowrap; pointer-events: none; }
.hw-badge-sub { background: var(--success); }
.hw-badge-un { background: var(--danger); }
.hw-badge-makeup { background: var(--warning); }
.hw-badge-leave { background: #607d8b; }
.hw-pills { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.hw-pill { font-size: 0.62rem; font-weight: 700; padding: 2px 6px; border-radius: 10px; line-height: 1.4; }
.hw-pill.sub { background: var(--success-light); color: var(--success); }
.hw-pill.un { background: var(--danger-light); color: var(--danger); }
.hw-pill.makeup { background: var(--warning-light); color: var(--warning); }
.hw-pill.leave { background: rgba(96,125,139,0.12); color: #546e7a; }
.hw-stu--makeup { background: var(--warning-light); }
.hw-stu--leave { background: rgba(96,125,139,0.12); }
.hw-group-title--makeup { color: var(--warning); border-left: none; }
.hw-group-title--leave { color: #546e7a; border-left: none; }
.hw-edit-hint { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 6px; }
.hw-stu-score { margin-top: 3px; font-size: 0.62rem; font-weight: 700; color: var(--primary); }
.hw-stu-comment { margin-top: 2px; font-size: 0.54rem; color: var(--text-secondary); line-height: 1.15; max-height: 2.3em; overflow: hidden; }
.hw-stu-remark { margin-top: 2px; font-size: 0.5rem; color: var(--primary); line-height: 1.15; max-height: 2.5em; overflow: hidden; font-weight: 600; background: var(--primary-light); border-radius: 3px; padding: 1px 4px; }
.hw-stu-leave-info { margin-top: 2px; font-size: 0.5rem; color: var(--text-tertiary); line-height: 1.15; }
.hw-deadline-bar { margin-bottom: 12px; padding: 10px 12px; background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.hw-deadline-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.hw-deadline-left { flex: 1 1 220px; min-width: 180px; }
.hw-deadline-pickers { display: flex; gap: 6px; flex-shrink: 0; }
.hw-deadline-picker { width: auto; min-width: 110px; padding: 5px 8px; font-size: 0.78rem; background: var(--card-bg); border: none; border-radius: var(--radius-xs); box-shadow: var(--shadow-inset); }
.hw-deadline-actions { display: flex; gap: 6px; flex-shrink: 0; align-items: flex-end; }
.hw-deadline-hint { margin-top: 6px; font-size: 0.62rem; color: var(--text-tertiary); opacity: 0.65; line-height: 1.4; }
.seg-control { display: flex; gap: 0; border: none; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); background: var(--card-bg); padding: 3px; }
.seg-btn { flex: 1; padding: 8px 8px; font-size: 0.82rem; font-weight: 600; background: transparent; color: var(--text-secondary); border: none; border-radius: var(--radius-xs); transition: background 0.15s, color 0.15s, box-shadow 0.15s; }
.seg-btn:first-child { border-right: none; }
.seg-active { background: var(--success-light); color: var(--success); box-shadow: var(--shadow-inset); }
.seg-active--un { background: var(--danger-light); color: var(--danger); box-shadow: var(--shadow-inset); }
.seg-active--makeup { background: var(--warning-light); color: var(--warning); box-shadow: var(--shadow-inset); }
.seg-active--leave { background: rgba(96,125,139,0.12); color: #546e7a; box-shadow: var(--shadow-inset); }
.seat-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px; font-size: 0.8rem; color: var(--text-secondary); }
.legend-item { display: flex; align-items: center; gap: 6px; }
.legend-swatch { width: 18px; height: 18px; border-radius: 4px; border: none; box-shadow: var(--shadow-sm); }
.student-header { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.student-avatar { width: 56px; height: 56px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1.4rem; font-weight: 700; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.student-info h2 { font-size: 1.3rem; margin-bottom: 2px; }
.student-info p { font-size: 0.85rem; color: var(--text-secondary); }
.status-badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.status-in { background: var(--success-light); color: var(--success); }
.status-out { background: var(--danger-light); color: var(--danger); }
.tabs-wrap { background: var(--bg-card); border-radius: var(--radius-sm); box-shadow: var(--shadow-md); padding: 4px; margin-bottom: 16px; border: 1px solid var(--border-light); }
.tabs { display: flex; gap: 0; border-bottom: none; box-shadow: none; margin-bottom: 0; overflow-x: auto; -webkit-overflow-scrolling: touch; background: transparent; }
.tab { padding: 10px 16px; font-size: 0.9rem; font-weight: 500; color: var(--text-secondary); border-bottom: 3px solid transparent; white-space: nowrap; transition: all 0.2s; border-radius: var(--radius-xs); }
.tab.active { color: var(--primary); border-bottom: 3px solid var(--primary); font-weight: 600; }
.behavior-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.behavior-tag { padding: 6px 14px; border-radius: 16px; font-size: 0.85rem; background: var(--card-bg); color: var(--text-secondary); cursor: pointer; transition: all 0.15s; border: none; user-select: none; box-shadow: var(--shadow-sm); }
.behavior-tag.selected { background: var(--primary-light); color: var(--primary); box-shadow: var(--shadow-inset); font-weight: 600; }
.timeline { position: relative; padding-left: 20px; }
.timeline::before { content: ''; position: absolute; left: 6px; top: 0; bottom: 0; width: 2px; background: rgba(0,0,0,0.05); }
.timeline-item { position: relative; margin-bottom: 16px; padding-bottom: 4px; }
.timeline-item::before { content: ''; position: absolute; left: -20px; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--primary); border: 2px solid var(--card-bg); box-shadow: var(--shadow-sm); }
.timeline-time { font-size: 0.75rem; color: var(--text-tertiary); margin-bottom: 4px; }
.timeline-content { background: var(--card-bg); border-radius: var(--radius-sm); padding: 10px 14px; font-size: 0.9rem; box-shadow: var(--shadow-inset); }
.timeline-behaviors { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.timeline-behavior { font-size: 0.72rem; padding: 2px 8px; background: var(--primary-light); color: var(--primary); border-radius: 10px; }
.conv-timeline { position: relative; padding-left: 24px; }
.conv-timeline::before { content: ''; position: absolute; left: 7px; top: 4px; bottom: 4px; width: 2px; background: rgba(0,0,0,0.05); }
.conv-item { position: relative; margin-bottom: 20px; }
.conv-marker { position: absolute; left: -24px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--card-bg); box-shadow: var(--shadow-sm); z-index: 1; }
.conv-body { background: var(--card-bg); border-radius: var(--radius-sm); padding: 12px 16px; position: relative; transition: box-shadow 0.2s; box-shadow: var(--shadow-sm); }
.conv-body:hover { box-shadow: var(--shadow); }
.conv-header { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.conv-date { font-size: 0.85rem; font-weight: 600; color: var(--text); }
.conv-communicator { font-size: 0.78rem; color: var(--primary); background: var(--primary-light); padding: 2px 8px; border-radius: 10px; }
.conv-source-tag { font-size: 0.68rem; padding: 1px 7px; border-radius: 8px; font-weight: 500; }
.conv-source-feishu { background: var(--success-light); color: var(--success); }
.conv-source-manual { background: var(--warning-light); color: var(--warning); }
.conv-content-text { font-size: 0.88rem; line-height: 1.7; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }
.conv-audio { margin-top: 8px; font-size: 0.78rem; color: var(--text-tertiary); background: var(--bg); padding: 4px 10px; border-radius: var(--radius-xs); box-shadow: var(--shadow-inset); display: inline-flex; align-items: center; gap: 4px; }
.conv-delete-btn { position: absolute; top: 8px; right: 8px; opacity: 0; transition: opacity 0.2s; }
.conv-body:hover .conv-delete-btn { opacity: 1; }
.tab-badge { display: inline-block; min-width: 16px; height: 16px; line-height: 16px; text-align: center; font-size: 0.68rem; font-weight: 600; color: #fff; background: var(--primary); border-radius: 8px; padding: 0 4px; margin-left: 2px; vertical-align: middle; }
.leave-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.leave-table th, .leave-table td { padding: 8px 10px; border-bottom: none; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.03); text-align: left; }
.leave-table th { background: var(--card-bg); font-weight: 600; color: var(--text-secondary); font-size: 0.8rem; box-shadow: var(--shadow-sm); }
.monthly-summary { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.monthly-card { background: var(--primary-light); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: 12px 16px; text-align: center; min-width: 100px; }
.monthly-card .month-label { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 4px; }
.monthly-card .month-value { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.monthly-card .month-detail { font-size: 0.72rem; color: var(--text-tertiary); margin-top: 2px; }
.parent-message { background: var(--primary-light); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); padding: 14px 16px; font-size: 0.9rem; line-height: 1.8; white-space: pre-wrap; word-break: break-all; }
.leave-card { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; box-shadow: var(--shadow); transition: box-shadow 0.2s; }
.leave-card--ended { background: var(--bg); opacity: 0.7; box-shadow: var(--shadow-sm); }
.leave-card:hover { box-shadow: var(--shadow-lg); }
.leave-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.leave-card-timeline { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 0; }
.leave-card-node { display: flex; flex-direction: column; gap: 1px; }
.leave-card-date { font-size: 0.88rem; font-weight: 600; color: var(--text); white-space: nowrap; }
.leave-card-time { font-size: 0.75rem; color: var(--text-tertiary); }
.leave-card-arrow { color: var(--text-tertiary); font-size: 1rem; flex-shrink: 0; }
.leave-card-days { background: var(--warning-light); color: var(--warning); font-size: 0.78rem; font-weight: 700; padding: 3px 10px; border-radius: 12px; white-space: nowrap; flex-shrink: 0; }
.leave-card-status { font-size: 0.62rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; }
.leave-status-active { background: var(--warning-light); color: var(--warning); border: none; }
.leave-status-upcoming { background: var(--primary-light); color: var(--primary); border: none; }
.leave-status-ended { background: var(--bg); color: var(--text-tertiary); border: none; }
.leave-list-header { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.leave-list-header .btn-xs { flex-shrink: 0; }
.leave-card-info { background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); padding: 8px 10px; margin-bottom: 8px; }
.leave-info-row { display: flex; align-items: center; gap: 6px; font-size: 0.78rem; line-height: 1.6; flex-wrap: wrap; }
.leave-info-row + .leave-info-row { margin-top: 4px; }
.leave-info-tag { font-size: 0.7rem; font-weight: 600; padding: 1px 8px; border-radius: 8px; flex-shrink: 0; }
.leave-tag-leave { background: var(--warning-light); color: var(--warning); }
.leave-tag-return { background: var(--success-light); color: var(--success); }
.leave-info-text { color: var(--text-secondary); }
.leave-info-muted { color: var(--text-tertiary); }
.leave-card-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.leave-card-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.leave-card-reason { background: var(--primary-light); color: var(--primary); font-size: 0.78rem; font-weight: 600; padding: 2px 10px; border-radius: var(--radius-xs); }
.leave-card-note { font-size: 0.75rem; color: var(--text-tertiary); }
.leave-card-actions { display: flex; gap: 6px; flex-shrink: 0; }
.leave-edit-area { margin-top: 10px; }
.leave-edit-form { background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); padding: 14px; }
.leave-edit-title { font-size: 0.88rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.student-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.student-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; min-width: 700px; }
.student-table th { padding: 10px 8px; text-align: left; background: var(--card-bg); font-weight: 600; color: var(--text-secondary); font-size: 0.8rem; cursor: pointer; white-space: nowrap; position: sticky; top: 0; box-shadow: var(--shadow-sm); }
.student-table th:hover { background: var(--bg); }
.student-table td { padding: 10px 8px; border-bottom: none; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.03); }
.student-table tr:hover td { background: var(--bg); }
.sort-arrow { font-size: 0.7rem; color: var(--primary); }
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.filter-chip { padding: 6px 14px; border-radius: 16px; font-size: 0.82rem; background: var(--card-bg); border: none; color: var(--text-secondary); cursor: pointer; transition: all 0.2s; box-shadow: var(--shadow-sm); }
.filter-chip.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow-inset); }
.ba-selected-count { margin-left: auto; font-size: 0.8rem; color: var(--text-tertiary); white-space: nowrap; }
.ba-student-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px; }
.ba-student-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-sm); }
.ba-student-item.selected { background: var(--primary-light); box-shadow: var(--shadow-inset); }
.ba-checkbox { width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
.ba-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.9rem; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.ba-student-info { display: flex; flex-direction: column; min-width: 0; }
.ba-student-name { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.ba-student-meta { font-size: 0.74rem; color: var(--text-tertiary); }
.ba-status-group { display: inline-flex; gap: 6px; }
.ba-seat-map { margin-top: 4px; margin-bottom: 8px; }
.ba-seat-selected { background: var(--primary-light) !important; box-shadow: var(--shadow-inset) !important; }
.ba-seat-selected .seat-nickname { color: var(--primary); }
.ba-seat-check { position: absolute; top: 2px; right: 2px; width: 18px; height: 18px; background: var(--primary); color: #fff; border-radius: 50%; font-size: 0.62rem; font-weight: 700; display: flex; align-items: center; justify-content: center; pointer-events: none; box-shadow: var(--shadow-sm); }
.ba-seat-filtered { opacity: 0.32; filter: grayscale(1); cursor: not-allowed !important; }
.ba-selected-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; padding: 10px 12px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); }
.ba-selected-label { font-size: 0.82rem; font-weight: 600; color: var(--text-secondary); }
.ba-selected-empty { font-size: 0.82rem; color: var(--text-tertiary); }
.ba-selected-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 14px; background: var(--primary-light); color: var(--primary); font-size: 0.76rem; font-weight: 600; border: none; box-shadow: var(--shadow-sm); white-space: nowrap; }
.ba-chip-x { cursor: pointer; font-weight: 700; opacity: 0.7; }
.ba-chip-x:hover { opacity: 1; }
.ba-preview { margin-top: 8px; }
.ba-preview-card { background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: 10px 12px; margin-bottom: 8px; }
.ba-preview-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.ba-preview-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.8rem; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.ba-preview-info { display: flex; flex-direction: column; min-width: 0; }
.ba-preview-name { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.ba-preview-meta { font-size: 0.72rem; color: var(--text-tertiary); }
.ba-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.ba-tab { flex: 1; padding: 9px 12px; border: none; background: var(--card-bg); border-radius: var(--radius-sm); font-size: 0.86rem; font-weight: 600; color: var(--text-secondary); cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-sm); }
.ba-tab:hover { color: var(--primary); box-shadow: var(--shadow); }
.ba-tab.active { background: var(--card-bg); color: var(--primary); box-shadow: var(--shadow-inset); }
.ba-ledger-list { display: flex; flex-direction: column; gap: 10px; }
.ba-ledger-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow); }
.ba-ledger-row:hover { box-shadow: var(--shadow-lg); }
.ba-ledger-main { flex: 1; min-width: 0; }
.ba-ledger-name { font-size: 0.94rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-ledger-date { font-size: 0.74rem; color: var(--text-tertiary); margin-top: 2px; }
.ba-ledger-counts { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.ba-ledger-arrow { font-size: 1.4rem; color: var(--text-tertiary); line-height: 1; flex-shrink: 0; }
.ba-count-pill { display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 12px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.ba-count-pill.total { background: var(--bg); color: var(--text-secondary); box-shadow: var(--shadow-sm); }
.ba-count-pill.scanned { background: var(--success-light); color: var(--success); box-shadow: var(--shadow-sm); }
.ba-count-pill.pending { background: var(--warning-light); color: var(--warning); box-shadow: var(--shadow-sm); }
.ba-count-pill.none { background: var(--bg); color: var(--text-tertiary); box-shadow: var(--shadow-sm); }
.ba-detail-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.ba-ledger-actions { display: flex; gap: 6px; flex-shrink: 0; }
.ba-detail-remove { width: 28px; height: 28px; border: none; background: var(--bg); color: var(--text-tertiary); border-radius: 50%; font-size: 0.82rem; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all 0.15s; }
.ba-detail-remove:hover { background: var(--danger); color: #fff; }
.ba-seat-existing { opacity: 0.35; filter: grayscale(1); cursor: not-allowed !important; }
.ba-seat-pick { cursor: pointer !important; transition: all 0.15s; }
.ba-detail-title { margin-bottom: 8px; }
.ba-detail-name { font-size: 1.02rem; font-weight: 700; color: var(--text); }
.ba-detail-sub { font-size: 0.76rem; color: var(--text-tertiary); margin-top: 2px; }
.ba-detail-summary { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.ba-detail-list { display: flex; flex-direction: column; gap: 8px; }
.ba-detail-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s; box-shadow: var(--shadow-sm); }
.ba-detail-row:hover { background: var(--primary-light); box-shadow: var(--shadow); }
.ba-detail-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--primary-light); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.84rem; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.ba-detail-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ba-detail-name { font-size: 0.9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ba-detail-real { font-size: 0.78rem; color: var(--text-tertiary); font-weight: 400; }
.ba-detail-meta { font-size: 0.74rem; color: var(--text-tertiary); margin-top: 1px; }
.ba-status-badge { flex-shrink: 0; padding: 4px 12px; border-radius: 14px; font-size: 0.78rem; font-weight: 600; }
.ba-status-badge.status-scanned { background: var(--success); color: #fff; box-shadow: var(--shadow-sm); }
.ba-status-badge.status-pending { background: var(--warning); color: #fff; box-shadow: var(--shadow-sm); }
.ba-status-badge.status-none { background: var(--text-tertiary); color: #fff; box-shadow: var(--shadow-sm); }
.task-card { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.task-card.status-pending { border-left: none; }
.task-card.status-progress { border-left: none; }
.task-card.status-done { border-left: none; }
.task-header { display: flex; justify-content: space-between; align-items: start; margin-bottom: 8px; flex-wrap: wrap; gap: 8px; }
.task-title { font-weight: 600; font-size: 1rem; }
.task-deadline { font-size: 0.78rem; color: var(--text-tertiary); }
.task-progress-bar { height: 6px; background: var(--card-bg); border-radius: 3px; overflow: hidden; margin-top: 8px; box-shadow: var(--shadow-inset); }
.task-progress-fill { height: 100%; background: var(--success); border-radius: 3px; transition: width 0.3s; }
.task-seat-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.task-seat-chip { padding: 4px 10px; border-radius: var(--radius-xs); font-size: 0.75rem; display: flex; align-items: center; gap: 4px; box-shadow: var(--shadow-sm); }
.task-seat-chip.done { background: var(--success-light); color: var(--success); }
.task-seat-chip.pending { background: var(--bg); color: var(--text-tertiary); }
.task-seat-chip.progress { background: var(--warning-light); color: var(--warning); }
.task-seat-picker { max-height: 420px; overflow-y: auto; border-radius: var(--radius); padding: 4px; }
.task-seat-picker-room { margin-bottom: 16px; }

/* 学生选择器 - 小卡片布局 */
.task-student-picker { max-height: 360px; overflow-y: auto; padding: 4px; }
.tsp-room { margin-bottom: 12px; }
.tsp-room-title { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; padding-left: 2px; }
.tsp-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.tsp-item {
  height: 24px;
  line-height: 22px;
  padding: 0 10px;
  font-size: 0.78rem;
  background: var(--bg-tertiary);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}
.tsp-item:hover { border-color: var(--primary); color: var(--primary); }
.tsp-item.selected {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 500;
}
.quick-leave-form { background: var(--card-bg); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow-sm); }

/* 休息日外出请假快捷卡片 */
.restday-leave-row {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}
.restday-leave-card {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.restday-leave-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}
.restday-leave-card:active {
  transform: translateY(0);
}
.restday-leave-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
  color: #fff;
}
.restday-leave-info {
  flex: 1;
  min-width: 0;
}
.restday-leave-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.restday-leave-desc {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.3;
}
.restday-leave-arrow {
  font-size: 1rem;
  color: rgba(255, 255, 255, 0.8);
  flex-shrink: 0;
}
@media (max-width: 480px) {
  .restday-leave-row {
    flex-direction: column;
    gap: 8px;
  }
}
.leave-advanced-toggle { margin-bottom: 8px; }
.leave-advanced-toggle summary { cursor: pointer; font-size: 0.86rem; color: var(--text-tertiary); padding: 6px 0; user-select: none; }
.leave-advanced-toggle[open] summary { margin-bottom: 12px; }
.task-seat-picker-title { font-size: 0.9rem; font-weight: 700; color: var(--text); margin-bottom: 8px; padding-left: 4px; }
.task-seat-pick { cursor: pointer; transition: all 0.15s; }
.task-seat-pick:hover { transform: scale(1.05); box-shadow: var(--shadow-lg); }
.task-seat-pick.selected { background: var(--primary-light) !important; box-shadow: var(--shadow-inset) !important; }
.task-seat-pick.selected .seat-nickname { color: var(--primary); }
.task-seat-picker .seat-map { padding: 10px; box-shadow: var(--shadow-inset); }
.comment-output { background: var(--card-bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); padding: 16px; margin-top: 12px; }
.comment-version-label { font-size: 0.8rem; font-weight: 600; color: var(--primary); margin-bottom: 8px; }
.comment-text { font-size: 0.9rem; line-height: 1.8; white-space: pre-wrap; }
.comment-source { margin-top: 8px; padding: 12px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); }
.src-block { margin-bottom: 12px; }
.src-block:last-child { margin-bottom: 0; }
.src-label { font-size: 0.78rem; font-weight: 600; color: var(--text-tertiary); margin-bottom: 4px; }
.src-text { font-size: 0.85rem; line-height: 1.7; white-space: pre-wrap; color: var(--text); }
.todo-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: none; box-shadow: inset 0 -1px 0 rgba(0,0,0,0.03); }
.todo-checkbox { width: 22px; height: 22px; border: none; border-radius: 50%; cursor: pointer; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all 0.2s; box-shadow: var(--shadow-sm); background: var(--card-bg); }
.todo-checkbox.checked { background: var(--success); box-shadow: var(--shadow-sm); }
.todo-checkbox.checked::after { content: '\2713'; color: #fff; font-size: 0.75rem; font-weight: 700; }
.todo-text { flex: 1; font-size: 0.9rem; }
.todo-text.done { text-decoration: line-through; color: var(--text-tertiary); }
.todo-delete { color: var(--text-tertiary); font-size: 1.1rem; padding: 4px; }
.template-card { border: none; border-radius: var(--radius-sm); padding: 14px; margin-bottom: 12px; cursor: pointer; transition: all 0.2s; background: var(--card-bg); box-shadow: var(--shadow); }
.template-card:hover { background: var(--primary-light); box-shadow: var(--shadow-lg); }
.template-name { font-weight: 600; margin-bottom: 4px; }
.template-preview { font-size: 0.8rem; color: var(--text-secondary); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal-box { background: var(--card-bg); border: none; border-radius: var(--radius); max-width: 560px; width: 100%; max-height: 90vh; overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg); }
.modal-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }
.conflict-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0; }
.conflict-version { border: none; border-radius: var(--radius-sm); padding: 12px; cursor: pointer; transition: all 0.2s; background: var(--card-bg); box-shadow: var(--shadow); }
.conflict-version:hover { box-shadow: var(--shadow-lg); }
.conflict-version.selected { background: var(--primary-light); box-shadow: var(--shadow-inset); }
.conflict-version-label { font-size: 0.8rem; font-weight: 600; color: var(--primary); margin-bottom: 6px; }
.toast { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); background: rgba(58,58,58,0.92); color: #fff; padding: 12px 24px; border-radius: 24px; font-size: 0.88rem; z-index: 3000; max-width: 90%; text-align: center; box-shadow: var(--shadow-lg); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warning { background: var(--warning); }
.toast.info { background: var(--primary); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-tertiary); }
.empty-state-icon { font-size: 3rem; margin-bottom: 12px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.text-sm { font-size: 0.82rem; }
.text-tertiary { color: var(--text-tertiary); }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-center { text-align: center; }
.font-bold { font-weight: 600; }
.font-mono { font-family: 'Courier New', Consolas, monospace; }
.w-full { width: 100%; }
.miss-summary { display: flex; gap: 10px; margin-bottom: 12px; }
.miss-stat { flex: 1; background: var(--card-bg); border: none; border-radius: var(--radius); padding: 10px 12px; text-align: center; box-shadow: var(--shadow); }
.miss-stat-num { display: block; font-size: 1.4rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.miss-stat-label { font-size: 0.74rem; color: var(--text-tertiary); }
.miss-sort { margin-bottom: 14px; }
.miss-list { display: flex; flex-direction: column; gap: 8px; }
.miss-row { display: grid; grid-template-columns: 28px minmax(0,1.4fr) minmax(0,1fr) auto 18px; align-items: center; gap: 10px; background: var(--card-bg); border: none; border-radius: var(--radius); padding: 10px 12px; cursor: pointer; box-shadow: var(--shadow); transition: transform 0.12s, box-shadow 0.12s; }
.miss-row:active { transform: scale(0.99); }
.miss-row.open { box-shadow: var(--shadow-inset); }
.miss-rank { font-size: 0.9rem; font-weight: 700; color: var(--text-tertiary); text-align: center; }
.miss-name { min-width: 0; }
.miss-nick { font-size: 0.95rem; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miss-real { font-size: 0.74rem; color: var(--text-tertiary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miss-seat { font-size: 0.76rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miss-tags { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.miss-badge { font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.miss-badge.un { background: var(--danger-light); color: var(--danger); }
.miss-badge.makeup { background: var(--warning-light); color: var(--warning); }
.miss-badge.leave { background: rgba(96,125,139,0.12); color: #546e7a; }
.miss-arrow { color: var(--text-tertiary); text-align: center; }
.miss-detail { grid-column: 1 / -1; margin-top: 4px; background: var(--bg); border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); }
.miss-detail-inner { padding: 10px 12px; }
.miss-detail-title { font-size: 0.78rem; font-weight: 600; color: var(--text-secondary); margin-bottom: 8px; }
.miss-item { padding: 8px 10px; background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); margin-bottom: 6px; cursor: pointer; }
.miss-item:last-child { margin-bottom: 0; }
.miss-item:active { transform: scale(0.99); }
.miss-item-title { font-size: 0.88rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.miss-item-meta { font-size: 0.74rem; color: var(--text-tertiary); margin-top: 2px; }

/* 作业未交详情 */
.page-container > .page-title { margin-bottom: 12px; }
.hw-miss-detail-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 14px; padding: 12px 14px; background: var(--card-bg); border-radius: var(--radius); box-shadow: var(--shadow); }
.hw-miss-detail-dates { display: flex; align-items: flex-end; gap: 6px; flex-wrap: wrap; }
.hw-miss-date-input { width: auto; min-width: 130px; padding: 5px 8px; font-size: 0.8rem; background: var(--card-bg); border: none; border-radius: var(--radius-xs); box-shadow: var(--shadow-inset); color: var(--text); }
.hw-miss-date-sep { font-size: 0.82rem; color: var(--text-tertiary); padding: 0 4px; padding-bottom: 5px; }
.hw-miss-enroll-check { display: flex; align-items: center; gap: 4px; font-size: 0.82rem; color: var(--text-secondary); cursor: pointer; white-space: nowrap; }
.hw-miss-detail-results { min-height: 40px; }
.hw-miss-detail-hint { padding: 28px 16px; text-align: center; font-size: 0.72rem; color: var(--text-tertiary); opacity: 0.65; }
.hw-miss-detail-list { display: flex; flex-direction: column; gap: 10px; }
.hw-miss-detail-summary { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 4px; padding: 0 4px; }
.hw-miss-detail-card { position: relative; background: var(--card-bg); border: none; border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.hw-miss-detail-card-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; padding-right: 44px; }
.hw-miss-detail-name { font-size: 0.95rem; font-weight: 700; color: var(--text); }
.hw-miss-detail-count { font-size: 0.72rem; font-weight: 600; color: var(--danger); background: var(--danger-light); padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.hw-miss-detail-enroll { font-size: 0.68rem; color: var(--text-tertiary); margin-bottom: 6px; }
.hw-miss-detail-items { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.hw-miss-detail-tag { font-size: 0.72rem; color: var(--text-secondary); background: var(--bg); padding: 3px 8px; border-radius: var(--radius-xs); box-shadow: var(--shadow-sm); }
.hw-miss-detail-text { font-size: 0.76rem; color: var(--text-secondary); line-height: 1.5; }
.hw-miss-detail-empty { padding: 28px; text-align: center; font-size: 0.78rem; color: var(--text-tertiary); }
.hw-miss-copy-btn { position: absolute; top: 10px; right: 10px; }
@media (max-width: 540px) {
  .miss-row { grid-template-columns: 24px minmax(0,1fr) 16px; grid-template-areas: "rank name arrow" "rank seat arrow" "rank tags arrow"; row-gap: 4px; }
  .miss-rank { grid-area: rank; }
  .miss-name { grid-area: name; }
  .miss-seat { grid-area: seat; }
  .miss-tags { grid-area: tags; justify-content: flex-start; }
  .miss-arrow { grid-area: arrow; }
  .miss-summary { flex-wrap: wrap; }
  .miss-stat { min-width: 30%; }
}
.bottom-nav { display: none; }
.bottom-nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--text-secondary); transition: all 0.2s; padding: 4px 0; -webkit-tap-highlight-color: transparent; }
.bottom-nav-icon { width: 22px; height: 22px; stroke: currentColor; }
.bottom-nav-label { font-size: 0.62rem; font-weight: 500; }
.bottom-nav-item.active { color: var(--primary); font-weight: 600; }
.classroom-swipe-hint { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 0.75rem; color: var(--text-tertiary); }
.swipe-dots { display: flex; gap: 6px; align-items: center; }
.swipe-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--card-bg); box-shadow: var(--shadow-sm); transition: all 0.25s; }
.swipe-dot.active { background: var(--primary); width: 20px; border-radius: 4px; box-shadow: var(--shadow-sm); }
@media (max-width: 768px) {
  :root { --seat-size: 58px; --seat-gap: 6px; --nav-height: 52px; --bottom-nav-height: 56px; }
  .nav-toggle { display: none !important; }
  .nav-menu { display: none !important; }
  .bottom-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: var(--bottom-nav-height); background: var(--card-bg); border: none; z-index: 1000; padding-bottom: env(safe-area-inset-bottom, 0); box-shadow: var(--shadow); }
  body { padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0)); }
  .nav-title { font-size: 0.95rem; }
  .app-container { padding: 10px; }
  .card { padding: 14px; }
  .seat-map { padding: 12px 8px; }
  .seat-id { font-size: 0.58rem; }
  .seat-nickname { font-size: 0.68rem; }
  .seat-realname { font-size: 0.54rem; }
  .student-avatar { width: 44px; height: 44px; font-size: 1.1rem; }
  .student-info h2 { font-size: 1.1rem; }
  .tabs { gap: 0; }
  .tab { padding: 8px 12px; font-size: 0.82rem; }
  .modal-box { padding: 16px; }
  .conflict-compare { grid-template-columns: 1fr; }
  .form-row > * { min-width: 100%; }
  .toast { bottom: calc(var(--bottom-nav-height) + 16px); font-size: 0.82rem; padding: 10px 18px; }
  .leave-card { padding: 10px 12px; margin-bottom: 8px; }
  .leave-card-date { font-size: 0.82rem; }
  .leave-card-time { font-size: 0.72rem; }
  .leave-card-info { padding: 6px 8px; }
  .leave-info-row { font-size: 0.74rem; gap: 4px; }
  .leave-info-tag { font-size: 0.66rem; padding: 1px 6px; }
  .leave-card-reason { font-size: 0.74rem; }
  .leave-card-bottom { gap: 6px; }
  .leave-card-actions .btn-sm { padding: 4px 10px; font-size: 0.76rem; }
  .leave-edit-form { padding: 10px; }
  .ba-student-list { max-height: 300px; }
  .ba-student-item { padding: 8px 10px; gap: 8px; }
  .ba-avatar { width: 30px; height: 30px; font-size: 0.82rem; }
  .ba-preview-card { padding: 8px 10px; }
  .seat-leave-badge { font-size: 0.46rem; padding: 1px 2px; top: 1px; right: 1px; }
  .seat-has-label { overflow: visible !important; }
.seat-leave-days { font-size: 0.5rem; padding: 3px 1px; }
  .seat-patrol-dot { width: 7px; height: 7px; top: 2px; right: 2px; }
  .task-seat-picker { max-height: 320px; }
  .task-seat-picker-title { font-size: 0.82rem; margin-bottom: 6px; }
}
/* ===== iPhone 13 Pro 移动端深度优化 (390px) ===== */
@media (max-width: 420px) {
  /* 根字号 16px→14px（-12.5%，比13px更温和，减少小字体阅读疲劳） */
  html { font-size: 14px; -webkit-text-size-adjust: 100%; }
  :root {
    --seat-size: 58px; --seat-gap: 4px;
    --nav-height: 44px; --bottom-nav-height: 50px;
    --radius: 12px; --radius-sm: 10px; --radius-xs: 6px;
  }

  /* 导航栏 */
  .nav-bar { padding: 0 10px; }
  .nav-title { font-size: 0.85rem; }
  .nav-logo { font-size: 0.72rem; padding: 1px 6px; }

  /* 主容器 */
  .app-container { padding: 6px 8px; }
  body { line-height: 1.45; }

  /* 卡片 */
  .card { padding: 10px 12px; border-radius: var(--radius); }
  .card-title { font-size: 0.92rem; margin-bottom: 6px; }
  .card-subtitle { font-size: 0.72rem; }

  /* 按钮 */
  .btn { padding: 6px 12px; font-size: 0.78rem; border-radius: var(--radius-sm); }
  .btn-sm { padding: 6px 10px; font-size: 0.7rem; }
  .btn-xs { padding: 8px 12px; font-size: 0.66rem; min-height: 32px; }

  /* 表单（输入框16px防止Safari自动缩放） */
  .form-input, .form-select, .form-textarea {
    padding: 8px 10px; font-size: 16px; border-radius: var(--radius-sm);
    background: #DADADA;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.15), inset -2px -2px 5px rgba(255,255,255,0.6);
  }
  .form-input:focus, .form-select:focus, .form-textarea:focus {
    background: #D5D5D5;
    box-shadow: inset 2px 2px 5px rgba(0,0,0,0.18), inset -2px -2px 5px rgba(255,255,255,0.5), 0 0 0 2px rgba(107,122,184,0.25);
  }
  .form-label { font-size: 0.74rem; margin-bottom: 4px; color: var(--text-secondary); font-weight: 600; }

  /* 座位图 */
  .seat { padding: 3px 1px; }
  .seat-id { font-size: 0.7rem; }
  .seat-nickname { font-size: 0.85rem; line-height: 1.15; }
  .seat-realname { font-size: 0.68rem; line-height: 1.1; }
  .seat-leave-badge { font-size: 0.4rem; padding: 0 2px; top: 0; right: 0; }
  .seat-patrol-dot { width: 6px; height: 6px; top: 1px; right: 1px; }
  .seat-map { padding: 6px 4px; }
  .seat-legend { gap: 6px; font-size: 0.6rem; padding: 4px 6px; }
  .legend-swatch { width: 8px; height: 8px; }
  .classroom-tab { padding: 5px 12px; font-size: 0.74rem; }

  /* 学生详情 */
  .student-header { gap: 8px; padding: 6px 0 8px; }
  .student-avatar { width: 34px; height: 34px; font-size: 0.82rem; }
  .student-info h2 { font-size: 0.86rem; }
  .status-badge { font-size: 0.56rem; padding: 1px 5px; }

  /* 标签页 */
  .tabs { gap: 0; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { padding: 6px 10px; font-size: 0.74rem; white-space: nowrap; }
  .tab-badge { font-size: 0.56rem; padding: 0 4px; min-width: 14px; height: 14px; line-height: 14px; }

  /* 子导航 */
  .sub-nav-container { padding: 5px 6px 0; }
  .sub-nav-bar { padding: 4px; gap: 4px; }
  .sub-nav-item { padding: 5px 10px; font-size: 0.72rem; }

  /* 表格 */
  .student-table, .overview-table { font-size: 0.7rem; }
  .student-table th, .student-table td,
  .overview-table th, .overview-table td { padding: 4px 5px; }
  .student-table th, .overview-table th { font-size: 0.66rem; }
  .overview-stat-item { padding: 6px 10px; min-width: 52px; }
  .overview-stat-num { font-size: 1.05rem; }
  .overview-stat-label { font-size: 0.62rem; }
  .overview-stats { gap: 6px; margin-bottom: 8px; }
  .overview-actions .btn-sm { padding: 2px 6px; font-size: 0.64rem; }
  .overview-search { padding: 4px 8px; font-size: 0.74rem; max-width: 140px; }

  /* 数据概览徽章 */
  .data-badge { font-size: 0.58rem; padding: 1px 4px; }

  /* 作业统计 */
  .hw-card { padding: 8px 10px; }
  .hw-card-title { font-size: 0.78rem; }
  .hw-card-sub { font-size: 0.62rem; }
  .hw-card-stat { font-size: 0.66rem; }
  .hw-stat-num { font-size: 1rem; }
  .hw-stu { padding: 4px 6px; }
  .hw-stu-name { font-size: 0.72rem; }
  .hw-stu-real { font-size: 0.6rem; }
  .hw-badge-sub, .hw-badge-un, .hw-badge-makeup, .hw-badge-leave { font-size: 0.56rem; padding: 1px 4px; }
  .hw-pill { font-size: 0.64rem; padding: 2px 6px; }
  .hw-toolbar { gap: 4px; padding: 6px 8px; }
  .hw-search { font-size: 0.72rem; padding: 4px 8px; }
  .hw-date { font-size: 0.7rem; padding: 4px 8px; }
  .hw-sort-select, .hw-daterange { font-size: 0.7rem; }
  .hw-group-title { font-size: 0.76rem; padding: 4px 8px; }
  .hw-detail-header { flex-direction: column; align-items: stretch; gap: 6px; }
  .hw-detail-header > .btn { align-self: flex-start; }
  .hw-detail-title { font-size: 0.88rem; width: 100%; flex: none; }
  .hw-detail-stat { font-size: 0.68rem; white-space: normal; padding: 3px 10px; }
  .hw-deadline-row { flex-direction: column; align-items: stretch; gap: 4px; }
  .hw-deadline-left { min-width: 0; flex: none !important; }
  .hw-deadline-left .form-label { font-size: 0.62rem; margin-bottom: 2px; }
  .hw-deadline-input { padding: 5px 8px; font-size: 0.72rem; }
  .hw-deadline-pickers { flex-direction: row; gap: 4px; }
  .hw-deadline-picker { min-width: 0; flex: 1; font-size: 0.72rem; padding: 4px 6px; }
  .hw-deadline-actions { flex-wrap: wrap; gap: 4px; }

  /* 作业欠交 */
  .miss-stat-num { font-size: 1.1rem; }
  .miss-stat-label { font-size: 0.62rem; }
  .miss-item-title { font-size: 0.74rem; }
  .miss-item-meta { font-size: 0.62rem; }

  /* 作业未交详情 */
  .hw-miss-detail-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .hw-miss-detail-dates { flex-direction: row; }
  .hw-miss-date-input { min-width: 0; flex: 1; font-size: 0.72rem; }
  .hw-miss-detail-name { font-size: 0.82rem; }
  .hw-miss-detail-card { padding: 10px 12px; }
  .hw-miss-detail-card-header { padding-right: 36px; }
  .hw-miss-detail-tag { font-size: 0.62rem; padding: 2px 6px; }
  .hw-miss-detail-text { font-size: 0.66rem; }
  .hw-miss-copy-btn { font-size: 0.6rem; }

  /* 请假记录 */
  .leave-card { padding: 8px 10px; margin-bottom: 6px; }
  .leave-card-date { font-size: 0.74rem; }
  .leave-card-time { font-size: 0.64rem; }
  .leave-card-days { font-size: 0.7rem; }
  .leave-info-row { font-size: 0.66rem; gap: 3px; }
  .leave-info-tag { font-size: 0.58rem; padding: 1px 4px; }
  .leave-card-reason { font-size: 0.66rem; }
  .leave-card-note { font-size: 0.62rem; }
  .leave-card-actions .btn-sm { padding: 3px 8px; font-size: 0.68rem; }
  .leave-card-actions { gap: 4px; }
  .leave-edit-form { padding: 8px; }

  /* 谈话记录 */
  .conv-item { padding: 5px 0; }
  .conv-date { font-size: 0.64rem; }
  .conv-communicator { font-size: 0.62rem; }
  .conv-content-text { font-size: 0.66rem; line-height: 1.5; }
  .conv-source-tag { font-size: 0.52rem; padding: 0 4px; }
  .conv-audio { font-size: 0.58rem; padding: 3px 6px; }
  .timeline-item { padding-left: 16px; }
  .timeline-time { font-size: 0.62rem; }
  .timeline-content { font-size: 0.66rem; padding: 5px 8px; }
  .timeline-behavior { font-size: 0.56rem; padding: 1px 5px; }

  /* 仪表盘 */
  .dash-card { padding: 10px; gap: 8px; }
  .dash-card-num { font-size: 1.2rem; }
  .dash-card-label { font-size: 0.62rem; }
  .dash-card-sub { font-size: 0.58rem; }
  .dash-cards { gap: 8px; }
  .dash-chart-card { padding: 10px; }
  .dash-chart-title { font-size: 0.76rem; margin-bottom: 6px; }
  .bar-val { font-size: 0.56rem; }
  .bar-label { font-size: 0.56rem; }
  .hbar-label { font-size: 0.62rem; }
  .hbar-val { font-size: 0.62rem; }
  .dash-section-title { font-size: 0.78rem; }
  .activity-name { font-size: 0.7rem; }
  .activity-desc { font-size: 0.64rem; }
  .activity-time { font-size: 0.58rem; }
  .quick-btn { padding: 6px 10px; font-size: 0.7rem; }
  .dash-activity, .dash-actions { padding: 10px; }

  /* 批量登记 */
  .ba-student-item { padding: 6px 8px; gap: 6px; }
  .ba-avatar { width: 26px; height: 26px; font-size: 0.72rem; }
  .ba-student-name { font-size: 0.74rem; }
  .ba-student-meta { font-size: 0.62rem; }
  .ba-preview-card { padding: 6px 8px; }
  .ba-tab { padding: 5px 10px; font-size: 0.72rem; }
  .ba-count-pill { font-size: 0.6rem; padding: 1px 5px; }

  /* 任务卡片 */
  .task-card { padding: 8px 10px; }
  .task-title { font-size: 0.78rem; }
  .task-deadline { font-size: 0.64rem; }
  .task-seat-chip { font-size: 0.6rem; padding: 1px 5px; }

  /* AI评语 */
  .comment-text { font-size: 0.72rem; line-height: 1.5; }
  .comment-version-label { font-size: 0.66rem; }
  .src-label { font-size: 0.64rem; }
  .src-text { font-size: 0.68rem; }

  /* 模态框 */
  .modal-box { padding: 12px; border-radius: var(--radius); max-height: 85vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
  .modal-title { font-size: 0.92rem; margin-bottom: 8px; }
  .modal-actions { gap: 6px; margin-top: 10px; }

  /* Toast */
  .toast { bottom: calc(var(--bottom-nav-height) + 10px); font-size: 0.72rem; padding: 8px 14px; }

  /* 底部导航 */
  .bottom-nav-item { font-size: 0.62rem; min-height: 44px; }
  .bottom-nav-label { font-size: 0.62rem; }
  .bottom-nav-icon { width: 22px; height: 22px; }
  .bottom-nav { gap: 2px; padding: 4px 2px 2px; }

  /* 工具类 */
  .filter-bar { gap: 4px; padding: 4px 6px; }
  .filter-chip { padding: 8px 14px; font-size: 0.66rem; min-height: 32px; display: inline-flex; align-items: center; }
  .empty-state-icon { font-size: 1.8rem; }
  .empty-state { font-size: 0.74rem; padding: 20px 10px; }

  /* 月份消课 */
  .monthly-card { padding: 8px 10px; }
  .monthly-summary { gap: 6px; }

  /* 分段控件 */
  .seg-control { padding: 2px; }
  .seg-btn { padding: 4px 10px; font-size: 0.7rem; }

  /* 性格分析 */
  .ca-text { font-size: 0.7rem; }
  .ca-label { font-size: 0.66rem; }

  /* 页头 */
  .page-header { padding: 6px 0; }
  .page-title { font-size: 0.92rem; }

  /* 滚动条隐藏 */
  ::-webkit-scrollbar { width: 3px; height: 3px; }

  /* ===== 移动端性能优化 ===== */
  /* 简化阴影，减少GPU合成层 */
  :root {
    --shadow: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-lg: 0 2px 6px rgba(0,0,0,0.1);
    --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.06);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  }
  /* 禁用hover变换，减少重绘 */
  .seat:hover, .seat-available:hover, .seat-occupied:hover, .seat-leave:hover, .card:hover,
  .hw-stu:hover, .task-card:hover, .btn:hover, .conflict-version:hover { transform: none !important; }
  /* 高频元素禁用transition，减少GPU合成 */
  .seat, .hw-stu, .ba-student-item, .ba-ledger-row, .ba-detail-row, .task-card, .dash-card, .activity-item, .quick-btn { transition: none !important; }
  /* 禁用页面入场动画，减少合成层重建 */
  #app { animation: none !important; }
  /* 任务座位选择器滚动优化 */
  .task-seat-picker { max-height: 420px; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; border-radius: var(--radius); padding: 4px; }
}
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }
@media print {
  .nav-bar, .nav-toggle, .btn, .toast { display: none !important; }
  body { padding: 0; background: #fff; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}

/* ===== P0-3: 座位长按视觉反馈 ===== */
.seat-pressing {
  box-shadow: var(--shadow-inset) !important;
  transform: scale(0.93);
  transition: all 0.15s ease;
}

/* ===== 页面切换过渡动画 ===== */
#app {
  animation: pageEnter var(--dur-normal) var(--ease-out);
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 页面切换时的淡出效果（通过 JS 添加 page-leave class） */
#app.page-leave {
  animation: pageLeave var(--dur-fast) var(--ease-in) forwards;
}
@keyframes pageLeave {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(-6px); }
}

/* ===== 模态框动效（已移除可能导致弹窗不可见的覆盖样式） ===== */

/* ===== Toast 动效 ===== */
.toast {
  animation: toastIn var(--dur-normal) var(--ease-out);
}
.toast.toast-leaving {
  animation: toastOut var(--dur-fast) var(--ease-in) forwards;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}
@keyframes toastOut {
  from { opacity: 1; transform: translateX(-50%) translateY(0); }
  to { opacity: 0; transform: translateX(-50%) translateY(-8px); }
}

/* ===== 折叠面板平滑展开 ===== */
.collapsible-body {
  display: block !important;
  max-height: 0;
  overflow: hidden;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  transition: max-height var(--dur-normal) var(--ease-out),
              padding-top var(--dur-normal) var(--ease-out),
              padding-bottom var(--dur-normal) var(--ease-out),
              opacity var(--dur-normal) var(--ease-out);
}
.collapsible.open .collapsible-body {
  max-height: 2000px;
  padding-top: 14px;
  padding-bottom: 14px;
  opacity: 1;
}

/* ===== 按钮微交互增强 ===== */
.btn {
  transform: translateY(0);
}
.btn:hover:not(:disabled):not(:active) {
  transform: translateY(-1px);
}
.btn:active:not(:disabled) {
  transform: translateY(1px);
}

/* ===== 卡片 hover 优化 ===== */
.card {
  transform: translateY(0);
  transition: box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.card:hover {
  transform: translateY(-1px);
}

/* ===== 底部导航项动效 ===== */
.bottom-nav-item {
  position: relative;
}
.bottom-nav-item::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
  transition: transform var(--dur-fast) var(--ease-out);
}
.bottom-nav-item.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ===== 列表项入场动画（渐次出现） ===== */
@keyframes itemFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 减少动效模式（无障碍） ===== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ===== P1-8: 作业状态按钮 2×2 网格 + 截止栏折叠（移动端） ===== */
.hw-detail-collapsible { display: none; }
@media (max-width: 420px) {
  .hw-deadline-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .hw-deadline-actions .btn {
    width: 100%;
    text-align: center;
  }
  .hw-detail-collapsible {
    display: block;
    cursor: pointer;
    user-select: none;
    padding: 6px 10px;
    font-size: 0.74rem;
    color: var(--text-secondary);
    background: var(--card-bg);
    border-radius: var(--radius-xs);
    box-shadow: var(--shadow-inset);
    margin-bottom: 6px;
  }
  .hw-detail-collapsed .hw-deadline-left,
  .hw-detail-collapsed .hw-deadline-pickers,
  .hw-detail-collapsed .hw-deadline-actions,
  .hw-detail-collapsed .hw-deadline-hint {
    display: none;
  }
  .hw-detail-collapsible::after {
    content: ' ▾';
    font-size: 0.7rem;
    opacity: 0.5;
    float: right;
  }
  .hw-detail-collapsed .hw-detail-collapsible::after {
    content: ' ▸';
  }
}

/* ===== P2-11: 下拉刷新指示器 ===== */
.pull-refresh-container {
  position: relative;
  overflow: hidden;
}
.pull-refresh-indicator {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-100%);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  color: var(--text-tertiary);
  transition: transform 0.2s ease;
  z-index: 10;
}
.pull-refresh-indicator.spinning {
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  from { transform: translateX(-50%) translateY(0) rotate(0deg); }
  to { transform: translateX(-50%) translateY(0) rotate(360deg); }
}

/* ===== P2-12: 骨架屏（加载占位） ===== */
.skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, var(--bg) 50%, var(--card-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  height: 60px;
  margin-bottom: 10px;
}
.skeleton-line {
  height: 14px;
  margin-bottom: 6px;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.overview-stats { display: flex; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.overview-stat-item { display: flex; flex-direction: column; align-items: center; padding: 10px 20px; background: var(--card-bg); border: none; border-radius: var(--radius); box-shadow: var(--shadow); min-width: 80px; }
.overview-stat-item.stat-warn { background: var(--warning-light); }
.overview-stat-num { font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.overview-stat-item.stat-warn .overview-stat-num { color: var(--warning); }
.overview-stat-label { font-size: 0.75rem; color: var(--text-tertiary); margin-top: 2px; }
.overview-search { flex: 1; min-width: 120px; max-width: 240px; padding: 6px 10px; font-size: 0.85rem; background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); }
.overview-table th { cursor: pointer; user-select: none; white-space: nowrap; }
.overview-table th:hover { background: var(--bg); }
.overview-table td { white-space: nowrap; }
.overview-table .sort-arrow { font-size: 0.7rem; color: var(--primary); }
.overview-actions { display: flex; gap: 4px; white-space: nowrap; }
.overview-actions .btn-sm { padding: 3px 8px; font-size: 0.72rem; }
.row-duplicate { background: var(--warning-light) !important; }
.dup-badge { display: inline-block; background: var(--warning); color: #fff; font-size: 0.62rem; padding: 1px 5px; border-radius: 3px; margin-left: 4px; vertical-align: middle; }
.delete-summary { background: var(--card-bg); border: none; border-radius: var(--radius); box-shadow: var(--shadow-inset); padding: 12px 16px; margin: 12px 0; }
.delete-summary p { margin: 4px 0; }
@media (max-width: 768px) {
  .overview-stats { gap: 8px; }
  .overview-stat-item { padding: 8px 12px; min-width: 60px; }
  .overview-stat-num { font-size: 1.2rem; }
  .overview-table { font-size: 0.78rem; }
  .overview-actions .btn-sm { padding: 2px 6px; font-size: 0.68rem; }
}
.hw-toolbar { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 10px 12px; margin-bottom: 14px; box-shadow: var(--shadow); }
.hw-toolbar-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.hw-search-wrap { position: relative; flex: 1 1 240px; min-width: 180px; display: flex; align-items: center; }
.hw-search-ico { position: absolute; left: 10px; font-size: 0.85rem; opacity: 0.6; pointer-events: none; }
.hw-search { width: 100%; padding-left: 30px !important; padding-right: 28px !important; }
.hw-clear-x { position: absolute; right: 6px; width: 20px; height: 20px; border: none; background: var(--card-bg); color: var(--text-secondary); border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-sm); }
.hw-clear-x:hover { background: var(--danger); color: #fff; }
.hw-daterange { flex: 0 1 200px; min-width: 150px; }
.hw-sort-select { flex: 0 0 auto; background: var(--card-bg); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-inset); }
.hw-dir-btn, .hw-reset-btn { flex: 0 0 auto; white-space: nowrap; }
.hw-toolbar-hint { margin-top: 8px; font-size: 0.72rem; color: var(--text-tertiary); }
.hw-toolbar-hint code { background: var(--primary-light); color: var(--text-secondary); padding: 1px 5px; border-radius: 4px; font-size: 0.72rem; }
.hw-toolbar-hint b { color: var(--text); }
.hw-date-wrap { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hw-date-label { font-size: 0.82rem; color: var(--text-secondary); }
.hw-date-sep { color: var(--text-secondary); font-size: 0.82rem; }
.hw-date { width: auto; min-width: 130px; padding: 5px 8px; font-size: 0.82rem; background: var(--card-bg); border: none; border-radius: var(--radius-xs); box-shadow: var(--shadow-inset); }
.hw-completed-wrap { margin-top: 16px; }
.hw-completed-toggle { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: var(--success-light); border: none; border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); cursor: pointer; color: var(--success); font-weight: 600; font-size: 0.92rem; user-select: none; }
.hw-completed-toggle:hover { box-shadow: var(--shadow); }
.hw-completed-toggle.open { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.hw-completed-caret { font-size: 0.8rem; line-height: 1; }
.hw-completed-title { flex: 0 0 auto; }
.hw-completed-note { margin-left: auto; font-size: 0.72rem; font-weight: 400; color: var(--success); }
.hw-completed-list { border: none; border-radius: 0 0 var(--radius-sm) var(--radius-sm); box-shadow: var(--shadow-inset); padding: 10px 12px 4px; background: var(--card-bg); }
.hw-card--done { opacity: 0.82; }
.hw-card--done .hw-card-title::after { content: ' \2713'; color: var(--success); }
.overview-stat-item.stat-clickable { cursor: pointer; transition: all 0.2s ease; position: relative; user-select: none; }
.overview-stat-item.stat-clickable:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.overview-stat-item.stat-clickable.stat-active { background: var(--primary-light); box-shadow: var(--shadow-inset); }
.overview-stat-item.stat-clickable.stat-active.stat-warn { background: var(--warning-light); box-shadow: var(--shadow-inset); }
.overview-stat-item.stat-clickable.stat-disabled { opacity: 0.5; cursor: default; pointer-events: none; }
.student-table tbody tr.row-clickable { cursor: pointer; transition: background 0.15s ease; }
.student-table tbody tr.row-clickable:hover { background: var(--primary-light); }
.student-table tbody tr.row-clickable:hover .status-badge { opacity: 0.92; }
.student-table td.cell-clickable { cursor: pointer; transition: all 0.15s ease; border-radius: 4px; position: relative; }
.student-table td.cell-clickable:hover { background: var(--primary-light); box-shadow: var(--shadow-inset); font-weight: 700; }
.student-table td.cell-clickable::after { content: '\25B8'; font-size: 0.65rem; margin-left: 3px; opacity: 0; transition: opacity 0.15s ease; color: var(--primary); }
.student-table td.cell-clickable:hover::after { opacity: 0.7; }
.btn-secondary:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.hw-unsub-alert { margin: 8px 0 12px; padding: 10px 14px; border-radius: var(--radius-xs); background: var(--danger-light); border: none; box-shadow: var(--shadow-sm); color: var(--danger); font-size: 0.9rem; font-weight: 600; cursor: pointer; }
.hw-unsub-alert b { font-size: 1.05rem; }
.hw-unsub-alert:hover { box-shadow: var(--shadow-inset); }
.hw-unsub-alert--ok { background: var(--success-light); color: var(--success); cursor: default; }
.hw-unsub-alert--ok:hover { background: var(--success-light); }
.hw-stat-card { transition: box-shadow 0.15s ease, transform 0.1s ease; position: relative; }
.hw-stat-card:hover { transform: translateY(-1px); }
.hw-stat-card--active { box-shadow: var(--shadow-inset); transform: translateY(0); opacity: 0.85; }
.hw-stat-card--active::after { content: '●'; position: absolute; top: 4px; right: 6px; font-size: 0.5rem; opacity: 0.6; }
.student-table td.data-cell { padding: 6px 8px; }
.data-badge { display: inline-flex; align-items: center; gap: 2px; padding: 2px 8px; margin: 2px 3px 2px 0; border-radius: 12px; font-size: 0.75rem; font-weight: 600; line-height: 1.5; white-space: nowrap; cursor: pointer; transition: all 0.15s ease; user-select: none; border: none; box-shadow: var(--shadow-sm); }
.data-badge:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.data-badge.badge-leave { background: var(--warning-light); color: var(--warning); }
.data-badge.badge-artwork { background: var(--primary-light); color: var(--primary); }
.data-badge.badge-task { background: var(--danger-light); color: var(--danger); }
.data-badge.badge-patrol { background: var(--success-light); color: var(--success); }
.data-badge.badge-zero { background: var(--bg); color: var(--text-tertiary); font-weight: 400; }
.hw-unsub-list { display: flex; flex-direction: column; gap: 8px; }
.hw-unsub-empty { padding: 10px 14px; background: var(--success-light); border: none; border-radius: var(--radius-xs); box-shadow: var(--shadow-sm); color: var(--success); font-weight: 600; font-size: 0.9rem; }
.hw-unsub-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: var(--danger-light); border: none; border-radius: var(--radius-xs); box-shadow: var(--shadow-sm); cursor: pointer; }
.hw-unsub-item:hover { box-shadow: var(--shadow-inset); }
.hw-unsub-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: var(--danger); }
.hw-unsub-body { flex: 1 1 auto; min-width: 0; }
.hw-unsub-title { font-weight: 600; font-size: 0.92rem; color: var(--text); }
.hw-unsub-sub { font-size: 0.76rem; color: var(--text-tertiary); margin-top: 2px; }
.hw-unsub-dates { display: flex; gap: 12px; margin-top: 4px; flex-wrap: wrap; }
.hw-date-item { display: flex; flex-direction: column; gap: 1px; font-size: 0.72rem; }
.hw-date-label { font-size: 0.62rem; color: var(--text-tertiary); font-weight: 500; }
.hw-unsub-go { flex: 0 0 auto; font-size: 0.78rem; color: var(--danger); }
.ca-block { margin-bottom: 12px; }
.ca-label { font-size: 0.82rem; font-weight: 600; color: var(--primary); margin-bottom: 4px; padding-left: 8px; border-left: none; }
.ca-text { font-size: 0.9rem; line-height: 1.7; color: var(--text); white-space: pre-wrap; background: var(--card-bg); border-radius: var(--radius-xs); box-shadow: var(--shadow-inset); padding: 10px 12px; }

/* 性格分析 - 学生卡片 5 模块（纯文字平铺） */
.ca-student-card { margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light); }
.ca-student-title { display: flex; align-items: center; justify-content: space-between; font-size: 0.95rem; margin-bottom: 8px; }
.ca-status { font-weight: normal; font-size: 0.78rem; }
.ca-modules { display: flex; flex-direction: column; gap: 12px; }
.ca-module-card { background: none; border-radius: 0; padding: 0; border: none; }
.ca-module-title { font-size: 0.82rem; font-weight: 600; color: var(--primary); margin-bottom: 4px; padding-bottom: 2px; border-bottom: none; }
.ca-content { font-size: 0.78rem; line-height: 1.65; color: var(--text); white-space: pre-wrap; word-break: break-word; }
.ca-content textarea { width: 100%; font-size: 0.78rem; line-height: 1.65; padding: 6px 8px; }

/* 性格分析 - 座位卡片缩小容器 */
.seat-map-analyze .seat { width: var(--seat-size) !important; height: calc(var(--seat-size) * 0.65) !important; padding: 2px !important; }
.seat-map-analyze .seat-id { font-size: 0.5rem !important; opacity: 0.55; line-height: 1; }
.seat-map-analyze .seat-nickname { font-size: 0.7rem !important; line-height: 1.1; }
.seat-map-analyze .seat-vacant-label { font-size: 0.55rem !important; }
.seat-map-analyze .seat-row { gap: 4px; }

/* 性格分析 - 座位表状态 */
.seat-analyzing { border-color: var(--primary); background: var(--primary-light); }
.seat-analyzed { border-color: var(--success); background: rgba(34, 197, 94, 0.1); }
.seat-analyze-fail { border-color: var(--danger); background: rgba(239, 68, 68, 0.1); }
.seat-before-enroll { border-color: rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.12); opacity: 0.75; }
.seat-no-archive { border: 2px dashed #d1d5db; background: #f3f4f6; opacity: 0.6; position: relative; }
.seat-no-archive .seat-nickname { color: #9ca3af; }
.seat-no-archive-label { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 10px; color: #9ca3af; font-weight: 600; pointer-events: none; }
.seat-analyze-dot {
  position: absolute; top: 4px; right: 4px;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--primary);
  animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

/* 性格分析 - 新旧对比模式座位状态 */
.seat-compare-changed { background: var(--warning-light) !important; box-shadow: inset 0 0 0 2px var(--warning); }
.seat-compare-new { background: var(--primary-light) !important; box-shadow: inset 0 0 0 2px var(--primary); }
.seat-keep-old { background: #d5d5d5 !important; }

/* 弹窗内编辑性格分析的文本框 */
.cam-ta { width: 100%; font-size: 0.78rem; line-height: 1.6; }

/* 班级群体分析 */
.ca-group-section { margin-bottom: 24px; }
.ca-group-title { font-size: 1rem; font-weight: 700; color: var(--text); margin-bottom: 12px; padding-left: 10px; border-left: 4px solid var(--primary); }

/* 性格分类卡片 */
.ca-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.ca-category-card { background: var(--card-bg); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--primary); }
.ca-category-name { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 8px; }
.ca-category-desc { font-size: 0.82rem; line-height: 1.6; color: var(--text-secondary); margin-bottom: 8px; }
.ca-category-students { font-size: 0.8rem; color: var(--text); margin-bottom: 6px; line-height: 1.5; }
.ca-category-advice { font-size: 0.8rem; color: var(--text-secondary); line-height: 1.5; }

/* 行为关联卡片 */
.ca-behavior-links { display: flex; flex-direction: column; gap: 10px; }
.ca-behavior-card { background: var(--card-bg); border-radius: var(--radius-sm); padding: 12px 14px; box-shadow: var(--shadow-sm); border-left: 3px solid var(--warning); }
.ca-behavior-name { font-size: 0.9rem; font-weight: 600; color: var(--warning-dark); margin-bottom: 6px; }
.ca-behavior-students, .ca-behavior-personality, .ca-behavior-cause { font-size: 0.8rem; line-height: 1.5; margin-bottom: 4px; }

/* 风险总览 */
.ca-risk-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.ca-risk-card { background: var(--card-bg); border-radius: var(--radius-sm); padding: 14px; box-shadow: var(--shadow-sm); }
.ca-risk-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ca-risk-label { font-size: 0.9rem; font-weight: 600; color: var(--text); }
.ca-risk-count { font-size: 0.85rem; font-weight: 700; color: var(--danger); background: var(--danger-light); padding: 2px 8px; border-radius: 12px; }
.ca-risk-desc { font-size: 0.8rem; line-height: 1.5; color: var(--text-secondary); margin-bottom: 6px; }
.ca-risk-students { font-size: 0.78rem; color: var(--text); line-height: 1.4; }

/* 响应式 */
@media (max-width: 640px) {
  .ca-modules { grid-template-columns: 1fr; }
  .ca-categories { grid-template-columns: 1fr; }
  .ca-risk-grid { grid-template-columns: 1fr; }
}
.dashboard { max-width: 960px; margin: 0 auto; padding: 0 0 20px; }
.dashboard-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.dashboard-title { font-size: 1.4rem; font-weight: 700; margin: 0; }
.dashboard-date { font-size: 0.85rem; color: var(--text-tertiary); }
.dash-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-card { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: var(--radius); background: var(--card-bg); border: none; cursor: pointer; transition: all 0.2s ease; box-shadow: var(--shadow); }
.dash-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.dash-card-primary { background: var(--primary-light); }
.dash-card-warn { background: var(--warning-light); }
.dash-card-danger { background: var(--danger-light); }
.dash-card-success { background: var(--success-light); }
.dash-card-icon { font-size: 1.6rem; flex-shrink: 0; }
.dash-card-body { display: flex; flex-direction: column; min-width: 0; }
.dash-card-num { font-size: 1.6rem; font-weight: 700; line-height: 1.1; color: var(--text); }
.dash-card-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 2px; }
.dash-card-sub { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; margin-bottom: 20px; }
.dash-chart-card { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }

/* 移动端仪表盘布局 */
.dash-mobile-leave,
.dash-mobile-patrol,
.dash-mobile-hw {
  display: none;
}

.dash-charts-desktop {
  display: grid;
}

.dash-desktop-only {
  display: block;
}

@media (max-width: 640px) {
  .dash-charts-desktop {
    display: none;
  }
  .dash-desktop-only {
    display: none !important;
  }

  /* 请假板块：全宽，上趋势下列表 */
  .dash-mobile-leave {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
  }
  .dash-mobile-leave-list {
    display: flex;
    flex-direction: column;
  }
  .leave-student-list {
    display: flex;
    flex-direction: column;
    gap: 0;
  }
  .leave-student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
  }
  .leave-student-item:last-child {
    border-bottom: none;
  }
  .leave-student-name {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text);
  }
  .leave-student-sessions {
    font-size: 0.68rem;
    color: var(--text-tertiary);
    text-align: right;
  }
  .leave-student-empty {
    font-size: 0.7rem;
    color: var(--text-tertiary);
    text-align: center;
    padding: 20px 0;
  }

  /* 巡班板块：左右各半 */
  .dash-mobile-patrol {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
  }
  .today-patrol-list {
    max-height: 180px;
    overflow-y: auto;
  }
  .today-patrol-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--border-light);
  }
  .today-patrol-item:last-child {
    border-bottom: none;
  }
  .today-patrol-name {
    font-size: 0.76rem;
    color: var(--text);
    font-weight: 500;
  }
  .today-patrol-desc {
    font-size: 0.65rem;
    color: var(--text-tertiary);
    max-width: 50%;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 作业提交率：全宽 */
  .dash-mobile-hw {
    display: block;
    margin-bottom: 12px;
  }

  /* 移动端图表卡片内边距缩小 */
  .dash-mobile-leave .dash-chart-card,
  .dash-mobile-patrol .dash-chart-card,
  .dash-mobile-hw .dash-chart-card {
    padding: 10px;
  }
  .dash-mobile-leave .dash-chart-title,
  .dash-mobile-patrol .dash-chart-title,
  .dash-mobile-hw .dash-chart-title {
    font-size: 0.76rem;
    margin-bottom: 8px;
  }
}

.dash-chart-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 12px; color: var(--text); }
.bar-chart { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 20px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; position: relative; justify-content: flex-end; }
.bar-val { font-size: 0.7rem; font-weight: 600; color: var(--text-secondary); position: absolute; top: -18px; }
.bar-fill { width: 70%; min-height: 2px; border-radius: 4px 4px 0 0; background: var(--card-bg); box-shadow: var(--shadow-sm); transition: height 0.3s ease; }
.bar-fill.bar-leave { background: linear-gradient(180deg, #F0A04B, #D9615A); }
.bar-fill.bar-success { background: linear-gradient(180deg, #5BA889, #4A8E74); }
.bar-fill.bar-warn { background: linear-gradient(180deg, #F0A04B, #D8893A); }
.bar-fill.bar-danger { background: linear-gradient(180deg, #D9615A, #C4534D); }
.bar-label { font-size: 0.68rem; color: var(--text-tertiary); margin-top: 4px; }
.hbar-chart { display: flex; flex-direction: column; gap: 8px; }
.hbar-row { display: flex; align-items: center; gap: 8px; }
.hbar-label { font-size: 0.75rem; width: 70px; text-align: right; flex-shrink: 0; color: var(--text-secondary); }
.hbar-track { flex: 1; height: 18px; background: var(--card-bg); border-radius: 9px; overflow: hidden; box-shadow: var(--shadow-inset); }
.hbar-fill { height: 100%; border-radius: 9px; transition: width 0.3s ease; }
.hbar-fill.bar-patrol { background: linear-gradient(90deg, #6B7AB8, #5664A0); }
.hbar-val { font-size: 0.75rem; font-weight: 600; width: 24px; flex-shrink: 0; color: var(--text); }
.dash-bottom { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) {
  .dash-bottom { grid-template-columns: 1fr; }
  .dash-cards { grid-template-columns: repeat(2, 1fr); }
}
.dash-activity, .dash-actions { background: var(--card-bg); border: none; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.dash-section-title { font-size: 0.9rem; font-weight: 600; margin: 0 0 10px; color: var(--text); }
.activity-list { display: flex; flex-direction: column; gap: 6px; }
.activity-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--bg); box-shadow: var(--shadow-sm); transition: all 0.15s ease; }
.activity-item:hover { background: var(--primary-light); box-shadow: var(--shadow-sm); }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--text-tertiary); }
.activity-dot.dot-ok { background: var(--success); }
.activity-dot.dot-warn { background: var(--warning); }
.activity-dot.dot-danger { background: var(--danger); }
.activity-name { font-size: 0.82rem; font-weight: 600; flex-shrink: 0; }
.activity-desc { font-size: 0.75rem; color: var(--text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.activity-time { font-size: 0.7rem; color: var(--text-tertiary); flex-shrink: 0; }
.activity-empty, .chart-empty { font-size: 0.8rem; color: var(--text-tertiary); padding: 12px; text-align: center; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.quick-btn { padding: 10px 12px; border: none; border-radius: var(--radius-xs); background: var(--card-bg); box-shadow: var(--shadow-sm); font-size: 0.82rem; cursor: pointer; transition: all 0.15s ease; text-align: center; color: var(--text); }
.quick-btn:hover { background: var(--primary-light); box-shadow: var(--shadow); color: var(--primary); }
.leave-today-list { display: flex; flex-direction: column; gap: 6px; }
.leave-today-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius-xs); background: var(--warning-light); border: none; box-shadow: var(--shadow-sm); }
.leave-today-name { font-size: 0.82rem; font-weight: 600; flex-shrink: 0; }
.leave-today-reason { font-size: 0.75rem; color: var(--warning); background: var(--warning-light); padding: 1px 6px; border-radius: 8px; }
.leave-today-date { font-size: 0.7rem; color: var(--text-tertiary); margin-left: auto; }

/* ===== 多级下拉导航菜单 ===== */
.nav-dropdown { position: relative; display: inline-block; }
.nav-link-parent { display: inline-flex; align-items: center; gap: 4px; }
.nav-caret { font-size: 0.7rem; opacity: 0.6; transition: transform 0.2s; }
.nav-dropdown:hover .nav-caret { transform: rotate(180deg); }
.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 160px;
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  box-shadow: -6px -6px 12px rgba(255,255,255,0.9), 6px 6px 16px rgba(0,0,0,0.1);
  padding: 6px;
  margin-top: 6px;
  display: none;
  z-index: 1100;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.2s, transform 0.2s;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown-menu.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}
.nav-dropdown-item {
  display: block;
  padding: 8px 14px;
  border-radius: var(--radius-xs);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.15s;
  white-space: nowrap;
}
.nav-dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
  box-shadow: var(--shadow-inset);
}
.nav-dropdown-item.active {
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-inset);
}

/* ===== 页面子导航条 ===== */
.sub-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px 0;
}
.sub-nav-bar {
  display: flex;
  gap: 8px;
  padding: 6px;
  background: var(--bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-inset);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.sub-nav-bar::-webkit-scrollbar { display: none; }
.sub-nav-item {
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  white-space: nowrap;
  cursor: pointer;
  text-decoration: none;
  flex-shrink: 0;
}
.sub-nav-item:hover {
  box-shadow: var(--shadow);
  color: var(--primary);
  transform: translateY(-1px);
}
.sub-nav-item.active {
  background: var(--card-bg);
  color: var(--primary);
  font-weight: 600;
  box-shadow: var(--shadow-inset);
  transform: none;
}
.sub-nav-item.active:hover {
  transform: none;
  box-shadow: var(--shadow-inset);
}

/* 移动端子导航优化 */
@media (max-width: 768px) {
  .sub-nav-container { padding: 8px 10px 0; }
  .sub-nav-item { padding: 6px 14px; font-size: 0.82rem; }

  /* 移动端下拉菜单样式 */
  .nav-dropdown-menu {
    position: static;
    box-shadow: var(--shadow-inset);
    margin-top: 4px;
    border-radius: var(--radius-xs);
  }
  .nav-dropdown-menu.show {
    display: block;
    opacity: 1;
    transform: none;
  }
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown-menu.show { display: block !important; }

  /* 移动端下拉箭头指示器 */
  .nav-dropdown .nav-link-parent::after {
    content: '▾';
    font-size: 0.65rem;
    margin-left: 4px;
    opacity: 0.5;
    display: inline-block;
    transition: transform 0.2s ease;
  }
  .nav-dropdown.dropdown-open .nav-link-parent::after {
    transform: rotate(180deg);
    opacity: 1;
  }
}

/* ===== 自定义机器人列表 ===== */
.custom-robots-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.custom-robot-item {
  background: #f5f6fa;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid #e0e2ea;
}
.custom-robot-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.custom-robot-name {
  font-size: 15px;
  font-weight: 600;
  color: #2c3e50;
  display: flex;
  align-items: center;
  gap: 8px;
}
.custom-robot-status {
  font-size: 12px;
  font-weight: 400;
  padding: 2px 8px;
  border-radius: 10px;
}
.custom-robot-status.status-active {
  background: #e8f5e9;
  color: #2e7d32;
}
.custom-robot-status.status-inactive {
  background: #fafafa;
  color: #9e9e9e;
}
.custom-robot-actions {
  display: flex;
  gap: 4px;
}
.custom-robot-body {
  font-size: 13px;
}
.custom-robot-desc {
  color: #607d8b;
  margin-bottom: 6px;
}
.custom-robot-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: #90a4ae;
  font-size: 12px;
}

/* ===== 模态框 ===== */
.modal-overlay {
  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;
  padding: 20px;
}
.modal-content {
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #eef0f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: #2c3e50;
}
.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #90a4ae;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.modal-close:hover {
  color: #546e7a;
}
.modal-body {
  padding: 18px 22px;
  overflow-y: auto;
  flex: 1;
}
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #eef0f5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 星期选择 */
.day-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.day-checkbox {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: #546e7a;
  padding: 6px 10px;
  background: #f5f6fa;
  border-radius: 8px;
  cursor: pointer;
}
.day-checkbox input {
  margin: 0;
}
.text-danger {
  color: #e53935 !important;
}
.ml-auto {
  margin-left: auto;
}

/* ========================================
   追加样式：移动端深度优化 + 深色模式 + 新组件
   ======================================== */

/* ===== 开关组件 (Switch) ===== */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.switch-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #D0D0D0;
  transition: 0.3s;
  border-radius: 26px;
  box-shadow: var(--shadow-inset);
}
.switch-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  transition: 0.3s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.switch input:checked + .switch-slider {
  background: var(--primary);
}
.switch input:checked + .switch-slider:before {
  transform: translateX(22px);
}
.switch-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
}
.switch-label-text {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}
.switch-label-desc {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== 主题切换按钮（顶部导航栏） ===== */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.2s;
  font-size: 1.1rem;
  border: none;
  color: var(--text);
  margin-left: 8px;
}
.theme-toggle-btn:active {
  box-shadow: var(--shadow-inset);
}

/* ===== 操作日志 UI ===== */
.log-date-picker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.log-date-select {
  flex: 1;
  min-width: 140px;
}
.log-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.log-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.log-time {
  font-size: 0.72rem;
  color: var(--text-tertiary);
  white-space: nowrap;
  flex-shrink: 0;
  padding-top: 2px;
}
.log-type-tag {
  font-size: 0.66rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.log-type-student { background: var(--primary-light); color: var(--primary); }
.log-type-leave { background: var(--warning-light); color: var(--warning); }
.log-type-patrol { background: var(--success-light); color: var(--success); }
.log-type-homework { background: rgba(156, 100, 200, 0.15); color: #9c64c8; }
.log-type-task { background: rgba(156, 100, 200, 0.15); color: #9c64c8; }
.log-type-setting { background: var(--danger-light); color: var(--text-secondary); }
.log-type-backup { background: var(--danger-light); color: var(--text-secondary); }
.log-type-login { background: var(--danger-light); color: var(--danger); }
.log-content {
  flex: 1;
  min-width: 0;
}
.log-target {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.log-detail {
  font-size: 0.74rem;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-all;
}
.log-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.log-page-info {
  font-size: 0.78rem;
  color: var(--text-secondary);
}
.log-empty {
  text-align: center;
  padding: 30px 20px;
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

/* ===== 自动备份 UI ===== */
.auto-backup-status {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.auto-backup-status-item {
  flex: 1;
  min-width: 140px;
  padding: 12px 14px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-inset);
}
.auto-backup-status-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.auto-backup-status-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}
.auto-backup-config {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}
.auto-backup-config .form-group {
  margin-bottom: 0;
}
.backup-file-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 400px;
  overflow-y: auto;
}
.backup-file-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.backup-file-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.backup-file-info {
  flex: 1;
  min-width: 0;
}
.backup-file-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.backup-file-meta {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 2px;
}
.backup-file-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}
.backup-file-actions .btn-xs {
  padding: 4px 8px;
  font-size: 0.7rem;
}
.backup-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 16px 0 10px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.backup-section-title:first-child {
  margin-top: 0;
}


/* ===== 深色模式变量 ===== */
[data-theme="dark"] {
  /* ===== 主色：蓝（深色加亮） ===== */
  --primary: #6b9ce0;
  --primary-light: #4a7abc;
  --primary-pale: #243b5e;
  --primary-dark: #9bc0ef;
  --primary-alpha: rgba(107, 156, 224, 0.18);

  /* ===== 状态色（深色模式提高明度保证可见） ===== */
  --danger: #f08080;
  --danger-light: #c05050;
  --danger-pale: #402424;
  --danger-dark: #f5a0a0;

  --warning: #f0c060;
  --warning-light: #c09040;
  --warning-pale: #403018;
  --warning-dark: #f5d890;

  --success: #70c89a;
  --success-light: #3a8a60;
  --success-pale: #1e3a2a;
  --success-dark: #98dcba;

  /* ===== 中性色：6级灰阶（深色模式） ===== */
  --gray-50: #121418;   /* 页面背景 */
  --gray-100: #1a1c22;   /* 次级背景 */
  --gray-200: #262930;   /* 卡片背景 */
  --gray-300: #363942;   /* 边框 */
  --gray-500: #9aa0ac;   /* 次要文字 */
  --gray-700: #e0e2e8;   /* 主要文字 */

  /* ===== 语义化变量 ===== */
  --bg: var(--gray-50);
  --card-bg: var(--gray-200);
  --surface: var(--gray-100);
  --text: var(--gray-700);
  --text-secondary: var(--gray-500);
  --text-tertiary: #6c707a;
  --border: var(--gray-300);
  --border-light: var(--gray-100);

  /* ===== 阴影 ===== */
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-inset: inset 0 2px 4px rgba(0, 0, 0, 0.2);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* ===== 深色模式 - 全局基础 ===== */
[data-theme="dark"] body {
  background: var(--bg);
  color: var(--text);
}

[data-theme="dark"] .nav-bar {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .nav-brand { color: var(--text); }
[data-theme="dark"] .nav-logo { background: var(--primary-pale); color: var(--primary-dark); }
[data-theme="dark"] .nav-title { color: var(--text); }
[data-theme="dark"] .nav-link { color: var(--text-secondary); }
[data-theme="dark"] .nav-link:hover, [data-theme="dark"] .nav-link.active {
  background: var(--primary-pale); color: var(--primary-dark);
}
[data-theme="dark"] .nav-toggle span { background: var(--text); }
[data-theme="dark"] .theme-toggle-btn {
  background: var(--card-bg); border: 1px solid var(--border); color: var(--text-secondary);
}
[data-theme="dark"] .theme-toggle-btn:hover {
  border-color: var(--primary); color: var(--primary); background: var(--primary-pale);
}
[data-theme="dark"] .nav-jump-btn {
  background: var(--primary-pale); color: var(--primary-dark) !important;
}
[data-theme="dark"] .nav-jump-btn:hover {
  background: var(--primary-light);
}

[data-theme="dark"] .bottom-nav {
  background: var(--card-bg);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.3);
  border-top: 1px solid var(--border);
}

/* ===== 深色模式 - 卡片 ===== */
[data-theme="dark"] .card {
  background: var(--card-bg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

[data-theme="dark"] .card:hover {
  box-shadow: var(--shadow-lg);
}

/* ===== 深色模式 - 表单 ===== */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

[data-theme="dark"] .form-input::placeholder,
[data-theme="dark"] .form-textarea::placeholder {
  color: var(--text-tertiary);
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-alpha);
}

[data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23a0a0b0' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
}

/* ===== 深色模式 - 按钮 ===== */
[data-theme="dark"] .btn {
  background: var(--card-bg);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

[data-theme="dark"] .btn:active {
  transform: translateY(1px);
}

[data-theme="dark"] .btn-primary {
  background: var(--primary);
  color: #1a1a2e;
  border-color: var(--primary);
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
}

[data-theme="dark"] .btn-secondary {
  background: var(--primary-pale);
  color: var(--primary-dark);
  border-color: var(--primary-light);
}

[data-theme="dark"] .btn-secondary:hover {
  background: var(--primary-light);
}

[data-theme="dark"] .btn-danger {
  background: var(--danger-pale);
  color: var(--danger-dark);
  border-color: var(--danger-light);
}

[data-theme="dark"] .btn-danger:hover {
  background: var(--danger-light);
}

[data-theme="dark"] .btn-success {
  background: var(--success-pale);
  color: var(--success-dark);
  border-color: var(--success-light);
}

[data-theme="dark"] .btn-success:hover {
  background: var(--success-light);
}

/* ===== 深色模式 - 模态框 ===== */
[data-theme="dark"] .modal-overlay {
  background: rgba(0,0,0,0.7);
}

[data-theme="dark"] .modal-box {
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

/* ===== 深色模式 - Toast ===== */
[data-theme="dark"] .toast {
  background: rgba(30,42,69,0.95);
  color: var(--text);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .toast.success { background: var(--success); color: #1a1a2e; border: none; }
[data-theme="dark"] .toast.error { background: var(--danger); color: #fff; border: none; }
[data-theme="dark"] .toast.warning { background: var(--warning); color: #1a1a2e; border: none; }
[data-theme="dark"] .toast.info { background: var(--primary); color: #1a1a2e; border: none; }

/* ===== 深色模式 - 折叠面板 ===== */
[data-theme="dark"] .collapsible {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .collapsible-header {
  background: var(--card-bg);
}

[data-theme="dark"] .collapsible-header:hover {
  box-shadow: var(--shadow-inset);
}

[data-theme="dark"] .collapsible-body {
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  border-top: 1px solid var(--border);
}

/* ===== 深色模式 - 子导航 ===== */
[data-theme="dark"] .sub-nav-bar {
  background: var(--bg);
  box-shadow: var(--shadow-inset);
}

[data-theme="dark"] .sub-nav-item {
  color: var(--text-secondary);
}

[data-theme="dark"] .sub-nav-item.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===== 深色模式 - 标签页 ===== */
[data-theme="dark"] .tabs-wrap { border-color: var(--border); }
[data-theme="dark"] .tabs {
  background: var(--bg);
}

[data-theme="dark"] .tab {
  color: var(--text-secondary);
}

[data-theme="dark"] .tab.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===== 深色模式 - 座位图 ===== */
[data-theme="dark"] .seat-map {
  background: var(--card-bg);
}

[data-theme="dark"] .seat {
  background: var(--card-bg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
}

[data-theme="dark"] .seat-available {
  background: #1e2a45;
  color: var(--text-tertiary);
}

[data-theme="dark"] .seat-occupied {
  background: var(--card-bg);
}

[data-theme="dark"] .seat-leave {
  background: var(--warning-light);
  border-color: transparent;
}

/* ===== 深色模式 - 表格 ===== */
[data-theme="dark"] .student-table th,
[data-theme="dark"] .overview-table th,
[data-theme="dark"] .leave-table th {
  background: var(--bg);
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .student-table td,
[data-theme="dark"] .overview-table td,
[data-theme="dark"] .leave-table td {
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .student-table tbody tr:hover,
[data-theme="dark"] .overview-table tbody tr:hover {
  background: var(--primary-light);
}

/* ===== 深色模式 - 下拉菜单 ===== */
[data-theme="dark"] .nav-dropdown-menu {
  background: var(--card-bg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .nav-dropdown-item {
  color: var(--text-secondary);
}

[data-theme="dark"] .nav-dropdown-item:hover {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .nav-dropdown-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

/* ===== 深色模式 - 仪表盘 ===== */
[data-theme="dark"] .dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .dash-activity,
[data-theme="dark"] .dash-actions {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .activity-item {
  background: var(--bg);
}

[data-theme="dark"] .activity-item:hover {
  background: var(--primary-light);
}

[data-theme="dark"] .quick-btn {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .quick-btn:hover {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .hbar-track {
  background: var(--bg);
}

/* ===== 深色模式 - 开关组件 ===== */
[data-theme="dark"] .switch-slider {
  background: #2a3a5a;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

[data-theme="dark"] .switch-slider:before {
  background: #e8e8e8;
}

/* ===== 深色模式 - 操作日志 ===== */
[data-theme="dark"] .log-item {
  background: var(--bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .log-type-setting,
[data-theme="dark"] .log-type-backup {
  color: var(--text-secondary);
}

/* ===== 深色模式 - 自动备份 ===== */
[data-theme="dark"] .auto-backup-status-item {
  background: var(--bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .backup-file-item {
  background: var(--bg);
  border: 1px solid var(--border);
}

/* ===== 深色模式 - 其他杂项 ===== */
[data-theme="dark"] .range-banner {
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .student-chip {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .hw-toolbar {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .hw-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .leave-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .task-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .monthly-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .overview-stat-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .data-badge {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .custom-robot-item {
  background: var(--card-bg);
  border-color: var(--border);
}

[data-theme="dark"] .custom-robot-name {
  color: var(--text);
}

[data-theme="dark"] .custom-robot-desc {
  color: var(--text-secondary);
}

[data-theme="dark"] .custom-robot-meta {
  color: var(--text-tertiary);
}

[data-theme="dark"] .status-active {
  background: var(--success-light);
  color: var(--success);
}

[data-theme="dark"] .status-inactive {
  background: var(--bg);
  color: var(--text-tertiary);
}

[data-theme="dark"] .day-checkbox {
  background: var(--bg);
  color: var(--text-secondary);
}

[data-theme="dark"] .hw-completed-toggle {
  background: var(--success-light);
  border: 1px solid var(--border);
}

[data-theme="dark"] .hw-completed-list {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: none;
}

[data-theme="dark"] .leave-today-item {
  background: var(--warning-light);
  border: 1px solid var(--border);
}

[data-theme="dark"] .filter-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .filter-chip {
  background: var(--bg);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

[data-theme="dark"] .filter-chip.active {
  background: var(--primary-light);
  color: var(--primary);
}

[data-theme="dark"] .empty-state {
  color: var(--text-tertiary);
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg, var(--card-bg) 25%, #1e2a45 50%, var(--card-bg) 75%);
}

[data-theme="dark"] .conflict-version {
  background: var(--card-bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .ba-student-item {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .ba-preview-card {
  background: var(--bg);
  border: 1px solid var(--border);
}

[data-theme="dark"] .seg-control {
  background: var(--bg);
}

[data-theme="dark"] .seg-btn {
  color: var(--text-secondary);
}

[data-theme="dark"] .seg-btn.active {
  background: var(--card-bg);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .offline-banner {
  background: var(--warning);
  color: #1a1a2e;
}


/* ===== iPhone 13 Pro (390px) 深度优化补充 ===== */
@media (max-width: 420px) {
  /* 确保底部导航5个tab均匀分布，不拥挤 */
  .bottom-nav {
    gap: 0;
    padding: 2px 4px 0;
  }
  .bottom-nav-item {
    padding: 2px 0;
    min-height: 48px;
    gap: 1px;
  }
  .bottom-nav-icon {
    width: 20px;
    height: 20px;
  }
  .bottom-nav-label {
    font-size: 0.56rem;
    font-weight: 500;
    line-height: 1.1;
  }

  /* 按钮最小点击区域 44x44px */
  .btn {
    min-height: 44px;
    min-width: 44px;
    align-items: center;
    justify-content: center;
  }
  .btn-sm {
    min-height: 36px;
    min-width: 36px;
  }
  .btn-xs {
    min-height: 28px;
    min-width: 28px;
  }

  /* 表单输入框确保16px字体，防止iOS Safari自动缩放 */
  .form-input,
  .form-select,
  .form-textarea,
  input[type="date"],
  input[type="time"],
  input[type="text"],
  input[type="password"],
  input[type="number"],
  input[type="email"],
  select,
  textarea {
    font-size: 16px !important;
  }

  /* 模态框最大高度85vh，内容可滚动 */
  .modal-box {
    max-height: 85vh !important;
    width: calc(100% - 20px);
    padding: 14px !important;
  }
  .modal-overlay {
    padding: 10px;
  }

  /* 安全区域适配 */
  .nav-bar {
    padding-top: env(safe-area-inset-top, 0);
    height: calc(var(--nav-height) + env(safe-area-inset-top, 0));
  }
  body {
    padding-top: calc(var(--nav-height) + env(safe-area-inset-top, 0));
  }
  .bottom-nav {
    padding-bottom: calc(env(safe-area-inset-bottom, 0) + 4px);
    height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0));
  }
  body {
    padding-bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0));
  }

  /* 防止横向溢出 */
  .app-container {
    overflow-x: hidden;
  }
  .card {
    max-width: 100%;
    overflow-x: hidden;
  }

  /* 座位图优化 - 确保整屏至少能看到60%的座位 */
  .seat-map {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overflow-y: hidden;
  }
  .seat-grid {
    min-width: max-content;
  }
  :root {
    --seat-size: 52px;
    --seat-gap: 4px;
  }

  /* 学生详情页 - 标签页两行布局（7个tab分两排，上4下3） */
  .tabs-wrap { padding: 6px; margin-bottom: 12px; }
  .tabs {
    overflow-x: visible;
    scrollbar-width: none;
    flex-wrap: wrap;
    gap: 4px;
  }
  .tabs::-webkit-scrollbar {
    display: none;
  }
  .tab {
    flex: 0 0 calc(25% - 3px);
    flex-shrink: 0;
    padding: 8px 4px;
    font-size: 0.72rem;
    text-align: center;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    white-space: normal;
    line-height: 1.25;
    border-radius: var(--radius-xs);
    border-bottom: none;
  }
  .tab.active {
    background: var(--primary-light);
    color: var(--primary);
    border-bottom: none;
    font-weight: 600;
  }
  .tab-label {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2px;
  }
  .tab-badge {
    position: absolute;
    top: 4px;
    right: 10%;
    font-size: 0.56rem;
    min-width: 14px;
    height: 14px;
    line-height: 14px;
    padding: 0 4px;
  }

  /* 仪表盘卡片布局适配 */
  .dash-cards {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .dash-card {
    padding: 10px 8px;
  }
  .dash-card-num {
    font-size: 1.1rem;
  }
  .dash-card-label {
    font-size: 0.6rem;
  }

  /* 图表不溢出 */
  .bar-chart,
  .hbar-chart {
    overflow-x: auto;
  }

  /* 设置页表单和列表适配 */
  .switch-label {
    padding: 10px 0;
  }
  .auto-backup-config {
    grid-template-columns: 1fr;
  }

  /* 操作日志列表适配 */
  .log-item {
    flex-wrap: wrap;
  }
  .log-time {
    order: 3;
    width: 100%;
    padding-top: 0;
  }
  .log-type-tag {
    order: 1;
  }
  .log-content {
    order: 2;
  }

  /* 备份文件列表适配 */
  .backup-file-item {
    flex-wrap: wrap;
  }
  .backup-file-actions {
    width: 100%;
    justify-content: flex-end;
    margin-top: 6px;
  }

  /* Toast位置调整 */
  .toast {
    bottom: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom, 0) + 12px);
    max-width: calc(100% - 32px);
  }

  /* 离线提示条位置 */
  .offline-banner {
    top: calc(var(--nav-height) + env(safe-area-inset-top, 0));
  }

  /* 主题切换按钮在移动端适配 */
  .theme-toggle-btn {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
    margin-left: 4px;
  }
}

/* 针对390px及以下的更精细调整 */
@media (max-width: 390px) {
  :root {
    --seat-size: 48px;
    --seat-gap: 3px;
  }
  .seat-id { font-size: 0.55rem; }
  .seat-nickname { font-size: 0.7rem; }
  .seat-realname { font-size: 0.55rem; }

  .bottom-nav-label {
    font-size: 0.52rem;
  }
  .bottom-nav-icon {
    width: 18px;
    height: 18px;
  }

  .nav-title {
    font-size: 0.8rem;
  }
  .nav-logo {
    font-size: 0.68rem;
  }
}

/* 跨工作台跳转按钮 */
.nav-jump-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 10px;
  margin-left: 12px;
  background: var(--primary-pale);
  color: var(--primary-dark) !important;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-jump-btn:hover {
  background: var(--primary-light);
}
.nav-jump-btn svg {
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .nav-jump-btn span {
    display: none;
  }
  .nav-jump-btn {
    padding: 6px;
    margin-left: 8px;
  }
}
/* ===== 性格分析 · 六维打分与群体分析 ===== */

/* 分数进度条（通用） */
.ca-score-bar {
  position: relative;
  height: 18px;
  background: #f0f0f0;
  border-radius: 9px;
  overflow: hidden;
  min-width: 60px;
}
.ca-score-fill {
  height: 100%;
  border-radius: 9px;
  transition: width 0.3s ease;
}
.ca-score-num {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  font-weight: 600;
  color: #333;
  line-height: 1;
}

/* 群体分析模块间距 */
.ca-group-section {
  margin-bottom: 28px;
}
.ca-group-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-bottom: 12px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border-light);
}

/* 快照切换条 */
.ca-snapshot-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 8px;
}
.ca-snap-btn {
  padding: 4px 12px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 14px;
  font-size: 12px;
  cursor: pointer;
  color: #555;
  transition: all 0.2s;
}
.ca-snap-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.ca-snap-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 班级整体画像 */
.ca-class-summary {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 16px;
}
.ca-class-overall {
  font-size: 13px;
  color: #444;
  line-height: 1.6;
  margin-bottom: 12px;
}
.ca-avg-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ca-avg-item {
  flex: 1;
  min-width: 90px;
  text-align: center;
  background: #fff;
  border-radius: 8px;
  padding: 10px 6px;
  position: relative;
  border: 1px solid #eee;
}
.ca-avg-item.strong {
  border-color: #27ae60;
  background: #eafaf1;
}
.ca-avg-item.weak {
  border-color: #e74c3c;
  background: #fdecea;
}
.ca-avg-label {
  font-size: 12px;
  color: #666;
  margin-bottom: 4px;
}
.ca-avg-val {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}
.ca-avg-tag {
  position: absolute;
  top: -8px;
  right: 8px;
  background: #27ae60;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
}
.ca-avg-tag.weak-tag {
  background: #e74c3c;
}

/* 维度总表 */
.ca-dim-table {
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  overflow: hidden;
  font-size: 12px;
}
.ca-dim-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid #eee;
  transition: background 0.15s;
}
.ca-dim-row:last-child {
  border-bottom: none;
}
.ca-dim-row:hover {
  background: #f5f8ff;
}
.ca-dim-row.ca-dim-head {
  background: #f0f2f5;
  font-weight: 600;
  color: #333;
}
.ca-dim-cell {
  padding: 8px 6px;
  text-align: center;
  flex-shrink: 0;
}
.ca-dim-cell.ca-dim-name {
  flex: 0 0 70px;
  font-weight: 500;
  text-align: left;
  padding-left: 10px;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-dim-cell.ca-dim-score {
  flex: 1;
  min-width: 70px;
  padding: 8px 8px;
}
.ca-dim-cell.ca-dim-label {
  flex: 0 0 80px;
  font-size: 11px;
  color: #888;
  text-align: left;
  padding-right: 10px;
}

/* 维度排行榜 */
.ca-dim-rank {
  background: #fafafa;
  border-radius: 8px;
  padding: 12px 16px;
}
.ca-dim-rank-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.ca-dim-rank-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ca-dim-rank-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s;
}
.ca-dim-rank-item:hover {
  background: #f0f5ff;
}
.ca-dim-rank-item.top1 .ca-rank-idx {
  background: #f1c40f;
  color: #fff;
}
.ca-dim-rank-item.top2 .ca-rank-idx {
  background: #bdc3c7;
  color: #fff;
}
.ca-dim-rank-item.top3 .ca-rank-idx {
  background: #cd7f32;
  color: #fff;
}
.ca-dim-rank-item.bottom1 .ca-rank-idx,
.ca-dim-rank-item.bottom2 .ca-rank-idx,
.ca-dim-rank-item.bottom3 .ca-rank-idx {
  background: #e74c3c;
  color: #fff;
}
.ca-rank-idx {
  flex: 0 0 24px;
  height: 24px;
  line-height: 24px;
  text-align: center;
  background: #ddd;
  color: #666;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
}
.ca-rank-name {
  flex: 0 0 60px;
  font-size: 12px;
  font-weight: 500;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ca-dim-rank-item .ca-score-bar {
  flex: 1;
  min-width: 100px;
}
.ca-rank-reason {
  flex: 0 0 auto;
  font-size: 11px;
  color: #888;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 风险分层 */
.ca-risk-layers {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ca-risk-layer {
  border-radius: 8px;
  padding: 12px 16px;
  border-left: 4px solid #ccc;
}
.ca-risk-layer.ca-risk-high {
  background: #fdecea;
  border-left-color: #e74c3c;
}
.ca-risk-layer.ca-risk-med {
  background: #fef5e7;
  border-left-color: #f39c12;
}
.ca-risk-layer.ca-risk-low {
  background: #eafaf1;
  border-left-color: #27ae60;
}
.ca-risk-layer-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}
.ca-risk-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.ca-risk-count {
  margin-left: auto;
  font-size: 12px;
  color: #666;
  font-weight: 400;
}
.ca-risk-student-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.ca-risk-student {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px 10px;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 11px;
  transition: transform 0.15s;
}
.ca-risk-student:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.ca-risk-sname {
  font-weight: 600;
  color: #333;
  font-size: 12px;
}
.ca-risk-sdims {
  color: #888;
  font-size: 10px;
}
.ca-risk-layer-desc {
  font-size: 12px;
  color: #666;
  line-height: 1.5;
}

/* 行为-维度关联卡片 */
.ca-behavior-links {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.ca-behavior-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.5;
}
.ca-behavior-name {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}
.ca-behavior-students,
.ca-behavior-pattern,
.ca-behavior-cause {
  margin-top: 4px;
  color: #555;
}
.ca-behavior-pattern {
  color: #6c5ce7;
}

/* 学生详情页：性格分析月 tab */
.ca-month-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--border-light);
}
.ca-month-tab {
  padding: 8px 16px;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.2s;
  user-select: none;
}
.ca-month-tab:hover {
  color: var(--primary);
}
.ca-month-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 600;
}
.ca-month-content {
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 学生详情页六维分数条 */
.ca-scores-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
  padding: 12px;
  background: #f8f9fa;
  border-radius: 8px;
}
.ca-score-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ca-score-dimlabel {
  font-size: 11px;
  color: #666;
  font-weight: 500;
}

/* 性格分析模块卡片（学生详情页） */
.ca-modules {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ca-module-card {
  background: #fafafa;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
  color: #333;
}
.ca-module-title {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  margin-bottom: 6px;
}
.ca-content {
  white-space: pre-wrap;
  word-break: break-word;
  color: #444;
}

/* 响应式 */
@media (max-width: 640px) {
  .ca-dim-cell.ca-dim-name { flex: 0 0 55px; font-size: 11px; padding-left: 6px; }
  .ca-dim-cell.ca-dim-score { min-width: 50px; padding: 6px 4px; }
  .ca-dim-cell.ca-dim-label { display: none; }
  .ca-rank-reason { display: none; }
  .ca-behavior-links { grid-template-columns: 1fr; }
  .ca-avg-row { gap: 6px; }
  .ca-avg-item { min-width: 70px; padding: 8px 4px; }
  .ca-avg-val { font-size: 18px; }
}


/* ===== 性格分析：控制区布局 ===== */
.ca-controls {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ca-controls-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.ca-btn-row {
  justify-content: flex-start;
}
.ca-btn-row .btn {
  flex: 0 0 auto;
}

/* ===== 性格分析：月份切换条（座位图上方二级目录） ===== */
.ca-monthbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  margin-bottom: 10px;
  background: var(--bg-secondary, #f8f9fb);
  border: 1px solid var(--border-light);
  border-radius: 10px;
}
.ca-monthbar-label {
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-right: 2px;
}
.ca-monthbar-btn {
  padding: 5px 12px;
  font-size: 13px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
}
.ca-monthbar-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.ca-monthbar-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}
.ca-monthbar-hint {
  font-size: 12px;
  color: #999;
  margin-left: auto;
}

/* ===== 弹窗内月份切换按钮（5列2排网格） ===== */
.ca-modal-months {
  margin-bottom: 12px;
}
.ca-modal-months-title {
  font-size: 12px;
  color: #888;
  margin-bottom: 6px;
}
.ca-month-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}
.ca-month-btn {
  padding: 7px 4px;
  font-size: 13px;
  text-align: center;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: #fff;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ca-month-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.ca-month-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* ===== 月份对照视图 ===== */
.cmp-score-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border-light);
  font-size: 14px;
}
.cmp-score-row:last-child {
  border-bottom: none;
}
.cmp-dim {
  flex: 0 0 88px;
  font-weight: 600;
}
.cmp-val {
  min-width: 28px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
}
.cmp-arrow {
  color: #aaa;
}
.cmp-delta {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 10px;
}
.cmp-up {
  color: #16a34a;
  background: rgba(34, 197, 94, 0.12);
}
.cmp-down {
  color: #dc2626;
  background: rgba(239, 68, 68, 0.1);
}
.cmp-flat {
  color: #888;
  background: rgba(0, 0, 0, 0.04);
}
.cmp-sent {
  padding: 2px 0;
  line-height: 1.7;
}
.cmp-sent.cmp-added {
  color: #15803d;
  background: rgba(34, 197, 94, 0.08);
  border-radius: 4px;
  padding: 2px 6px;
}
.cmp-sent.cmp-removed {
  color: #b45309;
  background: rgba(245, 158, 11, 0.1);
  border-radius: 4px;
  padding: 2px 6px;
  text-decoration: line-through;
  text-decoration-color: rgba(180, 83, 9, 0.5);
}
.cmp-legend-line {
  display: flex;
  gap: 12px;
  font-size: 12px;
  margin-bottom: 6px;
}
.cmp-legend-line .cmp-added {
  color: #15803d;
}
.cmp-legend-line .cmp-removed {
  color: #b45309;
}


/* ===== 待办分类选择器 ===== */
.todo-category-selector {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.todo-cat-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 6px;
  border: 1.5px solid var(--border-color, #e5e7eb);
  border-radius: 10px;
  background: var(--card-bg, #fff);
  cursor: pointer;
  transition: all 0.2s;
}
.todo-cat-btn:hover {
  border-color: #a5b4fc;
  background: rgba(99, 102, 241, 0.04);
}
.todo-cat-btn.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
}
.todo-cat-icon { font-size: 20px; }
.todo-cat-label { font-size: 12px; color: var(--text-secondary, #6b7280); }
.todo-cat-btn.active .todo-cat-label { color: #6366f1; font-weight: 600; }

/* ===== 班级待办选学生 - 紧凑小名模式（座位图布局） ===== */
.todo-multi-select.compact-nickname .todo-ms-seat-grid.compact-seat-grid {
  gap: 4px;
}
.todo-multi-select.compact-nickname .todo-ms-seat.compact-seat {
  width: 100%;
  height: 28px;
  line-height: 28px;
  padding: 0 4px;
  font-size: 12px;
  border-radius: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
.todo-multi-select.compact-nickname .todo-ms-seat.compact-empty {
  height: 28px;
  border-radius: 6px;
}
.todo-multi-select.compact-nickname .todo-ms-seat.compact-seat:hover {
  border-color: var(--primary, #6366f1);
}
.todo-multi-select.compact-nickname .todo-ms-seat.compact-seat.selected {
  border-color: var(--primary, #6366f1);
  background: rgba(99, 102, 241, 0.12);
  color: var(--primary, #6366f1);
  font-weight: 600;
}

/* ===== 待办排序按钮 ===== */
.todo-sort-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  margin-bottom: 10px;
}
.todo-sort-label {
  font-size: 12px;
  color: var(--text-secondary, #6b7280);
  margin-right: 4px;
}
.todo-sort-btn {
  padding: 4px 10px;
  font-size: 12px;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 12px;
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #6b7280);
  cursor: pointer;
  transition: all 0.2s;
}
.todo-sort-btn:hover {
  border-color: #a5b4fc;
  color: #6366f1;
}
.todo-sort-btn.active {
  border-color: #6366f1;
  background: rgba(99, 102, 241, 0.08);
  color: #6366f1;
  font-weight: 600;
}
.todo-sort-btn .sort-arrow { font-size: 10px; margin-left: 2px; }


/* ================================================
   办公优化样式 - Office Optimization
   适配：PC Edge + iPhone 13 Pro Safari PWA
   日间/夜间双模式优化
   ================================================ */

/* ===== 日间模式优化变量 ===== */
:root {
  --office-bg: #f5f6f8;
  --office-card: #ffffff;
  --office-surface: #fafbfc;
  --office-text: #1f2328;
  --office-text-secondary: #57606a;
  --office-text-tertiary: #8b949e;
  --office-border: #e4e7eb;
  --office-border-light: #eef0f3;
  --office-primary: #4f6ef7;
  --office-primary-hover: #3f5ae0;
  --office-primary-light: rgba(79, 110, 247, 0.1);
  --office-shadow-sm: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --office-shadow: 0 2px 8px rgba(0,0,0,0.06), 0 4px 16px rgba(0,0,0,0.04);
  --office-shadow-lg: 0 8px 24px rgba(0,0,0,0.08), 0 16px 48px rgba(0,0,0,0.06);
  --office-radius: 12px;
  --office-radius-sm: 8px;
  --office-radius-lg: 16px;
}

/* 覆盖基础变量 - 日间模式更清晰的办公配色 */
:root {
  --bg: var(--office-bg);
  --card-bg: var(--office-card);
  --surface: var(--office-surface);
  --text: var(--office-text);
  --text-secondary: var(--office-text-secondary);
  --text-tertiary: var(--office-text-tertiary);
  --primary: var(--office-primary);
  --primary-light: var(--office-primary-light);
  --primary-dark: var(--office-primary-hover);
  --border: var(--office-border);
  --border-light: var(--office-border-light);
  --shadow: var(--office-shadow-sm);
  --shadow-lg: var(--office-shadow);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.03);
  --radius: var(--office-radius);
  --radius-sm: var(--office-radius-sm);
  /* 兼容变量 */
  --bg-primary: var(--office-card);
  --bg-secondary: var(--office-surface);
  --bg-tertiary: #f0f2f5;
  --bg-inset: #f0f2f5;
  --primary-color: var(--office-primary);
  --text-primary: var(--office-text);
  --border-color: var(--office-border);
  --radius-md: var(--office-radius);
}

/* ===== 夜间模式优化变量 ===== */
[data-theme="dark"] {
  --office-bg: #0f1115;
  --office-card: #181b21;
  --office-surface: #1c1f26;
  --office-text: #e6e8eb;
  --office-text-secondary: #9ba1a9;
  --office-text-tertiary: #6b7280;
  --office-border: #2a2f38;
  --office-border-light: #23272f;
  --office-primary: #6d8bff;
  --office-primary-hover: #8aa3ff;
  --office-primary-light: rgba(109, 139, 255, 0.15);
  --office-shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --office-shadow: 0 4px 12px rgba(0,0,0,0.4);
  --office-shadow-lg: 0 12px 32px rgba(0,0,0,0.5);
}

[data-theme="dark"] {
  --bg: var(--office-bg);
  --card-bg: var(--office-card);
  --surface: var(--office-surface);
  --text: var(--office-text);
  --text-secondary: var(--office-text-secondary);
  --text-tertiary: var(--office-text-tertiary);
  --primary: var(--office-primary);
  --primary-light: var(--office-primary-light);
  --primary-dark: var(--office-primary-hover);
  --border: var(--office-border);
  --border-light: var(--office-border-light);
  --shadow: var(--office-shadow-sm);
  --shadow-lg: var(--office-shadow);
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-inset: inset 0 1px 3px rgba(0,0,0,0.3);
  /* 兼容变量 */
  --bg-primary: var(--office-card);
  --bg-secondary: var(--office-surface);
  --bg-tertiary: #23272f;
  --bg-inset: #23272f;
  --primary-color: var(--office-primary);
  --text-primary: var(--office-text);
  --border-color: var(--office-border);
}

/* ===== 全局排版优化 ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans CJK SC', sans-serif;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* 标题层级优化 */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
}

/* ===== 导航栏优化 ===== */
.nav-bar {
  background: var(--card-bg) !important;
  border-bottom: 1px solid var(--border);
  box-shadow: none !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

.nav-title {
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
}

/* ===== 卡片优化 ===== */
.card {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  box-shadow: var(--shadow-sm) !important;
  transition: box-shadow 0.2s var(--ease-out), transform 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

.card:hover {
  box-shadow: var(--shadow) !important;
  border-color: var(--primary-light) !important;
}

/* ===== 按钮优化 ===== */
.btn {
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--office-radius-sm) !important;
  transition: all 0.15s var(--ease-out);
  border: 1px solid var(--border) !important;
  background: var(--card-bg);
  color: var(--text);
}

.btn:hover {
  border-color: var(--primary) !important;
  color: var(--primary);
}

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

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

.btn-secondary {
  background: var(--bg-tertiary) !important;
  border-color: var(--border) !important;
  color: var(--text-secondary) !important;
}

.btn-secondary:hover {
  background: var(--border-light) !important;
  color: var(--text) !important;
}

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

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

/* ===== 模态框优化 ===== */
.modal-overlay {
  background: rgba(0, 0, 0, 0.45) !important;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content,
.modal-box {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--office-radius-lg) !important;
  box-shadow: var(--office-shadow-lg) !important;
  animation: modalSlideUp 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.modal-header {
  border-bottom: 1px solid var(--border-light) !important;
  padding: 18px 24px !important;
}

.modal-actions {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  margin-top: 20px !important;
}

/* ===== 输入框优化 ===== */
.form-input,
.form-select,
.form-textarea,
.todo-input-textarea {
  background: var(--card-bg) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--office-radius-sm) !important;
  color: var(--text) !important;
  font-size: 14px !important;
  line-height: 1.5;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-shadow: none !important;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus,
.todo-input-textarea:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--primary-light) !important;
  outline: none;
}

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

/* ===== 待办弹窗标题/副标题 ===== */
.todo-input-title {
  font-size: 17px !important;
  font-weight: 600 !important;
  color: var(--text) !important;
  letter-spacing: -0.01em;
  margin-bottom: 4px !important;
}

.todo-input-subtitle {
  font-size: 13px !important;
  color: var(--text-secondary) !important;
  margin-bottom: 16px !important;
  line-height: 1.5;
}

/* ===== 待办弹窗操作按钮区 ===== */
.todo-input-actions {
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  margin-top: 16px !important;
}

.todo-input-actions .btn {
  min-width: 80px;
  height: 38px;
  font-size: 14px;
  border-radius: var(--office-radius-sm);
}

/* ===== 标签/徽章优化 ===== */
.student-chip,
.data-badge {
  border-radius: 6px !important;
  font-size: 12px !important;
  padding: 4px 10px !important;
}

/* ===== 列表项优化 ===== */
.activity-item,
.log-item,
.todo-item {
  border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}

.activity-item:hover,
.log-item:hover {
  background: var(--bg-secondary);
}

/* ===== 底部导航优化 ===== */
.bottom-nav {
  background: var(--card-bg) !important;
  border-top: 1px solid var(--border);
  box-shadow: 0 -1px 3px rgba(0,0,0,0.04) !important;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
}

/* ===== 提示消息优化 ===== */
.toast {
  font-size: 14px !important;
  padding: 12px 20px !important;
  border-radius: 10px !important;
  box-shadow: var(--office-shadow-lg) !important;
  font-weight: 500;
}

/* ===== 空状态优化 ===== */
.empty-state {
  color: var(--text-tertiary);
}

.empty-state-icon {
  opacity: 0.5;
}

/* ===== 夜间模式：模态框遮罩更深 ===== */
[data-theme="dark"] .modal-overlay {
  background: rgba(0, 0, 0, 0.6) !important;
}

/* ===== 夜间模式：输入框背景更深 ===== */
[data-theme="dark"] .form-input,
[data-theme="dark"] .form-select,
[data-theme="dark"] .form-textarea,
[data-theme="dark"] .todo-input-textarea {
  background: var(--office-surface) !important;
}

[data-theme="dark"] .form-input:focus,
[data-theme="dark"] .form-select:focus,
[data-theme="dark"] .form-textarea:focus,
[data-theme="dark"] .todo-input-textarea:focus {
  border-color: var(--primary) !important;
}

/* ===== 夜间模式：卡片边框更明显 ===== */
[data-theme="dark"] .card {
  border-color: var(--border) !important;
}

/* ================================================
   移动端优化 - iPhone 13 Pro / Safari PWA
   ================================================ */

@media (max-width: 768px) {
  /* 基础字号优化 - 适配移动端阅读 */
  html {
    font-size: 15px;
  }

  body {
    line-height: 1.6;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* 导航栏高度适配 */
  .nav-bar {
    height: calc(var(--nav-height, 56px) + env(safe-area-inset-top, 0px));
    padding-top: env(safe-area-inset-top, 0px);
  }

  /* 模态框移动端适配 */
  .modal-overlay {
    padding: 0 !important;
    align-items: flex-end;
  }

  .modal-content,
  .modal-box {
    max-width: 100% !important;
    max-height: 88vh !important;
    border-radius: 16px 16px 0 0 !important;
    padding: 20px 16px !important;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)) !important;
    animation: modalSlideUpMobile 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  @keyframes modalSlideUpMobile {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  /* 待办弹窗移动端 */
  .todo-input-modal {
    width: 100% !important;
    max-width: 100% !important;
    padding: 20px 16px !important;
  }

  /* 按钮移动端触摸目标 */
  .btn {
    min-height: 44px;
    font-size: 15px;
  }

  .todo-input-actions .btn {
    min-height: 44px;
    font-size: 15px;
  }

  /* 输入框移动端优化 */
  .form-input,
  .form-select,
  .form-textarea,
  .todo-input-textarea {
    font-size: 16px !important; /* 防止 iOS 缩放 */
    min-height: 44px;
    padding: 10px 12px !important;
  }

  .todo-input-textarea {
    min-height: 100px !important;
  }

  /* 卡片间距移动端 */
  .card {
    border-radius: var(--office-radius) !important;
  }

  /* 底部导航安全区 */
  .bottom-nav {
    padding-bottom: env(safe-area-inset-bottom, 0px);
    height: calc(60px + env(safe-area-inset-bottom, 0px));
  }

  /* 座位图底部按钮安全区 */
  .seats-bottom-bar {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* 列表项行高移动端 */
  .activity-item,
  .log-item {
    padding: 12px 0;
  }

  /* 标题字号移动端 */
  .modal-title,
  .todo-input-title {
    font-size: 16px !important;
  }

  /* Toast 移动端位置 */
  .toast {
    bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
    max-width: 85% !important;
  }
}

/* PWA 独立模式优化 */
@media (display-mode: standalone) {
  body {
    padding-top: calc(var(--nav-height) + env(safe-area-inset-top, 0px));
  }

  .nav-bar {
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(var(--nav-height, 56px) + env(safe-area-inset-top, 0px));
  }
}

/* iPhone 13 Pro 特定优化 (390px 宽) */
@media (max-width: 420px) {
  .seats-bottom-btn {
    min-width: 80px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }
}

/* ================================================
   滚动条美化（仅桌面端）
   ================================================ */

@media (min-width: 769px) {
  ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
  }

  ::-webkit-scrollbar-track {
    background: transparent;
  }

  ::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
  }

  ::-webkit-scrollbar-thumb:hover {
    background: var(--text-tertiary);
  }
}

/* ===== 选中文本颜色 ===== */
::selection {
  background: var(--primary-light);
  color: var(--primary-dark);
}


/* ================================================
   座位卡片边界优化 - Seat Card Border Enhancement
   日间/夜间模式都增加清晰的边框
   ================================================ */

/* 日间模式：座位卡片加细边框，边界更清晰 */
.seat {
  border: 1px solid var(--office-border, #e4e7eb) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03) !important;
}

.seat-occupied {
  background: var(--office-card, #ffffff) !important;
}

.seat-available {
  background: var(--success-light) !important;
  border-color: rgba(91, 168, 137, 0.3) !important;
}

.seat-leave {
  background: var(--warning-light) !important;
  border-color: rgba(240, 160, 75, 0.4) !important;
}

.seat:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
  border-color: var(--office-primary, #4f6ef7) !important;
}

/* 深色模式：座位卡片边框更明显 */
[data-theme="dark"] .seat {
  border: 1px solid var(--office-border, #2a2f38) !important;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2) !important;
}

[data-theme="dark"] .seat-occupied {
  background: var(--office-card, #181b21) !important;
}

[data-theme="dark"] .seat-available {
  background: rgba(112, 196, 160, 0.1) !important;
  border-color: rgba(112, 196, 160, 0.3) !important;
}

[data-theme="dark"] .seat-leave {
  background: rgba(240, 176, 96, 0.12) !important;
  border-color: rgba(240, 176, 96, 0.35) !important;
}

[data-theme="dark"] .seat:hover {
  border-color: var(--office-primary, #6d8bff) !important;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3) !important;
}

/* 座位待办按钮深色模式 */
[data-theme="dark"] .seat-todo-btn {
  background: rgba(109, 139, 255, 0.12) !important;
  color: var(--office-primary, #6d8bff) !important;
}

[data-theme="dark"] .seat-todo-btn:hover {
  background: rgba(109, 139, 255, 0.2) !important;
}

/* 座位图容器深色模式 */
[data-theme="dark"] .seat-map {
  background: var(--office-bg, #0f1115) !important;
  border-color: var(--office-border, #2a2f38) !important;
}


/* ================================================
   学生档案 - 简历风格展示
   Student Profile - Resume Style
   ================================================ */

.profile-section {
  margin-bottom: 24px;
}

.profile-section:last-child {
  margin-bottom: 0;
}

.profile-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: none;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1.5px solid var(--primary);
  display: inline-block;
}

.profile-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
}

.profile-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-info-item--full {
  grid-column: 1 / -1;
}

.profile-info-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  line-height: 1.4;
}

.profile-info-value {
  font-size: 15px;
  color: var(--text);
  font-weight: 500;
  line-height: 1.5;
  word-break: break-all;
}

.profile-highlight {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary);
}

.profile-empty {
  color: var(--text-tertiary);
  font-weight: 400;
  font-size: 14px;
}

.profile-clickable {
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s;
  border-bottom: 1px dashed var(--text-tertiary);
}

.profile-clickable:hover {
  opacity: 0.7;
}

/* 移动端：单列布局 */
@media (max-width: 480px) {
  .profile-info-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .profile-info-value {
    font-size: 14px;
  }

  .profile-highlight {
    font-size: 15px;
  }

  .profile-section {
    margin-bottom: 20px;
  }
}

/* 深色模式 */
[data-theme="dark"] .profile-section-title {
  color: var(--text-secondary);
  border-bottom-color: var(--primary);
}

[data-theme="dark"] .profile-info-label {
  color: var(--text-tertiary);
}

[data-theme="dark"] .profile-info-value {
  color: var(--text);
}

[data-theme="dark"] .profile-empty {
  color: var(--text-tertiary);
}

[data-theme="dark"] .profile-clickable {
  border-bottom-color: var(--text-tertiary);
}

/* 性格分析块简历风格优化 */
.ca-block {
  margin-bottom: 12px;
}

.ca-label {
  font-size: 12px;
  color: var(--text-tertiary);
  font-weight: 500;
  margin-bottom: 6px;
}

.ca-text {
  font-size: 14px;
  color: var(--text);
  line-height: 1.7;
  background: var(--bg-secondary);
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
}

[data-theme="dark"] .ca-text {
  background: var(--office-surface, #1c1f26);
  border-left-color: var(--primary);
}

/* ================================================
   深度性格分析 - 七步分析结果格式化
   Deep Character Analysis - Formatted Output
   ================================================ */

.ca-analysis {
  line-height: 1.65;
  font-size: 13px;
}

/* --- 每一步的卡片容器 --- */
.ca-step {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e2e5ea);
  background: var(--card-bg, #fff);
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.05);
}
.ca-step:last-child { margin-bottom: 0; }

/* --- 步骤标题栏 --- */
.ca-step-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(135deg, var(--primary, #4a7abc), var(--primary-dark, #3a629c));
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: 0.02em;
}
.ca-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.ca-step-name { flex: 1; line-height: 1.4; }

/* --- 步骤内容区 --- */
.ca-step-body {
  padding: 14px 18px;
}

/* --- 假设分组标题（1.性格特点 2.成长环境...） --- */
.ca-hyp-group {
  margin: 12px 0 8px;
}
.ca-hyp-group:first-child { margin-top: 0; }
.ca-hyp-group-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--primary, #4a7abc);
  padding-left: 10px;
  border-left: 3px solid var(--primary, #4a7abc);
  margin-bottom: 8px;
  line-height: 1.4;
}

/* --- 可折叠假设卡片 --- */
.ca-card {
  margin: 6px 0;
  border-radius: 8px;
  border: 1px solid var(--border-color, #e2e5ea);
  overflow: hidden;
  background: var(--bg-secondary, #f8fafc);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.ca-card.open {
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.06);
  border-color: var(--primary, #4a7abc);
}
.ca-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.ca-card-head:hover {
  background: rgba(74, 122, 188, 0.06);
}
.ca-card-arrow {
  font-size: 12px;
  color: var(--primary, #4a7abc);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  font-weight: 700;
}
.ca-card.open .ca-card-arrow {
  transform: rotate(90deg);
}
.ca-card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text, #1f232b);
  line-height: 1.5;
  flex: 1;
}
.ca-card-body {
  display: none;
  padding: 6px 14px 12px;
  border-top: 1px solid var(--border-color, #e2e5ea);
  margin: 0 0 0 0;
}
.ca-card.open .ca-card-body {
  display: block;
}

/* --- 字段行（假设内容/支持证据等） --- */
.ca-field {
  display: flex;
  gap: 6px;
  margin: 6px 0;
  font-size: 13px;
  line-height: 1.6;
  align-items: flex-start;
}
.ca-field-k {
  font-weight: 600;
  color: var(--primary, #4a7abc);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 64px;
}
.ca-field-v {
  flex: 1;
  color: var(--text, #1f232b);
}
.ca-field-v strong {
  color: var(--text, #1f232b);
}

/* --- 项目符号列表 --- */
.ca-bullets {
  margin: 6px 0;
  padding-left: 16px;
  list-style: none;
}
.ca-bullets li {
  position: relative;
  padding: 2px 0 2px 12px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text, #1f232b);
}
.ca-bullets li strong {
  font-weight: 400;
}
.ca-bullets li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary, #4a7abc);
}

/* --- 普通段落 --- */
.ca-para {
  font-size: 13px;
  line-height: 1.65;
  margin: 4px 0;
  color: var(--text, #1f232b);
}
.ca-para strong {
  color: var(--text, #1f232b);
}

/* --- 风险等级标签 --- */
.ca-risk {
  display: inline-flex;
  align-items: center;
  padding: 6px 18px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 700;
  margin: 10px 0;
}
.ca-risk-low { background: rgba(61, 165, 112, 0.12); color: #2d8a5e; border: 1px solid rgba(61, 165, 112, 0.2); }
.ca-risk-medium { background: rgba(224, 160, 48, 0.12); color: #b8841e; border: 1px solid rgba(224, 160, 48, 0.2); }
.ca-risk-high { background: rgba(214, 80, 80, 0.12); color: #c04545; border: 1px solid rgba(214, 80, 80, 0.2); }
.ca-risk-critical { background: rgba(214, 80, 80, 0.2); color: #c04545; border: 1px solid rgba(214, 80, 80, 0.3); font-weight: 700; }

/* --- 警告框（⚠️标记的内容） --- */
.ca-alert {
  background: rgba(214, 80, 80, 0.06);
  border: 1px solid rgba(214, 80, 80, 0.2);
  border-left: 4px solid var(--danger, #d65050);
  border-radius: 10px;
  padding: 12px 16px;
  margin: 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--danger, #d65050);
  line-height: 1.7;
}

/* --- 深色模式 --- */
[data-theme="dark"] .ca-step {
  border-color: var(--border-color, #3a3d45);
  background: var(--office-surface, #1c1f26);
  box-shadow: 0 1px 3px 0 rgba(0,0,0,0.15);
}
[data-theme="dark"] .ca-step-head {
  background: linear-gradient(135deg, var(--primary, #6b9ce0), var(--primary-dark, #4a7bc8));
}
[data-theme="dark"] .ca-hyp-group-title {
  color: var(--primary, #6b9ce0);
  border-left-color: var(--primary, #6b9ce0);
}
[data-theme="dark"] .ca-card {
  border-color: var(--border-color, #3a3d45);
  background: rgba(107, 156, 224, 0.04);
}
[data-theme="dark"] .ca-card.open {
  border-color: var(--primary, #6b9ce0);
  box-shadow: 0 2px 8px 0 rgba(0,0,0,0.2);
}
[data-theme="dark"] .ca-card-head:hover { background: rgba(107, 156, 224, 0.08); }
[data-theme="dark"] .ca-card-arrow { color: var(--primary, #6b9ce0); }
[data-theme="dark"] .ca-card-title { color: var(--text, #e5e7eb); }
[data-theme="dark"] .ca-card-body { border-top-color: var(--border-color, #3a3d45); }
[data-theme="dark"] .ca-bullets li { color: var(--text, #e5e7eb); }
[data-theme="dark"] .ca-bullets li::before { background: var(--primary, #6b9ce0); }
[data-theme="dark"] .ca-field-k { color: var(--primary, #6b9ce0); }
[data-theme="dark"] .ca-field-v { color: var(--text, #e5e7eb); }
[data-theme="dark"] .ca-field-v strong { color: var(--text, #e5e7eb); }
[data-theme="dark"] .ca-para { color: var(--text, #e5e7eb); }
[data-theme="dark"] .ca-para strong { color: var(--text, #e5e7eb); }
[data-theme="dark"] .ca-alert {
  background: rgba(232, 112, 112, 0.08);
  border-color: rgba(232, 112, 112, 0.2);
  border-left-color: var(--danger, #e87070);
  color: var(--danger, #e87070);
}
[data-theme="dark"] .ca-risk-low { background: rgba(110, 180, 140, 0.12); color: #7dba9e; border-color: rgba(110, 180, 140, 0.2); }
[data-theme="dark"] .ca-risk-medium { background: rgba(230, 180, 80, 0.12); color: #d4a850; border-color: rgba(230, 180, 80, 0.2); }
[data-theme="dark"] .ca-risk-high { background: rgba(232, 112, 112, 0.12); color: #e87070; border-color: rgba(232, 112, 112, 0.2); }
[data-theme="dark"] .ca-risk-critical { background: rgba(232, 112, 112, 0.2); color: #e87070; border-color: rgba(232, 112, 112, 0.3); }

/* --- 移动端适配 --- */
@media (max-width: 480px) {
  .ca-step { margin-bottom: 10px; }
  .ca-step-head { padding: 8px 12px; font-size: 13px; gap: 6px; }
  .ca-step-num { width: 22px; height: 22px; font-size: 11px; }
  .ca-step-body { padding: 10px 12px; }
  .ca-hyp-group-title { font-size: 12px; }
  .ca-card-head { padding: 7px 10px; }
  .ca-card-arrow { font-size: 11px; }
  .ca-card-title { font-size: 12px; }
  .ca-card-body { padding: 4px 10px 8px; }
  .ca-field, .ca-bullets li, .ca-para, .ca-alert { font-size: 12px; }
  .ca-field-k { min-width: 56px; font-size: 12px; }
  .ca-risk { font-size: 11px; padding: 3px 10px; }
}

/* --- 桌面端排版优化（min-width: 769px） --- */
@media (min-width: 769px) {
  .ca-analysis {
    font-size: 14px;
  }
  .ca-step {
    margin-bottom: 16px;
    border-radius: 12px;
  }
  .ca-step-head {
    padding: 12px 20px;
    font-size: 16px;
    gap: 12px;
  }
  .ca-step-num {
    width: 28px;
    height: 28px;
    font-size: 14px;
  }
  .ca-step-body {
    padding: 16px 22px;
  }

  .ca-hyp-group-title {
    font-size: 15px;
  }
  .ca-card-head {
    padding: 10px 16px;
  }
  .ca-card-arrow {
    font-size: 13px;
  }
  .ca-card-title {
    font-size: 14px;
  }
  .ca-card-body {
    padding: 8px 16px 14px;
  }

  .ca-field {
    margin: 8px 0;
    font-size: 14px;
    gap: 8px;
  }
  .ca-field-k {
    min-width: 72px;
    font-size: 14px;
  }

  .ca-para {
    font-size: 14px;
    line-height: 1.7;
    margin: 6px 0;
  }

  .ca-bullets {
    margin: 8px 0;
  }
  .ca-bullets li {
    font-size: 14px;
    padding: 4px 0 4px 14px;
    line-height: 1.65;
  }
  .ca-bullets li::before {
    top: 12px;
    width: 5px;
    height: 5px;
  }

  .ca-risk {
    font-size: 13px;
    padding: 5px 16px;
    margin: 8px 0;
  }
  .ca-alert {
    font-size: 14px;
    padding: 10px 16px;
    margin: 8px 0;
  }
}

/* --- 超宽屏：放大内容区域 --- */
@media (min-width: 1200px) {
  .app-container {
    max-width: 1400px;
  }
}

/* --- 桌面端：性格分析弹窗加宽 --- */
@media (min-width: 769px) {
  .modal-box.modal-wide {
    max-width: 900px;
    padding: 28px 32px;
  }
  .modal-box.modal-wide .ca-modules {
    max-height: 75vh !important;
  }
}


/* ================================================
   请假待办建议弹窗 - 步骤列表优化
   Leave Todo Suggestion - Step List Optimization
   ================================================ */

.leave-suggest-step {
  padding: 8px 10px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  margin-bottom: 8px;
}

.leave-suggest-step-num {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin-top: 3px;
}

.leave-suggest-step-input {
  flex: 1;
  min-width: 0;
  font-size: 13px !important;
  resize: none;
  min-height: 28px;
  line-height: 1.4;
  word-break: break-word;
  overflow: hidden;
  padding: 4px 8px !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 6px !important;
  background: var(--card-bg) !important;
  color: var(--text) !important;
}

.leave-suggest-step-status {
  flex: 0 0 auto;
  width: 68px;
  font-size: 11px !important;
  padding: 4px 6px !important;
  border-radius: 6px !important;
  border: 1px solid var(--border-color) !important;
  background: var(--card-bg) !important;
  color: var(--text-secondary) !important;
}

.leave-suggest-step-del {
  flex: 0 0 auto;
  font-size: 11px !important;
  padding: 4px 6px !important;
  line-height: 1;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 深色模式 */
[data-theme="dark"] .leave-suggest-step {
  background: var(--office-surface, #1c1f26);
  border-color: var(--office-border, #2a2f38);
}

[data-theme="dark"] .leave-suggest-step-input {
  background: var(--office-card, #181b21) !important;
  border-color: var(--office-border, #2a2f38) !important;
  color: var(--text) !important;
}

[data-theme="dark"] .leave-suggest-step-status {
  background: var(--office-card, #181b21) !important;
  border-color: var(--office-border, #2a2f38) !important;
  color: var(--text-secondary) !important;
}

/* 移动端进一步缩小 */
@media (max-width: 480px) {
  .leave-suggest-step-input {
    font-size: 12px !important;
  }
  .leave-suggest-step-status {
    font-size: 10px !important;
    width: 60px;
  }
  .leave-suggest-step-num {
    width: 18px;
    height: 18px;
    font-size: 10px;
  }
}


/* ================================================
   学生档案 - 海报式布局 v2
   Student Profile - Poster Layout v2
   ================================================ */

/* 顶部 Hero 区 */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 70%, #7c3aed) 100%);
  border-radius: 16px;
  margin-bottom: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.profile-hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 200px;
  height: 200px;
  background: rgba(255,255,255,0.08);
  border-radius: 50%;
}

.profile-hero::after {
  content: '';
  position: absolute;
  bottom: -30%;
  right: 10%;
  width: 120px;
  height: 120px;
  background: rgba(255,255,255,0.05);
  border-radius: 50%;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  z-index: 1;
  border: 2px solid rgba(255,255,255,0.4);
}

.profile-hero-info {
  flex: 1;
  min-width: 0;
  z-index: 1;
}

.profile-hero-name {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-focus-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fca5a5;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px #fca5a5;
  animation: focusPulse 2s ease-in-out infinite;
}

@keyframes focusPulse {
  0%, 100% { box-shadow: 0 0 0 2px #fca5a5; }
  50% { box-shadow: 0 0 0 6px rgba(252, 165, 165, 0.3); }
}

.profile-hero-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  margin-top: 2px;
  margin-bottom: 10px;
}

.profile-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.profile-hero-badge {
  font-size: 11px;
  padding: 3px 10px;
  background: rgba(255,255,255,0.2);
  color: #fff;
  border-radius: 100px;
  font-weight: 500;
  backdrop-filter: blur(4px);
}

.profile-hero-badge.badge-success {
  background: rgba(134, 239, 172, 0.25);
  color: #bbf7d0;
}

.profile-hero-badge.badge-warning {
  background: rgba(253, 224, 71, 0.25);
  color: #fef08a;
}

/* 信息标签调小调浅 */
.profile-info-label {
  font-size: 11px !important;
  color: var(--text-tertiary) !important;
  font-weight: 400 !important;
  opacity: 0.85;
}

.profile-info-value {
  font-size: 14px !important;
  font-weight: 500;
}

/* 图标按钮（圆形） */
.profile-icon-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  padding: 0;
}

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

.profile-call-btn:hover {
  background: color-mix(in srgb, var(--success) 85%, #000);
  transform: scale(1.08);
}

.profile-call-btn:active {
  transform: scale(0.95);
}

.profile-copy-btn {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color) !important;
}

.profile-copy-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary) !important;
}

.profile-copy-btn:active {
  transform: scale(0.95);
}

/* 深色模式 - Hero 区 */
[data-theme="dark"] .profile-hero {
  background: linear-gradient(135deg, var(--primary) 0%, color-mix(in srgb, var(--primary) 60%, #7c3aed) 100%);
}

[data-theme="dark"] .profile-copy-btn {
  background: var(--office-surface, #1c1f26);
  color: var(--text-secondary);
  border-color: var(--office-border, #2a2f38) !important;
}

[data-theme="dark"] .profile-copy-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary) !important;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .profile-hero {
    padding: 16px 14px;
    gap: 12px;
    border-radius: 12px;
  }

  .profile-avatar {
    width: 52px;
    height: 52px;
    font-size: 22px;
  }

  .profile-hero-name {
    font-size: 19px;
  }

  .profile-hero-sub {
    font-size: 13px;
    margin-bottom: 8px;
  }

  .profile-hero-badge {
    font-size: 10px;
    padding: 2px 8px;
  }

  .profile-info-value {
    font-size: 13px !important;
  }

  .profile-icon-btn {
    width: 26px;
    height: 26px;
  }
}


/* ================================================
   学生档案 - 海报式布局 v3（彩色卡片 + 顶部工具栏）
   ================================================ */

/* 顶部工具栏 */
.profile-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  backdrop-filter: blur(10px);
}

.profile-back-btn {
  width: 36px;
  height: 36px;
  padding: 0 !important;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
}

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

.btn-ghost {
  background: transparent !important;
  border: 1px solid var(--border-color) !important;
  color: var(--text-secondary) !important;
}

.btn-ghost:hover {
  background: var(--bg-secondary) !important;
}

/* 彩色信息卡片 */
.profile-card {
  background: var(--card-bg);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}

.profile-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 16px 16px 0 0;
}

.profile-card--amber::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }
.profile-card--teal::before { background: linear-gradient(90deg, #10b981, #34d399); }
.profile-card--purple::before { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }

.profile-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.profile-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile-card--amber .profile-card-icon {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}

.profile-card--teal .profile-card-icon {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}

.profile-card--purple .profile-card-icon {
  background: rgba(139, 92, 246, 0.12);
  color: #8b5cf6;
}

.profile-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
}

/* 去掉旧的 section-title（已被 card-header 替代） */
.profile-section-title {
  display: none;
}

.profile-section {
  margin-bottom: 0;
}

/* 深色模式卡片 */
[data-theme="dark"] .profile-card {
  background: var(--office-card, #181b21);
  border-color: var(--office-border, #2a2f38);
}

[data-theme="dark"] .profile-card-title {
  color: var(--text);
}

/* Hero 区去掉 margin，和工具栏衔接更紧 */
.profile-hero {
  margin: 0 16px 16px;
}

/* ================================================
   座位图 - 顶部按钮优化
   ================================================ */

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

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

.seat-title-icon {
  font-size: 18px;
}

.seat-subtitle {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-tertiary);
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 100px;
  margin-left: 4px;
}

.seat-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.seat-action-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  height: 32px;
  line-height: 1;
}

.seat-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.seat-action-btn:active {
  transform: scale(0.95);
}

.seat-action-btn--icon {
  width: 32px;
  padding: 0;
  justify-content: center;
  border-radius: 8px;
}

.seat-action-btn--feishu {
  background: #3370ff;
  color: #fff;
  border-color: #3370ff;
  font-weight: 500;
}

.seat-action-btn--feishu:hover {
  background: #2860e0;
  border-color: #2860e0;
  color: #fff;
}

.seat-action-btn--ghost {
  background: var(--card-bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.78rem;
  padding: 6px 10px;
  gap: 4px;
}

.seat-action-btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-alpha);
}

.seat-action-divider {
  width: 1px;
  height: 18px;
  background: var(--border-color);
  margin: 0 2px;
}

/* 深色模式座位按钮 */
[data-theme="dark"] .seat-action-btn {
  background: var(--office-card, #181b21);
  border-color: var(--office-border, #2a2f38);
  color: var(--text-secondary);
}

[data-theme="dark"] .seat-action-btn--icon:hover {
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .seat-action-btn--feishu {
  background: #3370ff;
  color: #fff;
  border-color: #3370ff;
}

[data-theme="dark"] .seat-action-btn--ghost {
  background: var(--card-bg);
  border-color: var(--border);
  color: var(--text-secondary);
}

[data-theme="dark"] .seat-action-btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-alpha);
}

[data-theme="dark"] .seat-subtitle {
  background: var(--office-surface, #1c1f26);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .seat-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .seat-actions {
    width: 100%;
    justify-content: space-between;
  }

  .seat-action-btn {
    font-size: 11px;
    padding: 6px 8px;
    height: 30px;
  }

  .seat-action-btn--icon {
    width: 30px;
  }

  .profile-hero {
    margin: 0 12px 14px;
    padding: 14px 12px;
  }

  .profile-card {
    padding: 14px;
    border-radius: 14px;
  }

  .profile-card-title {
    font-size: 14px;
  }
}


/* ================================================
   作业统计页 - 顶部优化
   ================================================ */

.hw-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px 8px;
  gap: 12px;
}

.hw-page-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}

.hw-page-title-icon {
  font-size: 20px;
}

.hw-page-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.hw-action-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  height: 32px;
  line-height: 1;
  font-weight: 500;
}

.hw-action-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.hw-action-btn:active {
  transform: scale(0.95);
}

.hw-action-btn--ghost {
  background: var(--card-bg);
  border-color: var(--border-color);
  color: var(--text-secondary);
}

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

.hw-action-btn--primary:hover {
  opacity: 0.9;
  color: #fff;
}

/* 作业统计工具栏搜索图标修复 */
.hw-search-wrap {
  position: relative;
}

.hw-search-ico {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
}

.hw-search {
  padding-left: 36px !important;
  padding-right: 32px !important;
}

.hw-clear-x {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: none;
  background: var(--bg-secondary);
  color: var(--text-tertiary);
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.hw-clear-x:hover {
  background: var(--border-color);
  color: var(--text-secondary);
}

/* 深色模式 */
[data-theme="dark"] .hw-action-btn {
  background: var(--office-card, #181b21);
  border-color: var(--office-border, #2a2f38);
  color: var(--text-secondary);
}

[data-theme="dark"] .hw-action-btn--ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

[data-theme="dark"] .hw-action-btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

[data-theme="dark"] .hw-clear-x {
  background: var(--office-surface, #1c1f26);
  color: var(--text-tertiary);
}

/* ================================================
   集合点名页 - 顶部优化
   ================================================ */

.rollcall-page {
  padding: 16px !important;
}

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

.rollcall-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
}

.rollcall-title-icon {
  font-size: 19px;
}

.rollcall-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-tertiary);
  padding: 2px 8px;
  background: var(--bg-secondary);
  border-radius: 100px;
  margin-left: 2px;
}

.rollcall-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rollcall-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
  height: 32px;
  line-height: 1;
  font-weight: 500;
}

.rollcall-btn:hover {
  opacity: 0.9;
}

.rollcall-btn:active {
  transform: scale(0.95);
}

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

.rollcall-btn--ghost {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  height: 28px;
  padding: 4px 8px;
  font-size: 11px;
}

.rollcall-btn--ghost:hover {
  color: var(--primary);
}

.rollcall-btn--feishu {
  width: 32px;
  padding: 0;
  justify-content: center;
  background: #3370ff;
  border-color: #3370ff;
  color: #fff;
  border-radius: 8px;
}

.rollcall-btn--feishu:hover {
  background: #2860e0;
}

.rollcall-btn-group {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: 2px;
}

/* 列表项优化 */
.rollcall-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  background: var(--card-bg);
  border: 1px solid var(--border-light);
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.15s;
  gap: 12px;
}

.rollcall-list-item:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.rollcall-item-main {
  flex: 1;
  min-width: 0;
}

.rollcall-item-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.rollcall-item-meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rollcall-item-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rc-stat {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  font-weight: 500;
  line-height: 1.5;
}

.rc-stat--success { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.rc-stat--danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.rc-stat--warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.rc-stat--primary { background: rgba(79, 110, 247, 0.1); color: #4f6ef7; }

.rollcall-item-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.rc-action-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  padding: 0;
  flex-shrink: 0;
}

.rc-action-btn:hover {
  transform: scale(1.08);
}

.rc-action-btn--export:hover {
  border-color: #10b981;
  color: #10b981;
}

.rc-action-btn--feishu {
  background: #3370ff;
  border-color: #3370ff;
  color: #fff;
}

.rc-action-btn--feishu:hover {
  background: #2860e0;
  color: #fff;
}

.rc-action-btn--delete:hover {
  border-color: #ef4444;
  color: #ef4444;
}

/* 深色模式 - 集合点名 */
[data-theme="dark"] .rollcall-btn {
  background: var(--office-card, #181b21);
  border-color: var(--office-border, #2a2f38);
  color: var(--text-secondary);
}

[data-theme="dark"] .rollcall-btn--primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

[data-theme="dark"] .rollcall-btn--ghost:hover {
  color: var(--primary);
}

[data-theme="dark"] .rollcall-btn-group {
  background: var(--office-surface, #1c1f26);
}

[data-theme="dark"] .rollcall-count {
  background: var(--office-surface, #1c1f26);
}

[data-theme="dark"] .rollcall-list-item {
  background: var(--office-card, #181b21);
  border-color: var(--office-border, #2a2f38);
}

[data-theme="dark"] .rc-action-btn {
  background: var(--office-card, #181b21);
  border-color: var(--office-border, #2a2f38);
  color: var(--text-secondary);
}

[data-theme="dark"] .rc-action-btn--feishu {
  background: #3370ff;
  border-color: #3370ff;
  color: #fff;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .hw-page-header {
    padding: 10px 12px 6px;
  }

  .hw-page-title {
    font-size: 16px;
  }

  .hw-action-btn {
    font-size: 11px;
    padding: 5px 8px;
    height: 30px;
  }

  .rollcall-page {
    padding: 12px !important;
  }

  .rollcall-title {
    font-size: 16px;
  }

  .rollcall-btn {
    font-size: 11px;
    padding: 5px 8px;
    height: 30px;
  }

  .rollcall-btn--feishu {
    width: 30px;
  }

  .rollcall-list-item {
    padding: 10px 12px;
  }

  .rollcall-item-name {
    font-size: 14px;
  }

  .rc-action-btn {
    width: 28px;
    height: 28px;
  }
}


/* ================================================
   子导航 - 图标+文字样式（类底部导航风格）
   ================================================ */

.sub-nav-container {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 50;
}

.sub-nav-bar {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 8px 12px;
  gap: 4px;
}

.sub-nav-bar::-webkit-scrollbar {
  display: none;
}

.sub-nav-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 14px;
  border-radius: 12px;
  color: var(--text-tertiary);
  text-decoration: none;
  font-size: 11px;
  transition: all 0.2s;
  min-width: 56px;
}

.sub-nav-icon {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sub-nav-icon svg {
  width: 100%;
  height: 100%;
  stroke-width: 2;
}

.sub-nav-label {
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  line-height: 1.2;
}

.sub-nav-item:hover {
  color: var(--text-secondary);
  background: var(--bg-secondary);
}

.sub-nav-item.active {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  font-weight: 600;
}

.sub-nav-item.active .sub-nav-icon svg {
  stroke: var(--primary);
}

/* 深色模式 */
[data-theme="dark"] .sub-nav-container {
  background: var(--office-card, #181b21);
  border-bottom-color: var(--office-border, #2a2f38);
}

[data-theme="dark"] .sub-nav-item:hover {
  background: var(--office-surface, #1c1f26);
}

/* ================================================
   底部导航 - 放大（5个时更宽松）
   ================================================ */

.bottom-nav {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 6px);
}

.bottom-nav-item {
  padding: 6px 0 4px;
  gap: 3px;
}

.bottom-nav-icon {
  width: 26px;
  height: 26px;
}

.bottom-nav-label {
  font-size: 11px;
  font-weight: 500;
}

.bottom-nav-item.active {
  font-weight: 600;
}

/* 桌面端底部导航隐藏（保持原有逻辑） */
@media (min-width: 769px) {
  .bottom-nav {
    display: none;
  }
}

/* 移动端放大 */
@media (max-width: 480px) {
  .bottom-nav-icon {
    width: 28px;
    height: 28px;
  }

  .bottom-nav-label {
    font-size: 12px;
  }

  .bottom-nav-item {
    padding: 8px 0 6px;
    gap: 4px;
  }
}


/* ================================================
   工作台配色系统 v2 - 红/黄/蓝 + 黑白灰
   低饱和度，双模式适配
   ================================================ */

:root {
  /* 主色 - 蓝（偏灰调，不刺眼） */
  --primary: #4a72d9;
  --primary-light: #e8eefc;
  --primary-dark: #3a5fc0;
  --primary-alpha: rgba(74, 114, 217, 0.1);

  /* 强调色 - 红（暖调，警示/未开始） */
  --accent-red: #d9534f;
  --accent-red-light: #fbe9e8;
  --accent-red-dark: #c23e3a;

  /* 强调色 - 黄/琥珀（进行中/搁置） */
  --accent-yellow: #e8a93c;
  --accent-yellow-light: #fdf3e0;
  --accent-yellow-dark: #d19226;

  /* 成功色 - 绿（完成） */
  --success: #4fa878;
  --success-light: #e6f4ec;
  --success-dark: #3d8f63;

  /* 中性色 */
  --text: #1f2937;
  --text-secondary: #6b7280;
  --text-tertiary: #9ca3af;
  --card-bg: #ffffff;
  --bg: #f5f6f8;
  --bg-secondary: #f0f1f3;
  --border-color: #e5e7eb;
  --border-light: #f0f1f3;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.06);

  /* 状态色映射 */
  --status-not-started: var(--accent-red);
  --status-not-started-bg: var(--accent-red-light);
  --status-in-progress: var(--accent-yellow);
  --status-in-progress-bg: var(--accent-yellow-light);
  --status-done: var(--success);
  --status-done-bg: var(--success-light);
  --status-shelved: var(--text-secondary);
  --status-shelved-bg: var(--bg-secondary);
}

[data-theme="dark"] {
  /* 主色 - 蓝（深色加亮） */
  --primary: #6b8aee;
  --primary-light: rgba(107, 138, 238, 0.15);
  --primary-dark: #8aa5f3;
  --primary-alpha: rgba(107, 138, 238, 0.12);

  /* 强调色 - 红 */
  --accent-red: #e8726e;
  --accent-red-light: rgba(232, 114, 110, 0.15);
  --accent-red-dark: #f08e8b;

  /* 强调色 - 黄 */
  --accent-yellow: #f0bd5f;
  --accent-yellow-light: rgba(240, 189, 95, 0.15);
  --accent-yellow-dark: #f5d089;

  /* 成功色 - 绿 */
  --success: #6bc299;
  --success-light: rgba(107, 194, 153, 0.15);
  --success-dark: #8ad4b2;

  /* 中性色 - 深灰底 */
  --text: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;
  --card-bg: #1f2127;
  --bg: #14161c;
  --bg-secondary: #272a31;
  --border-color: #333741;
  --border-light: #272a31;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 2px 8px rgba(0,0,0,0.3);
}

/* ================================================
   待办页 - 状态看板卡片
   ================================================ */

.todo-dashboard {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.todo-dash-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.2s;
  position: relative;
  overflow: hidden;
}

.todo-dash-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
}

.todo-dash-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.todo-dash-card.active {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-alpha);
}

.todo-dash-card--not-started::before { background: var(--status-not-started); }
.todo-dash-card--in-progress::before { background: var(--status-in-progress); }
.todo-dash-card--done::before { background: var(--status-done); }
.todo-dash-card--shelved::before { background: var(--status-shelved); }

.todo-dash-count {
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 4px;
}

.todo-dash-card--not-started .todo-dash-count { color: var(--status-not-started); }
.todo-dash-card--in-progress .todo-dash-count { color: var(--status-in-progress); }
.todo-dash-card--done .todo-dash-count { color: var(--status-done); }
.todo-dash-card--shelved .todo-dash-count { color: var(--status-shelved); }

.todo-dash-label {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 500;
}

.todo-dash-sub {
  font-size: 11px;
  color: var(--text-tertiary);
  margin-top: 2px;
}

/* 待办分类 tab 重配色 */
.todo-page-tabs {
  background: var(--bg-secondary);
  border-radius: 10px;
  padding: 4px;
  margin-bottom: 12px;
  gap: 2px;
}

.todo-page-tab {
  flex: 1;
  text-align: center;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
  white-space: nowrap;
}

.todo-page-tab:hover {
  color: var(--text);
}

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

/* 待办卡片优化 */
.todo-event-card {
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  border-radius: 10px;
  margin-bottom: 8px;
  transition: all 0.15s;
  box-shadow: var(--shadow-sm);
}

.todo-event-card:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.todo-event-card.compact .todo-event-title {
  cursor: pointer;
}

.todo-event-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.todo-event-category {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 100px;
  background: var(--primary-alpha);
  color: var(--primary);
  font-weight: 500;
}

.todo-event-step-pill {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 100px;
  font-weight: 500;
  border: 1px solid transparent;
}

.todo-event-step-pill.not-started {
  background: var(--status-not-started-bg);
  color: var(--status-not-started);
}

.todo-event-step-pill.in-progress {
  background: var(--status-in-progress-bg);
  color: var(--status-in-progress);
}

.todo-event-step-pill.done {
  background: var(--status-done-bg);
  color: var(--status-done);
}

.todo-event-step-pill.shelved {
  background: var(--status-shelved-bg);
  color: var(--status-shelved);
}

/* 深色模式待办卡片 */
[data-theme="dark"] .todo-event-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

[data-theme="dark"] .todo-page-tabs {
  background: var(--bg-secondary);
}

[data-theme="dark"] .todo-page-tab.active {
  background: var(--card-bg);
}

/* 移动端适配 */
@media (max-width: 480px) {
  .todo-dashboard {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .todo-dash-count {
    font-size: 20px;
  }
}


/* ================================================
   顶部深色模式切换按钮
   ================================================ */

.theme-toggle-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  transition: all 0.2s;
  padding: 0;
  flex-shrink: 0;
  margin-left: 8px;
}

.theme-toggle-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-pale);
}

.theme-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.theme-toggle-btn .theme-icon-sun { display: none; }
.theme-toggle-btn .theme-icon-moon { display: block; }

[data-theme="dark"] .theme-toggle-btn .theme-icon-sun { display: block; }
[data-theme="dark"] .theme-toggle-btn .theme-icon-moon { display: none; }

/* ================================================
   设置页 - 集成与绑定二级折叠优化
   ================================================ */

.binding-group .collapsible {
  margin-bottom: 8px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  overflow: hidden;
}

.binding-group .collapsible-header {
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  background: var(--card-bg);
  transition: background 0.15s;
}

.binding-group .collapsible-header:hover {
  background: var(--bg-secondary);
}

.binding-group .collapsible-title {
  font-weight: 600;
  font-size: 14px;
  flex: 1;
  color: var(--text);
}

.binding-group .collapsible-status {
  font-size: 12px;
  color: var(--text-tertiary);
}

.binding-group .collapsible-chevron {
  font-size: 12px;
  color: var(--text-tertiary);
  transition: transform 0.2s;
}

.binding-group .collapsible.open .collapsible-chevron {
  transform: rotate(90deg);
}

.binding-group .collapsible-body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--border-color);
  padding-top: 12px;
}

/* ===== 设置页两级导航 ===== */

.settings-entry-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--card-bg);
  border-radius: 12px;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}
.settings-entry-card:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}
.settings-entry-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.settings-entry-info {
  flex: 1;
  min-width: 0;
}
.settings-entry-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.settings-entry-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.settings-entry-arrow {
  color: var(--text-tertiary);
  flex-shrink: 0;
}

.settings-detail-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px 16px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
}
.settings-detail-header svg {
  color: var(--text-secondary);
}

.settings-bindings-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.binding-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
}
.binding-card:hover {
  border-color: var(--primary-light);
}
.binding-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
}
.binding-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.binding-card-info {
  flex: 1;
  min-width: 0;
}
.binding-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.binding-card-status {
  font-size: 12px;
  color: var(--text-tertiary);
}
.binding-card-chevron {
  color: var(--text-tertiary);
  font-size: 12px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}
.binding-card .collapsible.open + .binding-card-header .binding-card-chevron,
.binding-card:has(.collapsible.open) .binding-card-chevron {
  transform: rotate(90deg);
}

.binding-card .collapsible-body {
  padding: 0 16px 16px;
  border-top: 1px solid var(--border-light);
  padding-top: 14px;
}

@media (max-width: 480px) {
  .settings-entry-card {
    padding: 14px;
  }
  .settings-entry-icon {
    width: 40px;
    height: 40px;
  }
  .binding-card-header {
    padding: 12px 14px;
  }
  .binding-card-icon {
    width: 36px;
    height: 36px;
  }
}

/* ===== 绑定卡片图标颜色变体 ===== */
.bci-primary {
  background: var(--primary-pale) !important;
  color: var(--primary-dark) !important;
}
.bci-success {
  background: var(--success-pale) !important;
  color: var(--success-dark) !important;
}
.bci-warning {
  background: var(--warning-pale) !important;
  color: var(--warning-dark) !important;
}
.bci-danger {
  background: var(--danger-pale) !important;
  color: var(--danger-dark) !important;
}
.bci-purple {
  background: #f0e6f5;
  color: #9b6bc4;
}
[data-theme="dark"] .bci-purple {
  background: #3a2a4a;
  color: #c49adf;
}

/* ===== 深色模式补充：设置页新组件 ===== */
[data-theme="dark"] .settings-entry-card {
  background: var(--card-bg);
  border-color: var(--border);
}
[data-theme="dark"] .settings-entry-card:hover {
  border-color: var(--primary);
}

[data-theme="dark"] .settings-detail-header {
  color: var(--text);
}
[data-theme="dark"] .settings-detail-header svg {
  color: var(--text-secondary);
}

[data-theme="dark"] .binding-card {
  background: var(--card-bg);
  border-color: var(--border);
}
[data-theme="dark"] .binding-card:hover {
  border-color: var(--primary-light);
}
[data-theme="dark"] .binding-card-title {
  color: var(--text);
}
[data-theme="dark"] .binding-card-status {
  color: var(--text-tertiary);
}
[data-theme="dark"] .binding-card-chevron {
  color: var(--text-tertiary);
}
[data-theme="dark"] .binding-card .collapsible-body {
  border-top-color: var(--border);
}

/* ===== 变量别名统一 ===== */
:root {
  --border-color: var(--border);
  --bg-secondary: var(--surface);
  --bg-inset: var(--surface);
  --primary-color: var(--primary);
  --danger-color: var(--danger);
  --accent-red: var(--danger);
  --accent-red-light: var(--danger-pale);
  --accent-yellow: var(--warning);
  --accent-yellow-light: var(--warning-pale);
}
[data-theme="dark"] {
  --border-color: var(--border);
  --bg-secondary: var(--surface);
  --accent-red: var(--danger);
  --accent-red-light: var(--danger-pale);
  --accent-yellow: var(--warning);
  --accent-yellow-light: var(--warning-pale);
}
/* ========== 巡班记录 ========== */
.patrol-record-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.patrol-record-card {
  padding: 14px;
  background: var(--bg-secondary);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.patrol-record-card:hover {
  background: var(--bg-tertiary);
}

.patrol-record-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.patrol-record-date {
  font-weight: 600;
  font-size: 14px;
}

.patrol-record-actions {
  display: flex;
  gap: 6px;
}

.patrol-record-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-tertiary);
  margin-bottom: 6px;
  flex-wrap: wrap;
}

.patrol-record-note {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

/* 编辑表单 */
.patrol-edit-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}

.patrol-form-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.patrol-form-row label {
  font-size: 13px;
  color: var(--text-secondary);
  width: 48px;
  flex-shrink: 0;
}

.patrol-form-row select,
.patrol-form-row input[type="date"],
.patrol-form-row input[type="time"] {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg-primary);
  color: var(--text-primary);
}

/* 标签栏 */
.patrol-tag-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
  background: var(--bg-secondary);
  border-radius: 8px;
}

.patrol-tag-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 2px solid var(--border-color);
  border-radius: 20px;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
  -webkit-user-select: none;
}

.patrol-tag-btn:hover {
  border-color: var(--tag-color, var(--primary));
}

.patrol-tag-btn.active {
  border-color: var(--tag-color, var(--primary));
  background: color-mix(in srgb, var(--tag-color, var(--primary)) 12%, var(--bg-primary));
  font-weight: 500;
}

.patrol-tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--tag-color, var(--primary));
}

.patrol-tag-name {
  white-space: nowrap;
}

.patrol-tag-add {
  border-style: dashed;
  color: var(--text-tertiary);
  padding: 8px 12px;
}

.patrol-tag-add:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* 座位图 */
.patrol-seat-map {
  overflow-x: auto;
}

.patrol-seat {
  position: relative;
  cursor: pointer;
  transition: all 0.15s;
  border: 2px solid transparent !important;
}

.patrol-seat:hover {
  transform: scale(1.05);
  z-index: 2;
}

.patrol-seat-tagged {
  border-width: 2px !important;
  border-style: solid !important;
}

.patrol-seat-leave {
  border: 2px solid #6b7280 !important;
  opacity: 0.6;
  cursor: not-allowed !important;
}

.patrol-seat-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  padding: 1px 5px;
  font-size: 9px;
  color: white;
  border-radius: 8px;
  white-space: nowrap;
  line-height: 1.4;
  z-index: 3;
}

/* 统计栏 */
.patrol-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 10px 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  font-size: 12px;
  margin-top: 10px;
}

/* 备注输入 */
.patrol-note-input {
  width: 100%;
  min-height: 60px;
  padding: 10px;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  resize: vertical;
  background: var(--bg-primary);
  color: var(--text-primary);
  box-sizing: border-box;
}

/* 标签颜色选择器 */
.tag-color-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-color-option {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}

.tag-color-option:hover {
  transform: scale(1.1);
}

.tag-color-option.selected {
  border-color: var(--text-primary);
  box-shadow: 0 0 0 2px var(--bg-primary), 0 0 0 4px var(--text-primary);
}

/* 详情弹窗 */
.patrol-detail-modal {
  max-width: 420px;
}

.patrol-detail-list {
  max-height: 300px;
  overflow-y: auto;
}

.patrol-detail-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
}

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

.patrol-detail-seat {
  font-size: 11px;
  color: var(--text-tertiary);
  width: 36px;
}

.patrol-detail-name {
  flex: 1;
}

.patrol-detail-tag {
  padding: 2px 8px;
  font-size: 11px;
  color: white;
  border-radius: 10px;
}

/* 巡班记录信息栏 */
.patrol-info-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px;
  background: var(--bg-secondary);
  border-radius: 8px;
  margin-top: 8px;
}

.patrol-info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.patrol-info-label {
  font-size: 11px;
  color: var(--text-tertiary);
}

.patrol-info-value {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

/* ===== 语音按钮：防止手机长按触发文字选择 ===== */
.voice-btn, #qlVoiceBtn, #todoInputVoiceBtn, [id*="VoiceBtn"] {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  touch-action: none;
  cursor: pointer;
}
