/* aikc-homework-r1.css —— 学生端「作业与测评」端口改造样式（r17-2）
 * 与 aikc-homework-r1.js 配套。配色沿用站点既有 墨绿/琥珀 体系。
 */

/* ---------- ① 冒险大厅卡片：保持原样，仅确保副标题不换行溢出 ---------- */
[data-aikc-hw-card="1"] p,
[data-aikc-hw-card="1"] small {
  white-space: normal;
  line-height: 1.5;
}

/* ---------- ② 作业页顶部「完成条件」说明条 ---------- */
.aikc-hw-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
  padding: 18px 22px;
  border: 2px solid #26332e;
  border-radius: 18px;
  background: linear-gradient(135deg, #fff9e8 0%, #fdf3d6 100%);
  box-shadow: 4px 5px 0 #26332e;
}

.aikc-hw-banner-main strong {
  display: block;
  font-size: 17px;
  color: #26332e;
  margin-bottom: 6px;
}

.aikc-hw-banner-main p {
  margin: 0;
  font-size: 14px;
  color: #6f7b76;
  line-height: 1.7;
}

.aikc-hw-banner-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  min-width: 168px;
}

.aikc-hw-stat-num {
  font-size: 30px;
  font-weight: 800;
  color: #f6ad2f;
  line-height: 1;
}

.aikc-hw-banner-stat small {
  font-size: 12px;
  color: #6f7b76;
}

.aikc-hw-stat-ok {
  font-style: normal;
  font-size: 12px;
  color: #1f8a52;
  font-weight: 600;
}

.aikc-hw-stat-todo {
  font-style: normal;
  font-size: 12px;
  color: #c2611c;
  font-weight: 600;
}

/* ---------- ③ 作业卡完成状态徽标 ---------- */
.aikc-hw-badge {
  display: inline-block;
  margin-bottom: 8px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}

.aikc-hw-badge-ok {
  background: #d8f5e3;
  color: #14713f;
  border: 1.5px solid #7ed3a4;
}

.aikc-hw-badge-todo {
  background: #ffe9cf;
  color: #a8531a;
  border: 1.5px solid #f0b071;
}

.aikc-hw-meta {
  display: block;
  margin: 8px 0 10px;
  font-size: 12px;
  color: #6f7b76;
}

/* 待完成卡片：轻微高亮，引导去做测评 */
article[data-aikc-hw-state="pending"] {
  border-color: #f0b071 !important;
  background: linear-gradient(180deg, #fffdf7 0%, #fff8ec 100%);
}

article[data-aikc-hw-state="pending"] button.aikc-hw-btn-jump {
  background: #f6ad2f;
  color: #26332e;
  font-weight: 700;
}

/* ---------- 课后测评自渲染弹窗 ---------- */
.aikc-hw-eval-backdrop {
  position: fixed;
  inset: 0;
  z-index: 99998;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(20, 28, 25, .55);
  overflow-y: auto;
}

.aikc-hw-eval-modal {
  position: relative;
  width: min(640px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 26px 28px 22px;
  border: 2px solid #26332e;
  border-radius: 22px;
  background: #fffdf7;
  box-shadow: 7px 8px 0 #26332e;
}

.aikc-hw-eval-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1.5px solid #26332e;
  border-radius: 50%;
  background: #fff;
  color: #26332e;
  font-size: 15px;
  cursor: pointer;
  line-height: 1;
}

.aikc-hw-eval-head small {
  display: block;
  font-size: 11px;
  letter-spacing: 1.6px;
  color: #9aa8a2;
  text-transform: uppercase;
}

.aikc-hw-eval-head h2 {
  margin: 4px 0 4px;
  font-size: 21px;
  color: #26332e;
}

.aikc-hw-eval-head p {
  margin: 0;
  font-size: 13px;
  color: #6f7b76;
}

.aikc-hw-eval-note {
  margin: 14px 0 18px;
  padding: 11px 15px;
  border-radius: 12px;
  background: #fff3e2;
  border: 1.5px solid #f0b071;
  color: #a8531a;
  font-size: 13px;
  line-height: 1.7;
}

.aikc-hw-eval-loading {
  margin: 26px 0;
  text-align: center;
  color: #6f7b76;
  font-size: 14px;
}

.aikc-hw-eval-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.aikc-hw-eval-fields article {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.aikc-hw-eval-fields strong {
  font-size: 14px;
  color: #26332e;
}

.aikc-hw-eval-stars {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.aikc-hw-eval-star {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 60px;
  padding: 7px 10px;
  border: 1.5px solid #cdd6d2;
  border-radius: 12px;
  background: #fff;
  color: #6f7b76;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, color .12s ease;
}

.aikc-hw-eval-star small {
  font-size: 14px;
  font-weight: 800;
}

.aikc-hw-eval-star span {
  font-size: 11px;
  white-space: nowrap;
}

.aikc-hw-eval-star:hover {
  border-color: #f0b071;
}

.aikc-hw-eval-star.active {
  background: #f6ad2f;
  border-color: #26332e;
  color: #26332e;
  font-weight: 700;
}

.aikc-hw-eval-submit {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 14px 20px;
  border: 2px solid #26332e;
  border-radius: 999px;
  background: #f6ad2f;
  color: #26332e;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 3px 4px 0 #26332e;
  transition: transform .12s ease, box-shadow .12s ease;
}

.aikc-hw-eval-submit:disabled {
  background: #e6e3d8;
  color: #9aa8a2;
  border-color: #cdd6d2;
  box-shadow: none;
  cursor: not-allowed;
}

.aikc-hw-eval-submit:not(:disabled):hover {
  transform: translate(-1px, -1px);
  box-shadow: 4px 5px 0 #26332e;
}

.aikc-hw-eval-submit:not(:disabled):active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #26332e;
}

/* ---------- ④ 详情页：折叠上传区 ---------- */
.aikc-hw-upload-fold {
  margin: 14px 0 18px;
  padding: 12px 16px;
  border: 1.5px dashed #b9c4bf;
  border-radius: 14px;
  background: #fbfaf4;
}

.aikc-hw-upload-summary {
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: #4a5a54;
  list-style: none;
}

.aikc-hw-upload-summary::-webkit-details-marker {
  display: none;
}

.aikc-hw-upload-summary::before {
  content: "▸ ";
  transition: transform .18s ease;
  display: inline-block;
}

.aikc-hw-upload-fold[open] .aikc-hw-upload-summary::before {
  content: "▾ ";
}

.aikc-hw-upload-fold > label.student-file-picker,
.aikc-hw-upload-fold > .selected-files {
  margin-top: 12px;
}

/* ---------- 详情页顶部提示条 ---------- */
.aikc-hw-editor-tip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 14px;
  font-size: 14px;
  line-height: 1.6;
}

.aikc-hw-editor-tip strong {
  font-size: 15px;
}

.aikc-hw-tip-ok {
  background: #e6f8ee;
  border: 1.5px solid #7ed3a4;
  color: #14713f;
}

.aikc-hw-tip-todo {
  background: #fff3e2;
  border: 1.5px solid #f0b071;
  color: #a8531a;
}

.aikc-hw-jump {
  margin-left: auto;
  padding: 9px 20px;
  border: 2px solid #26332e;
  border-radius: 999px;
  background: #f6ad2f;
  color: #26332e;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  box-shadow: 2px 3px 0 #26332e;
  transition: transform .12s ease, box-shadow .12s ease;
}

.aikc-hw-jump:hover {
  transform: translate(-1px, -1px);
  box-shadow: 3px 4px 0 #26332e;
}

.aikc-hw-jump:active {
  transform: translate(1px, 1px);
  box-shadow: 1px 1px 0 #26332e;
}

/* ---------- toast ---------- */
.aikc-hw-toast {
  position: fixed;
  left: 50%;
  bottom: 42px;
  transform: translateX(-50%);
  z-index: 99999;
  padding: 12px 24px;
  border: 2px solid #26332e;
  border-radius: 999px;
  background: #26332e;
  color: #fff9e8;
  font-size: 14px;
  font-weight: 600;
  box-shadow: 3px 4px 0 rgba(38, 51, 46, .35);
  animation: aikc-hw-toast-in .18s ease;
}

@keyframes aikc-hw-toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(8px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.aikc-hw-banner-jump {
  flex: 0 0 auto;
  margin-left: 0;
  align-self: center;
}

/* ---------- 移动端 ---------- */
@media (max-width: 640px) {
  .aikc-hw-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
  }

  .aikc-hw-banner-stat {
    align-items: flex-start;
    min-width: 0;
  }

  .aikc-hw-jump {
    margin-left: 0;
    width: 100%;
  }

  .aikc-hw-eval-modal {
    padding: 22px 18px 18px;
    box-shadow: 4px 5px 0 #26332e;
  }

  .aikc-hw-eval-star {
    flex: 1 1 28%;
    min-width: 0;
  }
}

/* ---------- 无障碍：减弱动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  .aikc-hw-toast { animation: none; }
  .aikc-hw-jump { transition: none; }
  .aikc-hw-upload-summary::before { transition: none; }
  .aikc-hw-eval-star { transition: none; }
  .aikc-hw-eval-submit { transition: none; }
}

/* ---------- r26：修复状态徽章被卡片图标样式（article>span 49×49）压扁的问题 ---------- */
.assessment-card-grid > article > span.aikc-hw-badge,
.homework-card-grid > article > span.aikc-hw-badge {
  width: auto;
  height: auto;
  display: inline-block;
  place-items: initial;
  position: static;
  margin-bottom: 8px;
  padding: 4px 12px;
  border: 1.5px solid #7ed3a4;
  border-radius: 999px;
  background: #d8f5e3;
  color: #14713f;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
  line-height: 1.5;
}

.assessment-card-grid > article > span.aikc-hw-badge-todo,
.homework-card-grid > article > span.aikc-hw-badge-todo {
  background: #ffe9cf;
  color: #a8531a;
  border-color: #f0b071;
}
