/* ============================================================
   作业管理 H5 全量样式（微信端，手机优先）
   三态颜色唯一真源（平台约定，黑=未交 / 绿=已交 / 红=已订正）：
     --st-unsub / --st-done / --st-fixed
   改颜色方案只动这 3 个变量 + 对应 3 个 -bg。
   触控目标：网格单元 min-height 46px；操作按钮 ≥44px。
   ============================================================ */
:root {
  /* 状态三色（用户拍板：未交黑 / 已交绿 / 已订正红） */
  --st-unsub: #1D2129;
  --st-done: #00B578;
  --st-fixed: #F53F5B;
  --st-unsub-bg: #F2F3F5;
  --st-done-bg: #E6FAF4;
  --st-fixed-bg: #FFE8EB;
  /* 中性/主色 */
  --blue: #2B5CF5;
  --blue-bg: #E8F0FE;
  --ink: #1D2129;
  --ink-2: #4E5969;
  --ink-3: #86909C;
  --line: #E5E6EB;
  --bg: #F5F6F7;
  --surface: #FFFFFF;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 1px 4px rgba(29, 33, 41, .05);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
  touch-action: manipulation;   /* 消除 300ms 点击延迟 + 防双击缩放 */
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 15px; color: var(--ink); }
.hidden { display: none !important; }

/* 页面容器：PC 视口下居中收窄（H5 不破版） */
.hw-page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 90px;
}
body.pc-shell .hw-page { box-shadow: 0 0 0 1px var(--line); }

/* ===== 导航栏 ===== */
.navbar {
  background: var(--surface);
  display: flex;
  align-items: center;
  padding: 10px 6px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.navbar .back, .navbar .more-btn, .navbar .add-btn, .navbar .home-btn {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--ink);
  border-radius: 8px;
  flex: none;
}
.navbar .home-btn { font-size: 19px; }
.navbar .add-btn {
  font-size: 26px;
  font-weight: 400;
  color: var(--blue);
}
.navbar .back:active, .navbar .more-btn:active, .navbar .add-btn:active, .navbar .home-btn:active { background: var(--bg); }
.navbar .title {
  flex: 1;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 0 4px;
}
.navbar .spacer { width: 40px; flex: none; }
.more-dots { display: inline-flex; gap: 3px; }
.more-dots span { width: 4px; height: 4px; border-radius: 50%; background: var(--ink-3); }

/* 右下角悬浮新建按钮（FAB） */
.fab-add {
  position: fixed;
  right: 20px;
  bottom: calc(84px + env(safe-area-inset-bottom));
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  font-size: 30px;
  font-weight: 300;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(43, 92, 245, 0.4);
  cursor: pointer;
  z-index: 40;
  transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}
.fab-add:active { transform: scale(0.92); box-shadow: 0 2px 8px rgba(43, 92, 245, 0.35); }
@media (prefers-reduced-motion: reduce) { .fab-add { transition: none; } }

/* 更多菜单（底部弹层） */
.action-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(110%);
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 51;
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
  padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
  transition: transform .22s ease-out;
  pointer-events: none;
}
.action-sheet.show { transform: translateX(-50%) translateY(0); pointer-events: auto; }
.action-sheet .as-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 20px;
  font-size: 15px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  min-height: 50px;
  text-align: left;
}
.action-sheet .as-item:last-of-type { border-bottom: none; }
.action-sheet .as-item.danger { color: var(--st-fixed); }
.action-sheet .as-item:active { background: var(--bg); }

/* ===== 班级行（红字下划线，可点击切换） ===== */
.class-row {
  background: var(--surface);
  padding: 8px 16px 10px;
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.class-row .cls {
  font-size: 14px;
  font-weight: 600;
  color: var(--st-fixed);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-bottom: 2px solid var(--st-fixed);
  padding-bottom: 2px;
  min-height: 26px;
  cursor: pointer;
}
.class-row .cls .caret { font-size: 10px; opacity: .8; }

/* ===== 精简统计（登记页一行） ===== */
.mini-stat {
  background: var(--surface);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}
.mini-stat .nums { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.mini-stat .nums b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.mini-stat .nums .r { color: var(--st-fixed); }
.mini-stat .bar {
  flex: 1;
  height: 5px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.mini-stat .bar i {
  display: block;
  height: 100%;
  background: var(--st-done);
  border-radius: 3px;
  transition: width .25s ease;
}

/* ===== 登记网格（4 列，名字着色即状态） ===== */
.grid { background: var(--surface); }
.grid-row { display: flex; border-bottom: 1px solid var(--line); }
.grid-row:last-child { border-bottom: none; }
.cell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 2px;
  border-right: 1px solid var(--line);
  cursor: pointer;
  position: relative;
  min-height: 46px;
  -webkit-touch-callout: none;   /* 抑制 iOS 长按系统菜单 */
  user-select: none;
  -webkit-user-select: none;
  transition: background .1s;
}
.cell:last-child { border-right: none; }
.cell:active { background: #F7F8FA; }
.cell .nm { font-size: 15px; font-weight: 600; transition: color .15s; }
/* 三态名字着色 */
.cell.s0 .nm { color: var(--st-unsub); }
.cell.s1 .nm { color: var(--st-done); }
.cell.s2 .nm { color: var(--st-fixed); }
/* 未交红点标记（名字右上角 7px，v4 定稿） */
.cell.s0::after {
  content: "";
  position: absolute;
  top: 6px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--st-fixed);
}
/* 点击弹跳 0.18s */
.cell.pop .nm { animation: nmPop .18s ease-out; }
@keyframes nmPop {
  0% { transform: scale(.8); }
  55% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) { .cell.pop .nm { animation: none; } }
/* 待同步感叹角标（乐观更新失败） */
.cell .sync-flag {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--st-fixed);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  z-index: 2;
}
.cell .sync-flag.syncing { background: var(--ink-3); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== 图例（可点击整体隐藏/恢复） ===== */
.legend {
  background: var(--surface);
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.legend .lg-inner { display: flex; justify-content: center; gap: 20px; font-size: 12px; color: var(--ink-2); cursor: pointer; user-select: none; transition: opacity .2s; }
/* 图例整体半透明隐藏（专用类，避开全局 .hidden{display:none}） */
.legend .lg-inner.lg-dim { opacity: .3; }
.legend .sw {
  width: 9px;
  height: 9px;
  border-radius: 2.5px;
  display: inline-block;
  margin-right: 4px;
  vertical-align: middle;
}
.sw.k { background: var(--st-unsub); }
.sw.g { background: var(--st-done); }
.sw.r { background: var(--st-fixed); }
.legend .tip { text-align: center; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }

/* ===== 底部操作栏（fixed） ===== */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  gap: 10px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.btn {
  flex: 1;
  padding: 13px 0;
  border: none;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  min-height: 46px;
}
.btn:active { filter: brightness(.94); }
.btn.ghost { background: #F2F3F5; color: var(--ink); }
.btn.primary { background: var(--blue); color: #fff; }
.btn.danger { background: var(--st-fixed); color: #fff; }
.btn.green { background: var(--st-done); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ===== 详情弹层（底部半屏，长按触发） ===== */
.hw-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .4);
  z-index: 50;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;   /* 默认不拦截页面交互，show 时恢复 */
}
.hw-mask.show { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 110%);
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  z-index: 51;
  padding: 10px 18px calc(24px + env(safe-area-inset-bottom));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, .15);
  transition: transform .22s ease-out;
  pointer-events: none;
}
.sheet.show { transform: translate(-50%, 0); pointer-events: auto; }
.sheet .grab { width: 36px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 12px; }
.sheet .d-head { display: flex; justify-content: space-between; align-items: center; }
.sheet .d-name { font-size: 18px; font-weight: 700; color: var(--ink); }
.sheet .d-no { font-size: 12px; color: var(--ink-3); font-weight: 400; margin-left: 6px; }
.sheet .d-badge { font-size: 12px; font-weight: 600; padding: 3px 12px; border-radius: 20px; flex: none; }
.d-badge.s0 { background: var(--st-unsub-bg); color: var(--st-unsub); }
.d-badge.s1 { background: var(--st-done-bg); color: var(--st-done); }
.d-badge.s2 { background: var(--st-fixed-bg); color: var(--st-fixed); }
.sheet .d-rows { margin-top: 14px; font-size: 14px; line-height: 2.2; color: var(--ink); }
.sheet .d-rows .k { color: var(--ink-3); font-size: 13px; margin-right: 10px; }
.sheet .d-rows b { font-variant-numeric: tabular-nums; }
.sheet .d-actions { display: flex; gap: 10px; margin-top: 16px; }
.sheet .d-actions .btn { padding: 12px 0; min-height: 46px; }

/* ===== 二次确认弹窗 ===== */
.hw-dialog {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%) scale(.92);
  width: min(300px, calc(100vw - 64px));
  background: var(--surface);
  border-radius: var(--radius-lg);
  z-index: 52;
  padding: 20px 18px 16px;
  opacity: 0;
  transition: transform .15s ease-out, opacity .15s;
  box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
  pointer-events: none;
}
.hw-dialog.show { transform: translate(-50%, -50%) scale(1); opacity: 1; pointer-events: auto; }
.hw-dialog-title { font-size: 16px; font-weight: 700; text-align: center; color: var(--ink); }
.hw-dialog-msg { font-size: 13.5px; color: var(--ink-2); text-align: center; margin-top: 8px; line-height: 1.6; }
.hw-dialog-actions { display: flex; gap: 10px; margin-top: 18px; }
.hw-dialog-actions .btn { padding: 11px 0; min-height: 44px; font-size: 14px; }

/* ===== Toast ===== */
.hw-toast {
  position: fixed;
  left: 50%;
  top: 14%;
  transform: translateX(-50%) translateY(-8px);
  background: rgba(29, 33, 41, .92);
  color: #fff;
  font-size: 13.5px;
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 99;
  max-width: calc(100vw - 48px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  text-align: center;
}
.hw-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.hw-toast.warn { background: #E6A23C; }

/* ===== 列表页 ===== */
.hw-tabs {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.hw-tabs .tab {
  flex: 1;
  padding: 12px 0 10px;
  font-size: 15px;
  color: var(--ink-2);
  font-weight: 500;
  position: relative;
  min-height: 46px;
  background: none;
}
.hw-tabs .tab.active { color: var(--ink); font-weight: 600; }
.hw-tabs .tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
}

.hw-card {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 13px 14px;
  margin: 10px 12px 0;
  display: block;
  width: calc(100% - 24px);
  text-align: left;
  border: none;
}
.hw-card.finished { opacity: .72; }
.hw-card .card-top { display: flex; align-items: center; gap: 8px; }
.subject-chip {
  flex: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-bg);
  padding: 3px 9px;
  border-radius: 6px;
}
.subject-chip.other { color: var(--ink-2); background: var(--st-unsub-bg); }
.hw-card .card-title {
  flex: 1;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.status-chip {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
}
.status-chip.active { color: var(--st-done); background: var(--st-done-bg); }
.status-chip.finished { color: var(--ink-3); background: var(--st-unsub-bg); }
.hw-card .card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
}
.hw-card .card-meta .cnt { font-variant-numeric: tabular-nums; }
/* 纯色完成率进度条（绿色，不含未交黑色段） */
.progress-done {
  height: 5px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--st-unsub-bg);
  margin-top: 9px;
}
.progress-done i { display: block; height: 100%; background: var(--st-done); border-radius: 3px; transition: width .25s; }
/* 作业卡删除按钮 */
.card-del {
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--ink-3);
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin-left: 2px;
}
.card-del:active { background: var(--red-bg); color: var(--red); }

.month-group { margin-top: 8px; }
.month-head {
  width: 100%;
  text-align: left;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-3);
  padding: 10px 16px 4px;
  background: none;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.month-head .cnt { font-weight: 400; color: var(--ink-3); }
.month-head .caret { margin-left: auto; transition: transform .2s; font-size: 10px; }
.month-group.open .month-head .caret { transform: rotate(90deg); }

/* 班级选择弹层 */
.class-list { max-height: 46vh; overflow-y: auto; }
.class-list .as-item { justify-content: space-between; }
.class-list .as-item .cnt { color: var(--ink-3); font-size: 12px; }
.class-list .as-item .ck { color: var(--blue); font-weight: 700; }

/* 空态 */
.hw-empty {
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
  padding: 56px 20px;
}
.hw-empty .big { font-size: 15px; color: var(--ink-2); margin-bottom: 6px; }

/* ===== 布置作业页 ===== */
.form-block {
  background: var(--surface);
  margin: 10px 12px 0;
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 14px;
}
.form-block .fb-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-block .fb-label .req { color: var(--st-fixed); }
.form-block .fb-label .opt { color: var(--ink-3); font-weight: 400; }
.hw-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  min-height: 44px;
  background: var(--surface);
}
.hw-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(43, 92, 245, .12); }
.hw-input.err { border-color: var(--st-fixed); }
.subject-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-tag {
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  color: var(--ink-2);
  background: var(--bg);
  border: 1px solid var(--line);
  min-height: 40px;
}
.subject-tag.active { color: #fff; background: var(--blue); border-color: var(--blue); font-weight: 600; }
.subject-tag.more { border-style: dashed; }

/* 目标学生行 */
.target-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.target-row:last-of-type { border-bottom: none; }
.target-row .t-name { font-size: 15px; font-weight: 600; }
.target-row .t-desc { font-size: 12px; color: var(--ink-3); margin-top: 2px; }
.target-row .t-btn { color: var(--blue); font-size: 13.5px; padding: 8px 10px; min-height: 40px; }
.target-row .t-state { font-size: 13px; color: var(--ink-2); }
.target-row .t-state.on { color: var(--st-done); font-weight: 600; }
.target-row .t-state .num { color: var(--blue); font-weight: 700; }

/* 学生勾选列表（底部弹层内） */
.pick-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 10px;
  border-bottom: 1px solid var(--line);
}
.pick-head .hw-input { flex: 1; }
.pick-head .mini-btn {
  font-size: 13px;
  color: var(--blue);
  padding: 10px 8px;
  min-height: 40px;
  white-space: nowrap;
}
.pick-list { max-height: 44vh; overflow-y: auto; }
.pick-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}
.pick-item .p-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid var(--line);
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  background: var(--surface);
}
.pick-item.on .p-check { background: var(--blue); border-color: var(--blue); }
.pick-item .p-name { font-size: 15px; font-weight: 500; }
.pick-item .p-no { font-size: 12px; color: var(--ink-3); margin-left: auto; font-variant-numeric: tabular-nums; }
.pick-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 6px 4px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.pick-foot .num { color: var(--blue); font-weight: 700; }

/* 截止时间选择 */
.deadline-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.deadline-opts .subject-tag { padding: 8px 14px; }
.deadline-opts .subject-tag.active { background: var(--blue); color: #fff; }
.hw-datetime { margin-top: 10px; width: 100%; min-height: 44px; }

/* 拍照九宫格 */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
  border: 1px dashed var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 88px;
  color: var(--ink-3);
  font-size: 12px;
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-cell .del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 13px;
  line-height: 22px;
  text-align: center;
  z-index: 2;
}
.photo-cell .state {
  position: absolute;
  left: 4px;
  bottom: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: 12px;
  line-height: 20px;
  text-align: center;
  z-index: 2;
}
.photo-cell .state.ok { background: var(--st-done); }
.photo-cell .state.fail { background: var(--st-fixed); }
.photo-cell .state.up { animation: spin 1s linear infinite; }
.photo-cell .state.retry { background: var(--st-fixed); font-size: 10px; line-height: 20px; }
.photo-cell .retry-tip {
  position: absolute;
  inset: auto 0 0 0;
  background: rgba(245, 63, 91, .92);
  color: #fff;
  font-size: 10.5px;
  text-align: center;
  padding: 3px 0;
  z-index: 3;
}

/* 发布按钮 */
.publish-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.publish-bar .btn { min-height: 48px; font-size: 16px; min-width: 120px; flex: none; }

/* ===== 汇总页 ===== */
.sum-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 12px 12px 0; }
.sc {
  background: var(--surface);
  border-radius: 12px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.sc .v { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.sc .l { font-size: 12px; color: var(--ink-3); margin-top: 3px; line-height: 1.4; }
.ring-wrap {
  background: var(--surface);
  margin: 10px 12px 0;
  border-radius: 12px;
  padding: 18px 16px;
  box-shadow: var(--shadow);
}
.ring {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  background: conic-gradient(var(--st-done) 0 0%, var(--st-fixed) 0 0%, var(--st-unsub) 0 100%);
  transition: background .3s;
}
.ring i {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-size: 21px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.legend-row { display: flex; justify-content: center; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--ink-2); }
.legend-row .li { display: flex; align-items: center; gap: 5px; }
.legend-row .li b { font-variant-numeric: tabular-nums; color: var(--ink); }
.sec-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  padding: 16px 12px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.warn-list {
  background: var(--surface);
  margin: 0 12px;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.warn-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
  min-height: 46px;
  align-items: center;
}
.warn-item:last-child { border-bottom: none; }
.warn-item .n { color: var(--st-fixed); font-weight: 600; text-align: right; }
.warn-item .ok { color: var(--ink-3); }

/* 一句话洞察条 */
.insight {
  background: linear-gradient(135deg, var(--blue-bg), #F2F7FF);
  border: 1px solid #D6E4FF;
  border-radius: 12px;
  margin: 10px 12px 0;
  padding: 12px 14px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.insight .up { color: var(--st-done); font-weight: 700; }
.insight .down { color: var(--st-fixed); font-weight: 700; }
.insight .flat { color: var(--ink-3); }
.insight .gen-btn {
  margin-left: auto;
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 14px;
  padding: 5px 10px;
  min-height: 32px;
  white-space: nowrap;
  background: #fff;
}

/* 周期切换 tab */
.period-tabs { display: flex; background: var(--surface); border-bottom: 1px solid var(--line); }
.period-tabs .tab {
  flex: 1;
  padding: 11px 0 9px;
  font-size: 14px;
  color: var(--ink-2);
  position: relative;
  min-height: 44px;
  background: none;
}
.period-tabs .tab.active { color: var(--ink); font-weight: 600; }
.period-tabs .tab.active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  border-radius: 2px;
  background: var(--blue);
}

/* 异常科目提示卡 */
.anomaly-card {
  background: #FFF7E8;
  border: 1px solid #FFE3B8;
  border-radius: 12px;
  margin: 10px 12px 0;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
  line-height: 1.7;
}
.anomaly-card .a-title { font-weight: 700; color: #B45309; margin-bottom: 4px; }
.anomaly-card .a-hide {
  margin-top: 8px;
  font-size: 12px;
  color: var(--ink-3);
  text-decoration: underline;
  background: none;
  min-height: 32px;
  padding: 4px 0;
}

/* 周期内作业行 */
.period-list { background: var(--surface); margin: 0 12px; border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.period-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  min-height: 46px;
}
.period-row:last-child { border-bottom: none; }
.period-row .d { color: var(--ink-3); flex: none; font-variant-numeric: tabular-nums; }
.period-row .t { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.period-row .rate { font-weight: 700; font-variant-numeric: tabular-nums; }
.period-row .rate.done { color: var(--st-done); }
.period-row .rate.low { color: var(--st-fixed); }

/* ===== 花名册页 ===== */
.roster-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  min-height: 48px;
}
.roster-item .no { color: var(--ink-3); font-size: 12.5px; font-variant-numeric: tabular-nums; width: 44px; flex: none; }
.roster-item .nm { font-size: 15px; font-weight: 500; }
.roster-item .idx { margin-left: auto; color: var(--ink-3); font-size: 12px; }
.add-form { display: flex; gap: 8px; }
.add-form .hw-input { flex: 1; min-width: 0; }

/* ===== 加载/错误态 ===== */
.hw-loading {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  padding: 60px 20px;
}
.hw-loading .spin {
  width: 22px;
  height: 22px;
  border: 2px solid var(--line);
  border-top-color: var(--blue);
  border-radius: 50%;
  margin: 0 auto 12px;
  animation: spin .8s linear infinite;
}
.hw-error {
  text-align: center;
  color: var(--st-fixed);
  font-size: 13.5px;
  padding: 60px 20px;
}
.hw-error .btn { display: inline-block; margin-top: 16px; padding: 10px 28px; flex: none; }

/* PC 大屏下的骨架：主体居中，顶部渐变条 */
body.pc-shell { background: #E8EAED; }
@media (min-width: 520px) {
  .hw-page { margin-top: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}
