/* ========== 全局样式 - 移动端优先 ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --primary: #4A90D9;
  --primary-light: #6BA8E8;
  --primary-dark: #357ABD;
  --success: #52C41A;
  --warning: #FAAD14;
  --danger: #FF4D4F;
  --bg: #F5F7FA;
  --card: #FFFFFF;
  --text: #333333;
  --text-secondary: #8C8C8C;
  --border: #E8E8E8;
  --shadow: 0 2px 12px rgba(0,0,0,0.08);
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

/* ========== 布局 ========== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 44px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 100;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.header-logo {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
  flex: 0 0 auto;
}

.header-title {
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.auth-logo-img {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
  padding: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  margin-bottom: 10px;
}

.header-action {
  font-size: 14px;
}

.main {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  bottom: 56px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px;
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: white;
  display: flex;
  border-top: 1px solid var(--border);
  z-index: 100;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.05);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  cursor: pointer;
  transition: color 0.2s;
  user-select: none;
  min-width: 0;
}

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

.tab-icon {
  font-size: 18px;
  margin-bottom: 2px;
}

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========== 统计卡片 ========== */
.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--card);
  border-radius: 10px;
  padding: 14px;
  box-shadow: var(--shadow);
}

.stat-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 4px;
}

.stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.stat-big {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
}
.stat-big .stat-value {
  color: white;
  font-size: 28px;
}

.stat-big .stat-label {
  color: rgba(255,255,255,0.85);
}

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

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

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  background: white;
  color: var(--text);
  transition: border-color 0.2s;
}

.form-textarea {
  height: auto;
  padding: 10px 12px;
  min-height: 80px;
  resize: vertical;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-group {
  flex: 1;
}

/* ========== 按钮 ========== */
.btn {
  display: inline-block;
  width: 100%;
  height: 44px;
  line-height: 44px;
  text-align: center;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

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

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

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

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

.btn-outline {
  background: white;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-sm {
  height: 32px;
  line-height: 32px;
  font-size: 13px;
  width: auto;
  padding: 0 16px;
}

/* 按钮加载态 / 防抖 */
.btn.is-loading {
  opacity: .8;
  pointer-events: none;
  cursor: default;
}
.btn-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -1px;
  animation: btn-spin .7s linear infinite;
}
@keyframes btn-spin {
  to { transform: rotate(360deg); }
}

/* ========== 列表 ========== */
.list {
  background: var(--card);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.list-item {
  display: flex;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

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

.list-item:active {
  background: #F5F7FA;
}

.list-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  margin-right: 12px;
  flex-shrink: 0;
}

.list-content {
  flex: 1;
  min-width: 0;
}

.list-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

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

.list-right {
  text-align: right;
  flex-shrink: 0;
  margin-left: 10px;
}

.list-right-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.list-right-label {
  font-size: 11px;
  color: var(--text-secondary);
}

/* ========== 标签 ========== */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.tag-success {
  background: #F6FFED;
  color: var(--success);
  border: 1px solid #B7EB8F;
}

.tag-warning {
  background: #FFFBE6;
  color: var(--warning);
  border: 1px solid #FFE58F;
}

.tag-danger {
  background: #FFF1F0;
  color: var(--danger);
  border: 1px solid #FFA39E;
}

.tag-info {
  background: #E6F7FF;
  color: var(--primary);
  border: 1px solid #91D5FF;
}

/* ========== 搜索框 ========== */
.search-box {
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 8px 0;
  z-index: 10;
}

.search-input {
  width: 100%;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 19px;
  padding: 0 16px;
  padding-left: 36px;
  font-size: 14px;
  background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E") no-repeat 12px center;
}

/* ========== 空状态 ========== */
.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

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

/* ========== 模态框 ========== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.modal.show {
  display: flex;
  animation: fadeIn 0.2s;
}

.modal-content {
  background: white;
  width: 100%;
  max-height: 90%;
  border-radius: 16px 16px 0 0;
  padding: 20px;
  overflow-y: auto;
  animation: slideUp 0.3s;
}

.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 16px;
  text-align: center;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 20px;
  color: var(--text-secondary);
  cursor: pointer;
  background: none;
  border: none;
}

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

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

/* ========== Toast ========== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  display: none;
  max-width: 80%;
  text-align: center;
}

.toast.show {
  display: block;
  animation: fadeIn 0.2s;
}

/* ========== Loading ========== */
.loading {
  position: fixed;
  top: 44px;
  left: 0;
  right: 0;
  text-align: center;
  padding: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  display: none;
}

.loading.show {
  display: block;
}

/* ========== 学生详情头部 ========== */
.student-header {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.student-name {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 6px;
}

.student-info {
  font-size: 13px;
  opacity: 0.9;
  margin-bottom: 16px;
}

.student-hours {
  display: flex;
  gap: 20px;
}

.hours-item {
  flex: 1;
}

.hours-value {
  font-size: 24px;
  font-weight: 700;
}

.hours-label {
  font-size: 12px;
  opacity: 0.85;
}

/* ========== 操作按钮组 ========== */
.action-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.action-btn {
  flex: 1;
  height: 44px;
  border-radius: 8px;
  border: none;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* 费用项目操作按钮：柔和低饱和配色 */
.ac-btn {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: #F2F5F9;
  color: #4A5568;
  transition: transform .12s ease, background .12s ease;
}
.ac-btn:active { transform: scale(0.97); }
.ac-btn.neutral { background: #F2F5F9; color: #4A5568; border-color: #E2E8F0; }
.ac-btn.primary { background: #E8F1FC; color: var(--primary-dark); border-color: #CFE3F8; }
.ac-btn.success { background: #EFF9EA; color: #389E0D; border-color: #CFEAC3; }
.ac-btn.warning { background: #FFF7E6; color: #D48806; border-color: #FFE7BA; }
.ac-btn.danger  { background: #FFF1F0; color: #CF1322; border-color: #FFD8D6; }
.ac-btn.solid {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

/* ========== 快速选择课时 ========== */
.hours-picker {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.hours-chip {
  flex: 1;
  height: 36px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.hours-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ========== 出勤选择 ========== */
.attendance-picker {
  display: flex;
  gap: 8px;
}

.attendance-chip {
  flex: 1;
  height: 40px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.attendance-chip.active {
  border-color: var(--primary);
  background: var(--primary);
  color: white;
}

/* 项目停课：出勤状态锁定为请假 */
.attendance-chip:disabled {
  cursor: not-allowed;
  opacity: .45;
}
.attendance-chip.active:disabled {
  opacity: 1;
  background: var(--warning);
  border-color: var(--warning);
}

/* ========== 日期分组 ========== */
.date-group {
  margin-bottom: 12px;
}

.date-header {
  font-size: 12px;
  color: var(--text-secondary);
  padding: 8px 4px;
  font-weight: 500;
}

/* ========== 照片上传 ========== */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.photo-item {
  position: relative;
  width: 100%;
  padding-bottom: 100%;
  border-radius: 8px;
  overflow: hidden;
  background: #F0F2F5;
}

.photo-item img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  background: rgba(0,0,0,0.6);
  color: white;
  border-radius: 50%;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.photo-add {
  width: 100%;
  padding-bottom: 100%;
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.photo-add:active { border-color: var(--primary); background: #F0F7FF; }

.photo-add-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 12px;
  gap: 4px;
}

.photo-add-icon { font-size: 26px; }

/* 统一凭证 / 照片上传框 */
.uploader-box {
  border: 1.5px dashed #D6DCE5;
  border-radius: 10px;
  background: #FAFBFD;
  padding: 14px 12px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
}
.uploader-box:hover,
.uploader-box:active {
  border-color: var(--primary);
  background: #F0F7FF;
}
.uploader-box-icon {
  font-size: 24px;
  line-height: 1.2;
}
.uploader-box-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  margin-top: 4px;
}
.uploader-box-hint {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
}
.uploader-camera {
  margin-top: 9px;
  padding: 4px 14px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
}
.uploader-camera:active {
  border-color: var(--primary);
  background: #E6F7FF;
}

/* 照片查看大图 */
.photo-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
}
.photo-viewer.show { display: flex; }
.photo-viewer img { max-width: 100%; max-height: 100%; }
.photo-viewer .close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 28px;
  cursor: pointer;
}

/* ========== 点名/批量消课 ========== */
.roll-student {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}

.roll-student:last-child { border-bottom: none; }

.roll-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 10px;
  flex-shrink: 0;
}

.roll-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 500; }
.roll-hours { font-size: 11px; color: var(--text-secondary); font-weight: 400; margin-top: 2px; }

.roll-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 calc(100% - 48px);
  margin-left: 48px;
  margin-top: 8px;
}

.roll-btn {
  min-width: 44px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 16px;
  font-size: 12px;
  cursor: pointer;
}

.roll-btn.sel-present { background: var(--success); color: white; border-color: var(--success); }
.roll-btn.sel-leave { background: var(--warning); color: white; border-color: var(--warning); }
.roll-btn.sel-makeup { background: var(--primary); color: white; border-color: var(--primary); }
.roll-btn.sel-absent { background: var(--danger); color: white; border-color: var(--danger); }
.roll-btn.sel-change { background: #722ED1; color: white; border-color: #722ED1; }
.roll-btn:disabled { opacity: .9; cursor: default; }

/* 段切换 */
.segment {
  display: flex;
  background: #EEF1F5;
  border-radius: 8px;
  padding: 3px;
  margin-bottom: 12px;
}
.segment-item {
  flex: 1;
  text-align: center;
  padding: 8px;
  font-size: 14px;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
}
.segment-item.active {
  background: white;
  color: var(--primary);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* 停课学生样式 */
.student-stopped .list-title { color: var(--text-secondary); }
.student-stopped .list-avatar { background: linear-gradient(135deg, #BFBFBF, #999); }

/* 班级卡片 */
.group-card {
  background: linear-gradient(135deg, #722ED1, #9254DE);
  color: white;
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
  cursor: pointer;
}

.group-card:active { opacity: 0.9; }

.group-name { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.group-meta { font-size: 13px; opacity: 0.9; display: flex; justify-content: space-between; }

.group-avatars { display: flex; margin-top: 10px; }

/* ================= 登录 / 注册 ================= */
.auth-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(160deg, #4A90D9, #2F6FB5);
  padding: 24px 20px;
  overflow-y: auto;
}
.auth-screen.show { display: block; }
.auth-logo { text-align: center; color: #fff; margin: 32px 0 24px; }
.auth-logo .t { font-size: 26px; font-weight: 700; }
.auth-logo .s { font-size: 13px; opacity: 0.85; margin-top: 6px; }
.auth-card { background: #fff; border-radius: 14px; padding: 20px; box-shadow: 0 8px 30px rgba(0,0,0,0.15); }
.auth-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.auth-tab {
  flex: 1; text-align: center; padding: 9px 0; border-radius: 8px;
  font-size: 14px; color: var(--text-secondary); background: #F2F4F7; cursor: pointer;
}
.auth-tab.active { background: var(--primary); color: #fff; font-weight: 600; }
.auth-tip { font-size: 12px; color: var(--text-secondary); line-height: 1.7; }
.auth-error { color: var(--danger); font-size: 13px; margin-bottom: 10px; }

/* 胶囊标签页 */
.nav-pills {
  display: inline-flex;
  background: #F0F2F5;
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 14px;
  width: 100%;
}
.nav-pills .pill {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  font-size: 14px;
  border-radius: 999px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
}
.nav-pills .pill.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(74,144,217,0.35);
}

/* 拍照按钮行 */
.photo-actions { display: flex; gap: 8px; }
.photo-actions .btn { flex: 1; }
.group-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  border: 2px solid white;
  margin-left: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
}
.group-avatar:first-child { margin-left: 0; }
.group-avatar-more { background: rgba(255,255,255,0.4); }

/* 切换标签（停课/正常） */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: #DDD;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.switch.on { background: var(--success); }
.switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: left 0.2s;
}
.switch.on::after { left: 22px; }

/* 响应式：手机端优先，桌面端逐步放宽 ========== */
@media (min-width: 768px) {
  .main {
    max-width: 760px;
    margin: 0 auto;
    left: 0;
    right: 0;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
    padding: 16px 20px;
  }
  
  .tabbar, .header {
    max-width: 760px;
    margin: 0 auto;
    left: 0;
    right: 0;
  }
  
  .modal-content {
    max-width: 520px;
    margin: auto;
    border-radius: 16px;
    height: auto;
  }
}

@media (min-width: 1200px) {
  .main {
    max-width: 1080px;
    padding: 22px 28px;
  }
  .tabbar, .header { max-width: 1080px; }
  .modal-content { max-width: 640px; }

  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-big { grid-column: 1 / -1; }

  /* 学生列表在宽屏时两列排布 */
  #student-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  #student-list > .empty { grid-column: span 2; }

  /* 首页两张统计卡改为更宽的比例 */
  .card { border-radius: 12px; }
}

/* v4 班课点名金额输入 */
.input-fee {
  width: 76px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 6px;
  font-size: 12px;
  text-align: right;
  background: #fff;
}

/* v5 一对一学生单选列表 */
.student-radio-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 260px;
  overflow-y: auto;
}

.student-radio-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  cursor: pointer;
}

.student-radio-item input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}

.student-radio-item .list-content { flex: 1; min-width: 0; }

.student-radio-item.active {
  border-color: var(--primary);
  background: #E6F7FF;
}

/* ========== 系统状态页 ========== */
.sys-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 16px;
  font-size: 13px;
  border-bottom: 1px dashed #F0F0F0;
}
.sys-row:last-child { border-bottom: none; }
.sys-row > span:first-child {
  color: var(--text-secondary);
  flex: 0 0 auto;
  max-width: 48%;
}
.sys-row > span:last-child {
  text-align: right;
  word-break: break-all;
}
.sys-bar {
  height: 8px;
  margin: 4px 16px 10px;
  background: #F0F0F0;
  border-radius: 4px;
  overflow: hidden;
}
.sys-bar > i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .3s ease;
}
.sys-bar.warn > i { background: var(--warning); }
.sys-bar.danger > i { background: var(--danger); }
.sys-mini-track {
  display: inline-block;
  width: 90px;
  height: 6px;
  background: #F0F0F0;
  border-radius: 3px;
  overflow: hidden;
}
.sys-mini-track > i {
  display: block;
  height: 100%;
  background: var(--primary-light);
  border-radius: 3px;
}
.sys-hours {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 80px;
  padding: 6px 16px 0;
}
.sys-hour-col {
  flex: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  min-width: 0;
}
.sys-hour-bar {
  width: 100%;
  background: var(--primary-light);
  border-radius: 3px 3px 0 0;
}
.sys-hour-label {
  font-size: 9px;
  color: var(--text-secondary);
  height: 12px;
  line-height: 12px;
}

/* ========== 仪表盘四宫格统计 ========== */
/* 四宫格始终一行四项，小屏也不换行，只缩小字号 */
.stat-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}
.stat-grid-4 .stat-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 86px;
  padding: 10px 8px;
  text-align: center;
}
.stat-grid-4 .stat-value {
  font-size: 20px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-grid-4 .stat-label {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 640px) {
  .stat-grid-4 .stat-card { padding: 8px 5px; min-height: 72px; }
  .stat-grid-4 .stat-value { font-size: 16px; }
  .stat-grid-4 .stat-label { font-size: 11px; }
}
@media (max-width: 380px) {
  .stat-grid-4 { gap: 6px; }
  .stat-grid-4 .stat-card { padding: 8px 3px; }
  .stat-grid-4 .stat-value { font-size: 14px; }
  .stat-grid-4 .stat-label { font-size: 10px; }
}

/* ========== 收支柱状图弹窗 ========== */
.trend-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.trend-series {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.trend-series-btn {
  flex: 1;
  padding: 8px 10px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: #fff;
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
}
.trend-series-btn.active {
  border-color: var(--primary);
  background: #E6F7FF;
  color: var(--primary);
  font-weight: 600;
}
.trend-chart {
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FBFCFE;
  padding: 8px 6px 2px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.trend-chart svg { width: 100%; height: auto; display: block; }
.trend-summary {
  display: flex;
  gap: 10px;
  margin-top: 10px;
  font-size: 13px;
}
.trend-summary > div {
  flex: 1;
  background: #F7F9FC;
  border-radius: 8px;
  padding: 8px 10px;
}
.trend-summary .k { font-size: 11px; color: var(--text-secondary); }
.trend-summary .v { font-size: 16px; font-weight: 700; margin-top: 2px; }

/* ========== 经营报表 ========== */
.report-chart-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.report-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}
.report-summary-item {
  background: var(--card);
  border-radius: 10px;
  padding: 10px 12px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.report-summary-label {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  min-height: 30px;
}
.report-summary-value {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
  word-break: break-all;
}
.report-rank-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 0;
}
.report-rank-name {
  flex: 0 0 88px;
  width: 88px;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.report-rank-track {
  flex: 1;
  height: 14px;
  background: #F0F2F5;
  border-radius: 7px;
  overflow: hidden;
}
.report-rank-track > i {
  display: block;
  height: 100%;
  border-radius: 7px;
  transition: width .25s;
}
.report-rank-val {
  flex: 0 0 88px;
  width: 88px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
}
.report-table-wrap {
  overflow: auto;
  max-height: 420px;
  border: 1px solid var(--border);
  border-radius: 8px;
  -webkit-overflow-scrolling: touch;
}
.report-table {
  border-collapse: collapse;
  width: 100%;
  min-width: 560px;
  font-size: 12px;
}
.report-table th,
.report-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  white-space: nowrap;
}
.report-table th:first-child,
.report-table td:first-child { text-align: left; }
.report-table thead th {
  position: sticky;
  top: 0;
  background: #F7F9FC;
  z-index: 1;
  font-weight: 600;
}
.report-table tbody tr:last-child td { border-bottom: none; }
.report-name { font-weight: 600; }
.report-income { color: #52C41A; }
.report-refund { color: #FA8C16; }
.report-classfee { color: #4A90D9; }
.report-expense { color: #F5222D; }
.report-positive { color: #389E0D; }
.report-negative { color: #F5222D; }
.report-transfer-note {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.7;
}
@media (max-width: 640px) {
  .report-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report-rank-name { flex-basis: 72px; width: 72px; }
  .report-rank-val { flex-basis: 78px; width: 78px; }
}

/* ========== 文件管理：存储概览与迁移 ========== */
.storage-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.storage-card {
  background: #F8FAFD;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  min-width: 0;
}
.storage-card-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}
.storage-card-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.3;
}
.storage-card-sub {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.storage-current {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.mig-progress {
  height: 8px;
  background: #F0F0F0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}
.mig-progress > i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width .2s;
}
.storage-mig-status {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}
.storage-mig-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 6px;
  line-height: 1.7;
}
.storage-mig-hint {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
}
@media (max-width: 640px) {
  .storage-grid { grid-template-columns: 1fr; }
}

/* ========== 用户管理：在线状态与使用统计 ========== */
.user-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}
.us-item {
  background: #F7F9FC;
  border-radius: 8px;
  padding: 8px 6px;
  text-align: center;
  min-width: 0;
}
.us-v {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.us-l {
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-summary-tip {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}
.user-row {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.user-row:last-child { border-bottom: none; }
.user-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
.user-name-line {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  min-width: 0;
  font-size: 15px;
  font-weight: 600;
}
.user-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-seen {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  flex: 0 0 auto;
  margin-top: 3px;
}
.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #C9CDD4;
  flex: 0 0 auto;
}
.online-dot.on {
  background: var(--success);
  box-shadow: 0 0 0 3px rgba(82, 196, 26, .18);
}
.vip-badge {
  display: inline-block;
  padding: 0 6px;
  height: 17px;
  line-height: 17px;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .5px;
  color: #8A6D00;
  background: linear-gradient(135deg, #FFE58F, #FFC53D);
  box-shadow: 0 1px 3px rgba(250, 173, 20, .4);
  flex: 0 0 auto;
}
.user-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}
.user-metric {
  background: #FAFBFC;
  border-radius: 7px;
  padding: 6px 4px;
  text-align: center;
  min-width: 0;
}
.user-metric b {
  display: block;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-metric span {
  display: block;
  font-size: 10px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-actions {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.user-actions .btn {
  width: auto;
  flex: 1;
  height: 32px;
  line-height: 32px;
  font-size: 12px;
}
@media (max-width: 640px) {
  .user-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .user-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ========== 学生档案 ========== */
.archive-search-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.archive-search-row .form-input {
  flex: 1 1 auto;
  width: auto;
  min-width: 0;
  height: 44px;
}
.archive-search-row .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 22px;
}
.archive-hero {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  border-radius: 12px 12px 0 0;
}
.archive-hero-name {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.archive-hero-name .tag { background: rgba(255,255,255,0.24); color: #fff; }
.archive-hero-sub { font-size: 12px; opacity: 0.9; margin-top: 6px; }
.archive-stats {
  display: flex;
  padding: 12px 8px;
  border-bottom: 1px solid var(--border);
}
.archive-stat { flex: 1; text-align: center; }
.archive-stat + .archive-stat { border-left: 1px solid var(--border); }
.archive-stat-value { font-size: 20px; font-weight: 700; color: var(--primary); }
.archive-stat-label { font-size: 11px; color: var(--text-secondary); margin-top: 3px; }
.archive-tabs {
  display: flex;
  gap: 6px;
  margin: 12px 0;
  overflow-x: auto;
}
.archive-tab {
  flex: 0 0 auto;
  padding: 9px 14px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 4px;
}
.archive-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.archive-tab.active .tag { background: rgba(255,255,255,0.25); color: #fff; }
.archive-hint {
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-secondary);
  background: #F7F9FC;
  border-left: 3px solid var(--primary);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
}
.archive-hint-danger { color: var(--danger); border-left-color: var(--danger); background: #FFF1F0; }
.archive-hint-success { color: var(--success); border-left-color: var(--success); background: #F6FFED; }
.wrong-point {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: #FAFBFC;
}

/* ========== 档案提醒 / 报告 ========== */
.archive-remind-card { border-left: 3px solid var(--danger); }
.archive-remind-text {
  padding: 0 16px 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
}
.archive-remind-text b { color: var(--danger); }
.archive-issue-actions {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.archive-issue-actions .btn {
  flex: 0 0 auto;
  width: auto;
  padding: 0 16px;
}
.lesson-sync-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.6;
  background: #F7F9FC;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 12px;
}
.lesson-sync-row input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
}
.lesson-issue-options {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  padding: 4px 0;
}
.lesson-issue-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.lesson-issue-options input {
  width: 16px;
  height: 16px;
}
.share-sections {
  border-top: 1px solid var(--border);
  padding: 10px 16px 14px;
}
.share-sections-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 8px;
}
.share-sections-hint {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
}
.share-group { margin-bottom: 8px; }
.share-group-title {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.share-group-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}
.share-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  cursor: pointer;
}
.share-check input {
  width: 16px;
  height: 16px;
}

.report-periods {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}
.report-period {
  flex: 0 0 auto;
  width: auto;
  height: 32px;
  line-height: 32px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
}
.report-period.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.report-head {
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.report-title { font-size: 22px; font-weight: 700; color: var(--primary); }
.report-sub { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.report-actions { display: flex; gap: 8px; margin-bottom: 12px; }
.report-actions .btn { flex: 1; }
.report-kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.report-kpi {
  background: #F7F9FC;
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.report-kpi b { display: block; font-size: 20px; color: var(--primary); }
.report-kpi span { font-size: 11px; color: var(--text-secondary); }
.report-section { margin-bottom: 16px; }
.report-section-title {
  font-size: 14px;
  font-weight: 600;
  padding-left: 8px;
  border-left: 3px solid var(--primary);
  margin-bottom: 8px;
}
.report-line {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 8px;
}
.report-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.report-list-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13px;
}
.report-list-row b { color: var(--primary); }
.report-list-row b.danger { color: var(--danger); }
.report-lesson {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}
.report-lesson-head { font-size: 13px; font-weight: 600; }
.report-lesson-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-top: 3px;
  white-space: pre-wrap;
}
.report-note {
  background: #FFF7E6;
  border-left: 3px solid var(--warning);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: #AD6800;
  margin: 6px 0 8px;
}
.report-note.danger {
  background: #FFF1F0;
  border-left-color: var(--danger);
  color: var(--danger);
}
.report-foot {
  text-align: center;
  font-size: 11px;
  color: #B0B7C3;
  margin-top: 16px;
}
@media (max-width: 480px) {
  .report-kpis { grid-template-columns: repeat(2, 1fr); }
  .report-actions { flex-direction: column; }
}

