:root {
  --green: #44916C;
  --green-dark: #2F6B4F;
  --green-deep: #1F4E39;
  --green-light: #E8F2ED;
  --green-pale: #F3F8F5;
  --bg: #F6F8F7;
  --card: #FFFFFF;
  --text: #1F2A26;
  --muted: #6B7B74;
  --line: #E3EAE6;
  --warn: #D98324;
  --radius: 16px;
  --shadow: 0 2px 12px rgba(31, 78, 57, 0.06);
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.view {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 0 16px 40px;
}

/* ---------- 儿子端 ---------- */
.kid-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 4px 12px;
}

.kid-date { display: flex; flex-direction: column; gap: 2px; }
#today-weekday { font-size: 26px; font-weight: 700; color: var(--green-deep); letter-spacing: -0.5px; }
#today-date { font-size: 14px; color: var(--muted); }

.kid-name {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 8px;
  padding: 2px 8px;
  margin-bottom: 2px;
}

.progress-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: var(--green-dark);
  background: conic-gradient(var(--green) 0deg, var(--green) 0deg, var(--green-light) 0deg);
  position: relative;
}
.progress-ring::after {
  content: "";
  position: absolute;
  inset: 7px;
  background: var(--bg);
  border-radius: 50%;
}
.progress-ring span { position: relative; z-index: 1; }

.kid-greeting {
  font-size: 14px;
  color: var(--muted);
  padding: 0 4px 16px;
}

/* 顶部提示条：现在该做哪一项 */
.kid-hint {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--green-pale);
  border: 1px solid var(--green-light);
  border-left: 3px solid var(--green);
  color: var(--green-deep);
  font-size: 14px;
  line-height: 1.5;
}
.kid-hint.all-done {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* 任务卡片上的时间段 */
.task-slot {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 3px;
}
.task-slot .slot-clock {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  font-weight: 600;
}
.task-slot.now .slot-clock { color: var(--green-dark); }
.task-slot.late .slot-clock { color: var(--warn); }

.slot-flag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--green);
  color: #fff;
  font-weight: 600;
}
.slot-flag.warn { background: var(--warn); }

.task-card.due {
  border-color: var(--green);
  background: var(--green-pale);
  box-shadow: 0 4px 16px rgba(68, 145, 108, 0.16);
}
.task-card.late { border-color: #EBC79A; }
.task-card.done .task-slot { opacity: 0.6; }

.task-list { display: flex; flex-direction: column; gap: 12px; }

.task-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease;
}
.task-card:active { transform: scale(0.985); }

.task-card.running { border-color: var(--green); background: var(--green-pale); }
.task-card.done { opacity: 0.72; }
.task-card.bind-card { border-style: dashed; background: var(--green-pale); }

.task-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-light);
  color: var(--green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}
.task-card.running .task-icon { background: var(--green); color: #fff; }
.task-card.done .task-icon { background: #DDE5E0; color: var(--muted); }

.task-info { flex: 1; min-width: 0; }
.task-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.task-meta { font-size: 13px; color: var(--muted); }
.task-card.done .task-title { text-decoration: line-through; text-decoration-color: var(--muted); }

.task-timer {
  font-size: 22px;
  font-weight: 700;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.task-action {
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
}
.task-action:active { background: var(--green-dark); }
.task-action.finish { background: var(--warn); }
.task-action.done-tag {
  background: transparent;
  color: var(--green);
  font-weight: 600;
  padding: 0;
  cursor: default;
}

.kid-footer { text-align: center; padding: 32px 0 8px; }
.admin-link { color: var(--muted); font-size: 13px; text-decoration: none; }

.loading, .empty {
  text-align: center;
  color: var(--muted);
  padding: 40px 0;
  font-size: 14px;
}

/* ---------- 家长端 ---------- */
.admin-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 4px 16px;
}
.admin-header h1 { font-size: 20px; margin: 0; flex: 1; color: var(--green-deep); }
.back-btn, .logout-btn {
  border: none;
  background: none;
  color: var(--green-dark);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 2px;
  font-family: inherit;
}
.logout-btn { color: var(--muted); font-size: 14px; }

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 24px 20px;
  box-shadow: var(--shadow);
  margin-top: 12px;
}
.login-card h2 { font-size: 19px; margin: 0 0 6px; color: var(--green-deep); }
.login-hint { font-size: 13px; color: var(--muted); margin: 0 0 22px; }

.login-field { margin-bottom: 14px; }
.login-field label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.login-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 16px;
  font-family: inherit;
  background: var(--green-pale);
  color: var(--text);
}
.login-field input:focus { outline: none; border-color: var(--green); background: #fff; }
.field-error { color: #C0392B; font-size: 12px; margin-top: 5px; }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.btn-code {
  border: 1px solid var(--green);
  background: #fff;
  color: var(--green-dark);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
}
.btn-code:disabled { border-color: var(--line); color: var(--muted); cursor: default; }

.btn-primary {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  margin-top: 6px;
}
.btn-primary:active { background: var(--green-dark); }
.btn-primary:disabled { background: #A9C4B6; cursor: default; }

.login-error { color: #C0392B; font-size: 13px; margin-top: 10px; text-align: center; }

.login-divider {
  text-align: center;
  margin: 18px 0;
  position: relative;
}
.login-divider::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 50%;
  height: 1px; background: var(--line);
}
.login-divider span {
  position: relative;
  background: var(--card);
  padding: 0 12px;
  color: var(--muted);
  font-size: 12px;
}
.btn-wechat {
  width: 100%;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

.admin-tabs {
  display: flex;
  gap: 4px;
  background: var(--green-light);
  padding: 4px;
  border-radius: 12px;
  margin-bottom: 16px;
}
.tab {
  flex: 1;
  border: none;
  background: none;
  padding: 9px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--green-dark);
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.tab.active { background: #fff; color: var(--green-deep); font-weight: 600; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }

.today-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.summary-card {
  flex: 1;
  background: var(--card);
  border-radius: 14px;
  padding: 14px 12px;
  box-shadow: var(--shadow);
  text-align: center;
}
.summary-num { font-size: 24px; font-weight: 700; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.summary-label { font-size: 12px; color: var(--muted); margin-top: 2px; }

.record-list { display: flex; flex-direction: column; gap: 10px; }
.record-card {
  background: var(--card);
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
  display: flex;
  gap: 12px;
  align-items: center;
}
.record-thumb {
  width: 54px; height: 54px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--green-light);
  flex-shrink: 0;
  cursor: pointer;
}
.record-thumb.empty-thumb {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: var(--muted);
}
.record-info { flex: 1; min-width: 0; }
.record-title { font-size: 15px; font-weight: 600; }
.record-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.record-time { font-size: 16px; font-weight: 700; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.record-time.long { color: var(--warn); }
.record-time.none { color: #C2CCC7; font-size: 13px; font-weight: 500; }

/* 分析 */
.range-switch { display: flex; gap: 6px; margin-bottom: 16px; }
.range-btn {
  border: 1px solid var(--line);
  background: #fff;
  padding: 7px 14px;
  border-radius: 20px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  font-family: inherit;
}
.range-btn.active { background: var(--green); border-color: var(--green); color: #fff; }

.chart-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}
.chart-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; color: var(--green-deep); }
.chart-sub { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }

/* 配置 */
.config-hint { font-size: 13px; color: var(--muted); margin-bottom: 14px; }

.config-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.config-item {
  background: var(--card);
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 10px;
}
.config-item .ci-main { flex: 1; min-width: 0; }
.config-item .ci-title { font-size: 15px; font-weight: 600; }
.config-item .ci-meta { font-size: 12px; color: var(--muted); }
.ci-del {
  border: none; background: none; color: #C0392B;
  font-size: 13px; cursor: pointer; padding: 6px; font-family: inherit;
}
.ci-edit {
  border: none; background: none; color: var(--green-dark);
  font-size: 13px; cursor: pointer; padding: 6px; font-family: inherit;
}
.btn-add {
  width: 100%;
  padding: 12px;
  border: 1px dashed var(--green);
  background: var(--green-pale);
  color: var(--green-dark);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ---------- 弹窗 ---------- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 30, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
  padding: 0;
}
.modal-box {
  background: var(--card);
  width: 100%;
  max-width: 560px;
  border-radius: 20px 20px 0 0;
  padding: 22px 20px calc(22px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow-y: auto;
}
.modal-box h3 { margin: 0 0 4px; font-size: 18px; color: var(--green-deep); }
.modal-task { font-size: 13px; color: var(--muted); margin-bottom: 16px; }

.photo-area {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: 14px;
  border: 2px dashed var(--line);
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  margin-bottom: 12px;
}
.photo-placeholder { text-align: center; color: var(--muted); font-size: 14px; }
.camera-icon { font-size: 34px; margin-bottom: 6px; }
.photo-preview { width: 100%; height: 100%; object-fit: cover; }

#remark-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  background: var(--green-pale);
  color: var(--text);
  margin-bottom: 16px;
}
#remark-input:focus { outline: none; border-color: var(--green); background: #fff; }

.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn-primary { flex: 1; margin: 0; }
.btn-ghost {
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
}
.modal-error { color: #C0392B; font-size: 13px; margin-top: 10px; text-align: center; }

.photo-viewer {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 8px; }

/* 提示条 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%) translateY(20px);
  background: var(--green-deep);
  color: #fff;
  padding: 11px 20px;
  border-radius: 22px;
  font-size: 14px;
  opacity: 0;
  transition: all 0.25s ease;
  z-index: 300;
  pointer-events: none;
  max-width: 80vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 明天预览 ---------- */
.peek-entry {
  margin-top: 4px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--green-pale);
  border: 1px dashed var(--green);
  display: flex;
  align-items: center;
  gap: 12px;
}
.peek-copy { flex: 1; min-width: 0; }
.peek-head { font-size: 14px; font-weight: 600; color: var(--green-deep); }
.peek-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }
.peek-btn {
  border: 0;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 10px;
  white-space: nowrap;
  font-family: inherit;
}
.peek-btn:active { background: var(--green-dark); }

.kid-hint.peek-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--green-light);
  border-left-color: var(--green-dark);
  font-weight: 600;
}
.peek-back {
  border: 0;
  background: #fff;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 8px;
  font-family: inherit;
  flex-shrink: 0;
}

.peek-summary {
  font-size: 13px;
  color: var(--muted);
  padding: 0 2px 4px;
}
.task-card.preview {
  background: var(--green-pale);
  box-shadow: none;
  border-style: dashed;
}
.task-card.preview:active { transform: none; }
.task-card.preview .task-icon { background: #fff; color: var(--green-dark); }

/* ---------- 设备配对 ---------- */
.kid-hint.unpaired {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #FFF8EC;
  border-color: #F0DCBB;
  border-left-color: var(--warn);
  color: #7A5220;
}
.pair-input {
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--green-pale);
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  color: var(--green-deep);
  margin-bottom: 4px;
}
.pair-input:focus { outline: 2px solid var(--green); outline-offset: 1px; }

/* ---------- 孩子档案 ---------- */
.kid-item { align-items: flex-start; }
.kid-item .ci-title { font-size: 16px; }

.kid-ops {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
}

.kid-code-btn {
  border: none;
  background: var(--green);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 10px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.kid-code-btn:active { background: var(--green-dark); }

.pair-code-box {
  margin-top: 10px;
  padding: 12px;
  border-radius: 14px;
  background: var(--green-pale);
  border: 1px dashed var(--green);
  text-align: center;
}
.pair-code {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 8px;
  text-indent: 8px;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}
.pair-code-note { font-size: 12px; color: var(--muted); margin-top: 4px; }

.kid-add-row { display: flex; gap: 8px; }
.kid-input {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
}
.kid-input:focus { outline: none; border-color: var(--green); }
.kid-add-btn { width: auto; flex-shrink: 0; }

/* 孩子设备列表：展开后显示已绑定设备 */
.kid-item { flex-wrap: wrap; align-items: flex-start; }
.kid-toggle { cursor: pointer; }
.kid-chevron {
  display: inline-block;
  color: var(--muted);
  font-size: 11px;
  margin-right: 5px;
  transition: transform 0.15s ease;
}
.kid-item.expanded .kid-chevron { transform: rotate(90deg); }

.kid-devices {
  flex-basis: 100%;
  width: 100%;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.device-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--green-pale);
  border: 1px solid var(--green-light);
  border-radius: 12px;
}
.device-info { flex: 1; min-width: 0; }
.device-name { font-size: 14px; font-weight: 600; }
.device-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}
.device-empty { font-size: 12px; color: var(--muted); padding: 8px 2px; }

.device-revoke {
  border: 1px solid var(--warn);
  background: #fff;
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  white-space: nowrap;
  transition: all 0.12s ease;
}
.device-revoke:active { background: var(--warn); color: #fff; }
.device-revoke.armed { background: var(--warn); color: #fff; }
.device-revoke:disabled { opacity: 0.6; cursor: default; }

/* ---------- 周课表 ---------- */
.tt-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.tt-bar-label { font-size: 13px; color: var(--muted); flex-shrink: 0; }
.tt-kid-select {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
}
.tt-kid-select:focus { outline: none; border-color: var(--green); }

.tt-legend {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 10px;
  min-height: 18px;
}

/* 横向滚动容器：首列 position: sticky 吸附 */
.tt-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
}

/* 自由时间轴：7 列横向排布，手机可横向滑动 */
.tt-free {
  display: flex;
  min-width: 644px;
}

.tt-head {
  background: var(--green-pale);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--green-dark);
  padding: 8px 2px;
  white-space: nowrap;
}
.tt-head.today {
  background: var(--green);
  color: #fff;
}

.tt-col {
  flex: 1 1 0;
  min-width: 92px;
  display: flex;
  flex-direction: column;
  background: var(--green-pale);
  border-left: 1px solid var(--line);
}
.tt-col:first-child { border-left: none; }

.tt-col-body {
  flex: 1;
  padding: 6px 5px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tt-col-empty {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  padding: 18px 4px;
  line-height: 1.5;
}

.tt-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 4px solid var(--green);
  border-radius: 12px;
  padding: 9px 9px 7px;
  box-shadow: var(--shadow);
  cursor: pointer;
}
.tt-row:active { transform: scale(0.985); }
.tt-row.tt-s1 { border-left-color: #2C5C8F; }
.tt-row.tt-s2 { border-left-color: #8A5A1E; }
.tt-row.tt-s3 { border-left-color: #5B3F8F; }
.tt-row.tt-s4 { border-left-color: #2F6B4F; }
.tt-row.tt-s5 { border-left-color: #256274; }
.tt-row.tt-s6 { border-left-color: #6B5A2F; }

.tt-row-time {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #1E4634;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.3px;
  padding: 1px 8px;
  border-radius: 8px;
  background: #CFE6D8;
  cursor: pointer;
  margin-bottom: 4px;
}
.tt-row-time:active { background: #B7DAC5; }

.tt-row-title {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tt-row-subj {
  font-size: 11px;
  color: #55685E;
  margin-top: 2px;
}

.tt-row-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.tt-mini {
  flex: 0 1 auto;
  border: 1px solid var(--line);
  background: #fff;
  color: #2E5C46;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 7px;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}
.tt-mini:active { background: var(--green-light); }
.tt-mini.danger { color: #C0392B; border-color: #F0D6D2; }
.tt-mini.danger:active { background: #FDF2F1; }

.tt-add {
  margin: 6px 5px 8px;
  border: 1px dashed var(--green);
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 9px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
}
.tt-add:active { background: var(--green-light); }

/* 科目浅色（不用红色大色块） */
.tt-s1 { background: #E9F0FA; color: #2C5C8F; }
.tt-s2 { background: #FDF2E3; color: #8A5A1E; }
.tt-s3 { background: #F1ECFB; color: #5B3F8F; }
.tt-s4 { background: #E9F6EF; color: #2F6B4F; }
.tt-s5 { background: #E8F4F8; color: #256274; }
.tt-s6 { background: #F7F1E2; color: #6B5A2F; }
.tt-s0 { background: var(--green-light); color: var(--green-dark); }

/* 任务池 */
.tt-pool { margin-top: 16px; }
.tt-pool-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}
.tt-pool-title { font-size: 14px; font-weight: 600; color: var(--green-deep); }
.tt-new-btn {
  border: 1px dashed var(--green);
  background: var(--green-pale);
  color: var(--green-dark);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  white-space: nowrap;
}

.tt-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin: 14px 2px 8px;
}
.tt-count {
  font-variant-numeric: tabular-nums;
  color: var(--green-dark);
  font-weight: 600;
}
.tt-group { display: flex; flex-direction: column; gap: 8px; }
.tt-group.tt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.tt-pitem {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px 8px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  position: relative;
}
.tt-pitem:active { background: var(--green-pale); }
.tt-pitem.sel {
  border-color: var(--green);
  background: var(--green-pale);
  box-shadow: 0 0 0 2px rgba(68, 145, 108, 0.14);
}
.tt-pitem.done { opacity: 0.82; }
.tt-pitem-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}
.tt-pdot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.tt-pname {
  width: 100%;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text, #22302B);
}
.tt-psubj {
  font-size: 11px;
  color: #5E7268;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tt-pdel {
  border: none;
  background: transparent;
  color: #B9C4BE;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  font-family: inherit;
}
.tt-pdel:active { color: #C0392B; }
.tt-pbadge {
  font-size: 11px;
  color: var(--green-dark);
  background: var(--green-light);
  border-radius: 8px;
  padding: 2px 7px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tt-hole {
  font-size: 12px;
  color: var(--muted);
  padding: 10px 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
}

/* 任务编辑弹窗 */
.tm-ops { display: flex; gap: 8px; margin-bottom: 16px; }
.tm-op {
  flex: 1;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-dark);
  font-size: 14px;
  font-weight: 600;
  padding: 13px 6px;
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
}
.tm-op:active { background: var(--green-pale); }
.tm-op.danger { color: #C0392B; border-color: #F0D6D2; }
.tm-op.danger:active { background: #FDF2F1; }

/* ---------- 新建任务表单 ---------- */
.nt-field { margin-bottom: 12px; text-align: left; }
.nt-field label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
}
.nt-field input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
}
.nt-field input:focus { outline: none; border-color: var(--green); }

/* ---------- 排课弹窗（任务+时间一步完成） ---------- */
.tt-pick-list {
  max-height: 240px;
  overflow-y: auto;
  margin: 8px 0 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
  text-align: left;
}
.tt-pick-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  padding: 9px 10px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}
.tt-pick-item:active { background: var(--green-pale); }
.tt-pick-item.sel {
  border-color: var(--green);
  background: var(--green-pale);
  box-shadow: 0 0 0 2px rgba(68, 145, 108, 0.14);
}
.tt-pick-item .tt-pname {
  flex: 1;
  min-width: 0;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sch-time-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 10px;
}
.sch-time-label { font-size: 13px; color: #55685E; margin-right: 4px; }
.sch-time-row select {
  font-size: 15px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #22302B);
}
.sch-colon { font-weight: 700; color: #55685E; }

/* ---------- 组合字段（原生下拉 + 手动输入） ---------- */
.combo2 { display: flex; gap: 8px; align-items: stretch; }
.combo2 select {
  flex: 0 0 138px;
  font-size: 14px;
  padding: 10px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--green-pale);
  color: var(--green-dark);
  font-family: inherit;
}
.combo2 input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #22302B);
}
.combo2 input:focus, .combo2 select:focus { outline: none; border-color: var(--green); }

.tt-pick-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #22302B);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.tt-pick-subj {
  font-size: 11px;
  color: #55685E;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ---------- 管理科目 ---------- */
.subj-gear {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--green-dark);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 8px;
  margin-left: 6px;
  cursor: pointer;
  font-family: inherit;
}
.subj-gear:active { background: var(--green-pale); }
.subj-list {
  max-height: 210px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 6px 0 12px;
  text-align: left;
}
.subj-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.subj-name { font-size: 14px; font-weight: 600; color: var(--text, #22302B); }
.subj-del {
  border: none;
  background: transparent;
  color: #B9C4BE;
  font-size: 18px;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  font-family: inherit;
}
.subj-del:active { color: #C0392B; }
.subj-add-row { display: flex; gap: 8px; margin-bottom: 14px; }
.subj-add-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #22302B);
}
.subj-add-row input:focus { outline: none; border-color: var(--green); }
.subj-add-row .btn-primary { flex: 0 0 84px; }
.subj-meta {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: #55685E;
  margin-top: 2px;
}

/* 任务池按科目分组 */
.tt-subj-head {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 12px 2px 6px;
  font-size: 12px;
  font-weight: 700;
  color: #55685E;
}
.tt-subj-head .tt-subj-name { flex: 1; min-width: 0; }
.tt-subj-head .tt-count { font-size: 11px; font-weight: 600; }

/* ---------- 任务说明 ---------- */
.nt-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text, #22302B);
  resize: vertical;
  min-height: 52px;
}
.nt-field textarea:focus { outline: none; border-color: var(--green); }

.task-note {
  font-size: 12px;
  color: #55685E;
  margin-top: 3px;
  line-height: 1.4;
  word-break: break-word;
}
.tt-row-note {
  font-size: 12px;
  color: #55685E;
  margin-top: 3px;
  line-height: 1.4;
  word-break: break-word;
}
.tt-pnote {
  font-size: 11px;
  color: #6B7C73;
  margin-top: 2px;
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tm-note {
  margin: 2px 0 12px;
  padding: 9px 12px;
  background: var(--green-pale);
  border-radius: 10px;
  font-size: 13px;
  color: #3B4A43;
  line-height: 1.5;
  text-align: left;
  word-break: break-word;
}

/* 排课弹窗按科目分组的组头（占满整行） */
.tt-pick-head {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #55685E;
}
.tt-pick-head .tt-count { font-size: 11px; font-weight: 600; }

/* 模板卡片右上角：编辑小笔 + 删除 */
.tt-top-ops { display: flex; align-items: center; gap: 2px; flex-shrink: 0; }
.tt-pedit {
  border: none;
  background: transparent;
  color: #8FA79A;
  font-size: 13px;
  line-height: 1;
  padding: 1px 3px;
  cursor: pointer;
  font-family: inherit;
}
.tt-pedit:active { color: var(--green-dark); }
