/* ═══════════════════════════════════════════════════════════
   橙子部落 · 课程表 course.css
   温暖治愈 · 米白底 + 暖橙主色 · 原生 CSS
   ═══════════════════════════════════════════════════════════ */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --bg: #faf7f2;
  --card: #ffffff;
  --ink: #5a4d42;
  --ink-2: #998876;
  --ink-3: #c2b3a1;
  --line: #eee5d8;
  --line-soft: #faf5ed;
  --orange: #e8a87c;
  --orange-deep: #d4824a;
  --orange-dark: #b96a35;
  --green-mask: rgba(169, 196, 131, 0.35);
  --danger: #cf6a52;
  --shadow-sm: 0 2px 10px rgba(90, 77, 66, 0.06);
  --shadow-md: 0 10px 34px rgba(90, 77, 66, 0.13);
  --radius: 18px;
}

html { -webkit-text-size-adjust: 100%; }

body {
  /* 全站统一「橙子部落字体」：Nunito 管数字/拉丁，ZCOOL 小薇体管中文；
     例外——周/月视图的课表网格保留系统字体（见下方 .week-scroll / .month-grid 覆盖）；
     2026-09-11 用户要求「其他的都统一成橙子部落字体」 */
  font-family: 'Nunito', 'ZCOOL XiaoWei', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans CJK SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.62;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 22px 90px;
}

/* ═══════════ 顶部导航 ═══════════ */
.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}

.nav-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9rem;
  min-height: 40px;
  padding: 0 4px;
  transition: color 0.25s ease;
  white-space: nowrap;
}
.nav-back:hover { color: var(--orange-deep); }

.topbar-title { text-align: center; justify-self: center; }

.topbar-title h1 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 1.9rem;
  font-weight: 400;
  color: var(--orange-deep);
  letter-spacing: 0.1em;
  line-height: 1.4;
}

.divider {
  width: 52px;
  height: 2px;
  margin: 2px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--orange), transparent);
  opacity: 0.55;
}

.btn-add {
  justify-self: end;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1;
}

/* ═══════════ 通用按钮 ═══════════ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 8px 20px;
  border: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.22s ease;
  user-select: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fffdfa;
  font-weight: 600;
  letter-spacing: 0.05em;
  box-shadow: 0 4px 14px rgba(212, 130, 74, 0.32);
}
.btn-primary:hover { box-shadow: 0 6px 20px rgba(212, 130, 74, 0.42); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.btn-ghost {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--orange); color: var(--orange-deep); background: #fff8f2; }

.btn-danger {
  background: linear-gradient(135deg, #e08a72, var(--danger));
  color: #fff;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(207, 106, 82, 0.28);
}
.btn-danger-ghost {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(207, 106, 82, 0.45);
}
.btn-danger-ghost:hover { background: rgba(207, 106, 82, 0.08); border-color: var(--danger); }

.btn-round {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
  font-size: 1.25rem;
  line-height: 1;
  box-shadow: none;
}
.btn-round:hover { border-color: var(--orange); color: var(--orange-deep); background: #fff6ee; }

.btn-today {
  min-height: 34px;
  padding: 4px 16px;
  font-size: 0.82rem;
  background: var(--card);
  border: 1.5px solid var(--line);
  color: var(--ink-2);
}
.btn-today:hover { border-color: var(--orange); color: var(--orange-deep); }

.link-like {
  background: none;
  border: none;
  padding: 0;
  color: var(--orange-deep);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline dotted;
}
.link-like:hover { color: var(--orange-dark); }

/* ═══════════ 视图切换 tabs ═══════════ */
.view-tabs {
  display: flex;
  justify-content: center;
  margin: 4px auto 22px;
}

.view-tabs .tab {
  min-height: 40px;
  padding: 8px 26px;
  border: 1.5px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.22s ease;
  white-space: nowrap;
}
/* 胶囊组边框合并：只有最左 tab 有左边框，各 tab 保留右边框作分隔线，杜绝中间双线/缺口 */
.view-tabs .tab + .tab { border-left: none; }
.view-tabs .tab:first-child { border-radius: 999px 0 0 999px; }
.view-tabs .tab:last-child { border-radius: 0 999px 999px 0; }
.view-tabs .tab:hover { color: var(--orange-deep); }
.view-tabs .tab.is-active {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 3px 12px rgba(212, 130, 74, 0.3);
}
/* 选中 tab 紧邻的未选中 tab：补一条分隔线颜色，避免透明边框露底 */
.view-tabs .tab.is-active + .tab { border-left: 1.5px solid var(--line); }

.main .view { animation: viewIn 0.25s ease; }
@keyframes viewIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

/* ═══════════ 子导航（周/月） ═══════════ */
.subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.subnav-group { display: inline-flex; align-items: center; gap: 10px; }
.subnav-label {
  min-width: 210px;
  text-align: center;
  font-size: 1rem;
  color: var(--ink);
  letter-spacing: 0.04em;
  font-weight: 600;
}

/* ═══════════ 周视图 ═══════════ */
.legend-dot, .cat-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.week-scroll {
  --hh: 62px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(90, 77, 66, 0.06);
  padding: 10px 6px 6px;
}

/* ⛔ 例外：周视图 / 月视图的「课程表」本体保持系统字体
   （手写体在密排表格 + 小字号下可读性差，2026-09-11 用户明确要求这两块不改；
     font-family 会向下继承 —— 星期表头 / 时间轴 / 课程块 / 月视图日期格全部随此规则走系统字体） */
.week-scroll,
.month-grid {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'HarmonyOS Sans SC', 'MiSans', 'Noto Sans CJK SC', 'Microsoft YaHei', 'Segoe UI', Roboto, sans-serif;
}

.week-inner { min-width: 730px; }

/* 表头：日期列 */
.week-head {
  display: flex;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.week-head .axis-spacer { width: 58px; flex: none; }
.day-head {
  flex: 1;
  text-align: center;
  padding: 6px 2px 4px;
  font-size: 0.82rem;
  color: var(--ink-2);
  cursor: pointer;
  border-radius: 8px;
  user-select: none;
}
.day-head:hover { background: rgba(62, 142, 126, 0.08); }
.day-head:active { background: rgba(62, 142, 126, 0.14); }
.day-head b { display: block; font-size: 0.9rem; font-weight: 600; color: var(--ink); }
.day-head.is-today b {
  color: var(--orange-deep);
}
.day-head.is-today .day-date {
  display: inline-block;
  min-width: 26px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff;
}

/* 表体：时间轴 + 天列 */
.week-body { display: flex; position: relative; }
.week-axis {
  width: 58px;
  flex: none;
  position: relative;
  height: calc(var(--hh) * var(--axis-hours, 12));
}
.axis-label {
  position: absolute;
  right: 8px;
  transform: translateY(-50%);
  font-size: 0.7rem;
  color: #9c8b76;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.axis-label.is-half { color: #ece3d6; font-size: 0.58rem; }

.day-col {
  flex: 1;
  position: relative;
  height: calc(var(--hh) * var(--axis-hours, 12));
}
.day-col.is-today { background-color: rgba(232, 168, 124, 0.03); }

/* 课程色块（通透版：无左侧色条、无重阴影、淡彩底+圆角） */
.ev {
  position: absolute;
  border-radius: 13px;
  padding: 3px 9px 4px;
  overflow: hidden;
  cursor: pointer;
  background: rgba(232, 168, 124, 0.14);
  border-left: none;
  transition: box-shadow 0.2s ease, filter 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.ev:hover { filter: brightness(0.99); box-shadow: 0 6px 18px rgba(90, 77, 66, 0.12); z-index: 5; }
.ev-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.25;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-all;
}
.ev-time {
  font-size: 0.7rem;
  font-weight: 500;
  color: #7f6f5d;
  margin-top: 1px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

/* 时间冲突预警：橙色虚线描边 + 右上角警示 */
.ev-conflict {
  box-shadow: inset 0 0 0 2px rgba(224, 105, 60, 0.9), 0 2px 6px rgba(90, 77, 66, 0.1);
  background-image: repeating-linear-gradient(135deg, rgba(224, 105, 60, 0.06) 0 6px, transparent 6px 12px);
}
.ev-conflict::after {
  content: '⚠';
  position: absolute;
  top: 3px;
  right: 5px;
  font-size: 0.66rem;
  color: #e06a3a;
  line-height: 1;
}

/* 临时加课块：绿色虚线描边 + "临"角标 */
.ev-extra {
  box-shadow: inset 0 0 0 1.5px rgba(62, 142, 126, 0.55);
  background-image: repeating-linear-gradient(135deg, rgba(62, 142, 126, 0.05) 0 6px, transparent 6px 12px);
}
.ev-ex {
  position: absolute;
  top: 2px;
  right: 4px;
  font-style: normal;
  font-size: 0.56rem;
  font-weight: 700;
  color: #fff;
  background: rgba(62, 142, 126, 0.85);
  border-radius: 5px;
  padding: 0 3px;
  line-height: 1.3;
}

.week-empty {
  text-align: center;
  color: var(--ink-3);
  font-size: 0.9rem;
  padding: 60px 10px;
}
.empty-hint { color: var(--ink-3); font-size: 0.88rem; padding: 30px 10px; text-align: center; }

/* ═══════════ 月视图 ═══════════ */
.month-wrap {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px 10px;
  overflow-x: auto;
}
.month-grid {
  min-width: 660px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}
.m-head-cell {
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-3);
  padding: 4px 0 8px;
  letter-spacing: 0.1em;
}
.m-head-cell.is-weekend { color: var(--orange); }
.m-cell {
  min-height: 92px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 6px 7px;
  background: #fffefc;
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  vertical-align: top;
}
.m-cell:hover { border-color: var(--orange); box-shadow: 0 3px 12px rgba(90, 77, 66, 0.08); }
.m-cell.is-dim { background: transparent; border-color: transparent; opacity: 0.55; }
.m-cell.is-today { border-color: var(--orange-deep); box-shadow: 0 0 0 2px rgba(232, 168, 124, 0.25); }
.m-date {
  font-size: 0.8rem;
  color: var(--ink-2);
  align-self: flex-start;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.m-cell.is-today .m-date {
  background: linear-gradient(135deg, var(--orange), var(--orange-deep));
  color: #fff;
  border-radius: 999px;
  padding: 0 7px;
  font-weight: 600;
}
.m-pills { display: flex; flex-direction: column; gap: 2px; overflow: hidden; }
.m-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.7rem;
  line-height: 1.3;
  color: var(--ink);
  background: #faf6f0;
  border-radius: 6px;
  padding: 1px 6px;
  overflow: hidden;
  white-space: nowrap;
}
.m-pill .pill-dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.m-pill .pill-name { overflow: hidden; text-overflow: ellipsis; }
.m-more { font-size: 0.68rem; color: var(--ink-3); padding-left: 2px; }

/* ═══════════ 数据统计 ═══════════ */
/* 首次进入统计页：异步面板（💰课程余额 / 📊年度概览）数据未到时高度为 0，会把页底的
   「📋 课程 · 全部课程」总览列表顶到数字卡正下方 → 观感上像面板顺序"跳变"。
   加载期间隐藏异步面板（占位不塌陷，数字卡立即可见），数据齐了整体淡入（2026-09-11）。 */
.stats-wrap { position: relative; }
.stats-wrap > * { transition: opacity 0.22s ease; }
.stats-wrap.is-loading > *:not(.stat-cards) { opacity: 0; pointer-events: none; }
.stats-wrap.is-loading::after {
  content: '🍊 正在加载数据…';
  position: absolute;
  left: 0;
  right: 0;
  top: 150px;
  text-align: center;
  font-size: 0.85rem;
  color: var(--ink-3);
}
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.stat-card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  padding: 20px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #eadfd0; }
.stat-card.is-on {
  border-color: var(--orange);
  box-shadow: 0 0 0 1px var(--orange) inset, var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card.is-on .stat-label { color: var(--orange-dark); font-weight: 600; }
/* ═══════════ 统计卡片 → 课程列表弹窗 ═══════════ */
.stats-list-body { max-height: min(62vh, 480px); overflow-y: auto; padding: 2px 6px 10px 2px; margin-top: 4px; }
.stats-list { display: flex; flex-direction: column; gap: 8px; }
.stats-li {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  text-align: left;
  background: #fdfaf5;
  border: 1px solid #eee3d0;
  border-radius: 13px;
  padding: 11px 13px;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: 0.18s;
}
.stats-li:hover { background: #faf4ea; border-color: #e3d5bd; }
.stats-li-top { display: flex; align-items: center; gap: 7px; min-width: 0; }
.stats-li-name { font-size: 0.92rem; font-weight: 600; color: #5a4a35; }
.stats-li-sub { font-size: 0.78rem; color: var(--ink-2); }
.stats-li-info { font-size: 0.78rem; color: #9a8b78; }
.stats-li .li-arrow { margin-left: auto; color: var(--ink-3); font-size: 0.9rem; flex: none; }
.stats-li-top .st-tag { font-size: 0.68rem; }
.stats-li-top .li-warn { font-size: 0.7rem; }
@media (max-width: 560px) {
  .stats-li-name { font-size: 0.88rem; }
}
.stat-badge {
  position: absolute;
  top: 10px;
  right: 12px;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 99px;
  background: #f2a25c;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 20px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 6px rgba(210, 130, 74, 0.35);
}
.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex: none;
  background: linear-gradient(145deg, #fdf3ea, #f7e3d3);
}
.stat-icon.green { background: linear-gradient(145deg, #eef3e4, #dde8cc); }
.stat-icon.pink { background: linear-gradient(145deg, #f9ecf3, #f0d9e6); }
.stat-icon.blue { background: linear-gradient(145deg, #e9f0f8, #d8e4f2); }
.stat-meta { min-width: 0; }
.stat-num {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}
.stat-num small { font-size: 0.85rem; font-weight: 600; color: var(--ink-2); margin-left: 2px; }
.stat-label { font-size: 0.8rem; color: var(--ink-2); }

.panel {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 18px 20px;
  margin-bottom: 14px;
}
.panel h3 {
  font-family: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

/* ═══════════ 统计页课程列表 ═══════════ */
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.panel-head h3 { margin-bottom: 0; }
.panel-count { font-size: 0.78rem; color: var(--ink-3); font-weight: 500; }
.pch-year-sel {
  font: inherit;
  font-size: 0.8rem;
  color: #5a4a35;
  background: #fdfaf5;
  border: 1px solid #e0d6c6;
  border-radius: 9px;
  padding: 5px 10px;
  cursor: pointer;
  outline: none;
}
.pch-year-sel:hover { border-color: #cfbfa2; }
.pch-year-sel:focus { border-color: #3e8e7e; box-shadow: 0 0 0 2px rgba(62, 142, 126, 0.15); }
.course-li {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 6px;
  background: none;
  border: none;
  border-bottom: 1px dashed var(--line-soft);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.15s ease;
}
.course-li:last-child { border-bottom: none; }
.course-li:hover { background: #fdf8f1; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-name { font-size: 0.95rem; font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.li-sub { font-size: 0.8rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li-lesson {
  flex: none;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-2);
  background: #f6f1ea;
  border-radius: 99px;
  padding: 3px 10px;
  font-variant-numeric: tabular-nums;
}
.li-lesson.is-low { background: #fdeee0; color: #d4824a; }
.li-lesson.is-low:empty { display: none; }
.li-warn {
  font-size: 0.68rem;
  font-weight: 600;
  color: #d4824a;
  background: #fdeee0;
  border-radius: 99px;
  padding: 1px 8px;
  vertical-align: middle;
}
.li-warn.li-empty { background: #fbe5e0; color: #cf6a52; }
.li-arrow { flex: none; color: var(--ink-3); font-size: 1.1rem; }
/* 统计页列表·大类组头（多门课折叠成一组，点开才展开明细） */
.cat-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  margin: 8px 0 2px;
  padding: 12px 12px;
  background: #faf5ec;
  border: 1px solid #f0e5d4;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.95rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.cat-group-head:hover { background: #f6ecdb; border-color: #e4d2b8; }
.cat-group-head.is-open { background: #f8efdd; border-color: #ead9ba; }
.cat-group-head .group-name { flex: 1; min-width: 0; font-weight: 600; color: var(--ink); }
.cat-group-head .group-count { flex: none; font-size: 0.75rem; font-weight: 700; color: var(--ink-2); background: rgba(255, 255, 255, 0.7); border-radius: 99px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.cat-group-head .group-arrow { flex: none; color: var(--ink-3); font-size: 0.8rem; transition: color 0.15s ease; }
.cat-group-head.is-open .group-arrow { color: var(--orange); }
/* 统计页：大类展开后的小类课程行缩进，突出上下级 */
.course-li.in-group { padding-left: 28px; }
.st-tag {
  font-size: 0.66rem;
  font-weight: 600;
  border-radius: 99px;
  padding: 1px 8px;
  vertical-align: middle;
}
.st-tag.st-paused { background: #f2ede4; color: #998876; }
.st-tag.st-completed { background: #e9f0f8; color: #6d8fb0; }
/* 挂起（2026-09-13）：排课时间已结束、还没点完结 → 暖橙提醒色（要她拍板，但不刺眼） */
.st-tag.st-suspended { background: #fdf1e3; color: #b8834a; }

/* ═══════════ 低课时提醒条（课程详情） ═══════════ */
.lesson-warn-bar {
  background: #fdf3e3;
  border: 1px solid #f5ddb8;
  color: #a86a2f;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  font-size: 0.88rem;
  line-height: 1.5;
}
.lesson-warn-bar b { color: #d4824a; font-weight: 700; }
.lesson-warn-bar.warn-empty { background: #fbeae6; border-color: #efc9bf; color: #b0543c; }

/* ═══════════ 分类管理 FAB ═══════════ */
.cat-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 18px;
  border: none;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.86rem;
  box-shadow: 0 6px 22px rgba(90, 77, 66, 0.18);
  cursor: pointer;
  transition: all 0.22s ease;
}
.cat-fab:hover { color: var(--orange-deep); transform: translateY(-2px); box-shadow: 0 10px 26px rgba(90, 77, 66, 0.22); }

/* ═══════════ 弹窗 ═══════════ */
body.modal-open {
  overflow: hidden;
  overscroll-behavior: none;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  background: var(--green-mask);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  padding: 20px;
}
.modal-overlay.open { display: flex; animation: maskIn 0.2s ease; }
@keyframes maskIn { from { opacity: 0; } to { opacity: 1; } }

.modal-content {
  background: var(--card);
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 22px;
  box-shadow: var(--shadow-md);
  padding: 24px 26px 22px;
  transform: translateY(16px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.modal-overlay.open .modal-content { transform: none; opacity: 1; }

.modal-sm { max-width: 400px; }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}
.modal-head h2 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.08em;
}
.modal-x {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.05);
  color: var(--ink-2);
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.modal-x:hover { background: rgba(0, 0, 0, 0.1); }

.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}

/* 冲突警示 */
.alert-conflict {
  background: #fdf1ea;
  border: 1.5px dashed var(--orange-deep);
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: #a05a2e;
  line-height: 1.8;
}
.alert-conflict .ac-title { font-weight: 700; }
.alert-conflict ul { margin: 4px 0 0 18px; }
.alert-conflict li::marker { color: var(--orange-deep); }

/* ═══════════ 表单 ═══════════ */
.form-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 16px;
}
.field { margin-bottom: 14px; min-width: 0; }
.field-full { grid-column: 1 / -1; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.field-hint { font-size: 0.72rem; color: var(--ink-3); margin: -8px 0 12px; }
/* ── 新增课程：费用（选填）分区 ── */
.form-pay-box {
  grid-column: 1 / -1;
  background: rgba(255, 244, 229, 0.65);
  border: 1px dashed rgba(233, 161, 87, 0.4);
  border-radius: 12px;
  padding: 12px 14px 2px;
  margin: 2px 0 4px;
}
.form-pay-box .form-pay-title { font-size: 0.82rem; color: var(--orange-deep); }
.form-pay-box .field { margin-bottom: 12px; }
.form-pay-box .field-hint { margin: -6px 0 10px; line-height: 1.5; }
.form-pay-box.hidden { display: none; }
.field-label {
  display: block;
  font-size: 0.8rem;
  color: var(--ink-2);
  margin-bottom: 6px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.field-label .req { color: var(--danger); font-style: normal; }

/* 课时换算提示：剩余 = 总课时 - 已经上过（负数=超出） */
.lesson-calc-tip {
  margin: -4px 0 12px;
  padding: 7px 11px;
  border-radius: 10px;
  background: #fdf6ec;
  border: 1px solid #f2e4d0;
  color: #a8845c;
  font-size: 0.78rem;
  line-height: 1.5;
}
.copy-hint { font-weight: 400; font-size: 0.72rem; color: var(--ink-3); margin-left: 4px; letter-spacing: 0; }
.field-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  min-height: 44px;
}
.field-input:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(232, 168, 124, 0.2);
}
.field-input.field-readonly {
  background: #f7f3ee;
  color: var(--ink-2);
  cursor: default;
}
.field-textarea { resize: vertical; min-height: 60px; line-height: 1.6; }
select.field-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238a7a6a' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 34px;
}
input[type='time'].field-input { font-variant-numeric: tabular-nums; }

/* 分类选择 chips */
.chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 36px;
  padding: 5px 14px 5px 10px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  transition: all 0.18s ease;
}
.chip:hover { border-color: var(--orange); }
.chip.is-on {
  border-color: var(--orange-deep);
  background: #fdf1e6;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(212, 130, 74, 0.18);
}
/* 星期多选 chips（复用 .chip 选中态，可多选） */
.chip-wd { padding: 5px 16px; justify-content: center; }
.weekday-note { color: #a09080; font-size: 0.78rem; margin-top: 6px; line-height: 1.7; }
.cat-none { font-size: 0.8rem; color: var(--ink-3); margin-top: 6px; }

/* ═══════════ 课程详情 ═══════════ */
.detail-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.detail-title-row h3 {
  font-family: 'ZCOOL XiaoWei', serif;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--ink);
}
.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  color: var(--ink-2);
  background: #faf6f0;
  border-radius: 999px;
  padding: 2px 12px 2px 8px;
}
.status-pill {
  font-size: 0.74rem;
  border-radius: 999px;
  padding: 1px 10px;
  font-weight: 600;
}
.status-pill.st-active { background: #e8f1dc; color: #6a8f3c; }
.status-pill.st-paused { background: #f0ece6; color: var(--ink-2); }
.status-pill.st-suspended { background: #fdf1e3; color: #b8834a; }
.status-pill.st-completed { background: #fdeee9; color: var(--danger); }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 20px;
  background: #faf7f2;
  border-radius: 14px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.detail-item { padding: 7px 0; min-width: 0; }
.detail-item .di-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  margin-bottom: 1px;
}
.detail-item .di-value { font-size: 0.92rem; color: var(--ink); word-break: break-word; }
.detail-item.span2 { grid-column: 1 / -1; }
.detail-notes {
  background: #faf7f2;
  border-radius: 14px;
  padding: 12px 16px;
  font-size: 0.88rem;
  color: var(--ink);
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-notes .di-label { display: block; font-size: 0.72rem; color: var(--ink-3); margin-bottom: 2px; }

/* ═══════════ 当日课程列表（月视图点日期） ═══════════ */
.modal-day { display: flex; flex-direction: column; overflow: hidden; }
.modal-day .modal-head { flex: none; }
.modal-day .day-scroll {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-right: 6px;
  margin-right: -6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(90, 77, 66, 0.22) transparent;
}
.modal-day .day-scroll::-webkit-scrollbar { width: 4px; }
.modal-day .day-scroll::-webkit-scrollbar-thumb { background: rgba(90, 77, 66, 0.2); border-radius: 4px; }
.modal-day.can-more::after {
  content: '↓ 上滑查看全部';
  flex: none;
  height: 30px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  background: #faf7f2;
  border-radius: 10px;
  transition: opacity 0.2s ease;
}
.modal-day.can-more.at-end::after { opacity: 0; }
.day-body { display: flex; flex-direction: column; gap: 10px; }
.day-row {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #faf7f2;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 16px;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
  width: 100%;
  font-family: inherit;
  flex: none;
}
.day-row:hover { border-color: var(--orange); background: #fff8f1; transform: translateX(2px); }
.day-row.is-routine { background: #f6f4ee; }
.day-row.is-routine:hover { background: #fbf7f0; }
.day-row.is-routine .dr-time { color: var(--ink-3); }
.day-row.is-routine .dr-name { color: var(--ink-2); font-weight: 500; }
.day-row .dr-time {
  flex: none;
  font-size: 0.78rem;
  color: var(--orange-deep);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 84px;
}
.day-row .dr-main { min-width: 0; flex: 1; }
.day-row .dr-ico { font-size: 1.05rem; line-height: 1; margin-right: 6px; display: inline-block; vertical-align: -1px; }
.day-row .dr-name { font-size: 0.95rem; color: var(--ink); font-weight: 600; line-height: 1.4; }
.day-row .dr-sub { font-size: 0.76rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.day-row .dr-arrow { color: var(--ink-3); font-size: 0.9rem; flex: none; }
.day-empty { text-align: center; color: var(--ink-3); padding: 26px 10px; font-size: 0.88rem; }

/* 当日安排弹窗底部：往这天加课 / 整天请假 */
.day-actions-row {
  flex: none;
  display: flex;
  gap: 10px;
  padding: 10px 18px 14px;
  border-top: 1px dashed rgba(120, 100, 80, 0.18);
}
.day-actions-row .btn {
  flex: 1;
  min-width: 0;
}
.btn-day-add {
  font-size: 0.88rem;
  color: #2d6e60;
  background: rgba(62, 142, 126, 0.1);
  border: 1px solid rgba(62, 142, 126, 0.35);
}
.btn-day-add:hover { background: rgba(62, 142, 126, 0.16); }
.btn-day-leave {
  font-size: 0.88rem;
  color: #8a5a2a;
  background: rgba(218, 145, 74, 0.1);
  border: 1px solid rgba(218, 145, 74, 0.4);
}
.btn-day-leave:hover { background: rgba(218, 145, 74, 0.16); }
.btn-day-restore { color: #2f6e5e; background: rgba(62, 142, 126, 0.08); border: 1px solid rgba(62, 142, 126, 0.4); }
.btn-day-restore:hover { background: rgba(62, 142, 126, 0.16); }
/* 整天请假面板（dayLeave 模式） */
.dl-skip-title {
  margin: 2px 0 2px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--ink-3);
}
.dl-skip-title + .sub-row { opacity: 0.75; }
.dl-fail-box .sub-row-main span { color: #b23b3b; }
/* 整天请假 · 课程勾选行（默认全选，可点掉） */
.dl-opt { cursor: pointer; }
.dl-opt .dl-box { display: inline-flex; align-items: center; flex: none; }
.dl-check { width: 18px; height: 18px; accent-color: #d98a3d; cursor: pointer; flex: none; }
.dl-opt.is-off { opacity: 0.5; }
.sub-form-actions .btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.day-row .dr-tag-extra {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.62rem;
  font-weight: 700;
  color: #2d6e60;
  background: rgba(62, 142, 126, 0.12);
  border: 1px solid rgba(62, 142, 126, 0.4);
  border-radius: 6px;
  padding: 0 4px;
  vertical-align: 1px;
  line-height: 1.4;
}

/* ═══════════ 分类管理 ═══════════ */
.cat-form {
  background: #faf7f2;
  border-radius: 14px;
  padding: 14px 16px 4px;
  margin-bottom: 16px;
}
.swatches {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px 8px;
  justify-items: center;
  align-items: center;
  margin-bottom: 8px;
}
.sw {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2.5px solid transparent;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sw-core {
  width: 44%;
  height: 44%;
  border-radius: 50%;
  display: block;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
}
.sw:hover { transform: scale(1.12); }
.sw.is-on { border-color: var(--ink); transform: scale(1.1); box-shadow: 0 0 0 2px #fff inset, 0 0 0 4px rgba(90,77,66,.25); }
.swatch-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.swatch-custom input[type='color'] {
  width: 40px;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 2px;
  cursor: pointer;
}
.swatch-custom input[type='text'] {
  width: 92px;
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 2px 8px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  outline: none;
}
.swatch-custom input[type='text']:focus { border-color: var(--accent); }
.btn-pick {
  height: 30px;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 2px 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--ink);
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-pick:hover { border-color: var(--accent); background: #fdf9f4; }

/* 颜色盘 */
.picker-body { padding: 6px 2px 2px; }
.picker-preview-row { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.picker-preview {
  width: 44px; height: 44px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.04);
  flex-shrink: 0;
}
.picker-hex-input {
  display: flex; align-items: center;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 2px 10px;
  height: 40px;
}
.picker-hash { color: var(--ink-2); font-size: 1rem; margin-right: 2px; }
.picker-hex-input input {
  border: none; outline: none;
  font-family: 'Nunito', monospace;
  font-size: 1rem; letter-spacing: .05em;
  color: var(--ink);
  width: 110px;
  background: transparent;
}
.picker-sv {
  position: relative;
  height: 170px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  cursor: crosshair;
  touch-action: none;
  margin-bottom: 14px;
  background: linear-gradient(to top, #000, rgba(0,0,0,0)), linear-gradient(to right, #fff, hsl(30,100%,50%));
  overflow: hidden;
}
.picker-hue {
  position: relative;
  height: 20px;
  border-radius: 10px;
  border: 1.5px solid var(--line);
  cursor: pointer;
  touch-action: none;
  margin-bottom: 8px;
  background: linear-gradient(to right, #f00, #ff0, #0f0, #0ff, #00f, #f0f, #f00);
}
.picker-cursor {
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px rgba(90,77,66,.5), 0 1px 4px rgba(0,0,0,.25);
  transform: translate(-50%, -50%);
  pointer-events: none;
  left: 100%; top: 0;
}
.picker-hue-cursor { width: 14px; height: 14px; left: 0; top: 50%; }
.cat-form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-bottom: 14px;
}
.cat-list { display: flex; flex-direction: column; gap: 8px; max-height: 40vh; overflow-y: auto; }
.cat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffefc;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 9px 12px 9px 14px;
}
.cat-row .cat-info { flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; }
.cat-row .cat-name { font-size: 0.92rem; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-row .cat-count { font-size: 0.75rem; color: var(--ink-3); flex: none; }
.cat-row .cat-ops { display: inline-flex; gap: 4px; flex: none; }
.mini-btn {
  min-height: 32px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
.mini-btn:hover { border-color: var(--orange); color: var(--orange-deep); }
.mini-btn.mini-danger:hover { border-color: var(--danger); color: var(--danger); background: rgba(207, 106, 82, 0.06); }
.cat-empty { text-align: center; color: var(--ink-3); font-size: 0.85rem; padding: 18px 10px; }
.cat-edit-inline { display: flex; gap: 6px; flex: 1; min-width: 0; }
.cat-edit-inline input {
  flex: 1;
  min-width: 0;
  min-height: 36px;
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  outline: none;
}
.cat-edit-inline input:focus { border-color: var(--orange); }

/* 确认弹窗 */
.confirm-text {
  font-size: 0.95rem;
  color: var(--ink);
  line-height: 1.9;
  padding: 4px 2px 6px;
  word-break: break-word;
}
.confirm-text .confirm-warn { color: var(--danger); font-weight: 600; }

/* ═══════════ 页脚 ═══════════ */
.footer {
  margin-top: 44px;
  text-align: center;
  color: var(--ink-3);
  font-size: 0.78rem;
  font-family: inherit;
  letter-spacing: 0.06em;
}

/* ═══════════ 响应式 ═══════════ */
@media (max-width: 767px) {
  .page { padding: 18px 12px 96px; }

  .topbar {
    grid-template-areas: 'back add' 'title title';
    grid-template-columns: 1fr auto;
    row-gap: 4px;
  }
  .nav-back { grid-area: back; }
  .btn-add { grid-area: add; min-height: 44px; min-width: 44px; padding: 0; font-size: 1.5rem; }
  .topbar-title { grid-area: title; }
  .topbar-title h1 { font-size: 1.55rem; letter-spacing: 0.1em; }

  .view-tabs { margin-bottom: 16px; }
  .view-tabs .tab { flex: 1; padding: 8px 6px; font-size: 0.88rem; }

  .subnav-label { min-width: 0; font-size: 0.92rem; }
  .btn-round { width: 42px; height: 42px; }
  .btn-today { min-height: 38px; }
  .subnav-group { gap: 6px; flex: 1; justify-content: center; }

  .week-scroll { --hh: 60px; border-radius: 16px; }
  .week-inner { min-width: 672px; }
  .week-head .axis-spacer, .week-axis { width: 46px; }
  .day-head { font-size: 0.72rem; }
  .ev { border-radius: 11px; padding: 2px 7px 3px; }
  .ev-name { font-size: 0.8rem; -webkit-line-clamp: 3; }
  .ev-time { font-size: 0.68rem; }

  .month-wrap { border-radius: 16px; padding: 10px 6px; }
  .month-grid { min-width: 600px; gap: 4px; }
  .m-cell { min-height: 74px; padding: 4px 5px; border-radius: 10px; }
  .m-date { font-size: 0.74rem; }
  .m-pill { font-size: 0.64rem; padding: 0 4px; }

  /* 3 卡并排一行（2026-09-11 用户要求「另三个并排放一排」）→ 手机端同步压缩间距与字号 */
  .stat-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat-card { padding: 12px 8px; gap: 8px; }
  .stat-icon { width: 32px; height: 32px; border-radius: 10px; font-size: 0.95rem; }
  .stat-num { font-size: 1.1rem; }
  .stat-num small { font-size: 0.72rem; }
  .stat-label { font-size: 0.72rem; }
  .stat-badge { transform: scale(0.85); transform-origin: top right; }

  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal-content {
    max-width: none;
    width: 100%;
    max-height: 92vh;
    border-radius: 24px 24px 0 0;
    padding: 20px 18px 26px;
    transform: translateY(100%);
  }
  .modal-overlay.open .modal-content { transform: none; }

  .form-body { grid-template-columns: 1fr; gap: 0; }
  .field { margin-bottom: 12px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .field-row .field { margin-bottom: 10px; }
  .field-input { min-height: 46px; }
  .btn { min-height: 42px; }
  .btn-danger-ghost, .btn-ghost { padding: 8px 16px; }

  .detail-grid { grid-template-columns: 1fr; gap: 0; }
  .cat-fab { right: 14px; bottom: 16px; }
  /* 手机端色块放大，便于触控（≥44px 触控标准） */
  .swatches { gap: 12px; }
  .sw { width: 42px; height: 42px; border-width: 3px; }
  /* 触屏设备禁用 hover 缩放，避免点击错位 */
  .sw:hover { transform: none; }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .page { padding: 26px 18px 90px; }
}


/* ═══════════ 删除方式弹窗（仅本次 / 每周这天停） ═══════════ */
#delInfo { padding: 2px 2px 14px; border-bottom: 1px dashed var(--line-soft); }
.del-course { display: flex; align-items: center; flex-wrap: wrap; font-size: 1.05rem; font-weight: 600; color: var(--ink); line-height: 1.4; }
.del-course .cat-pill { font-size: 0.74rem; font-weight: 400; }
.del-when { margin-top: 6px; font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.del-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.del-actions .btn { width: 100%; min-height: 48px; border-radius: 14px; flex-direction: column; gap: 1px; line-height: 1.35; }
.del-actions .btn[disabled] { opacity: 0.45; pointer-events: none; }
.del-hint { display: block; font-size: 0.7rem; font-weight: 400; opacity: 0.72; }
.del-all { min-height: 38px !important; font-size: 0.8rem; opacity: 0.85; }
.btn-del-cancel { min-height: 42px !important; background: #f3ede4; color: var(--ink-2); }
.btn-del-cancel:hover { background: #ece4d8; }

/* ═══════════ 续课弹窗 ═══════════ */
.renew-form { margin: 2px 2px 20px; display: flex; flex-direction: column; gap: 8px; }
.renew-form .field-input { font-size: 1.05rem; }
.confirm-text + .renew-form { margin-top: 14px; }

/* ═══════════ 菜谱视图（第4个 tab · menu） ═══════════ */
.menu-subnav { flex-wrap: wrap; row-gap: 8px; }
.menu-subnav .menu-actions { margin-left: auto; }
.menu-actions { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.menu-wrap {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 22px;
  box-shadow: 0 8px 30px rgba(90, 77, 66, 0.06);
  padding: 8px 4px;
}
.menu-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 2px 6px;
}
.menu-table {
  width: 100%;
  min-width: 660px;
  border-collapse: separate;
  border-spacing: 6px;
}
.menu-table thead th { padding: 6px 4px 4px; }
.menu-meal-th {
  width: 60px;
  text-align: center;
  font-size: 0.76rem;
  color: var(--ink-3);
  letter-spacing: 0.14em;
  font-weight: 600;
}
.menu-day-th { text-align: center; }
.menu-day-th b {
  display: block;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.5;
}
.menu-day-th span {
  font-size: 0.74rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  line-height: 1.3;
}
.menu-day-th.is-today b,
.menu-day-th.is-today span { color: var(--orange-deep); }

.menu-meal-cell {
  width: 60px;
  background: #fdf1e3;
  border-radius: 12px;
  text-align: center;
  vertical-align: middle;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--orange-deep);
  letter-spacing: 0.06em;
  padding: 4px 2px;
}
.menu-cell {
  min-width: 100px;
  min-height: 54px;
  background: #fffefc;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 6px 9px;
  vertical-align: top;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  -webkit-tap-highlight-color: transparent;
}
.menu-cell:hover {
  border-color: var(--orange);
  background: #fffaf3;
  box-shadow: 0 3px 10px rgba(90, 77, 66, 0.08);
}
.menu-cell:active { background: #fdf3e7; }
.menu-dish {
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--ink);
  word-break: break-all;
  padding: 1px 0;
}
.menu-add-hint {
  font-size: 0.76rem;
  color: var(--ink-3);
  line-height: 1.4;
  padding: 1px 0;
}

/* 菜谱单格编辑弹窗 */
.menu-edit-hint { font-size: 0.78rem; color: var(--ink-3); margin: -4px 0 10px; }
.menu-edit-textarea { min-height: 200px; resize: vertical; line-height: 1.75; }

/* 课程详情弹窗里的「当日菜谱」联动块 */
.menu-detail-block {
  background: #fdf7ef;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 11px 16px 12px;
  margin-bottom: 14px;
}
.menu-detail-block .di-label {
  display: block;
  font-size: 0.72rem;
  color: var(--ink-3);
  letter-spacing: 0.08em;
  margin-bottom: 5px;
}
.menu-detail-dish { font-size: 0.88rem; color: var(--ink); line-height: 1.9; word-break: break-all; }
.menu-detail-dish::before { content: '· '; color: var(--orange-deep); font-weight: 700; }
.menu-detail-loading,
.menu-detail-none { font-size: 0.85rem; color: var(--ink-3); }

@media (max-width: 767px) {
  .menu-wrap { border-radius: 16px; padding: 6px 2px; }
  .menu-table { min-width: 620px; border-spacing: 5px; }
  .menu-meal-th, .menu-meal-cell { width: 54px; }
  .menu-meal-cell { font-size: 0.82rem; padding: 3px 2px; }
  .menu-cell { padding: 5px 7px; min-height: 50px; }
  .menu-dish { font-size: 0.78rem; }
  .menu-actions { gap: 6px; }
  .menu-detail-dish { font-size: 0.85rem; }
}

/* ═══════════ P1-P3 · 费用台账 / 请假补课 / 节假日管理 ═══════════ */

/* 功能入口行（课程详情弹窗内，作息课不显示） */
.rec-actions { display: flex; gap: 8px; margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-soft, #f6f0e8); flex-wrap: wrap; }
.rec-act { font: inherit; cursor: pointer; border: none; background: rgba(141, 208, 174, 0.14); color: #4a6b5c; font-size: 0.8rem; padding: 6px 12px; border-radius: 20px; transition: 0.2s; }
.rec-act:hover { background: rgba(141, 208, 174, 0.3); }

/* 课程生命周期（阶段1，2026-09-12） */
.life-block { display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-soft, #f6f0e8);
  font-size: .78rem; color: var(--ink-2, #8a7a6a); }
.life-btn { font-size: .78rem; padding: 3px 10px; border-radius: 999px;
  border: 1px solid #dfe8df; background: #f4f8f4; color: #7e9a7e; cursor: pointer; font-family: inherit; }
.life-btn:hover { background: #e9f2e9; color: #6f8f6f; }
.life-meta { color: var(--ink-2, #8a7a6a); }
.finish-name { margin: 0 0 10px; color: var(--ink-1, #5a4d42); font-size: .92rem; }
.finish-label { display: block; margin: 10px 0 4px; font-size: .8rem; color: var(--ink-2, #8a7a6a); }
.finish-input { width: 100%; padding: 8px 10px; border: 1px solid var(--line, #e8e0d8);
  border-radius: 10px; background: #fdf5e9; color: var(--ink-1, #5a4d42); font-family: inherit; }
.finish-tip { margin: 12px 0 0; padding: 8px 10px; border-radius: 10px;
  background: #fdf7ee; color: #8a7a6a; font-size: .78rem; line-height: 1.5; }

/* 课程生命周期 · 阶段2（2026-09-12）：财务行 + 退课/停办弹窗 */
.life-fin { flex: 1 0 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.life-fin .life-amt { color: #7e8f7e; }
.term-warn { display: block; margin-top: 4px; color: #c08a3e; font-size: .76rem; line-height: 1.5; }

/* 到期提醒横幅 */
.expiring-banner { margin: 10px auto 4px; max-width: 960px; padding: 0 16px; }
.expiring-banner-inner { background: #fff7ec; border: 1px solid #f3ddc0; border-radius: 12px; padding: 10px 14px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 0.82rem; color: #8a6a3b; }
.expiring-banner .eb-item { cursor: pointer; background: #fff; border: 1px solid #f0d9b8; border-radius: 16px; padding: 3px 10px; transition: 0.2s; }
.expiring-banner .eb-item:hover { background: #fdf1e0; }
.expiring-banner .eb-item.is-expired { border-color: #f0cfc4; color: #b5533c; }
.expiring-banner .eb-x { margin-left: auto; cursor: pointer; opacity: 0.5; font-size: 1rem; background: none; border: none; color: inherit; }
.expiring-banner .eb-x:hover { opacity: 0.9; }

/* 通用子弹窗（费用/请假/节假日） */
.modal-content.modal-sub { max-width: 460px; }
#subModal .modal-content { padding: 22px 20px 18px; }
#subModal .modal-head { margin-bottom: 12px; }
#confirmModal.modal-overlay { z-index: 400; }   /* 确认弹窗须盖在 subModal 之上 */
.sub-scroll { max-height: 70vh; overflow-y: auto; padding: 4px 4px 10px; }
.sub-body { min-height: 60px; }
.sub-list { margin: 10px 0; }
.sub-row { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid #f0eae0; border-radius: 10px; margin-bottom: 8px; background: #fffdfa; }
.sub-row-main { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; flex-wrap: wrap; }
.sub-row-sub { font-size: 0.76rem; color: #9c8b76; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sub-row-ops { margin-left: auto; display: flex; gap: 8px; }
.sub-op { font: inherit; cursor: pointer; border: none; background: none; color: #b08968; font-size: 0.75rem; padding: 2px 4px; transition: 0.2s; }
.sub-op:hover { color: #d35400; }
.sub-tag { font-size: 0.68rem; padding: 1px 7px; border-radius: 10px; background: #f5ede2; color: #a08a6e; }
.sub-tag.expired { background: #fde8e8; color: #c0392b; }
.sub-tag.pending { background: #fff3d6; color: #b7791f; }
.sub-tag.done { background: #e3f2e5; color: #2e7d32; }
.sub-tag.cancelled { background: #f0ece4; color: #9a8b78; }
.sub-empty { text-align: center; color: #b9a88e; padding: 26px 0 18px; font-size: 0.85rem; }
.sub-add-btn { display: block; width: 100%; font: inherit; cursor: pointer; border: 1px dashed #d8cdbc; background: #fdfaf5; color: #8a6a3b; border-radius: 10px; padding: 9px; font-size: 0.85rem; transition: 0.2s; }
.sub-add-btn:hover { background: #f8f1e6; }
.sub-form { background: #faf6ef; border: 1px solid #efe6d8; border-radius: 10px; padding: 12px; margin: 10px 0; }
.sub-form .field { margin-bottom: 10px; }
.sub-form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.sub-form-actions .btn { min-height: 34px; padding: 4px 16px; font-size: 0.82rem; }
.sub-hint { font-size: 0.74rem; color: #b3a48c; margin-top: 4px; }
.sub-hint-top { font-size: 0.76rem; color: #a08a6e; margin: 2px 0 8px; }

/* 节假日全局入口按钮已不使用；如需在 nav 右侧加按钮，在此追加 */
@media (max-width: 767px) {
  .sub-scroll { max-height: 64vh; }
}

/* ═══════════ P1-P3 · 暂停管理 / 成长记录 / 单次课开关 ═══════════ */

/* 暂停状态 tag */
.sub-tag.active-pause { background: #fff3d6; color: #b7791f; }
.sub-tag.ended { background: #f0ece4; color: #9a8b78; }
/* 请假「是否扣课时」标记（2026-09-14）：只在消耗型请假上出现，默认不消耗不加标记 */
.sub-tag.consume { background: #fbe6d5; color: #c0703a; }
/* 请假表单里的「照扣课时」勾选行：复用请假勾选框样式（.dl-opt/.dl-box/.dl-check） */
.lv-consume { display: inline-flex; align-items: center; gap: 8px; }
.lv-consume-txt { font-size: 0.86rem; color: #5a4d42; }
.lv-consume-hint { margin-top: 4px; font-size: 0.72rem; color: #a08a6e; }

/* 上课类型切换（每周循环 / 单次） */
.seg { display: flex; gap: 8px; margin-bottom: 8px; }
.seg-btn { flex: 1; font: inherit; cursor: pointer; border: 1px solid #e5dccb; background: #fdfaf5; color: #8a7a5f; border-radius: 10px; padding: 8px 6px; font-size: 0.8rem; transition: 0.2s; }
.seg-btn:hover { background: #f8f1e6; }
.seg-btn.is-on { background: #e8f3ea; border-color: #b9d8be; color: #3e6b4a; font-weight: 600; }

/* 成长记录缩略图 / 选图按钮 */
.growth-thumb { max-width: 110px; border-radius: 8px; margin-top: 6px; display: block; border: 1px solid #f0e6d8; }
.growth-pick { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border: 1px dashed #d8cdbc; background: #fdfaf5; color: #8a6a3b; border-radius: 10px; padding: 8px 14px; font-size: 0.82rem; font-family: inherit; transition: 0.2s; }
.growth-pick:hover { background: #f8f1e6; }
#growthImgPreview { margin-top: 8px; font-size: 0.78rem; color: #9c8b76; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#growthImgPreview img { max-width: 110px; border-radius: 8px; }
#growthImgPreview .gp-remove { font: inherit; cursor: pointer; border: none; background: none; color: #b08968; font-size: 0.75rem; }

/* 单次课 date 字段间距 */
#onceDateField { margin-top: 2px; }
#onceDateField .field-label { font-size: 0.8rem; }

/* ═══════════ 法定节假日 · 日历"休"标记 ═══════════ */
.m-date-row { display: inline-flex; align-items: center; gap: 3px; align-self: flex-start; }
.hol-badge {
  display: inline-block;
  padding: 0 4px;
  font-size: 0.6rem;
  line-height: 1.5;
  font-style: normal;
  font-weight: 600;
  color: #d97b6c;
  background: rgba(224, 122, 105, 0.13);
  border-radius: 4px;
}
.day-head .hol-badge { margin-top: 1px; vertical-align: 1px; }
@media (max-width: 767px) {
  .hol-badge { font-size: 0.55rem; padding: 0 3px; }
}

/* 调休补班日 · "补"标记（蓝绿系，区分"休"的粉红） */
.mk-badge {
  display: inline-block;
  padding: 0 4px;
  font-size: 0.6rem;
  line-height: 1.5;
  font-style: normal;
  font-weight: 600;
  color: #3e8e7e;
  background: rgba(62, 142, 126, 0.13);
  border-radius: 4px;
}
.day-head .mk-badge { margin-top: 1px; vertical-align: 1px; }
@media (max-width: 767px) {
  .mk-badge { font-size: 0.55rem; padding: 0 3px; }
}

/* 整天请假日 · "请"标记（橙色系，区分"休"的粉红、"补"的蓝绿） */
.lv-badge {
  display: inline-block;
  padding: 0 4px;
  font-size: 0.6rem;
  line-height: 1.5;
  font-style: normal;
  font-weight: 600;
  color: #c97f2d;
  background: rgba(232, 145, 62, 0.15);
  border-radius: 4px;
}
.day-head .lv-badge { margin-top: 1px; vertical-align: 1px; }
@media (max-width: 767px) {
  .lv-badge { font-size: 0.55rem; padding: 0 3px; }
}

/* ═══════════ 调休补课 · 点日期设"补周几" ═══════════ */
.day-mk-bar {
  margin: 0 14px 8px;
  padding: 9px 12px;
  border-radius: 10px;
  background: #eaf5f1;
  border: 1px dashed #9fd0c0;
  color: #2f6e5e;
  font-size: 0.8rem;
  cursor: pointer;
  text-align: center;
}
.day-mk-bar b { color: #1f5c4d; }
.mk-body { padding: 6px 18px 18px; }
.mk-hint { font-size: 0.8rem; color: #9a8b78; margin-bottom: 12px; text-align: center; }
.mk-chips { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mk-chip {
  font: inherit;
  cursor: pointer;
  border: 1px solid #e0d6c6;
  background: #fdfaf5;
  color: #7a6a52;
  border-radius: 10px;
  padding: 10px 4px;
  font-size: 0.85rem;
  transition: 0.18s;
}
.mk-chip:hover { background: #f8f1e6; }
.mk-chip.is-on { background: #3e8e7e; border-color: #3e8e7e; color: #fff; font-weight: 600; }
.mk-actions { margin-top: 14px; text-align: center; }
.mk-actions .btn { font-size: 0.8rem; }

/* ═══════════ 往某天加课（临时加课） ═══════════ */
.al-body { padding: 6px 18px 20px; }
.al-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 2px;
}
.al-chip { font-size: 0.85rem; }
/* 组头放进 flex 换行容器（.al-chips）时独占一行 */
.al-chips .cat-group-head { flex: 1 1 100%; }
.al-time {
  margin-left: 5px;
  font-size: 0.72rem;
  color: var(--ink-3);
  font-weight: 400;
}
.al-empty { text-align: center; color: var(--ink-3); font-size: 0.82rem; padding: 18px 6px 6px; }
/* 选中课程后的时间面板 */
.al-time-panel {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #e2d7c2;
}
.al-picked {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #5a4a35;
  margin-bottom: 10px;
}
/* 「→ HH:MM 结束」实时推算提示。
   2026-09-19：时长本身已改成可编辑输入框（原来这里是只读色块），此处只留一行结果，
   保留 min-height 占位 → 改时间/时长时不会引起弹窗高度跳动。 */
.al-dur-hint {
  font-size: 0.8rem;
  color: #1f5c4d;
  margin: -8px 0 10px;
  min-height: 1.1em;
}
.al-time-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.al-time-actions .btn { font-size: 0.82rem; }

/* ═══════════ 课程余额汇总（统计页） ═══════════ */
.expiry-panel { margin-top: 14px; }
.expiry-list { display: flex; flex-direction: column; gap: 6px; }
.expiry-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 9px 12px;
  border: 1px solid var(--line-soft); border-radius: 10px;
  background: #fffdfa; cursor: pointer;
  font-family: inherit; font-size: 0.88rem;
  transition: background 0.15s ease;
}
.expiry-item:hover { background: #faf4ea; }
.expiry-item.warn { border-color: rgba(218, 145, 74, 0.5); background: #fff8ee; }
.expiry-name { font-weight: 600; color: var(--ink); flex: none; min-width: 96px; }
.expiry-detail { color: var(--ink-2); font-size: 0.78rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.expiry-item .li-arrow { color: var(--ink-3); font-size: 0.9rem; flex: none; }

/* ═══════════ 周课表打印（🖨 → A4 竖版一页 · 按周视图排版 / 另存 PDF）
   ⚠️ 纸面样式（.print-table / .pt-* 等）在 course.html 的 <style id="ppSheetCss"> 里 ——
   sheetToPng() 会读那份文本原样内联进导出图的 SVG，**纸面样式只改那一处，别在这儿再抄一份**。 ═══════════ */
.print-area { display: none; }
@media print {
  body.printing > *:not(#printArea) { display: none !important; }
  .print-area { display: block !important; }
  @page { size: A4 portrait; margin: 6mm; }
}

/* ═══════════ 周课表 · 打印预览浮层（A4 竖版一页 · 按周视图排版 → 存图 / 打印） ═══════════ */
.modal-print { max-width: 560px; display: flex; flex-direction: column; overflow: hidden; padding: 22px 18px 16px; }
.modal-print .modal-head { flex: none; margin-bottom: 12px; }
.pp-scroll { flex: 1; min-height: 0; overflow-y: auto; }
.pp-frame {
  position: relative; width: 100%; background: #fff; overflow: hidden;
  border: 1px solid #e8e0d8; border-radius: 8px; box-shadow: 0 2px 10px rgba(90, 77, 66, 0.07);
}
.pp-frame .pp-scaler { transform-origin: top left; }
.pp-shot { display: block; width: 100%; height: auto; }
.pp-note { font-size: 0.78rem; color: #8a7a6a; line-height: 1.7; padding: 10px 2px 0; }
.pp-note b { color: #c0703a; font-weight: 600; }
.pp-actions { display: flex; gap: 9px; padding-top: 12px; flex: none; }
.pp-actions .btn { flex: 1; }

/* ═══════════ 年度看板 / 图表（统计页） ═══════════ */
#chartsWrap { display: flex; flex-direction: column; gap: 14px; margin-top: 14px; }
.pch-nums { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-bottom: 12px; }
.pch-num {
  background: #fff7ef; border: 1px solid #f4e2cc; border-radius: 10px;
  padding: 8px 6px; text-align: center;
}
.pch-num.pch-taken, .pch-num.pch-leave { cursor: pointer; transition: background 0.2s, border-color 0.2s; }
.pch-num.pch-taken:hover, .pch-num.pch-leave:hover { background: #fff3e6; border-color: #e8a25c; }
.pch-num.pch-taken:active, .pch-num.pch-leave:active { background: #ffe9d2; }
.pch-num b { display: block; font-size: 1.05rem; color: var(--orange-dark, #c97f2d); }
.pch-num span { font-size: 0.68rem; color: var(--ink-2); }
.pch-sub { font-size: 0.78rem; color: var(--ink-2); margin-bottom: 6px; }
.pch-empty { text-align: center; color: var(--ink-3); font-size: 0.8rem; padding: 16px 8px; }
.pch-bars { display: flex; align-items: stretch; gap: 4px; height: 150px; padding-top: 4px; }
.pch-bar-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  height: 100%; min-width: 0;
}
.pch-bar-track {
  flex: 1; width: 100%; min-height: 0;
  display: flex; align-items: flex-end; justify-content: center;
}
.pch-bar-stack {
  display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  width: 62%; max-width: 26px; min-height: 18px;
}
.pch-bar {
  flex: 1 1 auto; width: 100%; min-height: 2px;
  background: #f0c79a; border-radius: 4px 4px 0 0;
  transition: background 0.2s;
}
.pch-bar.is-cur { background: #e8a25c; }
.pch-bar.is-future { background: #f7e2c8; }
.pch-bar-col:hover .pch-bar { background: #d98a3d; }
.pch-bar-num { font-size: 0.68rem; line-height: 1.15; font-weight: 600; color: var(--orange-deep, #b7791f); white-space: nowrap; }
.pch-bar-m { font-size: 0.62rem; color: var(--ink-2); margin-top: 3px; white-space: nowrap; }
.pch-total {
  display: flex; align-items: baseline; justify-content: center; gap: 6px;
  margin: 2px 0 12px; padding: 10px 12px;
  background: #fff3e6; border: 1px solid #f4dfc3; border-radius: 10px;
  font-size: 0.92rem; color: var(--ink-2);
}
.pch-total b { font-size: 1.2rem; font-weight: 700; color: var(--orange-deep, #b7791f); font-variant-numeric: tabular-nums; }
/* 退费小字（2026-09-13）：总费用已扣退费时标注扣了多少，让差额可追溯 */
.pch-refund { margin-left: 8px; font-size: 0.78rem; color: var(--text-sub, #8a7a6a); }
.pch-spend { display: flex; flex-direction: column; gap: 7px; }
.pch-spend-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.pch-spend-name { flex: none; width: 64px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.pch-spend-bar-bg { flex: 1; height: 9px; border-radius: 99px; background: var(--line-soft); overflow: hidden; }
.pch-spend-bar { display: block; height: 100%; border-radius: 99px; transition: width 0.4s ease; }
.pch-spend-val { flex: none; font-variant-numeric: tabular-nums; color: var(--ink); min-width: 70px; text-align: right; }
.pch-spend-pct { flex: none; width: 40px; text-align: right; color: var(--ink-2); font-size: 0.75rem; }
@media (max-width: 640px) {
  .pch-spend-val { min-width: 0; }
}

/* ═══════════════ 详情页缴费/续课记录区块（2026-09-08） ═══════════════ */
.detail-pay-block { margin-top: 14px; padding-top: 4px; }
.pay-block-head { display: flex; align-items: baseline; gap: 8px; font-size: 0.86rem; color: var(--orange-deep, #b7791f); margin-bottom: 8px; }
.pay-block-title { font-weight: 700; }
.pay-block-count { font-size: 0.72rem; color: #b3a48c; font-weight: 400; }
.pay-block-total { margin-left: auto; font-size: 0.78rem; color: var(--orange-deep, #b7791f); font-weight: 700; }
.pay-block-loading { color: #b9a88e; font-size: 0.78rem; padding: 6px 0; }
.pay-block-empty { color: #b9a88e; font-size: 0.78rem; padding: 6px 0 8px; }
.pay-avg-line { background: rgba(141, 208, 174, 0.12); border: 1px solid rgba(141, 208, 174, 0.35); color: #3f6b57; border-radius: 10px; padding: 7px 12px; font-size: 0.85rem; margin-bottom: 9px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pay-avg-line b { color: var(--orange-deep, #b7791f); font-size: 1rem; }
.pay-avg-sub { font-size: 0.7rem; color: #9c8b76; margin-left: auto; }
.pay-avg-muted { background: #faf6ef; border-color: #efe6d8; color: #a08a6e; }
.pay-list { display: flex; flex-direction: column; gap: 7px; margin-bottom: 9px; }
.pay-row { border: 1px solid #f0eae0; border-radius: 10px; padding: 8px 12px; background: #fffdfa; }
.pay-row-main { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; flex-wrap: wrap; }
.pay-date { color: #9c8b76; font-size: 0.78rem; }
.pay-amt { font-weight: 700; color: var(--ink); }
.pay-lessons { font-size: 0.78rem; color: #7a6a55; background: #f5f0e7; border-radius: 8px; padding: 1px 8px; }
.pay-no-lesson { color: #c9b695; font-style: normal; }
.pay-notes { font-size: 0.74rem; color: #b08968; }
/* 阶段3（2026-09-12）：换课转入被撤销后作废的缴费记录 —— 灰字标注、不计入累计 */
.pay-void { font-size: 0.72rem; color: #b0a495; border: 1px solid #e6ded2; border-radius: 999px; padding: 1px 7px; }
.pay-row-void { background: #faf7f2; opacity: 0.85; }
.pay-row-sub { font-size: 0.74rem; color: #a8937b; display: flex; align-items: center; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.pay-row-ops { margin-left: auto; display: flex; gap: 8px; }
.pay-op { font: inherit; cursor: pointer; border: none; background: none; color: #b08968; font-size: 0.75rem; padding: 2px 4px; transition: 0.2s; }
.pay-op:hover { color: #d35400; }
.pay-add-btn { display: block; width: 100%; font: inherit; cursor: pointer; border: 1px dashed #d8cdbc; background: #fdfaf5; color: #8a6a3b; border-radius: 10px; padding: 8px; font-size: 0.82rem; transition: 0.2s; }
.pay-add-btn:hover { background: #f8f1e6; }
.pay-add-form { background: #faf6ef; border: 1px solid #efe6d8; border-radius: 10px; padding: 12px; }
.pay-add-form .field { margin-bottom: 10px; }
.pay-add-form .field-row .field { margin-bottom: 10px; }
.pay-add-form .field-input { font-size: 0.9rem; }
.pay-add-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 2px; }
.pay-add-actions .btn { min-height: 34px; padding: 4px 16px; font-size: 0.82rem; }

/* ═══════════════════════════════════════════════════════════
   排课时间（多学期不同上课时间）· 2026-09-11
   详情页区块 + 时段弹窗表单
   ═══════════════════════════════════════════════════════════ */
.detail-seg-block {
  margin-top: 14px; padding: 12px 14px;
  background: #fdfcf8; border: 1px solid var(--line-soft);
  border-radius: 12px;
}
.seg-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.seg-title { font-size: 0.88rem; color: var(--ink); font-weight: 600; }
/* 辅助元素：小巧 · 淡绿半透明（橙子部落 UI 约定） */
.seg-add {
  font: inherit; font-size: 0.76rem; cursor: pointer;
  border: 1px solid rgba(169, 196, 131, 0.55);
  background: var(--green-mask); color: #5d7a45;
  border-radius: 999px; padding: 3px 11px;
  transition: 0.2s; white-space: nowrap;
}
.seg-add:hover { background: rgba(169, 196, 131, 0.55); }
.seg-empty { font-size: 0.8rem; color: var(--ink-3); padding: 8px 0 2px; }
.seg-hint { font-size: 0.74rem; color: #b8a992; padding: 4px 0 2px; line-height: 1.5; }

.seg-row { padding: 9px 0 7px; border-top: 1px dashed var(--line); }
.seg-row:first-of-type { border-top: none; }
.seg-row-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.seg-label {
  font-size: 0.72rem; color: #5d7a45; background: var(--green-mask);
  border-radius: 999px; padding: 1px 9px; white-space: nowrap;
}
.seg-time { font-size: 0.85rem; color: var(--ink); }
.seg-cnt { font-size: 0.72rem; color: var(--ink-2); margin-left: auto; white-space: nowrap; }
.seg-row-sub { font-size: 0.74rem; color: #a8937b; margin-top: 2px; }
.seg-ongoing {
  font-size: 0.68rem; color: #5d7a45; background: var(--green-mask);
  border-radius: 999px; padding: 0 7px; margin-left: 2px;
}
.seg-row-acts { display: flex; gap: 10px; margin-top: 6px; justify-content: flex-end; }
.seg-act {
  font: inherit; font-size: 0.73rem; cursor: pointer;
  border: none; background: none; color: #b08968; padding: 1px 3px; transition: 0.2s;
}
.seg-act:hover { color: var(--orange-dark); }
.seg-act-del:hover { color: var(--danger); }

/* 时段弹窗 */
.seg-body { padding: 14px 18px 4px; max-height: 62vh; overflow-y: auto; }
.seg-body .field { margin-bottom: 12px; }
.seg-body .field-row { display: flex; gap: 12px; }
.seg-body .field-row .field { flex: 1; margin-bottom: 12px; }
.seg-tip {
  font-size: 0.76rem; color: #5d7a45; background: var(--green-mask);
  border-radius: 10px; padding: 7px 11px; margin-bottom: 12px; line-height: 1.5;
}
.seg-req { color: var(--danger); }
.seg-opt { color: var(--ink-3); font-size: 0.74rem; font-weight: 400; }
.seg-preview {
  font-size: 0.78rem; color: var(--ink-2);
  background: var(--line-soft); border-radius: 10px; padding: 8px 11px;
}
.seg-preview b { color: var(--orange-dark); }
.seg-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 12px 18px 16px; border-top: 1px solid var(--line-soft);
}
@media (max-width: 640px) {
  .seg-body { padding: 12px 14px 2px; max-height: 58vh; }
  .seg-foot { padding: 10px 14px 14px; }
  .seg-cnt { margin-left: 0; }
}
