/* ===================== 按钮 ===================== */
.btn {
  --btn-bg: #fff;
  --btn-fg: var(--ink-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 9px 18px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform var(--t-fast) var(--ease-bounce), box-shadow var(--t-fast), filter var(--t-fast);
  box-shadow: 0 3px 0 var(--cream-300), 0 6px 14px rgba(196, 140, 120, 0.14);
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 4px 0 var(--cream-300), 0 10px 20px rgba(196, 140, 120, 0.2); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--cream-300), 0 3px 8px rgba(196, 140, 120, 0.16); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.btn-primary {
  --btn-bg: linear-gradient(160deg, var(--pink-500), var(--pink-600));
  --btn-fg: #fff;
  box-shadow: 0 4px 0 var(--pink-700), 0 10px 20px rgba(247, 108, 134, 0.32);
}
.btn-primary:hover { box-shadow: 0 5px 0 var(--pink-700), 0 14px 26px rgba(247, 108, 134, 0.38); }
.btn-primary:active { box-shadow: 0 1px 0 var(--pink-700), 0 4px 10px rgba(247, 108, 134, 0.3); }

.btn-peach {
  --btn-bg: linear-gradient(160deg, var(--peach-500), var(--peach-600));
  --btn-fg: #fff;
  box-shadow: 0 4px 0 var(--peach-700), 0 10px 20px rgba(255, 155, 77, 0.3);
}
.btn-mint {
  --btn-bg: linear-gradient(160deg, var(--mint-500), var(--mint-600));
  --btn-fg: #fff;
  box-shadow: 0 4px 0 var(--mint-700), 0 10px 20px rgba(63, 168, 143, 0.28);
}
.btn-ghost {
  --btn-bg: #fff;
  --btn-fg: var(--ink-700);
  box-shadow: inset 0 0 0 2px var(--cream-300), 0 3px 8px rgba(196, 140, 120, 0.08);
}
.btn-ghost:hover { --btn-fg: var(--pink-700); box-shadow: inset 0 0 0 2px var(--pink-300), 0 6px 14px rgba(247, 108, 134, 0.16); }
.btn-ghost:active { box-shadow: inset 0 0 0 2px var(--pink-300); }
/* 确认框的「再想想」：纯白 + 深灰字，hover 也不变粉 —— 红色只留给危险确认键 */
.btn-plain { --btn-fg: var(--ink-800); }
.btn-plain:hover { --btn-fg: var(--ink-800); box-shadow: inset 0 0 0 2px var(--cream-300), 0 6px 14px rgba(196, 140, 120, 0.14); }
.btn-danger { --btn-bg: linear-gradient(160deg, #F58A8A, var(--danger)); --btn-fg: #fff; box-shadow: 0 4px 0 #C94C4C, 0 10px 20px rgba(239, 100, 100, 0.28); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 30px; font-size: 16.5px; }
.btn-block { width: 100%; }
.btn-icon { padding: 7px 9px; }

/* ===================== 卡片 ===================== */
.card {
  position: relative;
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--s5);
  transition: transform var(--t-base) var(--ease-bounce), box-shadow var(--t-base);
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--sh-card-hover); }
.card.tight { padding: var(--s4); }
.card.flush { padding: 0; overflow: hidden; }
.card.sticker::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 20px;
  width: 26px;
  height: 8px;
  border-radius: 3px;
  background: var(--pink-300);
  transform: rotate(-5deg);
  opacity: 0.85;
}
.card-title {
  display: flex;
  align-items: center;
  gap: var(--s2);
  font-size: 16.5px;
  font-weight: 800;
  margin-bottom: var(--s3);
}
.card-title .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--cycle-1);
  box-shadow: 0 0 0 4px rgba(255, 143, 163, 0.16);
}

/* ===================== 标签 / 胶囊 ===================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 11px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  font-weight: 700;
  background: var(--cream-100);
  color: var(--ink-700);
  border: 1.5px solid var(--cream-200);
  white-space: nowrap;
}
.chip.pink { background: var(--pink-100); color: var(--pink-700); border-color: var(--pink-300); }
.chip.peach { background: var(--peach-100); color: var(--peach-700); border-color: #FFD0A8; }
.chip.lemon { background: var(--lemon-100); color: var(--lemon-700); border-color: #FFE39B; }
.chip.mint { background: var(--mint-100); color: var(--mint-700); border-color: #B6E7D8; }
.chip.coral { background: var(--coral-100); color: var(--coral-600); border-color: #FFC9C0; }
.chip.berry { background: var(--berry-100); color: var(--berry-600); border-color: #F3C4D8; }
.chip.ok { background: var(--ok-bg); color: var(--ok); border-color: #BEE9D1; }
.chip.warn { background: var(--warn-bg); color: #C9741A; border-color: #FFD8A8; }
.chip.danger { background: var(--danger-bg); color: #C94C4C; border-color: #F8C4C4; }
.chip.plain { background: #fff; }

/* ===================== 表单 ===================== */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--ink-700); }
/* 必填星号：和 label 同字号，别抢戏 */
.field > label .req { color: var(--danger, #E5544B); font-weight: 800; margin-left: 2px; }
/* 失败说明：短句列表，最多三行 */
.fail-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--ink-600);
  font-size: 13.5px;
  line-height: 1.8;
}
.fail-list li::marker { color: var(--warn); }
.field .hint { font-size: 12px; color: var(--ink-400); }

.input,
.select,
.textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--cream-200);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--ink-900);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-300); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--pink-300); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--pink-500);
  box-shadow: 0 0 0 4px var(--pink-050);
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.7; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%238C7A71' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
  cursor: pointer;
}

/* 糖果开关 */
.switch { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch .track {
  width: 44px; height: 26px; border-radius: 999px;
  background: var(--cream-300);
  position: relative;
  transition: background var(--t-base);
  box-shadow: var(--sh-inset);
}
.switch .track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(160, 110, 100, 0.3);
  transition: transform var(--t-base) var(--ease-bounce);
}
.switch input:checked + .track { background: linear-gradient(135deg, var(--mint-500), var(--mint-600)); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch .switch-label { font-size: 13.5px; font-weight: 600; color: var(--ink-700); }

/* 像素可爱的复选 */
.check { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; font-size: 14px; }
.check input { display: none; }
.check .box {
  width: 22px; height: 22px; border-radius: 8px;
  border: 2px solid var(--cream-300);
  background: #fff;
  display: grid; place-items: center;
  font-size: 13px; color: transparent;
  transition: all var(--t-fast) var(--ease-bounce);
}
.check input:checked + .box {
  background: linear-gradient(135deg, var(--pink-500), var(--pink-600));
  border-color: var(--pink-600);
  color: #fff;
  transform: scale(1.05);
}

/* ===================== 表格 ===================== */
.table-wrap { overflow-x: auto; border-radius: var(--r-md); }
table.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
table.table th {
  text-align: left;
  font-size: 12.5px;
  color: var(--ink-500);
  font-weight: 700;
  padding: 10px 14px;
  background: var(--cream-100);
  white-space: nowrap;
}
table.table th:first-child { border-top-left-radius: var(--r-md); border-bottom-left-radius: var(--r-md); }
table.table th:last-child { border-top-right-radius: var(--r-md); border-bottom-right-radius: var(--r-md); }
table.table td { padding: 11px 14px; border-bottom: 1.5px dashed var(--cream-200); vertical-align: middle; }
table.table tr:last-child td { border-bottom: none; }
table.table tbody tr:hover td { background: var(--pink-050); }

/* ===================== 进度条 ===================== */
.bar {
  position: relative;
  height: 12px;
  border-radius: 999px;
  background: var(--cream-200);
  overflow: hidden;
  box-shadow: var(--sh-inset);
}
.bar > i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-500), var(--peach-500));
  transition: width 420ms var(--ease-out);
}
.bar.mint > i { background: linear-gradient(90deg, var(--mint-500), var(--mint-600)); }
.bar.lemon > i { background: linear-gradient(90deg, var(--lemon-500), var(--lemon-600)); }
.bar.berry > i { background: linear-gradient(90deg, var(--berry-500), var(--berry-600)); }

/* 分段条（选择题分布） */
.segbar { display: flex; height: 16px; border-radius: 999px; overflow: hidden; box-shadow: var(--sh-inset); background: var(--cream-200); }
.segbar > span { transition: width 420ms var(--ease-out); }

/* ===================== 糖葫芦时间线 ===================== */
.timeline { position: relative; padding-left: 40px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 15px; top: 8px; bottom: 8px;
  width: 3px;
  border-radius: 3px;
  background: repeating-linear-gradient(180deg, var(--pink-300) 0 8px, transparent 8px 14px);
}
.tl-item { position: relative; margin-bottom: var(--s4); }
.tl-item:last-child { margin-bottom: 0; }
.tl-dot {
  position: absolute;
  left: -40px; top: 14px;
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-size: 15px;
  background: linear-gradient(150deg, var(--pink-500), var(--pink-600));
  color: #fff;
  box-shadow: 0 4px 10px rgba(247, 108, 134, 0.34), inset 0 2px 0 rgba(255, 255, 255, 0.45);
  z-index: 1;
}
.tl-dot.swapped { background: linear-gradient(150deg, var(--peach-500), var(--peach-600)); box-shadow: 0 4px 10px rgba(255, 155, 77, 0.34), inset 0 2px 0 rgba(255,255,255,.45); }
.tl-dot.substituted { background: linear-gradient(150deg, var(--mint-500), var(--mint-600)); box-shadow: 0 4px 10px rgba(63, 168, 143, 0.32), inset 0 2px 0 rgba(255,255,255,.45); }
.tl-dot.leave { background: linear-gradient(150deg, var(--lemon-500), var(--lemon-600)); box-shadow: 0 4px 10px rgba(232, 167, 43, 0.32), inset 0 2px 0 rgba(255,255,255,.45); }
.tl-dot.cancelled { background: linear-gradient(150deg, #F58A8A, var(--danger)); box-shadow: 0 4px 10px rgba(239, 100, 100, 0.32), inset 0 2px 0 rgba(255,255,255,.45); }
.tl-dot.planned { background: linear-gradient(150deg, #C9C0BA, #A5948A); box-shadow: 0 4px 10px rgba(140, 122, 113, 0.28), inset 0 2px 0 rgba(255,255,255,.35); }

.tl-card {
  background: var(--paper);
  border-radius: var(--r-md);
  box-shadow: var(--sh-card);
  padding: 14px 16px;
  transition: transform var(--t-fast) var(--ease-bounce), box-shadow var(--t-fast);
}
.tl-card:hover { transform: translateX(2px); box-shadow: var(--sh-card-hover); }
.tl-card .tl-head { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; margin-bottom: 4px; }
.tl-topic { font-weight: 800; font-size: 15.5px; }
.tl-meta { font-size: 12.5px; color: var(--ink-500); }
.tl-note {
  margin-top: 6px;
  font-size: 13px;
  color: var(--warn);
  background: var(--warn-bg);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  display: inline-block;
}
.tl-next {
  margin-top: 6px;
  font-size: 13px;
  color: var(--mint-700);
  background: var(--mint-100);
  border-radius: var(--r-sm);
  padding: 4px 10px;
  display: inline-block;
}

/* ===================== 弹窗 ===================== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(122, 92, 84, 0.28);
  backdrop-filter: blur(3px);
  display: grid; place-items: center;
  padding: var(--s4);
  z-index: 60;
  animation: floatUp 160ms var(--ease-out);
}
.modal {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-pop);
  width: min(560px, 100%);
  max-height: 90vh;
  overflow: auto;
  padding: var(--s6);
  animation: popIn 240ms var(--ease-bounce);
}
.modal.wide { width: min(1080px, 100%); }
.modal-head { display: flex; align-items: center; gap: var(--s3); margin-bottom: var(--s4); }
.modal-head h3 { font-size: 19px; }
.modal-foot { display: flex; gap: var(--s3); justify-content: flex-end; margin-top: var(--s5); }

/* ===================== 轻提示 ===================== */
.toast-host {
  position: fixed;
  right: 22px; bottom: 22px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 90;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: var(--paper);
  border-radius: var(--r-pill);
  box-shadow: var(--sh-pop);
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-800);
  display: flex; align-items: center; gap: var(--s2);
  border-left: 6px solid var(--pink-500);
  animation: popIn 240ms var(--ease-bounce);
}
.toast.ok { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.danger { border-left-color: var(--danger); }

/* ===================== 空状态 ===================== */
.empty-state {
  text-align: center;
  padding: var(--s10) var(--s5);
  color: var(--ink-500);
}
.empty-illo {
  font-size: 52px;
  margin-bottom: var(--s3);
  display: inline-block;
  animation: wiggle 3.4s ease-in-out infinite;
  filter: drop-shadow(0 6px 8px rgba(226, 150, 140, 0.28));
}
.empty-state h2 { font-size: 18px; margin-bottom: 6px; color: var(--ink-800); }

/* ===================== 统计小卡 ===================== */
.stat {
  background: var(--paper);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-card);
  padding: var(--s4) var(--s5);
  display: flex; align-items: center; gap: var(--s4);
}
.stat .stat-ico {
  width: 46px; height: 46px; border-radius: 16px;
  display: grid; place-items: center; font-size: 22px;
  background: var(--pink-100);
  box-shadow: inset 0 1px 0 #fff;
}
.stat .stat-ico.peach { background: var(--peach-100); }
.stat .stat-ico.lemon { background: var(--lemon-100); }
.stat .stat-ico.mint { background: var(--mint-100); }
.stat .stat-num { font-size: 28px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat .stat-label { font-size: 12.5px; color: var(--ink-500); }

/* ===================== 分页/标签页 ===================== */
.tabs { display: flex; gap: 6px; background: var(--cream-100); padding: 5px; border-radius: var(--r-pill); width: fit-content; }
.tab {
  border: none; background: transparent;
  padding: 7px 18px; border-radius: var(--r-pill);
  font-size: 13.5px; font-weight: 700; color: var(--ink-600);
  cursor: pointer; transition: all var(--t-fast);
}
.tab:hover { color: var(--pink-700); }
.tab.active { background: #fff; color: var(--pink-700); box-shadow: var(--sh-xs); }

/* ===================== 加载 ===================== */
.bubble-spinner {
  width: 46px; height: 46px; margin: 0 auto var(--s3);
  border-radius: 50%;
  border: 5px solid var(--pink-100);
  border-top-color: var(--pink-500);
  animation: spinBubble 0.9s linear infinite;
}
.skeleton {
  background: linear-gradient(90deg, var(--cream-100) 25%, var(--cream-200) 37%, var(--cream-100) 63%);
  background-size: 300% 100%;
  animation: sheen 1.3s ease-in-out infinite;
  border-radius: var(--r-md);
}

/* ===================== 二维码卡 ===================== */
.qr-card {
  display: flex; gap: var(--s4); align-items: center;
  background: linear-gradient(150deg, #FFF9F3, #FFF2F7);
  border: 2px dashed var(--pink-300);
  border-radius: var(--r-lg);
  padding: var(--s4);
}
.qr-box {
  background: #fff; padding: 10px; border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  line-height: 0;
}
.qr-box svg { display: block; }
.qr-url {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pink-700);
  word-break: break-all;
  background: #fff;
  border-radius: var(--r-sm);
  padding: 6px 10px;
  display: inline-block;
  margin-top: 4px;
}

/* ===================== 关键词云 ===================== */
.kw-cloud { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.kw {
  padding: 5px 14px;
  border-radius: var(--r-pill);
  font-weight: 800;
  line-height: 1.3;
  border: 2px solid transparent;
  cursor: default;
  transition: transform var(--t-fast) var(--ease-bounce);
}
.kw:hover { transform: translateY(-2px) rotate(-2deg); }

/* ===================== 代码块 ===================== */
.code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: #FFF8F2;
  border: 1.5px dashed var(--cream-300);
  border-radius: var(--r-md);
  padding: 10px 14px;
  color: var(--ink-700);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ===================== 年级 / 单元 分组（练习列表） ===================== */
.grade-section {
  border-left: 3px solid var(--pink-300);
  padding-left: var(--s4);
}
.grade-section.is-none { border-left-color: var(--cream-300); }

.grade-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: var(--s3);
}
.grade-head .grade-ico { font-size: 17px; }
.grade-head .grade-name { font-size: 18px; font-weight: 800; color: var(--ink-800); }
.grade-head .grade-count { font-size: 12.5px; font-weight: 700; color: var(--ink-500); }
.grade-head .grade-tip {
  font-size: 12px; color: var(--ink-500);
  background: var(--cream-100); border: 1px dashed var(--cream-300);
  padding: 2px 9px; border-radius: var(--r-pill);
}
.grade-section.is-none .grade-name { color: var(--ink-600); }

/* ---- 学期层：夹在年级和单元之间 ---- */
.semester-block { margin-bottom: var(--s3); }
.semester-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  margin-bottom: var(--s3);
}
.semester-tag {
  font-size: 13.5px;
  font-weight: 800;
  line-height: 1.5;
  padding: 3px 14px;
  border-radius: var(--r-pill);
  color: var(--ink-800);
  background: linear-gradient(135deg, var(--peach-100), #FFF7EF);
  border: 1.5px solid var(--peach-500);
}
.semester-tag.plain {
  color: var(--ink-500);
  background: var(--cream-100);
  border: 1.5px dashed var(--cream-300);
  font-weight: 700;
}
.semester-count { font-size: 12px; font-weight: 700; color: var(--ink-400); }
.semester-tip { font-size: 12px; color: var(--ink-400); }
.semester-block.is-none > .semester-head { opacity: .85; }

.unit-block { margin-bottom: var(--s2); }
.unit-block .unit-block { margin-left: var(--s2); }
.unit-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  margin-bottom: var(--s3);
  border-bottom: 1.5px dashed var(--cream-200);
}
.unit-head .unit-ico { font-size: 14px; }
.unit-head .unit-name { font-size: 14.5px; font-weight: 800; color: var(--ink-700); }
.unit-head .unit-count { font-size: 12px; font-weight: 700; color: var(--ink-400); }
.unit-head .unit-tip { font-size: 12px; color: var(--ink-400); }
.unit-head.is-none .unit-name { color: var(--ink-500); font-weight: 700; }
.unit-head.is-none { border-bottom-style: dotted; }

/* ---- 层级折叠 ---- */
.grade-head, .semester-head, .unit-head { cursor: pointer; user-select: none; }
.grade-head:hover .grade-name,
.semester-head:hover .semester-tag,
.unit-head:hover .unit-name { color: var(--ink-900); }

/* 折叠箭头：纯 CSS 等腰三角形，紧跟在标签文字右侧（不再顶到整行最右边）
   —— 箭头贴着它管的那几个字，才看得出"点这个标签能折叠"；
   负的 margin-left 抵消一部分父级 gap，让间距更紧凑。
   展开 → 朝下；折叠 → 整体转 -90° 变成朝右（transform 不占布局，不会左右抖） */
.fold-arrow {
  flex: none;
  width: 0; height: 0;
  border-left: 5.5px solid transparent;
  border-right: 5.5px solid transparent;
  border-top: 8px solid var(--ink-400);
  margin-left: -3px;      /* 紧挨着左边的标签文字 */
  align-self: center;
  transition: transform .16s ease, border-top-color .16s ease;
  transform-origin: 50% 55%;
}
.grade-head:hover .fold-arrow,
.semester-head:hover .fold-arrow,
.unit-head:hover .fold-arrow { border-top-color: var(--ink-700); }
/* 折叠时箭头转朝右，并且标题栏不再占下方间距 */
.is-collapsed > .grade-head .fold-arrow,
.is-collapsed > .semester-head .fold-arrow,
.is-collapsed > .unit-head .fold-arrow { transform: rotate(-90deg); }
.is-collapsed > .grade-head,
.is-collapsed > .semester-head,
.is-collapsed > .unit-head { margin-bottom: 0; }
.is-collapsed > .unit-head { border-bottom-color: transparent; }
.grade-section.is-collapsed > .grade-body,
.semester-block.is-collapsed > .semester-body,
.unit-block.is-collapsed > .unit-body { display: none; }

/* ===================== 首页 · 班级卡片 ===================== */
.board-card { display: flex; flex-direction: column; gap: 8px; }

.board-title-row {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0; /* 让标题在窄卡片里也能正常收缩 */
}
.board-dot {
  width: 12px; height: 12px; border-radius: 50%; flex: none;
}
/* 班名：单行主标题，字号由 JS 按容器宽度自适应（fitTitle） */
.board-title {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.board-meta {
  display: flex; flex-wrap: wrap; gap: 4px 12px;
  font-size: 12.5px; font-weight: 700; color: var(--ink-600);
}
.board-meta-item.strong { color: var(--ink-800); }

.board-lines { display: flex; flex-direction: column; gap: 5px; }
.board-line {
  display: flex; align-items: baseline; gap: 6px;
  font-size: 13px; line-height: 1.5;
  min-width: 0;
}
.board-line-ico { flex: none; font-size: 12.5px; opacity: .95; }
.board-line-label { flex: none; color: var(--ink-700); font-weight: 700; }
.board-line-value {
  color: var(--ink-800);
  min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.board-line-value.next { font-weight: 700; }
.board-line-sub { color: var(--ink-600); }
.board-line-empty { color: var(--ink-600); font-weight: 600; }

/* 排序控件 */
.board-sort-wrap {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: 14px; flex: none;
}
.board-sort-label {
  font-size: 12.5px; font-weight: 700; color: var(--ink-500);
}
.board-sort {
  font: inherit;
  font-size: 12.5px; font-weight: 700;
  color: var(--ink-700);
  background: var(--cream-100);
  border: 1.5px solid var(--cream-200);
  border-radius: var(--r-pill);
  padding: 4px 10px;
  cursor: pointer;
}
.board-sort:hover { background: #fff; }

/* ===================== 班级详情：子标签 ===================== */
.cls-tabs { margin: var(--s4) 0 var(--s5); }
.cls-tab-host { min-height: 200px; }

/* ===================== 班级详情：学生名册 ===================== */
.stu-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-bottom: var(--s4);
}
.stu-card { display: flex; flex-direction: column; gap: 12px; }
.stu-top { display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; }
.stu-avatar {
  width: 52px; height: 52px; border-radius: 50%; flex: none;
  object-fit: cover; background: var(--cream-100);
  box-shadow: var(--sh-xs);
}
.stu-name {
  font-size: 16px; font-weight: 800; color: var(--ink-800);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stu-points {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; flex-wrap: wrap;
  background: var(--cream-050, #fffaf3);
  border: 1.5px dashed var(--cream-200);
  border-radius: var(--r-md);
  padding: 8px 12px;
}
.stu-points-num {
  font-size: 26px; font-weight: 800; line-height: 1;
  color: var(--pink-700); font-variant-numeric: tabular-nums;
}
.stu-points-label { font-size: 12.5px; color: var(--ink-500); font-weight: 700; }

/* 编辑弹窗里的积分区 */
.stu-points-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.stu-log-title { font-size: 13px; font-weight: 800; color: var(--ink-700); margin-bottom: 8px; }
.stu-log-list { display: flex; flex-direction: column; gap: 6px; max-height: 220px; overflow-y: auto; }
.pl-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; padding: 7px 10px;
  background: var(--cream-050, #fffaf3);
  border-radius: var(--r-md);
}
.pl-delta { font-weight: 800; font-variant-numeric: tabular-nums; min-width: 34px; }
.pl-delta.up { color: var(--mint-700); }
.pl-delta.down { color: var(--pink-700); }

/* ===================== 设置页：积分项目行 ===================== */
.rule-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  background: var(--cream-050, #fffaf3);
  border: 1.5px solid var(--cream-200);
  border-radius: var(--r-md);
  font-size: 14px;
}
.rule-ico { font-size: 18px; flex: none; }

/* ===================== 批量添加：两列录入 ===================== */
.batch-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 46vh; overflow-y: auto;
  border: 1.5px solid var(--cream-200);
  border-radius: var(--r-md);
  padding: 10px;
}
.batch-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 8px;
  align-items: center;
}
.batch-head {
  font-size: 12.5px; font-weight: 800; color: var(--ink-500);
  padding: 0 2px;
}
.batch-row .btn-sm { padding: 6px 10px; line-height: 1; }

/* 危险文字的幽灵按钮（一键清空用） */
.btn-danger-text { color: var(--danger-600, #c0392b); }
.btn-danger-text:hover { background: rgba(192, 57, 43, 0.08); }

/* ===================== 积分项目选择弹窗（笑脸/哭脸） ===================== */
.pt-list { display: flex; flex-direction: column; gap: 8px; }
.pt-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 10px 12px;
  font-size: 14px; font-weight: 700; color: var(--ink-800);
  background: var(--cream-050, #fffaf3);
  border: 1.5px solid var(--cream-200);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: box-shadow .15s, transform .1s;
}
.pt-item:hover { box-shadow: var(--sh-xs); transform: translateY(-1px); }
.pt-item .pt-ico { font-size: 18px; flex: none; }
.pt-item .pt-label { flex: 1; min-width: 0; }
.pt-item .pt-delta {
  font-variant-numeric: tabular-nums; font-weight: 800; flex: none;
}
.pt-item .pt-delta.up { color: var(--mint-700); }
.pt-item .pt-delta.down { color: var(--pink-700); }

/* 撤销过的流水：灰掉 + 删除线，和正常记录区分开 */
.pl-row.pl-undo { opacity: .62; }
.pl-row.pl-undo .pl-delta,
.pl-row.pl-undo .grow { text-decoration: line-through; }

/* ── 页面切换手感 ──────────────────────────────────────────
   旧内容留到新内容就绪才被替换，加载期间只是淡一点，不闪白屏。 */
#main { transition: opacity .18s ease; }
#main.is-switching { opacity: .55; }

/* 子标签切换只换下面这块内容，轻轻淡入一下，眼睛跟得上 */
.cls-tab-host > * { animation: tab-in .18s ease both; }
@keyframes tab-in {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  #main, #main.is-switching { transition: none; opacity: 1; }
  .cls-tab-host > * { animation: none; }
}

/* ===================== 我的备课 · 课件组 / 课件 ===================== */
.lesson-bar {
  display: flex; align-items: center; gap: var(--s3);
  flex-wrap: wrap; margin: var(--s4) 0 var(--s3);
}
.lesson-bar .grow { flex: 1 1 auto; }
.lesson-tabs { margin: 0; }
.lesson-busy { font-weight: 700; color: var(--pink-700); }
.lesson-host { display: flex; flex-direction: column; gap: var(--s3); }

.lesson-group {
  background: var(--paper);
  border: 1.5px solid var(--cream-200);
  border-radius: var(--r-md);
  box-shadow: var(--sh-xs);
  overflow: hidden;
}
.lesson-group.is-loose { border-style: dashed; background: var(--cream-050); }

.lesson-group-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px var(--s3);
  cursor: pointer; user-select: none;
  background: linear-gradient(135deg, var(--peach-100), #FFF7EF);
  border-bottom: 1.5px solid var(--cream-200);
  transition: background var(--t-fast);
}
.lesson-group.is-loose > .lesson-group-head { background: var(--cream-100); }
.lesson-group-head:hover { filter: brightness(1.02); }
.lesson-group.is-collapsed > .lesson-group-head { border-bottom-color: transparent; }
.lesson-group-ico { font-size: 16px; }
.lesson-group-name { font-size: 15px; font-weight: 800; color: var(--ink-800); }
.lesson-group-count { font-size: 12px; font-weight: 700; color: var(--ink-400); }
.lesson-group.is-collapsed > .lesson-group-body { display: none; }
.lesson-group.is-collapsed > .lesson-group-head .fold-arrow { transform: rotate(-90deg); }

/* 右侧那排按钮在标题里：别让它们把"点击折叠"的手感吃掉 */
.lesson-group-head .btn-sm { padding: 4px 10px; font-size: 12px; }

.lesson-group-body { padding: var(--s2) var(--s2) var(--s2); display: flex; flex-direction: column; gap: 4px; }
.lesson-group-body.is-over { outline: 2px dashed var(--pink-500); outline-offset: -4px; background: var(--pink-050); }

.lesson-file {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.lesson-file:hover { background: var(--cream-100); }
.lesson-file-main { min-width: 0; }
.lesson-file-title {
  display: block;
  font-size: 14px; font-weight: 700; color: var(--ink-900);
  text-decoration: none;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  max-width: 46vw;
}
.lesson-file-title:hover { color: var(--pink-700); text-decoration: underline; }
.lesson-file-meta { font-size: 11.5px; color: var(--ink-400); margin-top: 1px; }
.lesson-file-acts { display: flex; gap: 6px; flex: none; }
.lesson-file-acts .btn-sm { padding: 4px 10px; font-size: 12px; text-decoration: none; }

.lesson-empty-line { padding: 6px 10px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lesson-tip { margin-top: var(--s2); }

/* 类型图标：一眼看出是网页 / PPT / PDF … */
.fico {
  width: 34px; height: 34px; flex: none;
  border-radius: 11px;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
  background: var(--cream-100);
  box-shadow: inset 0 1px 0 #fff;
}
.fico.pink  { background: var(--pink-100); }
.fico.peach { background: var(--peach-100); }
.fico.lemon { background: var(--lemon-100); }
.fico.mint  { background: var(--mint-100); }
.fico.coral { background: var(--coral-100); }
.fico.berry { background: var(--berry-100); }
.fico.plain { background: var(--cream-200); }

@media (max-width: 720px) {
  .lesson-file-title { max-width: 60vw; }
  .lesson-file-acts { flex-wrap: wrap; justify-content: flex-end; }
}
