/* ============================================
   学籍管理系统 - 移动端自适应样式
   ============================================ */

/* CSS 变量 */
:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --primary-bg: #eef2ff;
  --secondary: #7c3aed;
  --success: #16a34a;
  --success-bg: #f0fdf4;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0891b2;
  --info-bg: #ecfeff;

  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1e293b;
  --gray-900: #0f172a;

  --bg: #f5f6fa;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-secondary: #64748b;
  --border: #e2e8f0;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04), 0 1px 2px rgba(0,0,0,0.02);
  --shadow: 0 4px 12px rgba(0,0,0,0.06), 0 1px 3px rgba(0,0,0,0.04);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.10), 0 4px 8px rgba(0,0,0,0.04);
  --shadow-card: 0 2px 8px rgba(79,70,229,0.06), 0 1px 3px rgba(0,0,0,0.04);

  --header-height: 52px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
  padding-bottom: calc(var(--safe-bottom) + 16px);
  overflow-x: hidden;
}

input, select, textarea, button {
  font-family: inherit;
  font-size: inherit;
}

/* ===== 头部 ===== */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  box-shadow: 0 2px 12px rgba(79, 70, 229, 0.3);
}

.app-header h1 {
  font-size: 17px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}

.app-header .header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ===== 用户徽章 ===== */
.user-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.2);
  cursor: pointer;
  transition: background 0.2s;
}

.user-badge:active {
  background: rgba(255, 255, 255, 0.35);
}

.user-badge-icon {
  font-size: 16px;
}

.user-badge-name {
  font-size: 12px;
  font-weight: 500;
  max-width: 80px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== 用户菜单 ===== */
.user-menu-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1500;
  background: rgba(0, 0, 0, 0.3);
}

.user-menu {
  position: fixed;
  top: 52px;
  right: 12px;
  z-index: 1501;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  overflow: hidden;
  animation: menuSlide 0.2s ease;
}

@keyframes menuSlide {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.user-menu-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
}

.user-menu-header .menu-role {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 2px;
}

.user-menu-header .menu-name {
  font-size: 16px;
  font-weight: 600;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--border);
}

.user-menu-item:last-child {
  border-bottom: none;
}

.user-menu-item:active {
  background: var(--gray-50);
}

.user-menu-item.danger {
  color: var(--danger);
}

/* ===== 页面容器 ===== */
.page {
  display: none;
  padding: 12px;
  animation: fadeIn 0.25s ease;
}

.page.active {
  display: block;
}

/* ===== 移动端体验优化（手机竖屏） ===== */
@media (max-width: 600px) {
  /* 表单行统一单列，避免挤压 */
  .form-row,
  .form-row-3 {
    display: block;
  }
  .form-row > .form-group,
  .form-row-3 > .form-group {
    margin-bottom: 0;
  }
  /* 适度收紧内外边距 */
  .page { padding: 8px; }
  .card { padding: 14px; border-radius: 10px; margin-bottom: 10px; }
  .card-header { margin-bottom: 10px; }
  /* 表单组件在手机上的点击区域更大 */
  .form-group { margin-bottom: 14px; }
  .form-label { font-size: 13px; margin-bottom: 6px; }
  .form-input,
  .form-select,
  .form-textarea {
    font-size: 16px;        /* 防 iOS 输入时自动放大 */
    min-height: 44px;       /* 44×44 是 Apple 推荐触控目标 */
    padding: 12px 14px;
    -webkit-appearance: none;  /* 去掉 iOS 默认外观，让样式生效 */
    appearance: none;
  }
  /* select 在 iOS 上加右箭头 */
  .form-select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23475569' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 10px;
    padding-right: 32px;
  }
  /* 按钮 */
  .btn { padding: 12px 14px; font-size: 15px; border-radius: 8px; }
  .btn-lg { padding: 14px; font-size: 16px; }
  /* 头部 */
  .app-header { padding: 8px 12px; }
  .app-header h1 { font-size: 16px; }
  .user-badge { padding: 4px 8px; font-size: 13px; }
  /* 列表项 */
  .list-item { padding: 14px; }
  .list-item-title { font-size: 15px; }
  /* 上传组件的图标/按钮 */
  .photo-upload-area { padding: 14px; }
  .photo-upload-btn { padding: 10px 14px; font-size: 14px; }
  /* 提示框/弹窗 */
  .toast { font-size: 14px; padding: 12px 18px; max-width: 90%; }
  /* 表单分组 */
  .form-section-title { font-size: 14px; padding: 8px 0; }
  /* modal 底部安全区 */
  .modal { padding: 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-card);
  margin-bottom: 12px;
  transition: box-shadow 0.2s ease;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.2px;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-label .required {
  color: var(--danger);
  margin-left: 2px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

/* 输入错误状态 */
.form-input.input-error,
.form-select.input-error,
.form-textarea.input-error {
  border-color: var(--danger);
  background-color: #fef2f2;
  animation: shakeX 0.4s ease;
}
.form-input.input-error:focus,
.form-select.input-error:focus,
.form-textarea.input-error:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

@keyframes shakeX {
  0%, 100% { transform: translateX(0); }
  20%      { transform: translateX(-6px); }
  40%      { transform: translateX(5px); }
  60%      { transform: translateX(-3px); }
  80%      { transform: translateX(2px); }
}

/* 登录表单下方红色错误提示 */
.login-error-msg {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 8px 12px;
  background: #fef2f2;
  color: #b91c1c;
  border-left: 3px solid var(--danger, #ef4444);
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.4;
  animation: fadeIn 0.2s ease;
}
.login-error-icon {
  font-size: 15px;
  font-weight: 700;
  flex-shrink: 0;
}

/* 登录按钮下方的醒目错误横幅（密码错误时显示） */
.login-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
  color: #991b1b;
  border: 1px solid #fca5a5;
  border-left: 4px solid var(--danger, #dc2626);
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.45;
  position: relative;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.12);
}
.login-error-banner .login-error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--danger, #dc2626);
  color: #fff;
  border-radius: 50%;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}
.login-error-banner .login-error-content {
  flex: 1;
  min-width: 0;
}
.login-error-banner .login-error-title {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 2px;
}
.login-error-banner .login-error-text {
  font-size: 13px;
  color: #7f1d1d;
  word-break: break-all;
}
.login-error-banner .login-error-close {
  background: transparent;
  border: none;
  color: #991b1b;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  margin-left: auto;
  flex-shrink: 0;
  opacity: 0.5;
  transition: opacity 0.2s;
}
.login-error-banner .login-error-close:hover {
  opacity: 1;
}
.login-error-banner.shake {
  animation: shakeX 0.45s ease;
}

.login-default-tip {
  display: none;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.form-hint {
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 4px;
}

/* ===== 表单分区标题 ===== */
.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  margin: 16px 0 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--primary-bg);
  display: flex;
  align-items: center;
  gap: 4px;
}

.form-section-title:first-child {
  margin-top: 0;
}

/* ===== 表单行（双列布局） ===== */
.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
}

@media (min-width: 600px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
}

/* ===== 通讯地址 3 列布局 ===== */
@media (min-width: 600px) {
  .form-row-3 {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
  }
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:active {
  background: var(--primary-dark);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:active {
  background: var(--gray-50);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.btn-lg {
  padding: 14px 24px;
  font-size: 16px;
}

/* ===== 标签 ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.badge-blue { background: var(--primary-bg); color: var(--primary); }
.badge-green { background: var(--success-bg); color: var(--success); }
.badge-orange { background: var(--warning-bg); color: var(--warning); }
.badge-red { background: var(--danger-bg); color: var(--danger); }
.badge-gray { background: var(--gray-100); color: var(--gray-500); }

/* ===== 列表项 ===== */
.list-item {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.1s;
}

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.list-item-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}

.list-item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}

.list-item-meta span {
  display: flex;
  align-items: center;
  gap: 3px;
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--gray-400);
}

.empty-state .empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.empty-state p {
  font-size: 14px;
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s;
}

.modal-overlay.show {
  opacity: 1;
}

.modal {
  background: var(--card-bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

.modal-overlay.show .modal {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: var(--gray-400);
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.modal-body {
  padding: 16px 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.modal-footer .btn {
  flex: 1;
}

.confirm-modal {
  border-radius: 16px;
  max-width: 320px;
  margin: auto;
  align-self: center;
  transform: scale(0.9);
  transition: transform 0.25s;
}

.modal-overlay.show .confirm-modal {
  transform: scale(1);
}

/* ===== Toast ===== */
.toast-container {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  background: var(--gray-800);
  color: #fff;
  padding: 10px 20px;
  border-radius: 24px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.25s;
  max-width: 300px;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
  flex-shrink: 0;
}

.toast-success .toast-icon { background: var(--success); }
.toast-error .toast-icon { background: var(--danger); }
.toast-warning .toast-icon { background: var(--warning); }
.toast-info .toast-icon { background: var(--info); }

/* ===== 详情行 ===== */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 6px 0;
  font-size: 13px;
}

.detail-label {
  color: var(--text-secondary);
  flex-shrink: 0;
  min-width: 80px;
}

.detail-value {
  color: var(--text);
  text-align: right;
  font-weight: 500;
  word-break: break-all;
}

/* ===== 图片上传 ===== */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}

.upload-area:active {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.upload-area .upload-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

.upload-area .upload-text {
  font-size: 13px;
  color: var(--text-secondary);
}

.upload-preview {
  position: relative;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 缩略图卡片：小尺寸 + 保持比例不裁剪 + 可点击放大 */
.upload-preview .thumb-wrap {
  position: relative;
  display: inline-block;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  cursor: zoom-in;
  max-width: 150px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.upload-preview .thumb-wrap:active {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.18);
}

.upload-preview .thumb-wrap img {
  display: block;
  height: 96px;
  width: auto;
  max-width: 100%;
  border-radius: 4px;
  object-fit: contain;
  pointer-events: none;
}

.upload-preview .thumb-tip {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.upload-preview .upload-delete {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.92);
  color: #fff;
  border: 2px solid #fff;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  z-index: 2;
}

.upload-preview .upload-delete:active {
  background: rgba(185, 28, 28, 1);
}

/* ===== 扫描增强弹窗 ===== */
.scan-modal {
  max-width: 500px;
}

.scan-preview-wrap {
  position: relative;
  width: 100%;
  background: #1a1a2e;
  border-radius: 12px;
  overflow: hidden;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scan-preview-img {
  width: 100%;
  height: auto;
  max-height: 45vh;
  object-fit: contain;
  display: block;
}

.scan-loading {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  color: #fff;
  font-size: 14px;
}

.scan-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: scan-spin 0.8s linear infinite;
}

@keyframes scan-spin {
  to { transform: rotate(360deg); }
}

.scan-modes {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.scan-mode-btn {
  flex: 1;
  padding: 10px 4px;
  border: 2px solid var(--border);
  background: var(--card-bg);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
}

.scan-mode-btn.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-bg);
}

.scan-mode-btn:active {
  transform: scale(0.96);
}

.scan-tip {
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 10px;
}

/* ===== 粘贴上传弹窗 ===== */
.paste-hint-banner {
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 12px;
}
.paste-hint-banner b { font-weight: 700; }

.paste-preview-wrap {
  background: var(--gray-100);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 14px;
  min-height: 100px;
}
.paste-preview-img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 6px;
  object-fit: contain;
}
.paste-hint {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}
.paste-type-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.paste-type-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
  cursor: pointer;
  transition: all 0.15s;
  text-align: center;
}
.paste-type-btn:active { transform: scale(0.96); }
.paste-type-btn.has-photo {
  border-color: var(--warning);
  background: var(--warning-bg, #fffbeb);
}
.paste-type-icon { font-size: 22px; }
.paste-type-label { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.paste-type-status { font-size: 10px; color: var(--text-secondary); }

/* ===== 进度条 ===== */
.progress-bar {
  height: 6px;
  background: var(--gray-100);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 3px;
  transition: width 0.3s;
}

/* ===== 家长端登录 ===== */
.parent-login {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.parent-login .login-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.parent-login h2 {
  font-size: 20px;
  margin-bottom: 8px;
  color: var(--text);
}

.parent-login p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  text-align: center;
}

.parent-login .login-form {
  width: 100%;
  max-width: 320px;
}

/* ===== 登录页面 ===== */
.login-screen {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 9999;
  background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-y: auto;
  padding: 20px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.login-container {
  width: 100%;
  max-width: 380px;
  background: #fff;
  border-radius: 24px;
  padding: 28px 24px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: loginSlideUp 0.4s ease;
}

@keyframes loginSlideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-logo {
  text-align: center;
  margin-bottom: 24px;
}

.login-logo-icon {
  font-size: 52px;
  margin-bottom: 8px;
}

.login-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.login-form-area .form-group {
  margin-bottom: 14px;
}

.login-form-area .login-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  margin-top: 4px;
}

.login-form-area .login-btn:active {
  transform: scale(0.97);
  opacity: 0.9;
}

.login-form-area .login-credit {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 16px;
  letter-spacing: 0.5px;
  user-select: none;
}

.login-form-area .login-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gray-400);
  margin-top: 12px;
}

/* ===== 工具类 ===== */
.hidden { display: none !important; }
.mb-12 { margin-bottom: 12px; }
.text-center { text-align: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }

/* ===== 响应式 ===== */
@media (min-width: 768px) {
  .page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
  }
  .modal {
    border-radius: 16px;
    max-width: 560px;
    align-self: center;
    margin: auto;
    transform: scale(0.9);
  }
  .modal-overlay.show .modal {
    transform: scale(1);
  }
  .list-item {
    padding: 18px;
  }
}

/* ============================================
   材料示例区块
   ============================================ */
.material-sample {
  position: relative;
  width: 100%;
  background: var(--gray-50);
  border: 1px dashed var(--gray-300);
  border-radius: var(--radius-sm);
  padding: 8px;
  margin-bottom: 12px;
  cursor: zoom-in;
  transition: border-color 0.2s ease, transform 0.2s ease;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}
.material-sample:hover {
  border-color: var(--primary);
  transform: translateY(-1px);
}
.material-sample::after {
  content: "🔍 点击放大";
  position: absolute;
  bottom: 6px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.material-sample:hover::after {
  opacity: 1;
}
.material-sample img {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 480px;
  height: auto;
  border-radius: 4px;
}

.material-list {
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  padding: 6px 4px;
}
.material-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  font-size: 14px;
  color: var(--text);
  border-bottom: 1px solid var(--gray-200);
}
.material-item:last-child {
  border-bottom: none;
}
.material-num {
  color: var(--danger);
  font-weight: 700;
  font-size: 15px;
  flex-shrink: 0;
  width: 18px;
  text-align: center;
}
.material-text {
  flex: 1;
  line-height: 1.5;
}

/* ===== 材料示例图片预览（全屏放大）===== */
.material-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 24px;
  animation: fadeIn 0.18s ease-out;
  cursor: zoom-out;
}
.material-preview-overlay img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
  cursor: default;
}
.material-preview-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  line-height: 32px;
  text-align: center;
  cursor: pointer;
  user-select: none;
  z-index: 1;
  transition: background 0.2s ease;
}
.material-preview-close:hover {
  background: rgba(255, 255, 255, 0.32);
}
.material-preview-tip {
  margin-top: 14px;
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  user-select: none;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ===== 创建人 / 填报人 徽章 ===== */
.list-item-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.creator-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #1e40af;
  border: 1px solid #93c5fd;
  white-space: nowrap;
  cursor: default;
}
.creator-badge-empty {
  background: #f3f4f6;
  color: #9ca3af;
  border-color: #e5e7eb;
}
.filler-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #065f46;
  border: 1px solid #6ee7b7;
  white-space: nowrap;
  cursor: default;
}

/* ===== 老师筛选条 ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 12px;
  margin-bottom: 12px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  font-size: 13px;
}
.filter-label {
  color: var(--text-secondary);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.filter-select {
  flex: 0 0 auto;
  min-width: 160px;
  max-width: 280px;
  padding: 6px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s;
}
.filter-select:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.filter-active {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  background: #fef3c7;
  color: #92400e;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.btn-text {
  background: transparent;
  border: none;
  color: var(--info-color, #0891b2);
  cursor: pointer;
  padding: 2px 6px;
  font-size: 12px;
  text-decoration: underline;
}
.btn-text:hover {
  color: var(--primary-color, #2563eb);
}

/* ===== 移动端：徽章和筛选条适配 ===== */
@media (max-width: 600px) {
  .filter-bar {
    padding: 8px;
    gap: 6px;
  }
  .filter-select {
    flex: 1 1 100%;
    max-width: 100%;
    font-size: 14px;
    min-height: 36px;
  }
  .list-item-badges {
    gap: 4px;
  }
  .creator-badge,
  .filler-badge {
    font-size: 11px;
    padding: 1px 6px;
  }
}
