/* ============================================================
   来去题本管理后台 - 全局样式（现代清爽蓝主题）
   ============================================================ */

/* ===== 设计系统：CSS 变量 ===== */
:root {
  /* 主色系（清爽蓝） */
  --primary: #4A90E2;
  --primary-hover: #357ABD;
  --primary-light: #6BB6FF;
  --primary-bg: #e8f4fd;
  --primary-bg-hover: #d4ebfb;

  /* 语义色 */
  --success: #27ae60;
  --success-bg: #e8f8f0;
  --warning: #f39c12;
  --warning-bg: #fff4e0;
  --danger: #e74c3c;
  --danger-bg: #fdecea;
  --info: #4A90E2;
  --info-bg: #e8f4fd;

  /* 中性色阶 */
  --bg-page: #f5f7fa;
  --bg-card: #ffffff;
  --bg-hover: #f8f9fa;
  --bg-th: #fafbfc;
  --border: #e8ecf0;
  --border-strong: #d0d5dd;

  /* 文字色 */
  --text-primary: #1a2332;
  --text-regular: #4a5568;
  --text-secondary: #6b7280;
  --text-placeholder: #9ca3af;
  --text-inverse: #ffffff;

  /* 侧栏色（浅蓝色系） */
  --sidebar-bg: #eaf2fd;                     /* 浅蓝背景 */
  --sidebar-bg-deep: #dbe8fb;                /* 顶部 logo 区略深 */
  --sidebar-active: rgba(37, 99, 235, 0.14); /* 选中项浅蓝填充 */
  --sidebar-hover: rgba(37, 99, 235, 0.08);  /* 悬停浅蓝 */
  --sidebar-text: #3a5070;                   /* 深蓝灰文字 */
  --sidebar-text-active: #1d4ed8;            /* 选中项深蓝文字 */

  /* 间距 */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-full: 999px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-md: 0 2px 8px rgba(16, 24, 40, 0.06), 0 1px 2px rgba(16, 24, 40, 0.04);
  --shadow-lg: 0 4px 16px rgba(16, 24, 40, 0.08), 0 2px 4px rgba(16, 24, 40, 0.04);
  --shadow-xl: 0 12px 32px rgba(16, 24, 40, 0.12), 0 4px 8px rgba(16, 24, 40, 0.06);
  --shadow-primary: 0 4px 12px rgba(74, 144, 226, 0.25);

  /* 控件尺寸 */
  --control-height: 38px;
  --control-height-sm: 30px;
  --control-height-lg: 44px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-page);
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }

/* ===== 滚动条美化 ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.15); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.3); }

/* ============================================================
   登录页
   ============================================================ */
.login-view {
  min-height: 100vh;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 50%, #6BB6FF 100%);
  background-attachment: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  position: relative;
  overflow: hidden;
}

/* 登录背景装饰 */
.login-view::before,
.login-view::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  pointer-events: none;
}
.login-view::before { width: 400px; height: 400px; top: -150px; right: -100px; }
.login-view::after { width: 300px; height: 300px; bottom: -100px; left: -80px; }

.login-box {
  background: #fff;
  border-radius: var(--radius-2xl);
  padding: 48px 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  position: relative;
  z-index: 1;
}

.login-title {
  text-align: center;
  font-size: 26px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.5px;
}

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

.login-tip {
  margin-top: 20px;
  text-align: center;
  color: var(--text-placeholder);
  font-size: 12px;
}

/* ============================================================
   表单控件（核心修复：高度/对齐统一）
   ============================================================ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  margin-bottom: var(--space-sm);
  color: var(--text-regular);
  font-size: 13px;
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  height: var(--control-height);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 14px;
  line-height: var(--control-height);
  color: var(--text-primary);
  outline: none;
  transition: var(--transition);
  font-family: inherit;
  background-color: #fff;
}

.form-group textarea {
  height: auto;
  min-height: 96px;
  padding: 10px 14px;
  line-height: 1.6;
  resize: vertical;
}

/* 自定义 select 箭头（统一外观） */
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 36px;
  cursor: pointer;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1.5 3.5h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

.form-group input:hover,
.form-group select:hover,
.form-group textarea:hover {
  border-color: var(--border-strong);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12);
}

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

/* ============================================================
   按钮
   ============================================================ */
.btn-primary,
.btn-success,
.btn-danger,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: none;
  padding: 0 18px;
  height: var(--control-height);
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(74, 144, 226, 0.35);
}
.btn-primary:active { transform: translateY(0); }

.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #1e8449; transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; transform: translateY(-1px); }

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: var(--primary-bg);
  border-color: var(--primary-hover);
}

.btn-block { width: 100%; height: var(--control-height-lg); font-size: 15px; font-weight: 600; }

.btn-sm {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  height: var(--control-height-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12px;
  border: 1px solid var(--border);
  background: #fff;
  transition: var(--transition);
  margin-right: 6px;
  font-family: inherit;
  line-height: 1;
}
.btn-sm:hover { background: var(--bg-hover); border-color: var(--border-strong); }
.btn-sm.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-sm.btn-danger:hover { background: #c0392b; }

/* 承诺书 Tab 按钮 */
.cm-tab-btn {
  font-size: 14px;
  padding: 12px 20px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: var(--transition);
  font-family: inherit;
}
.cm-tab-btn:hover { color: var(--primary); }
.cm-tab-active { color: var(--primary) !important; border-bottom-color: var(--primary) !important; font-weight: 600; }

/* ============================================================
   主界面布局
   ============================================================ */
.app-view {
  display: flex;
  min-height: 100vh;
}

/* ===== 侧边栏 ===== */
.sidebar {
  width: 240px;
  background: var(--sidebar-bg);
  color: #2f4a6b;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
  flex-shrink: 0;
}

.logo-section {
  height: auto;
  padding: 14px 14px;
  border-bottom: 1px solid rgba(37, 99, 235, 0.18);
  display: flex;
  align-items: center;
  gap: 12px;
  background: #3b82f6;
  color: #fff;
  overflow: hidden;
}

.logo-image {
  width: 56px;
  height: 40px;
  flex: 0 0 56px;
  object-fit: contain;
  display: block;
}

.logo-copy { min-width: 0; line-height: 1.25; }
.logo-company {
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  letter-spacing: 0;
}
.logo-platform {
  display: inline-block;
  margin-top: 7px;
  padding: 4px 8px;
  border-radius: 6px;
  background: #fff;
  color: #1d4ed8;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}
.logo-icon, .logo-text { display: none; }

.nav-menu {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 11px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  transition: var(--transition);
  border-left: 3px solid transparent;
  white-space: nowrap;
  font-size: 14px;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  border-left-color: var(--primary);
  font-weight: 500;
}

.nav-icon { margin-right: 12px; font-size: 18px; line-height: 1; }

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(37, 99, 235, 0.18); }
.sidebar-footer .btn-outline {
  color: #2f4a6b;
  border-color: rgba(37, 99, 235, 0.35);
  background: transparent;
}
.sidebar-footer .btn-outline:hover {
  background: rgba(37, 99, 235, 0.10);
  border-color: rgba(37, 99, 235, 0.5);
  color: #1d4ed8;
}

/* ===== 主内容区 ===== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.top-bar {
  background: #fff;
  padding: 0 30px;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-title { font-size: 17px; font-weight: 600; color: var(--text-primary); }

.user-info {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-regular);
  font-size: 14px;
}

.user-avatar {
  width: 36px;
  height: 36px;
  line-height: 36px;
  text-align: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  border-radius: 50%;
  font-weight: 600;
  font-size: 14px;
  box-shadow: var(--shadow-primary);
}

.content-area {
  flex: 1;
  padding: 24px 30px;
  overflow: auto;
}

/* ============================================================
   仪表盘 - 统计卡片
   ============================================================ */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  padding: var(--space-xl);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  border: 1px solid var(--border);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  font-size: 32px;
  margin-bottom: var(--space-sm);
  line-height: 1;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--space-xs);
  line-height: 1.2;
}

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

/* ============================================================
   面板/卡片
   ============================================================ */
.panel {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  padding: var(--space-2xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.panel-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  color: var(--text-primary);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
  gap: var(--space-md);
}

/* ============================================================
   筛选/搜索栏
   ============================================================ */
.filter-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  align-items: center;
}

.search-input {
  height: var(--control-height);
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  outline: none;
  min-width: 220px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  background-color: #fff;
  line-height: var(--control-height);
  transition: var(--transition);
}

.search-input:hover { border-color: var(--border-strong); }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.12); }
.search-input::placeholder { color: var(--text-placeholder); }

select.search-input {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  padding-right: 36px;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1.5 3.5h9z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
}

/* ============================================================
   表格
   ============================================================ */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

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

.data-table th {
  background: var(--bg-th);
  color: var(--text-regular);
  font-weight: 600;
  white-space: nowrap;
  font-size: 13px;
  text-transform: none;
  position: sticky;
  top: 0;
}

.data-table tbody tr {
  transition: var(--transition);
}

.data-table tbody tr:nth-child(even) { background: #fafbfc; }

.data-table tbody tr:hover {
  background: var(--primary-bg);
}

/* ============================================================
   标签 Tag
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  background: var(--primary-bg);
  color: var(--primary);
  font-weight: 500;
  line-height: 1.5;
  white-space: nowrap;
}

.tag-success { background: var(--success-bg); color: var(--success); }
.tag-danger { background: var(--danger-bg); color: var(--danger); }
.tag-warning { background: var(--warning-bg); color: var(--warning); }
.tag-info { background: var(--info-bg); color: var(--info); }

/* ============================================================
   操作按钮（表格内）
   ============================================================ */
.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 12px;
  margin-right: 6px;
  font-family: inherit;
  transition: var(--transition);
  line-height: 1.4;
  font-weight: 500;
}

.action-edit { background: var(--primary-bg); color: var(--primary); }
.action-edit:hover { background: var(--primary); color: #fff; }

.action-delete { background: var(--danger-bg); color: var(--danger); }
.action-delete:hover { background: var(--danger); color: #fff; }

.action-view { background: var(--bg-hover); color: var(--text-regular); border: 1px solid var(--border); }
.action-view:hover { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); }

/* ============================================================
   模态框
   ============================================================ */
.modal {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn 0.2s ease;
}

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

.modal-backdrop {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(16, 24, 40, 0.5);
  backdrop-filter: blur(2px);
}

.modal-box {
  position: relative;
  background: #fff;
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 640px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  animation: modalSlideUp 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.modal-header h3 { font-size: 17px; color: var(--text-primary); font-weight: 600; }

.close-btn {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover { color: var(--text-primary); background: var(--bg-hover); }

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

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: var(--space-md);
}

/* ============================================================
   Toast 提示
   ============================================================ */
.toast {
  position: fixed;
  top: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text-primary);
  color: #fff;
  padding: 12px 24px;
  border-radius: var(--radius-lg);
  z-index: 2000;
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
}

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

/* ============================================================
   选项编辑器
   ============================================================ */
.options-editor {
  background: var(--bg-hover);
  padding: var(--space-lg);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid var(--border);
}

.option-row {
  display: flex;
  gap: var(--space-md);
  align-items: center;
  margin-bottom: var(--space-sm);
}

.option-row .key-input { width: 60px; text-align: center; }
.option-row .text-input { flex: 1; }
.option-row button {
  padding: 0 12px;
  height: var(--control-height);
  background: var(--danger-bg);
  color: var(--danger);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  font-size: 13px;
}
.option-row button:hover { background: var(--danger); color: #fff; }

/* ============================================================
   题目/试卷选择列表（核心：自定义复选框/单选框）
   ============================================================ */
.question-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-sm);
  background: #fff;
}

.question-checkbox {
  padding: 10px 12px;
  cursor: pointer;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: var(--transition);
  margin-bottom: 2px;
}

.question-checkbox:hover { background: var(--bg-hover); }

/* 自定义复选框样式 */
.question-checkbox input[type="checkbox"],
.question-checkbox input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
  margin: 0;
  outline: none;
}

.question-checkbox input[type="checkbox"]:hover,
.question-checkbox input[type="radio"]:hover {
  border-color: var(--primary);
}

.question-checkbox input[type="checkbox"]:checked {
  background: var(--primary);
  border-color: var(--primary);
}

.question-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* 单选框改为圆形 */
.question-checkbox input[type="radio"] {
  border-radius: 50%;
}

.question-checkbox input[type="radio"]:checked {
  background: #fff;
  border-color: var(--primary);
  border-width: 2px;
}

.question-checkbox input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* 通用复选框/单选框（适用于表单其他位置） */
input[type="checkbox"].dept-check,
input[type="checkbox"].class-check,
input[type="checkbox"].pa-q-check,
input[type="radio"][name="ex-paper"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  flex-shrink: 0;
  margin: 0;
  outline: none;
}

input[type="checkbox"].dept-check:hover,
input[type="checkbox"].class-check:hover,
input[type="checkbox"].pa-q-check:hover,
input[type="radio"][name="ex-paper"]:hover {
  border-color: var(--primary);
}

input[type="checkbox"].dept-check:checked,
input[type="checkbox"].class-check:checked,
input[type="checkbox"].pa-q-check:checked {
  background: var(--primary);
  border-color: var(--primary);
}

input[type="checkbox"].dept-check:checked::after,
input[type="checkbox"].class-check:checked::after,
input[type="checkbox"].pa-q-check:checked::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

input[type="radio"][name="ex-paper"] { border-radius: 50%; }
input[type="radio"][name="ex-paper"]:checked {
  background: #fff;
  border-color: var(--primary);
}
input[type="radio"][name="ex-paper"]:checked::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
}

/* ===== 文件会签范围选择 ===== */
.cs-scope-bar { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.cs-scope-tip { color:#6b7280; font-size:12px; }
.cs-scope-count { margin-top:8px; color:#185FA5; font-size:12px; }
.cs-mini-btn { border:1px solid #e3e8ef; background:#fff; color:#333; padding:4px 12px; border-radius:6px; cursor:pointer; font-size:12px; margin-left:6px; }
.cs-mini-btn:hover { border-color:#185FA5; color:#185FA5; }
.cs-chip-cloud { display:flex; flex-wrap:wrap; gap:8px; max-height:200px; overflow:auto; padding:4px; }
.cs-chip { display:inline-flex; align-items:center; gap:6px; padding:7px 12px; border:1px solid #e3e8ef; border-radius:8px; cursor:pointer; font-size:13px; background:#fff; color:#333; transition:all .15s; user-select:none; }
.cs-chip:hover { border-color:#185FA5; }
.cs-chip.on { background:#185FA5; color:#fff; border-color:#185FA5; }
.cs-chip .cs-chip-num { font-size:11px; color:#6b7280; }
.cs-chip.on .cs-chip-num { color:rgba(255,255,255,0.85); }
.cs-search { width:100%; padding:8px 10px; border:1px solid #e3e8ef; border-radius:8px; margin-bottom:8px; font-size:13px; box-sizing:border-box; }
.cs-search:focus { outline:none; border-color:#185FA5; }
.cs-student-list { max-height:230px; overflow:auto; display:flex; flex-direction:column; gap:6px; padding:2px; }
.cs-student-item { display:flex; align-items:center; gap:8px; padding:8px 10px; border:1px solid #eef1f5; border-radius:8px; cursor:pointer; font-size:13px; background:#fff; transition:all .15s; }
.cs-student-item:hover { border-color:#185FA5; }
.cs-student-item.on { border-color:#185FA5; background:#eef6ff; }
.cs-student-item input { accent-color:#185FA5; width:15px; height:15px; flex-shrink:0; }

/* ============================================================
   杂项
   ============================================================ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-placeholder);
  font-size: 14px;
}

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

.pagination {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
}

.pagination button {
  padding: 0 14px;
  height: var(--control-height);
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 13px;
  transition: var(--transition);
  font-family: inherit;
  color: var(--text-regular);
}

.pagination button:hover { border-color: var(--primary); color: var(--primary); }

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

.sig-thumb {
  max-width: 80px;
  max-height: 40px;
  cursor: pointer;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}
.sig-thumb:hover { border-color: var(--primary); box-shadow: var(--shadow-sm); }

/* ============================================================
   试卷编辑器 - 左右双栏布局
   ============================================================ */
.paper-editor-modal .modal-box {
  max-width: 1200px;
  width: 94vw;
  max-height: 92vh;
}

.paper-editor {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: var(--space-lg);
  min-height: 520px;
  height: calc(92vh - 280px);
}

/* 左侧题库区 */
.paper-q-bank {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
}

.paper-q-bank-toolbar {
  padding: var(--space-md);
  border-bottom: 1px solid var(--border);
  background: var(--bg-th);
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  align-items: center;
}

.paper-q-bank-toolbar .search-input {
  min-width: 0;
  flex: 1;
  height: var(--control-height-sm);
  padding: 0 10px;
  font-size: 13px;
  line-height: var(--control-height-sm);
}

.paper-q-bank-toolbar select.search-input { flex: 0 0 110px; }

.paper-q-bank-actions {
  padding: var(--space-sm) var(--space-md);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  background: #fff;
  font-size: 12px;
  color: var(--text-secondary);
}

.paper-q-bank-body {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-sm);
}

/* 按分类分组 */
.paper-q-group {
  margin-bottom: var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.paper-q-group-header {
  padding: 8px 12px;
  background: var(--bg-th);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-regular);
  border-bottom: 1px solid var(--border);
}

.paper-q-group-header .group-stat {
  font-weight: 500;
  font-size: 12px;
  color: var(--text-secondary);
}

.paper-q-group-header .group-stat .selected-count {
  color: var(--primary);
  font-weight: 600;
}

.paper-q-group-body { padding: 4px; }

/* 题目项 */
.paper-q-item {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  transition: var(--transition);
  cursor: pointer;
}

.paper-q-item:hover { background: var(--bg-hover); }
.paper-q-item.is-selected { background: var(--primary-bg); }
.paper-q-item.is-selected:hover { background: var(--primary-bg-hover); }

/* 试卷编辑器内的复选框：让点击穿透到 .paper-q-item，由 JS 统一管理状态 */
.paper-q-item .pa-q-check {
  pointer-events: none;
  margin-top: 2px;
}

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

.paper-q-item-title {
  color: var(--text-primary);
  word-break: break-all;
}

.paper-q-item-meta {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.paper-q-item-meta .tag {
  font-size: 11px;
  padding: 1px 8px;
}

/* 题目展开预览 */
.paper-q-item-detail {
  margin-top: 8px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 12px;
  color: var(--text-regular);
  line-height: 1.7;
  display: none;
}

.paper-q-item.is-expanded .paper-q-item-detail { display: block; }

.paper-q-item-detail .detail-label {
  color: var(--text-secondary);
  font-weight: 500;
  margin-right: 4px;
}

.paper-q-item-detail .option-line {
  padding: 2px 0;
}

.paper-q-item-detail .answer-line {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  color: var(--success);
}

/* 右侧已选清单 */
.paper-selected {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
}

.paper-selected-header {
  padding: 12px 14px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-hover) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
}

.paper-selected-stats {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.9;
  background: var(--bg-th);
}

.paper-selected-stats .stat-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.paper-selected-stats .stat-row .stat-value {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.paper-selected-stats .stat-row .stat-value.text-primary { color: var(--primary); }
.paper-selected-stats .stat-row .stat-value.text-warning { color: var(--warning); }

.paper-selected-stats .type-distribution {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.paper-selected-stats .type-distribution .tag {
  font-size: 11px;
  padding: 1px 7px;
}

.paper-selected-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px;
}

.paper-selected-item {
  padding: 8px 10px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  transition: var(--transition);
  border: 1px solid transparent;
}

.paper-selected-item:hover {
  background: var(--bg-hover);
  border-color: var(--border);
}

.paper-selected-item .item-index {
  width: 22px;
  height: 22px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  flex-shrink: 0;
}

.paper-selected-item .item-title {
  flex: 1;
  min-width: 0;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.paper-selected-item .item-score {
  color: var(--warning);
  font-weight: 600;
  font-size: 12px;
  flex-shrink: 0;
}

.paper-selected-item .item-remove {
  width: 22px;
  height: 22px;
  border: none;
  background: var(--danger-bg);
  color: var(--danger);
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.paper-selected-item .item-remove:hover {
  background: var(--danger);
  color: #fff;
}

.paper-selected-empty {
  text-align: center;
  padding: 40px 12px;
  color: var(--text-placeholder);
  font-size: 13px;
}

.paper-selected-empty .empty-icon {
  font-size: 36px;
  display: block;
  margin-bottom: 8px;
  opacity: 0.5;
}

/* 题量较大时的提示 */
.paper-q-bank-tip {
  padding: 6px var(--space-md);
  background: var(--warning-bg);
  color: var(--warning);
  font-size: 12px;
  border-bottom: 1px solid var(--border);
  display: none;
}

.paper-q-bank-tip.is-visible { display: block; }

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .logo-text, .nav-item span:not(.nav-icon), .sidebar-footer button span { display: none; }
  .nav-item { justify-content: center; padding: 14px 8px; }
  .nav-icon { margin-right: 0; }
  .content-area { padding: 16px; }
  .panel { padding: 16px; }
  .top-bar { padding: 0 16px; }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .search-input { min-width: 0; width: 100%; }
}

/* ============================================================
   学习资料附件上传组件
   ============================================================ */
.upload-btns {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-btn {
  position: relative;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
}

.upload-btn input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-btn:hover {
  background: var(--primary-bg);
  border-color: var(--primary);
  color: var(--primary);
}

.upload-tip {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 上传进度条 */
.upload-progress {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg-th);
  border-radius: var(--radius-md);
}

.upload-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--primary) 0%, var(--primary-hover) 100%);
  border-radius: 4px;
  transition: width 0.2s ease;
}

.upload-progress-text {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-secondary);
}

/* 已上传文件卡片 */
.file-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--bg-th);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.file-card:hover {
  border-color: var(--primary);
  background: var(--primary-bg);
}

.file-card .file-icon {
  font-size: 28px;
  line-height: 1;
  flex-shrink: 0;
}

.file-card .file-info {
  flex: 1;
  min-width: 0;
}

.file-card .file-name {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-card .file-size {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.file-card .file-type {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.file-card .btn-sm {
  flex-shrink: 0;
  padding: 4px 10px;
  font-size: 12px;
}

/* 小尺寸按钮通用 */
.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
}

/* 学员档案"查看档案"按钮 */
.action-view {
  background: var(--primary-bg);
  color: var(--primary);
}
.action-view:hover {
  background: var(--primary);
  color: #fff;
}

/* 状态文字与徽标 */
.text-ok { color: var(--success); }
.text-muted { color: var(--text-placeholder); }
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}
.badge-ok { background: var(--success-bg); color: var(--success); }
.badge-warn { background: var(--warning-bg); color: var(--warning); }
.badge-bad { background: var(--danger-bg); color: var(--danger); }

/* ===== 一人一档档案视图 ===== */
.archive-view { font-size: 14px; }
.archive-info-card {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
  background: var(--bg-subtle, #f7f9fc);
  border: 1px solid var(--border, #eef1f5);
  border-radius: var(--radius, 8px);
  padding: 16px;
  margin-bottom: 16px;
}
.ai-row { display: flex; gap: 10px; line-height: 1.6; }
.ai-label { color: var(--text-secondary, #666); min-width: 84px; }
.ai-val { color: var(--text-primary, #222); font-weight: 500; }
.archive-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}
.stat-box {
  flex: 1;
  min-width: 120px;
  background: linear-gradient(135deg, var(--primary-bg), #f7fbff);
  border: 1px solid var(--primary-bg-hover);
  border-radius: var(--radius, 8px);
  padding: 14px;
  text-align: center;
}
.stat-box-val { font-size: 22px; font-weight: 700; color: var(--primary); }
.stat-box-label { font-size: 12px; color: var(--text-secondary, #666); margin-top: 4px; }
.archive-actions { display: flex; gap: 10px; margin-bottom: 12px; }
.archive-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.af-input {
  flex: 1;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid var(--border, #ddd);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
}
.af-select {
  padding: 7px 10px;
  border: 1px solid var(--border, #ddd);
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  background: #fff;
}
.archive-sec { margin-bottom: 20px; }
.archive-sec-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #222);
  margin-bottom: 8px;
  border-left: 3px solid var(--primary, #4A90E2);
  padding-left: 8px;
}
.archive-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.archive-table th, .archive-table td {
  border: 1px solid var(--border, #eee);
  padding: 8px 10px;
  text-align: left;
}
.archive-table th { background: var(--bg-subtle, #f7f9fc); color: var(--text-secondary, #555); font-weight: 600; }
.archive-table tr:nth-child(even) td { background: #fafbfd; }
.archive-msg-content { max-width: 320px; color: var(--text-secondary, #555); }

/* 打印：仅显示档案内容，隐藏侧边栏/筛选/按钮 */
@media print {
  body * { visibility: hidden; }
  #modal, #modal * { visibility: visible; }
  #modal {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    bottom: auto !important;
    right: auto !important;
    display: block !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: auto !important;
    overflow: visible !important;
    background: #fff !important;
  }
  .modal-backdrop { display: none !important; }
  .modal-box {
    width: 100% !important;
    max-width: none !important;
    max-height: none !important;
    overflow: visible !important;
    box-shadow: none !important;
    border: none !important;
    margin: 0 !important;
    display: block !important;
  }
  .modal-body { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  .no-print, .modal-footer { display: none !important; }
  .archive-table th, .archive-table td { border: 1px solid #ccc; }
  .archive-sec { page-break-inside: avoid; }
  .stat-box { box-shadow: none; }
}

/* ============================================================
   数据概览优化
   ============================================================ */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.qa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  font-size: 14px;
  color: var(--text-primary);
  cursor: pointer;
  transition: all .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.qa-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.qa-icon { font-size: 18px; }

/* 指标卡升级：固定 3 列，避免末行缺角 */
.dash-stat-grid { grid-template-columns: repeat(3, 1fr); }
.stat-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.stat-trend {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
}
.trend-up { background: #e8f7ee; color: #1f9d55; }
.trend-down { background: #fdecec; color: #e04848; }
.trend-flat { background: #f1f3f6; color: #8a93a2; }

/* 指标卡图标底色 */
.stat-icon.ig-blue { background: #eaf2ff; color: #2a7fff; }
.stat-icon.ig-orange { background: #fff3e6; color: #ff8c00; }
.stat-icon.ig-purple { background: #f1ebff; color: #8b5cf6; }
.stat-icon.ig-green { background: #e6f8ee; color: #22c55e; }
.stat-icon.ig-cyan { background: #e2fbf6; color: #12b3a6; }
.stat-icon.ig-red { background: #fdecec; color: #ef4444; }

/* 两栏布局 */
.dash-cols {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  align-items: start;
}

/* 分类条形图 */
.cat-chart { display: flex; flex-direction: column; gap: 14px; }
.cat-bar-row { display: flex; align-items: center; gap: 12px; }
.cat-bar-label { width: 130px; flex-shrink: 0; font-size: 13px; color: var(--text-secondary); text-align: right; }
.cat-bar-body { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.cat-bar-line { display: flex; align-items: center; gap: 10px; }
.cat-bar-track { flex: 1; height: 10px; background: #eef1f6; border-radius: 5px; overflow: hidden; }
.cat-bar { height: 100%; border-radius: 5px; min-width: 2px; transition: width .4s ease; }
.cat-bar.ig-blue { background: #2a7fff; }
.cat-bar.ig-orange { background: #ff8c00; }
.cat-bar-val { width: 28px; font-size: 13px; color: var(--text-primary); font-weight: 600; text-align: right; }

/* 最近动态 */
.activity-feed { display: flex; flex-direction: column; }
.activity-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.activity-item:last-child { border-bottom: none; }
.activity-dot { width: 9px; height: 9px; border-radius: 50%; margin-top: 6px; flex-shrink: 0; }
.activity-dot.ig-purple { background: #8b5cf6; }
.activity-dot.ig-green { background: #22c55e; }
.activity-body { flex: 1; }
.activity-text { font-size: 14px; color: var(--text-primary); line-height: 1.5; }
.activity-time { font-size: 12px; color: #aaa; margin-top: 4px; }

/* 响应式 */
@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .dash-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .cat-bar-label { width: 92px; font-size: 12px; }
}

/* ============================================================
   全局加载进度条（请求期间顶部滑动指示）
   ============================================================ */
.loading-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 3000;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  background: transparent;
}
.loading-bar.active { opacity: 1; }
.loading-bar::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 38%;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  animation: loadingSlide 1s ease-in-out infinite;
}
@keyframes loadingSlide {
  0%   { left: -40%; }
  100% { left: 100%; }
}

/* ============================================================
   宽表格横向滚动容器（窄屏不撑破布局）
   ============================================================ */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.table-wrap > .data-table,
.table-wrap > .archive-table {
  min-width: 720px;
}

