/* ============================================================
   班级宠物 · 自定义样式
   ------------------------------------------------------------
   这里改的是原站真实前端的"外观"。每次刷新页面都会自动加载
   (由 serve_mirror.py 注入到每个 HTML 页面),无需重启服务
   (带 ?v= 时间戳,避免浏览器缓存旧版本)。

   想看到效果:保存本文件后直接刷新浏览器即可。
   ============================================================ */

/* 示例 1:把品牌主色改成你喜欢的颜色(如果原站用了 CSS 变量) */
:root {
  --brand: #ff7a59;
}

/* 示例 2:给顶部导航加一点阴影,更立体 */
header, nav {
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

/* 示例 3:给"我的功能"浮窗按钮留的样式钩子(配合 custom.js) */
#custom-fab {
  z-index: 9999;
}

/* ============================================================
   任务功能（教师端 · 学生端）注入层样式
   这些类只作用于 custom.js 注入的弹层 / 导航节点，不影响原站。
   ============================================================ */
.task-bar { display:flex; gap:10px; margin-bottom:14px; flex-wrap:wrap; }
.task-btn {
  background:#6366f1; color:#fff; border:none; border-radius:12px;
  padding:10px 16px; font-size:14px; font-weight:700; cursor:pointer; font-family:inherit;
  box-shadow:0 4px 12px rgba(99,102,241,.28); transition:background .15s;
}
.task-btn:hover { background:#4f46e5; }
.task-btn:disabled { opacity:.6; cursor:default; }
.task-btn-ghost {
  background:#f1f5f9; color:#475569; border:none; border-radius:12px;
  padding:9px 14px; font-size:13px; font-weight:600; cursor:pointer; font-family:inherit;
}
.task-btn-ghost:hover { background:#e2e8f0; }

/* 教师端任务批量管理 */
.task-batch-bar { display:flex; align-items:center; gap:12px; margin-bottom:12px; padding:8px 14px; background:#fff7ed; border:1px solid #fed7aa; border-radius:12px; flex-wrap:wrap; }
.task-sel-all { display:flex; align-items:center; gap:6px; font-size:13px; font-weight:600; color:#9a3412; cursor:pointer; user-select:none; margin:0; }
.task-sel-count { font-size:13px; color:#9a3412; }
.task-card-sel { display:flex; align-items:center; margin-right:2px; }
.task-card-sel input, .task-sel-all input { width:18px; height:18px; cursor:pointer; accent-color:#ef4444; }
.task-card-top .task-card-title { flex:1 1 auto; }
.task-btn-danger { background:#ef4444; box-shadow:0 4px 12px rgba(239,68,68,.28); }
.task-btn-danger:hover { background:#dc2626; }
.task-btn-danger:disabled { opacity:.55; cursor:default; box-shadow:none; }

.task-list { display:flex; flex-direction:column; gap:12px; }
.task-card {
  background:#fff; border:1px solid #eef2f7; border-radius:16px; padding:14px 16px;
  box-shadow:0 2px 8px rgba(15,23,42,.05);
}
.task-card-top { display:flex; align-items:center; justify-content:space-between; gap:10px; }
.task-card-title { font-size:15px; font-weight:800; color:#0f172a; }
.task-card-points { display:inline-block; margin-top:6px; font-size:13px; font-weight:700; color:#16a34a; }
.task-card-desc { font-size:13px; color:#475569; margin-top:6px; line-height:1.5; white-space:pre-wrap; }
.task-card-meta { font-size:12px; color:#94a3b8; margin-top:6px; }
.task-stat-btn { flex:0 0 auto; }
.task-edit-btn { flex:0 0 auto; color:#1d4ed8; border-color:#bfdbfe; background:#eff6ff; }
.task-edit-btn:hover { background:#dbeafe; border-color:#93c5fd; }

/* 学生端卡片：折叠模式 */
.task-card-header {
  display:flex; align-items:center; justify-content:space-between; gap:10px;
  cursor:pointer; user-select:none;
}
.task-card-header:hover .task-card-expand-hint { opacity:1; }
.task-card-expand-hint {
  font-size:12px; color:#94a3b8; opacity:0.6; transition:opacity .2s;
  white-space:nowrap;
}
.task-card-expand-icon {
  font-size:12px; transition:transform .2s; display:inline-block;
}
.task-card.expanded .task-card-expand-icon { transform:rotate(180deg); }
.task-card-body { margin-top:10px; display:none; border-top:1px dashed #e2e8f0; padding-top:10px; }
.task-card.expanded .task-card-body { display:block; }
.task-card-summary {
  display:flex; align-items:center; gap:12px; flex-wrap:wrap;
  font-size:13px; color:#64748b;
  padding:8px 0;
}
.task-card-summary .task-done { font-weight:600; color:#16a34a; }
.task-card-summary .task-done.is-graded { color:#7c3aed; }
.task-card-summary .task-grading { color:#f59e0b; }
.task-card-summary .task-acc { background:none; border:none; padding:0; margin:0; font-size:13px; }
.task-card-summary .task-acc b { font-size:14px; }
.task-card-summary .task-acc.lv-good { color:#16a34a; }
.task-card-summary .task-acc.lv-mid { color:#d97706; }
.task-card-summary .task-acc.lv-bad { color:#dc2626; }

.task-stat-wrap { margin-top:12px; border-top:1px dashed #e2e8f0; padding-top:10px; }
.task-stat-bar {
  background:#eef2ff; color:#3730a3; border-radius:10px; padding:8px 12px;
  font-size:13px; font-weight:600; margin-bottom:10px;
}
.task-stat-bar b { font-size:15px; }
/* 排序表头：仿表格列标题，置于数据首行；点击切换 正序▲/倒序▼ */
.task-sort-table {
  display:flex; align-items:stretch; width:100%; margin-bottom:10px;
  border:1px solid #e2e8f0; border-radius:10px; overflow:hidden; background:#f1f5f9;
}
.task-sort-th {
  flex:1 1 0; min-width:0; text-align:center; font-size:13px; font-weight:700; color:#475569;
  padding:9px 6px; cursor:pointer; user-select:none; white-space:nowrap;
  border-right:1px solid #e2e8f0; transition:background .12s ease, color .12s ease;
}
.task-sort-th:last-child { border-right:none; }
.task-sort-th:hover { background:#e2e8f0; color:#1e293b; }
.task-sort-th.active {
  background:#4338ca; color:#fff; font-weight:800;
}
.task-sort-th.active:hover { background:#3730a3; }
.task-sub-block { margin-top:10px; }
.task-section-title { font-size:13px; font-weight:700; color:#334155; margin-bottom:6px; }
.task-sub-item {
  background:#f8fafc; border:1px solid #eef2f7; border-radius:12px; padding:10px 12px; margin-bottom:8px;
}
.task-sub-head { display:flex; align-items:center; justify-content:space-between; gap:8px; }
.task-sub-name { font-weight:700; color:#0f172a; font-size:14px; }
.task-sub-time { font-size:11px; color:#94a3b8; }
.task-sub-text { font-size:13px; color:#475569; margin-top:4px; white-space:pre-wrap; line-height:1.5; }
.task-thumbs { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.task-thumb {
  width:84px; height:84px; object-fit:cover; border-radius:10px; cursor:pointer;
  border:1px solid #e2e8f0; background:#fff;
}
.task-thumb:hover { border-color:#6366f1; }
.task-pending { font-size:13px; color:#64748b; line-height:1.6; background:#fffbeb; border:1px solid #fde68a; border-radius:10px; padding:8px 10px; }

.task-empty, .task-loading { font-size:13px; color:#94a3b8; padding:18px 4px; text-align:center; }

.task-label { display:block; font-size:13px; font-weight:600; color:#334155; margin:12px 0 5px; }
.task-input, .task-textarea {
  width:100%; border:1px solid #d8dee9; border-radius:10px; padding:9px 11px;
  font-size:14px; color:#0f172a; font-family:inherit; background:#fff; box-sizing:border-box;
}
.task-input:focus, .task-textarea:focus { outline:none; border-color:#6366f1; box-shadow:0 0 0 3px rgba(99,102,241,.15); }
.task-textarea { min-height:72px; resize:vertical; }
.task-hint { font-size:12px; color:#64748b; background:#f1f5f9; border-radius:10px; padding:8px 10px; margin-bottom:10px; line-height:1.5; }

/* 作业打卡：正确率与积分规则说明（极简一行） */
.task-help-simple {
  font-size:13px; color:#475569; background:#f1f5f9; border-left:4px solid #6366f1;
  border-radius:8px; padding:8px 12px; margin-bottom:12px; line-height:1.5;
}

.task-act { margin-top:10px; }
.task-done { font-size:13px; font-weight:700; color:#16a34a; margin-bottom:6px; }
.task-submit-form { margin-top:6px; border-top:1px dashed #e2e8f0; padding-top:8px; }
.task-file { margin-top:4px; font-size:13px; }
.task-form-row { display:flex; gap:10px; margin-top:12px; }
.task-form-row .task-btn, .task-form-row .task-btn-ghost { flex:1; }
.task-err { color:#dc2626; font-size:13px; min-height:18px; margin-top:8px; }
.task-form-head { display:flex; align-items:center; gap:12px; margin-bottom:6px; }
.task-form-title { font-size:15px; font-weight:800; color:#0f172a; }

/* AI 批改结果展示 */
.task-photo-cell { display:flex; flex-direction:column; gap:4px; max-width:150px; }
/* 学生提交：可连续拍/选多张的编辑态预览 */
.task-thumbs-edit { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.task-photo-cell-edit { position:relative; }
.task-photo-cell-edit .task-thumb { display:block; }
.task-photo-del {
  position:absolute; top:-7px; right:-7px; width:22px; height:22px;
  border-radius:50%; background:#ef4444; color:#fff; border:none;
  font-size:15px; line-height:1; padding:0; cursor:pointer;
  box-shadow:0 2px 6px rgba(239,68,68,.45);
}
.task-photo-del:hover { background:#dc2626; }
.task-add-more { margin-top:8px; }
.task-ag-err { font-size:12px; color:#dc2626; background:#fef2f2; border:1px solid #fecaca; border-radius:6px; padding:3px 6px; }

/* 标准答案图片上传 */
.task-ak-wrap { margin-top:4px; display:flex; flex-direction:column; gap:6px; }
.task-ak-previews { display:flex; align-items:flex-start; gap:8px; flex-wrap:wrap; }
.task-ak-cell { display:flex; flex-direction:column; align-items:center; gap:4px; }
.task-ak-img { max-width:140px; max-height:140px; border-radius:8px; border:1px solid #e2e8f0; }
.task-ak-del { font-size:12px; padding:2px 8px; }
.task-ak-del { font-size:12px; padding:4px 8px; }

/* AI 批改：状态与正确率 */
.task-done.is-graded { color:#7c3aed; }
.task-grading { font-size:11px; font-weight:600; color:#d97706; }
.task-acc { margin-top:6px; font-size:14px; font-weight:700; color:#0f172a; background:#f5f3ff; border:1px solid #ddd6fe; border-radius:10px; padding:7px 10px; }
.task-acc b { font-size:18px; margin:0 2px; }
.task-acc.lv-good { color:#15803d; background:#f0fdf4; border-color:#bbf7d0; }
.task-acc.lv-good b { color:#16a34a; }
.task-acc.lv-mid { color:#b45309; background:#fffbeb; border-color:#fde68a; }
.task-acc.lv-mid b { color:#d97706; }
.task-acc.lv-bad { color:#b91c1c; background:#fef2f2; border-color:#fecaca; }
.task-acc.lv-bad b { color:#dc2626; }


/* 教师端任务统计：按班级分区 + 已提交(绿)/未提交(灰) + 代传表单 */
.task-sub-group { margin-bottom:8px; }
.task-acc-tag {
  display:inline-block; font-size:11px; font-weight:700; padding:2px 8px; border-radius:999px;
  background:#e2e8f0; color:#64748b; margin-left:6px;
}
.task-acc-tag.lv-good { background:#dcfce7; color:#16a34a; }
.task-acc-tag.lv-mid { background:#fef3c7; color:#d97706; }
.task-acc-tag.lv-bad { background:#fee2e2; color:#dc2626; }
.task-sub-name.is-submitted { color:#16a34a; }
.task-sub-name.is-submitted + .task-acc-tag { margin-left:8px; }
.task-pending-title { font-size:12px; color:#94a3b8; margin:8px 0 4px; }
.task-pending-group { display:flex; flex-wrap:wrap; }
.task-pending-name {
  display:inline-block; padding:4px 12px; margin:0 6px 6px 0; border-radius:999px;
  background:#f1f5f9; color:#94a3b8; font-size:13px; cursor:pointer; user-select:none;
  border:1px dashed #cbd5e1; transition:all .15s;
}
.task-pending-name:hover { background:#e2e8f0; color:#475569; border-color:#94a3b8; }
.task-none { font-size:12px; color:#94a3b8; padding:6px 2px; }
.task-proxy-form {
  width:100%; margin-top:6px; margin-bottom:10px; padding:10px 12px;
  background:#fffbeb; border:1px solid #fde68a; border-radius:12px; box-sizing:border-box;
}
.task-proxy-title { font-size:13px; font-weight:600; color:#92400e; margin-bottom:8px; }
.task-proxy-form .task-file { margin:8px 0; }
.task-sub-name.is-submitted { cursor:pointer; border-bottom:1px dashed #86efac; }
.task-sub-name.is-submitted:hover { color:#15803d; }
.task-photo-hint { font-size:12px; color:#94a3b8; margin-bottom:10px; }
.task-retry-btn {
  display:inline-block; margin-left:8px; padding:3px 10px; font-size:12px; font-weight:600;
  color:#dc2626; background:#fee2e2; border:1px solid #fecaca; border-radius:999px; cursor:pointer;
}
.task-retry-btn:hover { background:#fecaca; }
.task-retry-btn:disabled { opacity:.6; cursor:default; }

/* 发布范围：班级多选（可勾选多个班级；不选 = 全部班级） */
.task-group-wrap { margin:4px 0 4px; }
.task-group-chip {
  display:inline-block; padding:7px 14px; border-radius:999px; font-size:13px; font-weight:700;
  cursor:pointer; user-select:none; border:1px solid #e2e8f0; background:#fff; color:#475569;
  transition:all .12s;
}
.task-group-chip:hover { border-color:#94a3b8; }
.task-group-chip.on { border-color:#2563eb; background:#eff6ff; color:#1d4ed8; }

/* 教师端任务卡：发布范围标签 */
.task-target-tag {
  display:inline-block; font-size:12px; font-weight:700; color:#1d4ed8;
  background:#eff6ff; border:1px solid #bfdbfe; border-radius:999px; padding:2px 10px;
}
