/* 词有引力 · 教师端深空风（2026-06-16 E6:银河配色,保留布局只改颜色）
   调色板:底 #0b1026 / 面板 #161d40 / 亮面板 #1b2350 / 边 #3a4480 暗边 #2c3566
          主字 #e8edff / 次字 #8a93c4 / 暗字 #5a648c
          蓝 #5b9bff / 紫 #8a6bff / 绿 #3ddc97 / 金 #ffc857 / 粉 #ff5d8f */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', sans-serif;
  background:
    radial-gradient(135% 95% at 74% 4%, #2a1f66 0%, #141a44 34%, #0b1026 64%, #070a1c 100%) fixed,
    #0b1026;
  color: #e8edff;
  padding: 24px;
  min-height: 100vh;
}

/* 全局表单元素深空风(兜底:覆盖所有未被具体选择器命中的 input/textarea/select,防白底)
   输入框比卡片(#161d40)更深+亮边,做出"凹陷输入区"对比 */
input, textarea, select {
  background: #0e1430;
  color: #e8edff;
  border: 1px solid #3d4788;
  border-radius: 6px;
  font-family: inherit;
}
input::placeholder, textarea::placeholder { color: #5a648c; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #5b9bff; box-shadow: 0 0 0 2px rgba(91, 155, 255, 0.2); }

.container { max-width: 1600px; margin: 0 auto; }

h1 { font-size: 22px; margin-bottom: 24px; text-align: center; color: #e8edff; }

.card {
  background: #161d40;
  padding: 20px;
  margin-bottom: 20px;
  border: 1px solid #3a4480;
  border-radius: 12px;
}

.card h2 {
  font-size: 16px;
  margin-bottom: 16px;
  color: #cfe0ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

form label {
  display: block;
  margin-bottom: 12px;
  font-size: 14px;
}

form input {
  display: block;
  width: 100%;
  padding: 8px;
  margin-top: 4px;
  border: 1px solid #3a4480;
  background: #1b2350;
  color: #e8edff;
  border-radius: 6px;
  font-size: 14px;
}
form input:focus { outline: none; border-color: #5b9bff; }

button {
  padding: 8px 20px;
  font-size: 14px;
  background: linear-gradient(135deg, #5b9bff, #8a6bff);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

button:hover { opacity: .9; }
button:disabled { background: #3a4480; color: #8a93c4; cursor: not-allowed; }

.word-list { list-style: none; }
.word-list li {
  padding: 12px 0;
  border-bottom: 1px solid #2c3566;
  font-size: 14px;
}
.word-list li:last-child { border-bottom: none; }
.word-list .empty { color: #5a648c; }

.toast {
  padding: 12px 20px;
  margin-bottom: 16px;
  text-align: center;
  font-size: 14px;
  border-radius: 6px;
}
.toast.success { background: rgba(61, 220, 151, 0.15); color: #3ddc97; }
.toast.error { background: rgba(255, 93, 143, 0.15); color: #ff5d8f; }
.toast.hidden { display: none; }

/* 登录区 */
#login-section { max-width: 360px; margin: 60px auto; }
#account-input,
#password-input {
  display: block;
  width: 100%;
  padding: 8px;
  margin-bottom: 12px;
  border: 1px solid #3a4480;
  background: #1b2350;
  color: #e8edff;
  border-radius: 6px;
  font-size: 14px;
}
#account-input:focus,
#password-input:focus { outline: none; border-color: #5b9bff; }
#login-btn { width: 100%; }
.login-error {
  margin-top: 12px;
  color: #ff5d8f;
  font-size: 13px;
  min-height: 18px;
}

/* 退出登录链接 */
.logout-link {
  display: block;
  text-align: right;
  margin-top: -12px;
  margin-bottom: 16px;
  font-size: 12px;
  color: #8a93c4;
  text-decoration: none;
}
.logout-link:hover { text-decoration: underline; color: #cfe0ff; }

/* === 顶部导航条（多页面共用） === */
.top-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 24px;
  border-bottom: 1px solid #2c3566;
  font-size: 14px;
  flex-wrap: wrap;
}
.top-nav a {
  color: #5b9bff;
  text-decoration: none;
}
.top-nav a:hover { text-decoration: underline; }
.top-nav .nav-active {
  color: #e8edff;
  font-weight: 600;
}
.top-nav .nav-sep {
  color: #3a4480;
}
.top-nav #logout-link {
  margin-left: auto;
  font-size: 12px;
  color: #8a93c4;
}

/* === 文本导入审核页 === */
.input-section textarea {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  margin-bottom: 12px;
  border: 1px solid #3a4480;
  background: #1b2350;
  color: #e8edff;
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.input-section .hint {
  color: #8a93c4;
  font-size: 13px;
  margin-bottom: 8px;
}

/* 状态区 */
.status-section {
  margin-bottom: 20px;
}
.status-section > div {
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.6;
}
.status-loading {
  background: rgba(91, 155, 255, 0.15);
  color: #5b9bff;
}
.status-info {
  background: rgba(255, 200, 87, 0.12);
  color: #ffc857;
}
.status-error {
  background: rgba(255, 93, 143, 0.15);
  color: #ff5d8f;
}

/* 审核卡片 */
.review-card {
  background: #161d40;
  border: 1px solid #3a4480;
  border-radius: 8px;
  margin-bottom: 24px;
  padding: 16px 20px;
  transition: opacity 0.3s;
}
.review-card.fading {
  opacity: 0;
}
.review-card .card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  border-bottom: 1px solid #2c3566;
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.review-card .card-title {
  font-size: 24px;
  font-weight: 600;
  color: #e8edff;
}
.review-card .card-index {
  color: #5a648c;
  font-size: 13px;
}

/* 字段分组 */
.field-group {
  margin-bottom: 18px;
}
.field-group-title {
  font-size: 12px;
  color: #8a93c4;
  letter-spacing: 1px;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px dashed #2c3566;
}

/* 字段行：label 左固定 / value 右 flex */
.field-row {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  gap: 12px;
}
.field-row .field-label {
  flex-shrink: 0;
  width: 110px;
  padding-top: 6px;
  font-size: 13px;
  color: #8a93c4;
}
.field-row .field-value {
  flex: 1;
  min-width: 0;
}
.field-input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid #3a4480;
  background: #1b2350;
  color: #e8edff;
  border-radius: 4px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
}
.field-input:focus { outline: none; border-color: #5b9bff; }
textarea.field-input {
  resize: vertical;
  line-height: 1.5;
}

/* 数组字段 */
.array-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.array-row {
  display: flex;
  gap: 6px;
}
.array-row .array-input {
  flex: 1;
}
.array-remove {
  flex-shrink: 0;
  width: 30px;
  padding: 0;
  background: #1b2350;
  color: #8a93c4;
  font-size: 18px;
  line-height: 1;
}
.array-remove:hover {
  background: #2c3566;
}
.array-add {
  align-self: flex-start;
  background: transparent;
  color: #5b9bff;
  font-size: 13px;
  padding: 4px 8px;
  margin-top: 4px;
}
.array-add:hover {
  background: rgba(91, 155, 255, 0.12);
}

/* 卡片底部按钮 */
.card-actions {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid #2c3566;
  display: flex;
  gap: 12px;
}
.btn-pass {
  background: #3ddc97;
  color: #fff;
}
.btn-pass:hover { opacity: .9; }
.btn-discard {
  background: #1b2350;
  color: #8a93c4;
}
.btn-discard:hover { background: #2c3566; }

/* === 多列行布局（cols-2 / cols-3）=== */
.field-row.cols-2,
.field-row.cols-3 {
  display: grid;
  gap: 16px;
  align-items: center;
}
.field-row.cols-2 { grid-template-columns: 1fr 1fr; }
.field-row.cols-3 { grid-template-columns: 1fr 1fr 1fr; }

/* 列里的小单元：label 紧贴 input，不再用 110px 固定宽 */
.field-cell {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
}
.field-row.cols-2 .field-label,
.field-row.cols-3 .field-label {
  width: auto;
  padding-top: 0;
  font-size: 13px;
  color: #8a93c4;
  white-space: nowrap;
  flex-shrink: 0;
}
.field-cell .field-input {
  flex: 1;
  min-width: 0;
}

/* === 数组多列布局（派生词/近义词/词块）=== */
.array-box.array-cols-3,
.array-box.array-cols-5 {
  display: grid;
  gap: 8px;
  align-items: center;
}
.array-box.array-cols-3 { grid-template-columns: repeat(3, 1fr); }
.array-box.array-cols-5 { grid-template-columns: repeat(5, 1fr); }
.array-box.array-cols-3 > .array-add,
.array-box.array-cols-5 > .array-add {
  grid-column: 1 / -1;
  justify-self: start;
}

/* === 待审核列表页 === */
.info-section p {
  font-size: 14px;
  color: #8a93c4;
  margin: 0;
  display: flex;
  align-items: center;
}

.pending-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.pending-table th,
.pending-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #2c3566;
  vertical-align: middle;
}
.pending-table th {
  font-weight: 600;
  color: #8a93c4;
  background: #1b2350;
  font-size: 13px;
}
.pending-table tbody tr:hover {
  background: #1b2350;
}
.btn-view {
  padding: 4px 12px;
  background: #5b9bff;
  color: #fff;
  font-size: 13px;
}
.btn-view:hover { opacity: .9; }

.empty-state {
  padding: 60px 20px;
  text-align: center;
  color: #5a648c;
  font-size: 14px;
}

.muted { color: #8a93c4; }

/* === 详情弹窗 === */
.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 6, 18, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  box-sizing: border-box;
}
.detail-modal .modal-content {
  background: #161d40;
  width: 100%;
  max-width: 900px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px 28px;
  border-radius: 12px;
  border: 1px solid #3a4480;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
  box-sizing: border-box;
}
.detail-modal .modal-title {
  font-size: 18px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #2c3566;
}
.detail-modal .modal-title span {
  color: #5b9bff;
}
.detail-modal .modal-body {
  padding-bottom: 16px;
}
.detail-modal .modal-buttons {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid #2c3566;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.btn-approve { background: #3ddc97; color: #fff; }
.btn-approve:hover { opacity: .9; }
.btn-save { background: #5b9bff; color: #fff; }
.btn-save:hover { opacity: .9; }
.btn-cancel { background: #1b2350; color: #8a93c4; }
.btn-cancel:hover { background: #2c3566; }

/* === 班级管理页（cm- 前缀避免和其他页样式冲突）=== */
.cm-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  vertical-align: middle;
  display: block;
}
.cm-avatar-placeholder {
  display: inline-block;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #2c3566;
  vertical-align: middle;
}
.cm-class-row {
  cursor: pointer;
}
.cm-class-row:hover {
  background: #1b2350;
}

/* === 班级详情页（沿用 cm- 前缀）=== */
.cm-back {
  margin: -8px 0 16px;
  font-size: 13px;
}
.cm-back a {
  color: #5b9bff;
  text-decoration: none;
}
.cm-back a:hover {
  text-decoration: underline;
}

.cm-class-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  font-size: 14px;
  color: #8a93c4;
}
.cm-class-meta > span > span {
  color: #e8edff;
  font-weight: 500;
}

.cm-helper-text {
  font-size: 13px;
  color: #8a93c4;
  margin-bottom: 12px;
  line-height: 1.5;
}

.cm-user-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.cm-user-list .empty {
  color: #5a648c;
  padding: 12px 0;
  font-size: 14px;
}
.cm-user-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #2c3566;
}
.cm-user-item:last-child {
  border-bottom: none;
}
.cm-user-name {
  flex: 1;
  font-size: 14px;
}
.cm-user-action {
  flex-shrink: 0;
  padding: 6px 14px;
  font-size: 13px;
}

/* ============================================================
   班级管理 / 班级详情 改版（2026-06-04）
   ============================================================ */

/* 创建班级：单行 */
.cm-create-inline {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cm-create-inline label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0;
  font-size: 14px;
}
.cm-create-inline label input {
  display: inline-block;
  width: 220px;
  margin-top: 0;
}
.cm-create-inline #cm-max-students { width: 140px; }
.cm-create-inline button { flex-shrink: 0; }

/* 已创建班级：卡片网格 */
.cm-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.cm-class-card {
  border: 1px solid #3a4480;
  border-radius: 8px;
  padding: 14px 16px;
  background: #161d40;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cm-class-card-name { font-size: 16px; font-weight: 600; color: #e8edff; }
.cm-class-card-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; color: #8a93c4; }
.cm-class-card-time { font-size: 12px; }
.cm-class-card-actions { display: flex; gap: 8px; margin-top: 4px; }
.cm-btn-edit { padding: 5px 14px; font-size: 13px; background: #5b9bff; color: #fff; border: none; border-radius: 4px; cursor: pointer; }
.cm-btn-edit:hover { opacity: .9; }
.cm-btn-del { padding: 5px 14px; font-size: 13px; background: transparent; color: #ff5d8f; border: 1px solid #ff5d8f; border-radius: 4px; cursor: pointer; }
.cm-btn-del:hover { background: rgba(255, 93, 143, 0.12); }

/* 已注册用户：平铺（仅查看） */
.cm-user-group-title { font-size: 13px; color: #8a93c4; font-weight: 600; margin-bottom: 8px; }
.cm-user-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.cm-user-tile {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border: 1px solid #3a4480; border-radius: 20px; background: #1b2350;
}
.cm-user-tile-name { font-size: 13px; color: #e8edff; }

/* 班级详情：工具条 */
.cm-detail-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.cm-bulk-btn { padding: 6px 16px; font-size: 13px; border-radius: 4px; cursor: pointer; border: none; color: #fff; }
.cm-bulk-btn.add { background: #3ddc97; color: #fff; }
.cm-bulk-btn.add:hover { opacity: .9; }
.cm-bulk-btn.remove { background: #1b2350; color: #8a93c4; }
.cm-bulk-btn.remove:hover { background: #2c3566; }
.cm-bulk-btn.primary { background: #5b9bff; }
.cm-bulk-btn.primary:hover { opacity: .9; }
.cm-bulk-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.cm-sel-hint { font-size: 12px; color: #8a93c4; }

/* 可选平铺：成员 / 加学生（胶囊） */
.cm-select-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.cm-select-tile {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px 6px 6px; border: 1px solid #3a4480; border-radius: 20px;
  background: #161d40; cursor: pointer; user-select: none; position: relative;
}
.cm-select-tile:hover { border-color: #5b9bff; }
.cm-select-tile.selected { border-color: #5b9bff; background: rgba(91, 155, 255, 0.15); }
.cm-select-tile .cm-tile-name { font-size: 13px; color: #e8edff; }
.cm-select-tile .cm-tile-other { font-size: 11px; color: #ffc857; }

/* 可选平铺：词包（方卡 + 角标） */
.cm-pack-tiles { display: flex; flex-wrap: wrap; gap: 12px; }
.cm-pack-tile {
  width: 200px; border: 1px solid #3a4480; border-radius: 6px; padding: 10px 12px;
  background: #161d40; cursor: pointer; user-select: none; position: relative;
}
.cm-pack-tile:hover { border-color: #5b9bff; }
.cm-pack-tile.selected { border-color: #5b9bff; background: rgba(91, 155, 255, 0.15); }
.cm-pack-tile .cm-pack-name { font-size: 14px; font-weight: 600; color: #e8edff; padding-right: 28px; }
.cm-pack-tile .cm-pack-meta { font-size: 12px; color: #8a93c4; margin-top: 4px; }

/* 角标（选中才显示） */
.cm-badge {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #5b9bff; color: #fff; font-size: 12px; font-weight: 600;
  display: none; align-items: center; justify-content: center;
}
.cm-select-tile .cm-badge { top: 50%; right: 8px; transform: translateY(-50%); width: 18px; height: 18px; font-size: 11px; }
.selected > .cm-badge { display: inline-flex; }

/* 班级详情：可编辑班名 */
.cm-name-edit-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cm-name-input { font-size: 18px; font-weight: 600; padding: 6px 10px; border: 1px solid #3a4480; background: #1b2350; color: #e8edff; border-radius: 4px; width: auto; min-width: 260px; }
