/* ===== 交作业：学生提交卡片 + 老师批改页 ===== */

/* 学生端：下载模板 → 上传 .md */
/* 卡片固定落在任务小节末尾，和上面的正文拉开距离，别让人以为它是标题的附属品 */
.content .hw-card { margin: 28px 0 20px; border: 1px solid #e3e9f2; border-top: 2px solid #d7e3f5; border-radius: 9px; background: #fbfdff; overflow: hidden; }
.content .hw-head { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 9px 12px; font-size: 13px; }
.content .hw-title { font-weight: 700; color: #1f2937; }
.content .hw-status { font-size: 12px; color: #8593a8; background: #eef2f8; padding: 2px 8px; border-radius: 20px; cursor: pointer; }
.content .hw-status.on { color: #15803d; background: #e8f7ee; }
.content .hw-sub { font-size: 12px; color: #9aa8bd; }
.content .hw-tpl, .content .hw-pick {
  padding: 5px 11px; border-radius: 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
}
.content .hw-tpl { border: 1px solid #c9d6e8; background: #fff; color: #25507d; }
.content .hw-tpl:hover { background: #f3f7fd; }
.content .hw-pick { border: 1px solid #c9d6e8; background: #fff; color: #25507d; }
.content .hw-pick:hover { background: #f3f7fd; }
.content .hw-file { font-size: 11.5px; color: #9aa8bd; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.content .hw-submit {
  margin-left: auto; padding: 5px 14px; border: 0; border-radius: 6px; background: #2563eb;
  color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.content .hw-submit[disabled] { background: #c8d3e4; cursor: not-allowed; }
.content .hw-submit:not([disabled]):hover { background: #1d4ed8; }

/* 手机 / 没装 Typora 的学生：直接粘正文，不必先有 .md 文件 */
.content .hw-paste { border: 1px dashed #9fb6d6; background: #f7fbff; color: #1f5fa8; }
.content .hw-paste:hover { background: #eaf3ff; }
.content .hw-pastebox { border-top: 1px solid #eef2f8; background: #fff; padding: 10px 12px 12px; }
.content .hw-textarea {
  width: 100%; box-sizing: border-box; min-height: 150px; resize: vertical;
  border: 1px solid #dbe3ef; border-radius: 8px; padding: 10px 12px;
  font: 13.5px/1.7 ui-monospace, Menlo, Consolas, "Microsoft YaHei", monospace;
  color: #1f2430; background: #fdfefe; outline: none;
}
.content .hw-textarea:focus { border-color: #7aa7e8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.content .hw-pastefoot { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.content .hw-pastemeta { font-size: 11.5px; color: #8593a8; }
.content .hw-pastemeta.over { color: #dc2626; font-weight: 600; }
.content .hw-pastesubmit {
  margin-left: auto; padding: 6px 16px; border: 0; border-radius: 6px;
  background: #16a34a; color: #fff; font-size: 12.5px; font-weight: 600; cursor: pointer;
}
.content .hw-pastesubmit[disabled] { background: #c8d3e4; cursor: not-allowed; }
.content .hw-pastesubmit:not([disabled]):hover { background: #15803d; }

.content .hw-body { border-top: 1px solid #eef2f8; padding: 10px 12px 12px; background: #fff; }
.content .hw-meta { font-size: 11.5px; color: #8593a8; margin-bottom: 8px; }
.content .hw-render {
  border: 1px solid #e8edf5; border-radius: 8px; padding: 12px 14px;
  font-size: 14px; line-height: 1.75; color: #1f2430; max-height: 420px; overflow: auto;
}
.content .hw-render img { max-width: 100%; border-radius: 6px; border: 1px solid #e3e9f2; }
.content .hw-render pre { background: #f6f8fb; padding: 10px 12px; border-radius: 6px; overflow: auto; }
.content .hw-render code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.content .hw-render h1 { font-size: 18px; margin: 4px 0 10px; }
.content .hw-render h2 { font-size: 15px; margin: 14px 0 8px; }
.content .hw-comment { border-top: 1px solid #eef2f8; padding: 9px 12px; font-size: 12.5px; color: #15803d; background: #f4fbf7; }

/* ===== 老师批改页 ===== */
body.hw-page { margin: 0; background: #f5f7fa; color: #1f2430; font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.hw-top { position: sticky; top: 0; z-index: 20; height: 56px; background: #fff; border-bottom: 1px solid #eceff4;
  display: flex; align-items: center; gap: 16px; padding: 0 22px; }
.hw-brand { font-weight: 700; color: #2563eb; text-decoration: none; }
.hw-top .spacer { flex: 1; }
.hw-top .who { color: #7a8494; font-size: 13px; }

.hw-main { max-width: 1280px; margin: 0 auto; padding: 18px 22px 60px; }
.hw-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.hw-lec { display: flex; gap: 6px; }
.hw-lec a { padding: 6px 12px; border-radius: 7px; background: #fff; border: 1px solid #e3e9f2; color: #3b4351; text-decoration: none; font-size: 13px; }
.hw-lec a.on { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.hw-task { display: flex; gap: 6px; margin-left: auto; }
.hw-task button { padding: 6px 12px; border-radius: 7px; border: 1px solid #e3e9f2; background: #fff; font-size: 13px; cursor: pointer; color: #3b4351; }
.hw-task button.on { border-color: #2563eb; color: #2563eb; background: #eef4ff; font-weight: 600; }

.hw-stats { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.hw-stat { background: #fff; border-radius: 10px; padding: 12px 16px; min-width: 120px; }
.hw-stat b { display: block; font-size: 22px; line-height: 1.2; }
.hw-stat span { font-size: 12px; color: #8593a8; }
.hw-stat.ok b { color: #16a34a; }
.hw-stat.wait b { color: #d97706; }
.hw-stat.miss b { color: #dc2626; }

.hw-tablewrap { background: #fff; border-radius: 10px; overflow: hidden; }
.hw-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.hw-table th { text-align: left; color: #8593a8; font-weight: 600; font-size: 12px; padding: 10px 14px; border-bottom: 1px solid #eceff4; }
.hw-table td { padding: 10px 14px; border-bottom: 1px solid #f4f6f9; vertical-align: middle; }
.hw-table tr:last-child td { border-bottom: 0; }
.hw-thumb { width: 84px; height: 52px; object-fit: cover; border-radius: 5px; border: 1px solid #e3e9f2; cursor: pointer; background: #f5f7fa; }
.hw-pill { font-size: 12px; padding: 2px 8px; border-radius: 20px; }
.hw-pill.new { background: #fff5e6; color: #b45309; }
.hw-pill.ok { background: #e8f7ee; color: #15803d; }
.hw-pill.back { background: #fdecec; color: #b91c1c; }
.hw-pill.miss { background: #f1f4f9; color: #8593a8; }
.hw-open { padding: 4px 10px; border-radius: 6px; border: 1px solid #dfe6f0; background: #fff; font-size: 12.5px; cursor: pointer; }

.hw-modal { position: fixed; inset: 0; background: rgba(18,24,34,.6); display: flex; align-items: center; justify-content: center; z-index: 90; padding: 24px; }
.hw-dialog { background: #fff; border-radius: 12px; width: min(900px, 100%); max-height: 92vh; display: flex; flex-direction: column; overflow: hidden; }
.hw-dialog-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid #eceff4; }
.hw-dialog-head b { font-size: 14px; }
.hw-dialog-head .x { margin-left: auto; border: 0; background: transparent; font-size: 18px; cursor: pointer; color: #8593a8; }
.hw-dialog-body { padding: 14px 16px; overflow: auto; }
.hw-dialog-body img { max-width: 100%; border-radius: 8px; border: 1px solid #e3e9f2; }
.hw-dialog-note { margin-top: 12px; font-size: 13px; color: #4a5568; background: #f7f9fc; border-radius: 8px; padding: 10px 12px; }
.hw-dialog-foot { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid #eceff4; }
.hw-dialog-foot textarea { flex: 1; min-height: 40px; padding: 8px 10px; border: 1px solid #dfe6f0; border-radius: 8px; font-size: 13px; font-family: inherit; }
.hw-btn { padding: 7px 14px; border-radius: 7px; border: 1px solid #dfe6f0; background: #fff; font-size: 13px; cursor: pointer; }
.hw-btn.primary { background: #16a34a; border-color: #16a34a; color: #fff; font-weight: 600; }
.hw-btn.danger { color: #b91c1c; border-color: #f3c6c6; background: #fff7f7; }
.hw-empty { padding: 40px; text-align: center; color: #8593a8; }

/* 老师批改页：任务与截止时间 */
.hw-taskbox { background: #fff; border-radius: 10px; margin-bottom: 14px; }
.hw-taskbox summary { cursor: pointer; padding: 12px 16px; font-size: 13px; font-weight: 600; color: #25507d; }
.hw-taskrows { padding: 0 12px 8px; }
.hw-taskrow { display: flex; align-items: center; gap: 10px; padding: 7px 6px; border-bottom: 1px solid #f4f6f9; font-size: 12.5px; flex-wrap: wrap; }
.hw-taskrow .hl { width: 56px; color: #8593a8; flex: none; }
.hw-taskrow .ht { flex: 1; min-width: 170px; }
.hw-taskrow input[type=datetime-local] { border: 1px solid #dfe6f0; border-radius: 6px; padding: 4px 6px; font-size: 12.5px; font-family: inherit; }
.hw-taskrow .hopen { display: flex; align-items: center; gap: 4px; color: #4a5568; flex: none; }
.hw-taskrow .hcnt { color: #8593a8; width: 88px; flex: none; }
.hw-taskrow .hflag { width: 84px; flex: none; }
.hw-tasknote { margin: 0; padding: 6px 16px 14px; font-size: 12px; color: #8593a8; }

/* 报告相关 */
.hw-doc{font-size:12.5px;color:#25507d;background:#eef4ff;padding:2px 8px;border-radius:5px}
.hw-md-view{font-size:14px;line-height:1.8;color:#1f2430}
.hw-md-view img{max-width:100%;border-radius:8px;border:1px solid #e3e9f2;margin:6px 0}
.hw-md-view pre{background:#f6f8fb;padding:10px 12px;border-radius:6px;overflow:auto}
.hw-md-view code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:13px}
.hw-md-view h1{font-size:19px;margin:4px 0 10px}
.hw-md-view h2{font-size:15px;margin:16px 0 8px}
.hw-src{margin-top:14px;font-size:12.5px;color:#8593a8}
.hw-src pre{max-height:220px;overflow:auto;background:#f7f9fc;border-radius:6px;padding:10px;font-size:12px}
