/* 班委工作台样式（独立于 admin/display，适配教室大屏与手机） */
:root {
  --bg: #f2f5fb;
  --panel: #ffffff;
  --line: #e2e8f2;
  --text: #1f2937;
  --muted: #64748b;
  --brand: #2563eb;
  --brand-dk: #1d4ed8;
  --ok: #16a34a;
  --ok-dk: #15803d;
  --del: #dc2626;
  --warn: #d97706;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--text);
  font: 15px/1.6 -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
[hidden] { display: none !important; }

/* 顶栏 */
.cw-top {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(120deg, #1e40af, #2563eb);
  color: #fff; padding: 10px 16px;
}
.cw-brand-t { font-size: 18px; font-weight: 700; letter-spacing: 1px; }
.cw-brand-s { font-size: 12px; opacity: .85; }
.cw-user { display: flex; align-items: center; gap: 8px; }
.cw-chip {
  background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  padding: 4px 12px; border-radius: 999px; font-size: 13px;
}
.cw-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--text);
  border-radius: 9px; padding: 9px 16px; font-size: 15px; cursor: pointer;
  transition: all .15s;
}
.cw-btn:active { transform: scale(.97); }
.cw-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.cw-btn-ghost { background: transparent; color: inherit; border-color: rgba(255,255,255,.4); }
.cw-btn-block { width: 100%; font-size: 16px; padding: 11px 0; }
.cw-btn-add { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; flex: 1; padding: 12px 0; }
.cw-btn-del { background: var(--del); border-color: var(--del); color: #fff; font-weight: 700; flex: 1; padding: 12px 0; }
.cw-ipt {
  width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  font-size: 15px; outline: none; margin-bottom: 10px; background: #fff;
}
.cw-ipt:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* 登录 */
.cw-login-holder {
  min-height: calc(100vh - 54px); display: flex; align-items: center; justify-content: center;
  padding: 24px 14px;
}
.cw-login-card {
  width: min(400px, 100%); background: var(--panel); border: 1px solid var(--line);
  border-radius: 18px; padding: 26px 24px; box-shadow: 0 12px 30px rgba(15,30,60,.10);
}
.cw-login-title { font-size: 20px; font-weight: 700; }
.cw-login-sub { color: var(--muted); font-size: 13px; margin: 4px 0 14px; }
.cw-err {
  color: var(--del); background: #fdecec; border-radius: 8px;
  padding: 8px 10px; font-size: 13px; margin-bottom: 10px;
}
.cw-login-note {
  margin-top: 12px; font-size: 12px; color: var(--muted); line-height: 1.7;
  background: #f6f8fc; border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px;
}

/* 工作区 */
.cw-app { max-width: 1100px; margin: 0 auto; padding: 12px; }
.cw-tabs { display: flex; gap: 8px; margin-bottom: 10px; }
.cw-tab {
  flex: 1; border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 10px 0; border-radius: 12px; font-size: 16px; cursor: pointer;
}
.cw-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.cw-panel { animation: cwFade .18s ease; }
@keyframes cwFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; } }

.cw-tool { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.cw-seg {
  display: inline-flex; background: #e4e9f2; border-radius: 999px; padding: 3px;
}
.cw-seg-b {
  border: 0; background: transparent; color: var(--muted); padding: 6px 16px;
  border-radius: 999px; font-size: 14px; cursor: pointer;
}
.cw-seg-b.on { background: #fff; color: var(--brand); font-weight: 700; box-shadow: 0 1px 4px rgba(0,0,0,.10); }
.cw-search {
  flex: 1; min-width: 140px; border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 12px; font-size: 15px; outline: none; background: #fff;
}

/* 小组筛选 chips */
.cw-groups { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.cw-g {
  border: 1px solid var(--line); background: var(--panel); color: var(--muted);
  padding: 5px 12px; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.cw-g.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* 名单网格 */
.cw-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.cw-card {
  background: var(--panel); border: 2px solid var(--line); border-radius: 14px;
  padding: 10px 12px; cursor: pointer; user-select: none; transition: all .12s;
  display: flex; flex-direction: column; gap: 3px;
}
.cw-card:active { transform: scale(.97); }
.cw-card.sel { border-color: var(--brand); background: #eef4ff; }
.cw-card .nm { font-size: 16px; font-weight: 700; }
.cw-card .grp { font-size: 11px; color: var(--muted); }
.cw-card .tot { font-size: 13px; }
.cw-card .tot b { color: var(--brand); }
.cw-card .cwbadge {
  display: inline-block; font-size: 10px; background: #eef2ff; color: var(--brand);
  border-radius: 4px; padding: 0 5px; margin-left: 4px; vertical-align: 1px;
}
.cw-card.empty { opacity: .6; }

/* 小组模式 */
.cw-grow {
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
  padding: 12px 14px; cursor: pointer; margin-bottom: 8px; display: flex;
  justify-content: space-between; align-items: center;
}
.cw-grow:active { background: #eef4ff; }
.cw-grow .g-name { font-weight: 700; font-size: 16px; }
.cw-grow .g-meta { font-size: 12px; color: var(--muted); }

.cw-empty { color: var(--muted); text-align: center; padding: 40px 0; }

/* 弹层 */
.cw-mask {
  position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 200;
  display: flex; align-items: flex-end; justify-content: center;
}
.cw-sheet {
  background: #fff; width: min(560px, 100%); border-radius: 20px 20px 0 0;
  padding: 18px 18px max(14px, env(safe-area-inset-bottom));
  max-height: 92vh; overflow: auto;
  animation: cwUp .2s ease;
}
@keyframes cwUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
.cw-sheet-title { font-size: 18px; font-weight: 800; }
.cw-sheet-sub { color: var(--muted); font-size: 13px; margin: 2px 0 12px; }
.cw-lbl { font-size: 13px; color: var(--muted); margin: 10px 0 6px; }
.cw-req { color: var(--warn); }
.cw-reasons, .cw-amounts { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.cw-r, .cw-a {
  border: 1px solid var(--line); background: #f8fafd; color: var(--text);
  border-radius: 8px; padding: 6px 12px; font-size: 14px; cursor: pointer;
}
.cw-r.on { background: #eef4ff; border-color: var(--brand); color: var(--brand); font-weight: 700; }
.cw-a.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.cw-sheet-actions { display: flex; gap: 10px; margin: 14px 0 8px; }
.cw-close { width: 100%; }

/* 日志 */
.cw-log-note { color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.cw-log-list { display: flex; flex-direction: column; gap: 8px; }
.cw-log {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; display: flex; align-items: center; gap: 10px;
}
.cw-log .sc {
  width: 52px; flex: none; text-align: center; font-weight: 800; font-size: 17px;
  border-radius: 9px; padding: 5px 0;
}
.sc-plus { background: #e9f8ef; color: var(--ok); }
.sc-minus { background: #fdecec; color: var(--del); }
.cw-log .bd { flex: 1; min-width: 0; }
.cw-log .bd .l1 { font-size: 15px; font-weight: 700; }
.cw-log .bd .l1 .who { color: var(--muted); font-weight: 400; font-size: 12px; margin-left: 4px; }
.cw-log .bd .l2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-log .bd .l2 .op { color: var(--brand); }
.cw-log .tm { flex: none; font-size: 11px; color: var(--muted); text-align: right; }

/* toast */
.cw-toast {
  position: fixed; left: 50%; bottom: 12%; transform: translateX(-50%);
  background: rgba(15,23,42,.92); color: #fff; padding: 10px 20px; border-radius: 999px;
  font-size: 14px; z-index: 400; max-width: 86vw; text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
}
.cw-toast.ok { background: rgba(22,163,74,.95); }
.cw-toast.err { background: rgba(220,38,38,.95); }

/* ---------- 撤销误触（v=2 新增） ---------- */
.cw-undo {
  flex: none; border: 1px solid var(--line); background: #fff; color: var(--del);
  border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer;
  transition: all .12s;
}
.cw-undo:active { background: #fdecec; transform: scale(.96); }
.cw-log .sc .batch { display: block; font-size: 10px; font-weight: 600; opacity: .85; line-height: 1.2; }
.cw-undo-preview {
  background: #f6f8fc; border: 1px solid var(--line); border-radius: 10px;
  padding: 12px 14px; margin-bottom: 10px; text-align: center;
}
.cw-undo-preview .uv-main { font-size: 26px; font-weight: 800; line-height: 1.3; }
.cw-undo-preview .uv-info { font-size: 14px; }
.cw-undo-preview .uv-time { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cw-btn.busy { opacity: .6; pointer-events: none; }

/* ===== 快评条 ===== */
.cw-quick {
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px;
  padding: 10px 12px; margin-bottom: 12px;
}
.cw-q-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cw-q-row + .cw-q-row { margin-top: 8px; }
.cw-q-lbl { font-size: 12px; color: var(--muted); flex: 0 0 auto; }
.cw-q-chips { display: flex; gap: 5px; flex-wrap: wrap; flex: 1 1 auto; }
.cw-qc {
  border: 1px solid var(--line); background: #fff; border-radius: 8px;
  padding: 4px 9px; font-size: 13px; cursor: pointer; color: var(--text, #333);
}
.cw-qc.m { color: #b91c1c; border-color: #fecaca; }
.cw-qc.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }
.cw-qc.on.m { background: #dc2626; border-color: #dc2626; }
.cw-qr {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 3px 10px; font-size: 12px; cursor: pointer; color: var(--text, #333);
}
.cw-qr.on { background: #eef4ff; border-color: var(--brand); color: var(--brand); font-weight: 700; }
.cw-q-amt { width: 72px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.cw-q-sign {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px;
  padding: 4px 0; font-size: 15px; cursor: pointer; color: var(--brand); font-weight: 700;
}
.cw-q-sign.minus { color: #dc2626; }
.cw-q-rsn { flex: 1 1 160px; min-width: 140px; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 13px; }
.cw-q-status { margin-top: 8px; font-size: 12px; color: var(--muted); }
.cw-q-status b { color: var(--brand); }

/* 快评结果行（含撤销） */
.cw-q-result {
  background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534;
  border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.cw-q-undo {
  border: 1px solid #86efac; background: #fff; color: #15803d;
  border-radius: 8px; padding: 3px 12px; font-size: 12px; cursor: pointer;
}
.cw-q-undo:disabled { opacity: .5; }

/* 快评闪烁反馈 */
@keyframes cwFlashPlus { 0% { background: #dcfce7; border-color: #22c55e; transform: scale(.97); } 100% { transform: scale(1); } }
@keyframes cwFlashMinus { 0% { background: #fee2e2; border-color: #ef4444; transform: scale(.97); } 100% { transform: scale(1); } }
.cw-card.flash-plus, .cw-grow.flash-plus { animation: cwFlashPlus .9s ease-out; }
.cw-card.flash-minus, .cw-grow.flash-minus { animation: cwFlashMinus .9s ease-out; }

/* ===== 补录（2026-09-28）：把漏记的分补到过去某天；每次补录强制留痕 ===== */
.cw-q-backlbl { display: flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.cw-q-backlbl input { width: auto; }
.cw-q-date { border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; font-size: 13px; }
.cw-q-backnote { font-size: 12px; color: var(--muted); }
.cw-quick.back-on { border-color: #f0a020; box-shadow: 0 0 0 2px rgba(240, 160, 32, .18); }
.cw-bd-tag { display: inline-block; background: #fff4e0; color: #b96b00; border: 1px solid #f3c47a;
             border-radius: 6px; padding: 1px 8px; font-size: 12px; font-weight: 700; }
.cw-bd { display: inline-block; margin-left: 6px; background: #fff4e0; color: #b96b00; border: 1px solid #f3c47a;
         border-radius: 5px; padding: 0 5px; font-size: 11px; }
.cw-backlbl { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; margin: 6px 0; }
.cw-backlbl input { width: auto; }
.cw-backwarn { margin-top: 6px; padding: 7px 10px; background: #fff4e0; border: 1px solid #f3c47a;
               border-radius: 8px; color: #9a5800; font-size: 12px; line-height: 1.5; }

/* ===== 设置管理卡片（2026-09-30，班委权限功能；权限来自班主任后台授权） ===== */
.cw-perm-note { background: #eef4ff; border: 1px solid #c7d8f8; color: #1d4ed8;
                border-radius: 10px; padding: 8px 12px; font-size: 13px; margin-bottom: 14px; }
.cw-mcard { background: var(--panel); border: 1px solid var(--line); border-radius: 14px;
            padding: 14px 16px; margin-bottom: 14px; }
.cw-mcard-h { margin-bottom: 10px; }
.cw-mcard-t { font-size: 16px; font-weight: 800; }
.cw-mcard-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cw-mcard-act { margin-top: 12px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cw-mnote { margin-top: 8px; font-size: 12px; color: var(--muted); }
.cw-mrow { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; }
.cw-mlbl { flex: 0 0 62px; font-size: 13px; color: var(--muted); }
.cw-ipt-s { width: auto; min-width: 130px; }
.cw-ipt-num { width: 64px; }
.cw-od-list { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; }
.cw-od-item { display: inline-flex; align-items: center; gap: 4px; background: var(--bg);
              border: 1px solid var(--line); border-radius: 8px; padding: 3px 6px 3px 10px; font-size: 14px; }
.cw-od-today { font-style: normal; background: #dcfce7; color: #15803d; border-radius: 5px;
               padding: 0 5px; font-size: 11px; margin-left: 2px; }
.cw-od-b { border: 0; background: transparent; cursor: pointer; font-size: 12px;
           padding: 2px 4px; color: var(--muted); border-radius: 4px; }
.cw-od-b:hover { background: #e6ecf7; color: var(--text); }
.cw-od-b.del:hover { background: #fee2e2; color: var(--del); }
.cw-preset { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 6px 0 10px; }
.cw-preset-tip { font-size: 12px; color: var(--muted); }
.cw-task-row { display: flex; align-items: center; gap: 8px; margin: 5px 0; }
.cw-task-name { flex: 0 0 84px; text-align: left; border: 1px solid var(--line); background: var(--bg);
                border-radius: 8px; padding: 5px 10px; font-size: 14px; cursor: pointer; }
.cw-task-name.as-txt { cursor: default; background: transparent; border: 0; padding-left: 2px; }
.cw-task-name:not(.as-txt):hover { background: #eef4ff; border-color: #c7d8f8; }
.cw-task-input { flex: 1; }
.cw-seat-grid { display: grid; gap: 5px; margin: 10px 0; }
.cw-seat-cell { border: 1px dashed var(--line); background: var(--bg); border-radius: 8px;
                min-height: 40px; font-size: 12px; cursor: pointer; padding: 2px; color: var(--text);
                overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-seat-cell.on { border-style: solid; background: #eef4ff; border-color: #9dbdf5; font-weight: 700; }
.cw-seat-cell:hover { border-color: var(--brand); }

/* ===== 学生换组（沿用后台「快捷换组」：小组列 + 学生卡片 + 拖拽/点选） ===== */
.cw-rg-tip { background: #eef4ff; border: 1px solid #c7d8f8; color: #1d4ed8; border-radius: 10px;
             padding: 8px 12px; font-size: 13px; line-height: 1.5; margin: 2px 0 10px; }
.cw-rg-tip b { color: #1e40af; }
.cw-rg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
              gap: 10px; align-items: start; }
.cw-rg-col { background: var(--bg); border: 1px solid var(--line); border-radius: 12px;
             padding: 8px; min-height: 84px; transition: border-color .15s, background .15s; }
.cw-rg-col.over { border-color: var(--brand); background: #eef4ff; }
.cw-rg-head { display: flex; align-items: center; gap: 6px; padding: 3px 5px 8px; border-radius: 8px;
              cursor: pointer; user-select: none; }
.cw-rg-head:hover .cw-rg-name { color: var(--brand); }
.cw-rg-name { font-weight: 700; font-size: 14px; }
.cw-rg-go { display: none; font-size: 11px; color: #fff; background: var(--brand);
            border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.cw-rg-count { font-size: 12px; color: var(--muted); margin-left: auto; }
/* 已选中学生 → 所有小组标题高亮为可点目标（手机上的主要交互提示） */
.cw-rg-grid.picking .cw-rg-head { background: #e8f0ff; outline: 2px dashed #9dbdf5; outline-offset: -1px; }
.cw-rg-grid.picking .cw-rg-head:hover { outline-color: var(--brand); background: #dbe8ff; }
.cw-rg-grid.picking .cw-rg-go { display: inline-block; }
.cw-rg-list { display: flex; flex-direction: column; gap: 6px; min-height: 26px; }
.cw-rg-chip { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line);
              border-radius: 9px; padding: 7px 9px; font-size: 14px; cursor: grab;
              transition: box-shadow .12s, border-color .12s, background .12s; }
.cw-rg-chip:hover { border-color: var(--brand); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cw-rg-chip:active { cursor: grabbing; }
.cw-rg-chip.dragging { opacity: .45; }
.cw-rg-chip.sel { border-color: var(--brand); background: #eef4ff; box-shadow: 0 0 0 2px rgba(37,99,235,.18); }
.cw-rg-no { color: var(--muted); font-size: 11px; min-width: 22px; }
.cw-rg-nm { font-weight: 600; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cw-rg-sc { color: #b45309; font-size: 12px; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) {
  .cw-rg-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
  .cw-rg-chip { padding: 9px 10px; }   /* 手机上卡片更大更好点 */
}
