:root {
  --brand: #7cb305;        /* 童心童乐品牌黄绿(深一档,可读性好) */
  --brand-d: #649000;      /* hover */
  --brand-tint: #f3f9d9;   /* 浅底点缀 */
  --bg: #f6f8f5;           /* 背景:极浅灰绿 */
  --card: #ffffff;
  --text: #1f2937;         /* 主文字 */
  --text-2: #4b5563;       /* 次文字 */
  --muted: #94a39a;        /* 辅助/提示 */
  --line: #e5ebe6;         /* 分隔线 */
  --line-2: #eef2ed;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 12px rgba(0,0,0,.04);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased;
  font-size: 14px;
  line-height: 1.5;
}

/* ===== 登录 ===== */
.login-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; background: linear-gradient(135deg, #f3f9d9 0%, #f6f8f5 60%); }
.login-card { width: 400px; max-width: 92vw; background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 32px 30px 26px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.brand .logo { padding: 0 10px; height: 42px; border-radius: 10px; background: var(--brand); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: 1px; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
.brand h1 { font-size: 18px; margin: 0; font-weight: 700; }
.brand .sub { margin: 3px 0 0; font-size: 12px; color: var(--muted); }
.login-card label { display: block; font-size: 12px; color: var(--text-2); margin: 12px 0 5px; }
.login-card input { width: 100%; height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font-size: 14px; outline: none; background: #fafcfa; }
.login-card input:focus { border-color: var(--brand); background: #fff; }
#login-btn { width: 100%; height: 42px; margin-top: 20px; background: var(--brand); color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600; cursor: pointer; transition: .15s; }
#login-btn:hover { background: var(--brand-d); }
.hint { text-align: center; font-size: 12px; color: var(--muted); margin-top: 12px; }
.foot { margin-top: 18px; font-size: 12px; color: var(--muted); }

/* ===== 顶栏 ===== */
.topbar { display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 22px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.brand.small { gap: 10px; }
.brand.small .logo { height: 34px; font-size: 11px; border-radius: 8px; padding: 0 8px; }
.brand-title { display: flex; flex-direction: column; line-height: 1.2; }
.brand-title > span:first-child { font-weight: 700; font-size: 15px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.user { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--text-2); }
.user .today { font-size: 12px; color: var(--muted); }
.ghost { border: 1px solid var(--line); background: #fff; color: var(--text); height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer; font-size: 13px; transition: .12s; }
.ghost:hover { border-color: var(--brand); color: var(--brand); }
.ghost.link { text-decoration: none; display: inline-flex; align-items: center; }
.ghost.sm { height: 28px; padding: 0 10px; font-size: 12px; }

/* ===== 布局 ===== */
.shell { display: flex; min-height: calc(100vh - 58px); }
.side { width: 156px; flex-shrink: 0; background: var(--card); border-right: 1px solid var(--line); padding: 14px 8px; display: flex; flex-direction: column; gap: 2px; position: sticky; top: 58px; height: calc(100vh - 58px); overflow-y: auto; }
.nav-btn { display: flex; align-items: center; gap: 9px; width: 100%; border: none; background: transparent; color: var(--text-2); font-size: 13.5px; font-weight: 600; padding: 10px 12px; border-radius: 8px; cursor: pointer; transition: .12s; text-align: left; }
.nav-btn .nv-ico { font-size: 16px; }
.nav-btn:hover { background: var(--brand-tint); color: var(--brand); }
.nav-btn.active { background: var(--brand-tint); color: var(--brand); }
.content { flex: 1; padding: 20px 24px 40px; max-width: 1240px; margin: 0 auto; width: 100%; }
.view { animation: fadeIn .18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }
.view-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.view-head h2 { font-size: 19px; margin: 0; font-weight: 700; }
.view-head .tip { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 8px; }

/* ===== 维度块 ===== */
.dim-block { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.dim-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 700; margin-bottom: 12px; color: var(--text-2); }
.dim-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 38px; height: 20px; padding: 0 9px; border-radius: 6px; background: var(--brand-tint); color: var(--brand); font-size: 11px; font-weight: 700; }
/* 旧差异颜色统一回品牌色,避免视觉噪音 */
.dim-teach .dim-badge, .dim-stu .dim-badge, .dim-staff .dim-badge, .dim-sales .dim-badge { background: var(--brand-tint); color: var(--brand); }

/* ===== 卡片 ===== */
.cards { display: grid; gap: 10px; margin-bottom: 4px; }
.cards-4 { grid-template-columns: repeat(4, 1fr); }
.cards-5 { grid-template-columns: repeat(5, 1fr); }
.cards-3 { grid-template-columns: repeat(3, 1fr); }
.cards-2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.card-label { font-size: 12px; color: var(--muted); }
.card-num { font-size: 26px; font-weight: 700; margin-top: 6px; line-height: 1; color: var(--text); font-variant-numeric: tabular-nums; }
.card-num.sm { font-size: 15px; line-height: 1.3; margin-top: 8px; }
.card-sub { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.4; }
/* 强调卡:浅品牌底 + 品牌字(去掉炫酷渐变,清爽) */
.card.accent { background: var(--brand-tint); border-color: transparent; }
.card.accent .card-label, .card.accent .card-sub { color: var(--brand); }
.card.accent .card-num { color: var(--brand); }
.card.warn-card { border-color: #f5d9a8; background: #fffaf0; }
.card.warn-card .card-num { color: var(--warn); }
.card.warn-card .card-label, .card.warn-card .card-sub { color: #b9760e; }

/* ===== 面板 / 表格 ===== */
.panel { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 14px; }
.panel-title { font-size: 14px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.panel-tip { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.table-wrap { overflow-x: auto; }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th, .tbl td { padding: 9px 10px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
.tbl th { color: var(--text-2); font-weight: 600; font-size: 11.5px; background: #fafcf9; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
.tbl tbody tr:hover { background: #f8fbf6; }
.tbl .empty { text-align: center; color: var(--muted); padding: 22px 0; }
.empty { text-align: center; color: var(--muted); padding: 22px 0; font-size: 13px; margin: 0; }

/* ===== 固定列宽表格（2026-09-18）=====
   ☠️ 报障：「课程列表要拖横向滚动条才看得全」。
   根因：`.tbl td { white-space: nowrap }` + 列宽随内容长（周期「周二三四 17:30~19:00；
   周六 08:20」、起止「2026-09-01 ~ 2026-12-31」都很长）→ 表格总宽超过可视区。
   对策：这类表格用 table-layout:fixed + <colgroup> 定宽，单元格允许换行。
   ⚠️ 只对带 .tbl-fit 的表生效，别污染其它表（成本测算那种就靠 nowrap 撑开）。 */
.tbl-fit { table-layout: fixed; width: 100%; }
.tbl-fit th, .tbl-fit td {
  padding: 8px 6px;
  font-size: 12.5px;
  white-space: normal;              /* 关键：覆盖 .tbl td 的 nowrap */
  overflow-wrap: break-word;
  word-break: break-word;
  vertical-align: middle;
}
.tbl-fit th { font-size: 11.5px; line-height: 1.35; }
/* 「课时」列的小标注 .wk-tag 本身已 display:block，会自然落到第二行 */
.tbl-fit .wk-tag { margin-top: 2px; }
/* ≤560px 手机上仍然允许横滑（固定布局在窄屏会挤成一团） */
@media (max-width: 900px) {
  .tbl-fit { table-layout: auto; }
  .tbl-fit th, .tbl-fit td { white-space: nowrap; }
}

/* ===== 成本测算表：紧凑化（2026-09-17）=====
   ☠️ 三个报障都源于 `.tbl td { white-space: nowrap }` + 单元格里塞长文案：
     ① 成本算式 43 字 → 把「按课程测算」表撑宽，毛利列被挤出可视区
     ② 按老师汇总的「含底薪 ¥1,120（0.53 个月 · 16 天/30）」两行换行且不完整
   对策：这几列允许换行 + 降级为多行小字，把宽度让给数字列。 */
#ca-body td, #ca-tbody td { vertical-align: middle; }
/* ☠️ 列序号 2026-09-18 跟着「现金流」列一起删改过，再动表头务必重数：
   按课程测算 = 课程/老师/模式/已消应上/学生/确认收入/成本/成本算式(8)/毛利
   按老师汇总 = 老师/模式/课程数/人次/节数/确认收入/成本(7)/毛利 */
#ca-body td:nth-child(8), #ca-tbody td:nth-child(7) { white-space: normal; max-width: 240px; line-height: 1.45; }
.ca-formula { display: block; font-size: 12.5px; color: var(--text); }
.ca-formula-sub { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.ca-none { color: var(--muted); }
/* 底薪标注：紧跟金额的短标记，完整算式走 title 悬浮 */
.ca-base { display: inline-block; margin-left: 5px; padding: 1px 5px; border-radius: 4px; font-size: 11px;
  background: var(--brand-tint); color: var(--brand); cursor: help; vertical-align: 1px; }
/* 「已消 / 应上」进度列 */
.ca-prog { min-width: 108px; }
.ca-pair { display: block; }
.ca-pair b { font-size: 14px; }
.ca-cap { display: block; font-size: 11px; color: var(--muted); margin-top: 1px; }
.ca-rate { display: inline-block; width: 100%; height: 4px; border-radius: 2px; background: var(--line-2); margin-top: 5px; overflow: hidden; vertical-align: middle; }
.ca-rate > i { display: block; height: 100%; border-radius: 2px; background: var(--brand); }
.ca-rate.low > i { background: var(--warn); }
.ca-rate.full > i { background: var(--ok); }
.ca-rate-t { font-size: 11px; color: var(--muted); margin-left: 4px; vertical-align: middle; }

/* ===== 标签 ===== */
.tag-org { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--brand-tint); color: var(--brand); font-size: 11.5px; margin: 1px 2px; }
.tag-ok { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #dcfce7; color: var(--ok); font-size: 11.5px; }
.tag-warn { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #fef3c7; color: #b9760e; font-size: 11.5px; }
.tag-danger { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #fee2e2; color: var(--danger); font-size: 11.5px; }
.tag-none { color: var(--warn); }
.tag-phase { display: inline-block; padding: 2px 9px; border-radius: 4px; font-size: 11px; font-weight: 700; vertical-align: middle; }
.tag-phase.p1 { background: #dcfce7; color: var(--ok); }
.tag-phase.p2 { background: #fef3c7; color: #b9760e; }
.tag-phase.p3 { background: #f3e8fd; color: #8b5cc9; }
.link-btn { color: var(--brand); cursor: pointer; border: none; background: none; font-size: 12.5px; padding: 0; }
.link-btn:hover { text-decoration: underline; }
.link-btn.danger-link { color: var(--danger); }

/* ===== 表单 ===== */
.filter-bar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; margin-bottom: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 11.5px; color: var(--muted); }
.field select, .field input { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; outline: none; background: #fff; color: var(--text); }
.field select:focus, .field input:focus { border-color: var(--brand); }
.req { color: var(--danger); }
.primary { background: var(--brand); color: #fff; border: none; border-radius: 7px; height: 36px; padding: 0 16px; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: .12s; }
.primary:hover { background: var(--brand-d); }
.primary.sm { height: 32px; padding: 0 12px; font-size: 12.5px; align-self: flex-end; }
.dz-tip { font-size: 12px; color: var(--muted); margin: 12px 0 0; line-height: 1.55; padding: 8px 12px; background: #fafcf9; border-radius: 8px; border-left: 3px solid var(--brand-tint); }
.form-stack { display: flex; flex-direction: column; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; flex-wrap: wrap; }
.seg button { border: none; background: #fff; color: var(--muted); height: 32px; padding: 0 12px; cursor: pointer; font-size: 12.5px; border-right: 1px solid var(--line); }
.seg button:last-child { border-right: none; }
.seg button.active { background: var(--brand); color: #fff; }

/* ===== 子页签 ===== */
.sub-tabs { display: flex; gap: 6px; margin-bottom: 14px; }
.sub-tab { border: 1px solid var(--line); background: #fff; color: var(--text-2); height: 32px; padding: 0 14px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 600; transition: .12s; }
.sub-tab.active { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ===== 2026-09-30：「排课消课」拆成两个板块（排课 / 消课）的一级切换 =====
   ☠️ .sub-tabs 有 display:flex，所以「藏起来」只能靠全局的 [hidden]{display:none!important}
     （见本文件顶部）—— 切板块时用 r.hidden = true 是有效的，别再给 .sub-tabs 加 display 覆盖，
      否则 !important 之外的常规规则会被 flex 顶掉，表现为「切了板块两行页签叠在一起」。 */
.board-tabs { display: flex; gap: 2px; margin-bottom: 14px; border-bottom: 2px solid var(--line); }
.board-tab { position: relative; display: inline-flex; align-items: center; height: 38px; padding: 0 20px;
  border: 0; background: transparent; color: var(--text-2); font-size: 14.5px; font-weight: 700;
  cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: .12s; }
.board-tab:hover { color: var(--brand-d); background: var(--brand-tint); }
.board-tab.active { color: var(--brand-d); border-bottom-color: var(--brand); }
.bt-ico { margin-right: 6px; font-size: 15px; }
.board-badge, .tab-badge { display: inline-block; min-width: 18px; height: 18px; line-height: 18px;
  padding: 0 5px; margin-left: 7px; border-radius: 9px; background: var(--danger); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center; vertical-align: 1px; }
.tab-badge { min-width: 16px; height: 16px; line-height: 16px; border-radius: 8px; }
/* 消课异常提醒：按天分组的分隔行 */
tr.day-row td { background: #fff8ee; color: #b45309; font-weight: 700; font-size: 12.5px;
  letter-spacing: .2px; padding-top: 7px; padding-bottom: 7px; }
tr.day-row .dr-cnt { color: var(--danger); }
.falt-zero { color: var(--danger); font-weight: 700; }
.falt-hint { color: var(--muted); font-size: 12px; }

/* ===== 图表（纯 CSS 条形图） ===== */
.bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12.5px; }
.bar-label { width: 150px; flex-shrink: 0; text-align: right; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-track { flex: 1; height: 18px; background: #f1f5f0; border-radius: 4px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 4px; background: var(--brand); transition: width .3s ease; display: flex; align-items: center; justify-content: flex-end; padding-right: 6px; color: #fff; font-size: 11px; font-weight: 600; min-width: 22px; }
.bar-grade { font-size: 10px; color: var(--muted); margin-left: 3px; }
.bar-val { width: 30px; text-align: right; color: var(--muted); font-size: 11px; flex-shrink: 0; }

/* ===== 漏斗 ===== */
.funnel-step { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.funnel-label { width: 60px; flex-shrink: 0; font-size: 12px; color: var(--muted); text-align: right; }
.funnel-track { flex: 1; height: 28px; background: #f1f5f0; border-radius: 6px; overflow: hidden; }
.funnel-fill { height: 100%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; font-weight: 700; background: var(--brand); border-radius: 6px; min-width: 40px; transition: width .3s ease; }
.funnel-step.s1 .funnel-fill { background: #d4dccf; }
.funnel-step.s2 .funnel-fill { background: #a8c389; }
.funnel-step.s3 .funnel-fill { background: #88a964; }
.funnel-step.s4 .funnel-fill { background: var(--brand); }

/* ===== 招生工具 ===== */
.tool-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 6px; }
.tool-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; text-align: center; background: #fff; }
.tool-ico { font-size: 24px; }
.tool-name { font-size: 13px; font-weight: 700; margin: 6px 0 4px; }
.tool-desc { font-size: 11.5px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.tool-output { margin-top: 12px; border: 1px dashed var(--brand); background: var(--brand-tint); border-radius: 8px; padding: 12px 14px; font-size: 12.5px; line-height: 1.65; color: var(--text); white-space: pre-wrap; }

/* ===== 签到列表 ===== */
.sign-row { display: flex; align-items: center; justify-content: space-between; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: 8px; margin-bottom: 6px; background: #fff; }
.sign-row .s-name { font-weight: 600; font-size: 13px; }
.sign-row .s-info { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.sign-ops { display: flex; gap: 6px; align-items: center; }
.btn-mini { border: 1px solid var(--line); background: #fff; color: var(--text); height: 28px; padding: 0 10px; border-radius: 7px; cursor: pointer; font-size: 12px; }
.btn-mini:hover { border-color: var(--brand); color: var(--brand); }
.btn-mini.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-mini.leave { background: var(--warn); border-color: var(--warn); color: #fff; }

/* ===== 信息网格 ===== */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.info-grid > div { display: flex; flex-direction: column; gap: 3px; }
.info-grid span { font-size: 11.5px; color: var(--muted); }
.info-grid b { font-size: 13.5px; font-weight: 600; }

/* ===== 分期说明 ===== */
.phase-list { display: flex; flex-direction: column; gap: 8px; }
.phase-item { display: flex; align-items: flex-start; gap: 8px; font-size: 13px; line-height: 1.55; color: var(--text); }
.phase-item .tag-phase { flex-shrink: 0; margin-top: 1px; }

/* ===== 弹窗 ===== */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.42); display: flex; align-items: center; justify-content: center; z-index: 50; }
.modal-mask[hidden] { display: none !important; }
.modal { width: 460px; max-width: 92vw; background: #fff; border-radius: 12px; padding: 20px 22px; box-shadow: 0 10px 30px rgba(0,0,0,.15); max-height: 86vh; overflow-y: auto; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.modal-body { font-size: 13px; line-height: 1.65; }
.modal-body .field { margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; margin-top: 14px; }
.modal-actions .spacer { flex: 1; }
.lesson-stop-dialog { width:460px; max-width:92vw; max-height:86vh; overflow:auto; border:0; border-radius:12px; padding:22px; box-shadow:0 10px 30px rgba(0,0,0,.15); }
.lesson-stop-dialog::backdrop { background:rgba(0,0,0,.42); }
.lesson-stop-dialog h3 { margin:0 0 12px; }
.lesson-stop-choices { border:1px solid #e2e6df; border-radius:8px; padding:12px; display:flex; gap:14px; flex-wrap:wrap; }
.lesson-stop-choices label { display:flex; align-items:center; gap:6px; cursor:pointer; }
#lesson-stop-error { color:#b13c32; }
#cal-grid button.ev { display:block; width:100%; text-align:left; font-family:inherit; border:0; cursor:pointer; }

/* ===== Toast ===== */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px; z-index: 60; box-shadow: var(--shadow); }

/* ===== 响应式 ===== */
@media (max-width: 1080px) {
  .cards-4 { grid-template-columns: repeat(2, 1fr); }
  .cards-5 { grid-template-columns: repeat(3, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .side { width: 56px; padding: 10px 4px; }
  .nav-btn { justify-content: center; padding: 10px 0; }
  .nav-btn span:last-child { display: none; }
  .cards-3 { grid-template-columns: 1fr; }
  .tool-row { grid-template-columns: 1fr; }
  .content { padding: 14px 12px 36px; }
  .user .today { display: none; }
}
/* ===== 手机端适配（≤560px） ===== */
@media (max-width: 560px) {
  .topbar { padding: 0 10px; gap: 8px; height: 54px; }
  .topbar .ghost.link { display: none; }   /* 隐藏「旧版工作台」链接 */
  .brand.small .logo { font-size: 10px; padding: 0 6px; }
  .brand-title > span:first-child { font-size: 13px; }
  .brand-sub { display: none; }
  .user { gap: 8px; font-size: 12px; }
  .user .ghost { padding: 0 9px; font-size: 12px; height: 30px; }
  .side { width: 48px; padding: 10px 3px; top: 54px; height: calc(100vh - 54px); }
  .nav-btn { padding: 10px 0; }
  .nav-btn .nv-ico { font-size: 15px; }
  .content { padding: 10px 10px 40px; }
  .view-head { flex-wrap: wrap; gap: 6px; }
  .view-head h2 { font-size: 16px; }
  .view-head .tip { display: block; width: 100%; margin: 2px 0 0; line-height: 1.5; }
  .cards-4, .cards-5, .cards-3, .cards-2 { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .dim-block, .panel { padding: 12px 12px; }
  .card { padding: 12px; }
  .card-num { font-size: 22px; }
  .dim-title { font-size: 12.5px; }
  .tbl th, .tbl td { padding: 8px 8px; font-size: 12px; }
  .tool-row { grid-template-columns: 1fr; }
  .modal { width: 92vw; max-width: 92vw; }
  .modal-actions { flex-wrap: wrap; }
  .modal-actions .spacer { display: none; }
  .btn, .btn.primary, .btn.ghost { padding: 9px 12px; font-size: 13px; }
  .stat-num { font-size: 20px; }
}

/* ===== 手机端溢出修复（content 可收缩 + 内部元素自适应） ===== */
@media (max-width: 820px) {
  .content { width: auto; min-width: 0; }
  .sub-tabs { flex-wrap: wrap; }
  .filter-bar { gap: 8px; padding: 10px; }
  .seg { max-width: 100%; }
  .table-wrap { max-width: 100%; }
}

/* ===== 老师管理（新增 / 编辑 / 配学科） ===== */
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 20px; }
.form-grid .field { gap: 6px; }
.form-grid label { font-size: 13px; color: var(--muted); }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 4px; }
.form-msg { font-size: 13px; color: var(--ok); }
.mono { font-family: Consolas, Monaco, monospace; font-size: 12px; }
.chk-row { display: flex; flex-wrap: wrap; gap: 10px; }
.chk { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border: 1.5px solid var(--line); border-radius: 20px; cursor: pointer; font-size: 14px; background: #fff; transition: .15s; user-select: none; }
.chk input { display: none; }
.chk.on { border-color: var(--brand); background: #fdf3ea; color: var(--brand-d); font-weight: 600; }
.toggle-deleted { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 400; cursor: pointer; user-select: none; }
.toggle-deleted input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.row-off { background: #faf6f2; color: #b3a89e; }
.row-off .tag-org { background: #f3ece6; color: #b3a89e; }
@media (max-width: 820px) { .form-grid { grid-template-columns: 1fr; } }

/* ============ 对外错题本（人员维度） ============ */
.pill { display:inline-block; padding:2px 8px; border-radius:999px; font-size:12px; line-height:18px; white-space:nowrap; }
.btn-mini.danger { color:#B42318; border-color:#F2C9C4; }
.btn-mini.danger:hover { background:#FEF3F2; border-color:#B42318; color:#B42318; }
.pe-cnt { color: var(--brand-d); text-decoration:none; font-weight:600; }
.pe-cnt:hover { text-decoration: underline; }
.pe-det-box { padding:6px 8px 10px; }
.pe-det-box .tbl { background:#fff; }

/* ===== 助理只读模式（2026-09-09）：机构端把某板块设为「只读」时，隐藏其写操作按钮 ===== */
/* 家校绑定(family.js) 与 对外错题本 的写操作均带 data-act；老师学员的写操作有各自属性 */
.view.ro [data-act] { display: none !important; }
.view.ro #sr-add,
.view.ro #tm-form,
.view.ro [data-tm-edit],
.view.ro [data-tm-del],
.view.ro [data-tm-reset],
.view.ro [data-tm-restore] { display: none !important; }
.view.ro .ro-hint {
  display: block; margin: 10px 0 4px; padding: 8px 12px;
  background: #FFF8E8; border: 1px solid #F2D58A; border-radius: 8px;
  color: #8a6d1a; font-size: 12.5px;
}
.ro-badge {
  display: inline-block; margin-left: 6px; padding: 1px 7px; border-radius: 999px;
  background: #EEF1FB; color: #5B6CFF; font-size: 11px; font-weight: 700; vertical-align: middle;
}

/* 排课收费：学生多选容器 */
.stu-box {
  display: flex; flex-wrap: wrap; gap: 7px 12px;
  max-height: 190px; overflow-y: auto; padding: 10px 12px;
  border: 1px solid #E6E8F0; border-radius: 8px; background: #FAFBFF;
}
.stu-box label { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: #333; cursor: pointer; }
.stu-box input[type="checkbox"] { margin: 0; cursor: pointer; }
.stu-box .none { color: #9aa0b0; font-size: 12.5px; }

/* 学员建档：分组标题 + 三列栅格 + 科目多选（科目 → 班级下拉） */
.form-sep {
  margin: 16px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #ECEFF7;
  font-size: 13px; font-weight: 700; color: #5B6CFF;
}
.form-sep:first-of-type { margin-top: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 10px; }
.subj-box {
  display: flex; flex-direction: column; gap: 6px;
  max-height: 300px; overflow-y: auto; padding: 10px 12px;
  border: 1px solid #E6E8F0; border-radius: 8px; background: #FAFBFF;
}
.subj-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: #333; cursor: pointer;
}
.subj-row input[type="checkbox"] { margin: 0; cursor: pointer; flex: none; }
.subj-row .subj-name { width: 62px; flex: none; font-weight: 600; }
.subj-row select { flex: 1; min-width: 0; }

/* 勾选科目后展开的「该课课时」（2026-09-13）：正课/赠送可手改，右侧显示单价与剩余 */
.subj-block { display: flex; flex-direction: column; gap: 2px; }
.subj-block + .subj-block { border-top: 1px dashed #EDEFF6; padding-top: 5px; }
.subj-hours {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  margin: 2px 0 2px 22px; padding: 7px 10px;
  background: #FFFDF7; border: 1px solid #F3E6CB; border-radius: 7px;
  font-size: 12.5px; color: #6B6047;
}
.subj-hours .sh-lb { font-weight: 700; color: #B07A20; flex: none; }
.subj-hours .sh-f { display: flex; align-items: center; gap: 4px; color: #7A8299; }
.subj-hours .sh-f .inp { width: 74px; min-width: 0; text-align: right; }
.subj-hours .sh-info { color: #7A8299; flex: 1 1 100%; }
.subj-hours .sh-info .tag-org { margin-left: 2px; }
/* 非「按次收」的课没有课时池概念（按时段收费，不按节）→ 隐藏正课/赠送输入，只留说明 */
/* 2026-09-30：`no-hours` 只隐藏「正课/赠送」——非按次收的课（按月收的托管等）确实没有
   这两个池，但**照样有试课**（用户口径「所有科目都有试课」）⇒ 试课行必须继续显示。 */
.subj-hours.no-hours .sh-f:not(.sh-trial) { display: none; }
.subj-hours.no-hours { background: #F7F9FF; border-color: #E6E8F0; color: #7A8299; }
.sh-will { display: block; margin: 0 0 2px 22px; font-size: 12px; color: #1E8E4E; font-weight: 600; }
.sh-will:empty { display: none; }
@media (max-width: 640px) {
  .grid3 { grid-template-columns: 1fr; }
  .subj-row { flex-wrap: wrap; }
  .subj-row select { width: 100%; }
  .subj-hours { margin-left: 0; }
  .sh-will { margin-left: 0; }
}

/* 排课：上课时间段 / 上课日多选 */
.time-pair { display: flex; align-items: center; gap: 6px; }
.time-pair input { flex: 1; min-width: 0; }
.time-pair span { color: #9AA1B1; font-size: 12px; }
.day-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.day-pick label {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; padding: 6px 10px; border: 1px solid #E6E8F0; border-radius: 8px;
  background: #fff; font-size: 13px; color: #333; cursor: pointer; user-select: none;
}
.day-pick label:hover { border-color: #5B6CFF; }
.day-pick input { display: none; }
.day-pick input:checked + span { color: #fff; }
.day-pick label:has(input:checked) {
  background: linear-gradient(100deg, #5B6CFF, #8A5BFF); border-color: transparent; color: #fff; font-weight: 600;
}

/* 月历课表（与教师端 workbench 的 .cal 保持一致） */
.cal {
  display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px;
  background: #E6E8F0; border: 1px solid #E6E8F0; border-radius: 12px; overflow: hidden;
}
.cal-hd { background: #FAFBFD; text-align: center; padding: 8px 0; font-size: 12px; color: #7A8299; font-weight: 600; }
.cal-cell { background: #fff; min-height: 98px; padding: 6px 7px; }
.cal-cell.out { background: #FAFBFD; }
/* 今天：暖色底 + 玫红描边 + 日期徽章，与「普通课(蓝)/临时加课(橙)/已完成(绿)」都不撞色 */
.cal-cell.today { background: #FFF1F5; box-shadow: inset 0 0 0 2px #E8578A; }
.cal-day { font-size: 12px; font-weight: 700; color: #7A8299; margin-bottom: 5px; }
.cal-cell.today .cal-day {
  display: inline-block; color: #fff; background: #E8578A;
  border-radius: 9px; padding: 0 6px; line-height: 17px;
}
.cal-cell .ev {
  font-size: 11px; background: #EEF1FF; color: #5B6CFF; border-radius: 6px;
  padding: 3px 5px; margin-bottom: 3px; line-height: 1.3;
  overflow: hidden; cursor: pointer;
}
.cal-cell .ev .ev-main { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-cell .ev .ev-tn {
  display: block; font-size: 10px; opacity: .78; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-cell .ev.extra { background: #FFF3E6; color: #C97A17; }
.cal-cell .ev.done { background: #E9F7EF; color: #1E8E4E; }
.cal-tt { font-size: 14px; font-weight: 700; color: #333; margin-left: 4px; }
/* 课程列表「课时」列下的每周节数小标注 */
.wk-tag {
  display: block; font-size: 11px; font-weight: 500; color: #7A8299; margin-top: 1px;
}

/* 上课时段规则多行编辑器 */
.slot-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; margin-bottom: 7px;
  border: 1px solid #E6E8F0; border-radius: 9px; background: #FAFBFF;
}
.slot-row .slot-days { gap: 4px; flex: 1; }
.slot-row .slot-days label { min-width: 34px; padding: 5px 7px; font-size: 12.5px; }
.slot-row .time-pair { width: 172px; flex: none; }
.slot-row .slot-rm {
  flex: none; border: 1px solid #E6E8F0; background: #fff; color: #A32D2D;
  width: 30px; height: 30px; border-radius: 8px; cursor: pointer; font-size: 13px;
}
.slot-row .slot-rm:hover { background: #FFF3F3; border-color: #E7B3B3; }

/* ============ 学情报告：作业批阅内嵌预览（2026-09-13）============
 * 视觉对齐教师端「作业批阅」生成的家长 H5 页面（api_workbench.js renderH5），
 * 让机构管理者在这里看到的就是家长手机上看到的样子。
 */
.rv-sum { font-size: 13px; color: #5B6480; margin-bottom: 10px; }
.rv-sum b { color: var(--brand-d, #5B6CFF); font-size: 15px; }
.rv-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 9px 12px; margin-bottom: 12px;
  background: #F6F8FF; border: 1px solid #E6E8F0; border-radius: 10px;
}
.rv-meta-lb { font-size: 12.5px; color: #7A8299; font-weight: 600; margin-right: 3px; }
.gchip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 3px 9px; border-radius: 999px;
  background: #E9F7EF; color: #1E8E4E; font-size: 12px; font-weight: 600;
}
.gchip.off { background: #FFF3E6; color: #C97A17; }

.rv-wrap { display: flex; flex-direction: column; gap: 14px; }
.rv-card {
  border: 1px solid #E6E8F0; border-radius: 12px; background: #fff;
  padding: 14px 16px 16px;
}
.rv-card .hd {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-bottom: 9px; border-bottom: 1px dashed #EDEFF6; margin-bottom: 9px;
}
.rv-card .hd .nm { font-size: 15px; font-weight: 700; color: #2B3245; }
.rv-card .hd .st {
  flex: none; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 700;
}
.rv-card .meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: 12.5px; color: #7A8299; margin-bottom: 10px;
}
/* 作业条目：勾选框 + 文本 + 条目批语 */
.rv-card .ngrp {
  font-size: 13px; font-weight: 700; color: #5B6480;
  margin: 10px 0 7px; padding-left: 2px;
}
.rv-card .nitem { display: flex; gap: 9px; padding: 5px 2px; align-items: flex-start; }
.rv-card .cb {
  flex: none; width: 15px; height: 15px; margin-top: 2px;
  border: 1.5px solid #C9CFDE; border-radius: 4px; background: #fff;
}
.rv-card .cb.done { background: #1E8E4E; border-color: #1E8E4E; position: relative; }
.rv-card .cb.done::after {
  content: '✓'; position: absolute; inset: 0;
  color: #fff; font-size: 11px; line-height: 12px; text-align: center; font-weight: 700;
}
.rv-card .nbody { flex: 1; min-width: 0; }
.rv-card .ntx { font-size: 13.5px; color: #2B3245; line-height: 1.55; }
.rv-card .ncmt {
  margin-top: 4px; padding: 6px 9px; border-radius: 7px;
  background: #F6F8FF; color: #5B6480; font-size: 12.5px; line-height: 1.55;
}
/* 整体批语 */
.rv-card .rv {
  margin-top: 11px; padding: 10px 12px;
  background: #FFFBF3; border: 1px solid #F3E6CB; border-radius: 10px;
}
.rv-card .rv-h { font-size: 12.5px; font-weight: 700; color: #B07A20; margin-bottom: 5px; }
.rv-card .rv-txt { font-size: 13.5px; color: #4A4030; line-height: 1.6; }
.rv-card .rv-img { max-width: 100%; border-radius: 8px; display: block; }
.rv-card .rv-empty { background: #FAFBFF; border-color: #EDEFF6; }
.rv-card .rv-none { font-size: 12.5px; color: #98A1B3; }
/* 照片/视频 */
.rv-card .ph-h { font-size: 12.5px; color: #7A8299; margin: 11px 0 6px; font-weight: 600; }
.rv-card .ph {
  max-width: 100%; border-radius: 9px; display: block; margin-bottom: 8px;
  border: 1px solid #EDEFF6;
}
.rv-card .ph.vd { max-height: 340px; }
.rv-card .nophoto {
  padding: 18px; text-align: center; color: #A7AFC0; font-size: 12.5px;
  background: #FAFBFF; border: 1px dashed #E6E8F0; border-radius: 9px;
}
.rv-card .note {
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed #EDEFF6;
  font-size: 13px; color: #5B6480; line-height: 1.6;
}

/* 课时与学费：两列（录入金额 + 单价）；原来的「整期学费（自动）」只读框已取消 */
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 10px; }
@media (max-width: 640px) {
  .grid2 { grid-template-columns: 1fr; }
}

/* ================= 消课照片核对（2026-09-29 新增） =================
   机构端「排课消课 → 消课照片核对」列表样式。
   ☠️ 三档核对标记颜色语义：一致=绿、不符=黄、未识别=灰。
      「未识别」绝不能报红 —— 那是"没数出人数"，不是"人数不符"。 */
.ckp-thumb {
  display: block; width: 78px; height: 58px; object-fit: cover;
  border-radius: 7px; border: 1px solid #E3E7F0; background: #F7F9FC;
  transition: transform .12s ease, box-shadow .12s ease;
}
.ckp-thumb:hover { transform: scale(1.04); box-shadow: 0 3px 12px rgba(36, 107, 136, .18); }
.tag-ok {
  display: inline-block; background: #E7F7EF; color: #1B6B47;
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tag-warn {
  display: inline-block; background: #FFF6E5; color: #8A5A12;
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.tag-mute {
  display: inline-block; background: #F1F3F8; color: #6B7488;
  border-radius: 6px; padding: 2px 8px; font-size: 12px; font-weight: 600; white-space: nowrap;
}

/* ===== 教师功能配置（设置页）2026-09-29 =====
   逐项控制教师端侧边栏功能的显示/隐藏。
   勾选 = 显示；取消勾选 = 教师端隐藏该菜单，且对应后端接口一并关闭。
   隐藏态整行降灰，右侧状态文字由 JS 同步为「已隐藏」。 */
/* ---- 教师功能配置（按老师，2026-09-29 v2）---- */
/* ☠️ .mini-btn / .action-row / .sel-info 在本页 CSS 里本来没有定义，
   之前那块面板靠 tech.css 的通用按钮样式勉强显示，尺寸与页面其它按钮不一致。
   这里补齐定义，避免「保存按钮看起来像纯文字」这类观感问题。 */
.mini-btn {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  height: 30px; padding: 0 14px; border-radius: 8px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; transition: .15s;
}
.mini-btn:hover { border-color: var(--brand); color: var(--brand); }
.mini-btn:disabled { background: #F4F6FA; color: #A8B2C4; cursor: not-allowed; border-color: #E4E9F1; }
.mini-btn.ghost { color: var(--text-2); font-weight: 500; }
.mini-btn.ghost:hover { border-color: #C2802A; color: #C2802A; background: #FFFBF3; }
.action-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sel-info { font-size: 12px; color: var(--text-2); }

.tf-toolbar { display: flex; align-items: center; gap: 10px; margin: 10px 0 12px; }
.tf-search {
  flex: 0 1 260px; height: 30px; padding: 0 10px; font-size: 12.5px;
  border: 1px solid #D8DEEA; border-radius: 8px; background: #fff; color: #22293A; outline: none;
}
.tf-search:focus { border-color: #246B88; box-shadow: 0 0 0 2px rgba(36,107,136,.10); }
.tf-count { font-size: 12px; color: #6B7488; }

/* 表头：与数据行的列宽必须严格一致，否则列会错位 */
/* ☠️ repeat(8,...) = TF_ITEMS 的项数（home/tools/collect/print/archive/checkin/prep/ai）。
   加列时**这里和 workspace.html 的表头、workspace.js 的 TF_ITEMS 三处必须同改**，
   漏改任意一处都会让表头与数据列错位。 */
.tf-head, .tf-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) repeat(7, 86px) 108px 96px;
  align-items: center; gap: 8px;
}
.tf-head {
  padding: 0 12px 8px; font-size: 11.5px; font-weight: 700; color: #808AA0;
  border-bottom: 1px solid #EDF0F6;
}
.tf-col-name { padding-left: 2px; }
.tf-col-sw { text-align: center; }
.tf-col-op { text-align: center; }

.tf-list { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.tf-loading { color: #6B7488; font-size: 13px; padding: 8px 0; }
.tf-row {
  border: 1px solid #E3E7F0; border-radius: 9px;
  padding: 8px 12px; background: #fff;
  transition: border-color .12s ease, background .12s ease;
}
.tf-row:hover { border-color: #B9C6E0; background: #FAFBFF; }
.tf-name { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tf-name b { font-size: 13.5px; color: #22293A; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tf-name em { font-size: 11.5px; color: #98A0B4; font-style: normal; }

.tf-cell {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  cursor: pointer; padding: 4px 0; border-radius: 6px;
}
.tf-cell:hover { background: #F2F5FC; }
.tf-cell .tf-check { width: 15px; height: 15px; cursor: pointer; accent-color: #1B6B47; }
/* ☠️ 取消勾选 = 隐藏 ⇒ 用橙色点提示「这项被关掉了」，一眼扫得出哪列有异常 */
.tf-cell .tf-dot { width: 6px; height: 6px; border-radius: 50%; background: transparent; }
.tf-cell.tf-off .tf-dot { background: #E8A33D; }
.tf-cell.tf-off .tf-check { accent-color: #C2802A; }
.tf-op { display: flex; gap: 5px; justify-content: center; }
.tf-mini {
  font-size: 11px; padding: 2px 7px; border-radius: 6px; cursor: pointer;
  border: 1px solid #D8DEEA; background: #fff; color: #4A5570; line-height: 1.5;
}
.tf-mini:hover { border-color: #246B88; color: #246B88; }
.tf-state {
  flex: 0 0 auto; font-size: 11.5px; font-weight: 700; text-align: center;
  color: #1B6B47; background: #E7F7EF; border-radius: 6px; padding: 2px 6px; white-space: nowrap;
}
.tf-state.tf-state-off { color: #8A5A12; background: #FFF6E5; }
.ai-assignment-list { overflow-x:auto; }
.ai-assignment-head, .ai-assignment-row { display:grid; grid-template-columns:minmax(150px,1.3fr) repeat(3,minmax(110px,1fr)) 76px; gap:8px; align-items:center; min-width:650px; }
.ai-assignment-head { padding:0 10px 7px; color:#808AA0; font-size:12px; font-weight:700; }
.ai-assignment-row { padding:8px 10px; border:1px solid #E3E7F0; border-radius:8px; margin-top:6px; background:#fff; }
.ai-assignment-row select { width:100%; min-width:0; padding:6px 7px; border:1px solid #D8DEEA; border-radius:6px; background:#fff; color:#22293A; }
.ai-student-name { display:flex; flex-direction:column; gap:2px; min-width:0; }
.ai-student-name b { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ai-student-name small { color:#98A0B4; }

/* ================================================================
   2026-09-30：对外报名表（「生成报名表」板块）
   ================================================================ */

/* ☠️ 「消课照片核对 / 消课异常提醒 / 生成报名表」筛选栏里的次要按钮一直写的是 class="sm"，
   但 .sm 这个类**从来没被定义过** ⇒ 那几个按钮一直渲染成浏览器默认样式，与右侧 .ghost 不搭。
   这里补一条。☠️ 必须用 :where() 把特异性降为 0 —— 否则它会盖掉 .primary（同为单类选择器，
   靠源码顺序决胜），把「保存」这类主按钮的蓝底给抹掉。 */
:where(.sm) {
  border: 1px solid var(--line); background: #fff; color: var(--text);
  height: 32px; padding: 0 12px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; transition: .12s; align-self: flex-end;
}
:where(.sm):hover { border-color: var(--brand); color: var(--brand); }
/* 同一条兜底：删除类按钮要红，否则只看得出是个普通次要按钮（照片核对页的「删除」也走这里） */
:where(.sm).danger { color: #B42318; border-color: #F2C9C4; }
:where(.sm).danger:hover { background: #FEF3F2; border-color: #B42318; color: #B42318; }

/* ---- 报名链接行 ---- */
.fap-linkrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.fap-linkin {
  flex: 1 1 320px; min-width: 0; height: 34px; padding: 0 10px;
  border: 1px solid var(--line); border-radius: 7px; background: #fafcfa;
  color: var(--text); outline: none; font-size: 12.5px;
}
.fap-linkin:focus { border-color: var(--brand); background: #fff; }
.fap-linkmeta { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.fap-qrbox {
  flex: 0 0 auto; width: 132px; height: 132px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; display: flex; align-items: center;
  justify-content: center; overflow: hidden;
}
.fap-qrbox img { width: 100%; height: 100%; display: block; }
.fap-qrempty { font-size: 11.5px; color: var(--muted); text-align: center; padding: 0 8px; line-height: 1.5; }
.fap-tips { flex: 1 1 300px; margin: 0; padding-left: 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.85; }
.fap-tips b { color: var(--brand-d); }

/* ---- 配置区 ---- */
.fap-switch {
  display: inline-flex; align-items: center; gap: 7px; height: 34px;
  font-size: 13px; color: var(--text-2); cursor: pointer; user-select: none;
}
.fap-switch input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.fap-block { margin-top: 16px; }
.fap-blocktitle { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.fap-mini { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.fap-hint { font-size: 12px; color: var(--muted); line-height: 1.5; }
.fap-up { display: flex; align-items: center; gap: 10px; height: 34px; flex-wrap: wrap; }
.fap-qrprev {
  margin-top: 14px; padding: 12px; border: 1px dashed var(--line);
  border-radius: 10px; background: #fafcfa; text-align: center;
}
.fap-qrprev img { max-width: 200px; max-height: 240px; display: block; margin: 0 auto 8px; border-radius: 8px; }

/* ---- 登记表内容 · 字段配置器（飞书风格 · 2026-10-02 重做） ---- */
/* 折叠容器：默认收起，避免几十行字段配置挡住整页（用户要求「默认折叠」） */
details.fld-fold, details.fld-fold2 {
  border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe;
  padding: 10px 12px; margin-top: 12px;
}
details.fld-fold > summary.fap-blocktitle,
details.fld-fold2 > summary.fld-fold-sum {
  cursor: pointer; list-style: none; display: flex; align-items: center; gap: 8px;
  flex-wrap: wrap; font-weight: 600;
}
details.fld-fold > summary::-webkit-details-marker,
details.fld-fold2 > summary::-webkit-details-marker { display: none; }
details.fld-fold > summary.fap-blocktitle::before,
details.fld-fold2 > summary.fld-fold-sum::before { content: '▸'; color: var(--brand); font-size: 13px; }
details.fld-fold[open] > summary.fap-blocktitle::before,
details.fld-fold2[open] > summary.fld-fold-sum::before { content: '▾'; }
.fld-fold-mark {
  margin-left: auto; font-size: 12px; font-weight: 500; color: var(--brand);
  background: #eef4ff; border-radius: 999px; padding: 2px 10px;
}
/* 「点开配置」只在收起时显示，展开后自动消失 */
details[open] > summary .fld-fold-mark { display: none; }
details.fld-fold > .fld-editor, details.fld-fold2 > .fld-editor { margin-top: 12px; }
.fld-editor { margin-top: 4px; }

/* --- 主体：左列表 + 右编辑面板 --- */
.fcfg { display: flex; gap: 14px; align-items: flex-start; }
.fcfg-left {
  flex: 0 0 268px; max-height: 420px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 6px;
}
.fcfg-right {
  flex: 1 1 auto; min-width: 0; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; padding: 14px 16px;
}
.fcfg-empty {
  padding: 26px 10px; text-align: center; font-size: 12.5px; color: var(--muted); line-height: 1.9;
}
.fcfg-empty span { font-size: 12px; opacity: .85; }

/* --- 左侧字段卡片 --- */
.fcfg-item {
  display: flex; align-items: center; gap: 8px; padding: 9px 8px 9px 4px;
  border-radius: 8px; cursor: pointer; border: 1px solid transparent;
  position: relative; transition: background .12s, border-color .12s;
}
.fcfg-item:hover { background: #f5f8fd; }
.fcfg-item.on { background: #eef4ff; border-color: #c9dcff; }
.fcfg-item.locked { background: #fafbfd; }
.fcfg-item.locked.on { background: #eef4ff; }
.fcfg-item.dragging { opacity: .4; }
.fcfg-item.over-top { box-shadow: inset 0 2px 0 0 var(--brand); }
.fcfg-item.over-bot { box-shadow: inset 0 -2px 0 0 var(--brand); }
.fcfg-grip {
  flex: 0 0 auto; width: 16px; text-align: center; color: #c2cad8;
  font-size: 13px; cursor: grab; user-select: none; letter-spacing: -2px;
}
.fcfg-grip:active { cursor: grabbing; }
.fcfg-item:hover .fcfg-grip { color: #93a0b5; }
.fcfg-tico {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 7px; background: #f0f3f8;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; color: #5a6a86;
}
.fcfg-item.on .fcfg-tico { background: #dbe8ff; color: var(--brand-d); }
.fcfg-imain { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.fcfg-iname {
  font-size: 13px; color: inherit; white-space: nowrap; overflow: hidden;
  text-overflow: ellipsis; line-height: 1.35;
}
.fcfg-isub { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcfg-ilock { flex: 0 0 auto; font-size: 11px; opacity: .75; }

/* --- 右侧编辑面板 --- */
.fcfg-ptitle {
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 12px;
  padding-bottom: 9px; border-bottom: 1px solid var(--line);
}
.fcfg-prow { margin-bottom: 13px; }
.fcfg-prow > label {
  display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 6px;
}
.fcfg-tipline { margin-left: 8px; font-size: 11.5px; color: var(--muted); font-weight: 400; }
.fcfg-lab, .fcfg-ph, .fcfg-pty, .fcfg-opts {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px;
  font-size: 13px; background: #fff; color: inherit; font-family: inherit;
}
.fcfg-lab, .fcfg-ph, .fcfg-pty { height: 34px; padding: 0 10px; }
.fcfg-pty { cursor: pointer; }
.fcfg-opts { padding: 8px 10px; min-height: 74px; resize: vertical; line-height: 1.7; }
.fcfg-lab:focus, .fcfg-ph:focus, .fcfg-pty:focus, .fcfg-opts:focus {
  outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(59,130,246,.10);
}
.fcfg-prow-inline { display: flex; align-items: center; gap: 14px; }
.fcfg-prow-inline > label { margin-bottom: 0; }
.fcfg-static {
  font-size: 12.5px; color: var(--muted); background: #f6f8fb; border-radius: 8px;
  padding: 9px 11px; line-height: 1.6; display: flex; align-items: center; gap: 8px;
}
.fcfg-sw {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  cursor: pointer; user-select: none;
}
.fcfg-sw input { width: 16px; height: 16px; accent-color: var(--brand); cursor: pointer; }
.fcfg-locknote { font-size: 11.5px; color: var(--muted); }
.fcfg-pact {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--line);
}
.fcfg-req-wrap {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px;
  color: var(--text-2); cursor: pointer; user-select: none;
}
.fcfg-req-wrap input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.fcfg-del {
  height: 32px; padding: 0 14px; border-radius: 8px; cursor: pointer; font-size: 12.5px;
  border: 1px solid #f2c9c4; background: #fff; color: #b42318;
}
.fcfg-del:hover { background: #fef3f2; }

/* --- 底部：按类型添加 --- */
.fcfg-addbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.fcfg-addlab { font-size: 12.5px; color: var(--muted); margin-right: 2px; }
.fcfg-addbtn {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer;
  font-size: 12.5px; color: var(--text-2); font-family: inherit;
  transition: border-color .12s, color .12s, background .12s;
}
.fcfg-addbtn:hover { border-color: var(--brand); color: var(--brand-d); background: #f7faff; }
.fcfg-addbtn b { font-size: 13px; font-weight: 600; color: #8b98ad; }
.fcfg-addbtn:hover b { color: var(--brand); }

@media (max-width: 820px) {
  .fcfg { flex-direction: column; }
  .fcfg-left { flex: 1 1 auto; width: 100%; max-height: 220px; }
  .fcfg-right { width: 100%; }
}

/* ---- 明细状态胶囊 ---- */
.fap-pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; line-height: 18px; white-space: nowrap; }
.fap-pill.done { color: #16794c; background: #e7f7ef; }
.fap-pill.new { color: #8a5a12; background: #fff6e5; }
.fap-pill.failed { color: #b42318; background: #fef3f2; }
.fap-pill.dup { color: #4a5570; background: #eef1f6; }
.fap-pill.sid { color: var(--brand-d); background: var(--brand-tint); }
.fap-ops { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 820px) {
  .fap-linkmeta { gap: 12px; }
  .fap-qrbox { width: 108px; height: 108px; }
}

