/* ============================================================================
   扩展功能样式：实时课堂（视频 / 白板 / 圈画）+ 成长档案缩略图 + 经营看板补充
   通用组件（按钮、面板、表单、表格、标签）已收敛到 style.css，这里不再重复定义。
   ========================================================================== */

/* ---------- 课堂房间骨架 ---------- */
.room { --room-ink: #0f172a; }
.room-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 306px;
  gap: var(--s4);
  align-items: start;
}
.room-main { min-width: 0; }
.room-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s4);
  position: sticky;
  top: 76px;
}
.room-side h2 {
  font-size: 11px;
  font-family: var(--font-mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
  margin: var(--s4) 0 var(--s2);
}
.room-side h2:first-of-type { margin-top: 0; }
.room-side .admin-list { border: 0; background: transparent; }
.room-side .admin-list > div { padding: 9px 0; }
.room-side .admin-list h3 { font-size: 12.5px; }
.room-side .empty { padding: var(--s4) var(--s3); font-size: var(--fs-xs); }

/* 主区标签页 */
.room-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: var(--s3);
}
.room-tab {
  border: 0;
  background: transparent;
  padding: 7px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
}
.room-tab:hover { color: var(--ink); background: transparent; border-color: transparent; }
.room-tab.active { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(16, 42, 67, .12); }
.room-panel { min-width: 0; }
.room-panel .whiteboard { margin-top: 0; }

/* ---------- 白板模式：白板占满主区，画面竖排在右（类似 Zoom），成员栏移到左侧 ----------
   开关是 #room[data-view="board"]，由 room.js 在切标签页时同步。
   视频面板不做 DOM 搬迁，只换位置，避免 <video>/WebRTC 渲染器被重新挂载而黑屏。 */
.video-rail-head { display: none; }

.room[data-view="board"] .room-layout {
  position: relative;
  grid-template-columns: 264px minmax(0, 1fr);
}
.room[data-view="board"] .room-side {
  grid-column: 1;
  grid-row: 1;
  max-height: calc(100vh - 92px);
  overflow-y: auto;
}
.room[data-view="board"] .room-main {
  grid-column: 2;
  grid-row: 1;
  padding-right: 232px; /* 给右侧竖排画面留出宽度，内容不会压到画面下面 */
}
.room[data-view="board"] #panel-video {
  position: absolute;
  top: 0;
  right: 0;
  width: 216px;
  max-height: min(100%, calc(100vh - 96px)); /* 一屏内放得下，人多就在列内滚动 */
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  z-index: 6;
}
.room[data-view="board"] #panel-video #spotlight { display: none !important; }
.room[data-view="board"] .video-rail-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  padding: 0 2px;
}
.room[data-view="board"] .video-rail-head strong {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 600;
}
.room[data-view="board"] .video-rail-head .hint { font-size: 10.5px; color: var(--ink-4); }
.room[data-view="board"] #videos {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-gutter: stable;
}
.room[data-view="board"] .room-side h2 {
  border-top: 1px solid var(--line);
  padding-top: var(--s3);
}
.room[data-view="board"] .room-side h2:first-of-type { border-top: 0; padding-top: 0; }
.room[data-view="board"] .video-tile { max-width: none; width: 100%; border-radius: 10px; }
.room[data-view="board"] .video-label { left: 6px; bottom: 6px; font-size: 10.5px; padding: 2px 7px; }

/* 窄屏放不下三列：画面回到主区上方横排，成员栏顺延到下面 */
@media (max-width: 1180px) {
  .room[data-view="board"] .room-layout { grid-template-columns: 1fr; }
  .room[data-view="board"] .room-side {
    grid-column: 1;
    grid-row: auto;
    max-height: none;
    overflow: visible;
  }
  .room[data-view="board"] .room-main {
    grid-column: 1;
    grid-row: auto;
    padding-right: 0;
  }
  .room[data-view="board"] #panel-video {
    position: static;
    width: auto;
    max-height: none;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    margin-bottom: var(--s3);
  }
  .room[data-view="board"] #videos {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
  }
  .room[data-view="board"] .video-tile { flex: 0 0 176px; width: 176px; }
}


/* 视频网格：auto-fit 让单人画面占满一行但不至于铺满整屏，多人时自动排成小格 */
.video-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.video-tile { max-width: 520px; }
.video-tile {
  position: relative;
  background: var(--room-ink);
  border-radius: var(--r);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border: 1px solid #1e293b;
}
.video-surface { position: absolute; inset: 0; background: #0b1220; }
.video-surface video, .video-surface > div, .video-surface canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  display: block;
}
.video-tile.local .video-surface { transform: scaleX(-1); }
.video-label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  background: rgba(10, 14, 20, .74);
  color: #fff;
  font-size: 11.5px;
  font-weight: 500;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  z-index: 2;
  backdrop-filter: blur(4px);
}
/* 画面角标：麦克风开/闭。全员静音时每个学生画面右上角都会出现红色闭麦图标 */
.video-mic {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(10, 14, 20, .62);
  color: #e7f0ff;
  backdrop-filter: blur(4px);
  transition: background .16s ease, color .16s ease;
  pointer-events: none;
}
.video-mic svg { width: 14px; height: 14px; }
.video-mic.is-muted { background: rgba(194, 65, 12, .92); color: #fff; }
.room[data-view="board"] .video-mic { width: 20px; height: 20px; right: 5px; top: 5px; }
.room[data-view="board"] .video-mic svg { width: 12px; height: 12px; }
#btn-mic.is-muted { background: #fdece4; border-color: #f3c3ae; color: #b03a09; }
#btn-mute-all.is-on { background: #fdece4; border-color: #f3c3ae; color: #b03a09; }
#btn-wb-lock.is-on { background: #fdece4; border-color: #f3c3ae; color: #b03a09; }
.video-note {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  max-width: 86%;
  padding: 9px 13px;
  border: 1px solid #fcd34d;
  background: rgba(254, 243, 199, .97);
  color: #92400e;
  font-size: 12px;
  line-height: 1.6;  border-radius: 10px;
  cursor: pointer;
  text-align: left;
}

/* 课堂控制条 */
.room-controls {
  display: flex;
  gap: var(--s2);
  flex-wrap: wrap;
  align-items: center;
  margin: var(--s4) 0;
  padding: var(--s3);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
}
.room-controls button { font-size: 12.5px; padding: 8px 13px; }
.room-controls select { width: auto; min-width: 180px; margin: 0; padding: 8px 10px; font-size: 12.5px; }

.room-chat { display: flex; gap: var(--s2); margin-bottom: var(--s3); }
.room-chat input { flex: 1; margin: 0; padding: 9px 12px; font-size: var(--fs-sm); }

.room-events, .question-list {
  max-height: 200px;
  min-height: 76px;
  overflow: auto;
  font-size: 12.5px;
  color: var(--ink-2);
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 10px 12px;
}
.event-line, .question-row { padding: 5px 0; border-bottom: 1px dashed var(--line); line-height: 1.55; }
.event-line:last-child, .question-row:last-child { border-bottom: 0; }
.event-line.warn { color: var(--amber); }
.event-line.ask { color: var(--teal); }
.event-line.chat { color: var(--ink-2); }
.peer-row {
  padding: 7px 10px;
  background: var(--paper-2);
  border-radius: var(--r-sm);
  margin-bottom: 5px;
  font-size: 12.5px;
  color: var(--ink-2);
}
/* 退出课堂的成员：保留提示但弱化显示 */
.peer-row.left {
  background: transparent;
  color: var(--ink-4, #94a3b8);
  font-size: 12px;
  font-style: italic;
  border: 1px dashed var(--line);
}
.question-list { max-height: 170px; }

/* 音视频引擎徽标 */
.engine-badge {
  align-self: center;
  margin-left: auto;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid var(--line);
  color: var(--ink-3);
  background: var(--paper-2);
}
.engine-badge.cloud { background: var(--teal-soft); color: var(--teal); border-color: #86efac; }
.engine-badge.mesh { background: var(--amber-soft); color: var(--amber); border-color: #fcd34d; }
.engine-badge.warn { background: var(--danger-soft); color: var(--danger); border-color: #fdba74; white-space: normal; }

/* ---------- 作品放大 + 圈画 ---------- */
.spotlight {
  position: relative;
  margin: var(--s3) 0;
  background: var(--room-ink);
  border-radius: var(--r);
  padding: 10px;
  text-align: left;
}
.spotlight-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: #f8fafc; padding: 2px 4px 10px; }
.spotlight-top strong { font-size: 13px; font-weight: 600; }
.spotlight-top > .button { margin-left: auto; }
.annotate-tools { display: flex; align-items: center; gap: 7px; }
.annotate-tools input[type="color"] { width: 30px; height: 28px; min-width: 30px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; }
.annotate-tools select {
  width: auto; padding: 5px 8px; margin: 0;
  border-radius: 7px; border: 1px solid #334155;
  background: #1e293b; color: #f8fafc; font-size: 12px;
}
.annotate-tools .hint { color: #829ab1; }
.annotate-tools .button { border-color: #334155; color: #e2e8f0; background: #1e293b; }
.annotate-tools .button:hover { background: #334155; border-color: #475569; color: #fff; }
.spotlight-stage {
  position: relative;
  width: 100%;
  min-height: 240px;
  background: #0b1220;
  border-radius: 10px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.spotlight-stage #spotlight-body { width: 100%; display: flex; align-items: center; justify-content: center; }
.spotlight img, .spotlight video { max-width: 100%; max-height: 440px; border-radius: 8px; display: block; }
.spotlight-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; pointer-events: none; }
.spotlight-stage.annotatable canvas { pointer-events: auto; cursor: crosshair; }
.spotlight .hint { color: #829ab1; font-size: 11.5px; margin: 8px 4px 2px; }

/* ---------- 互动白板 ---------- */
.whiteboard {
  margin: var(--s4) 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--s3);
}
.wb-head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: 10px; padding: 2px 2px 0; }
.wb-title { display: flex; align-items: baseline; gap: 10px; }
.wb-title strong { font-size: 14px; }
.wb-title .hint { font-size: var(--fs-xs); color: var(--ink-3); }
.wb-tools { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; margin-left: auto; }
.wb-tool {
  padding: 5px 10px;
  border-radius: 7px;
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 12px;
  color: var(--ink-2);
  cursor: pointer;
}
.wb-tool:hover { border-color: var(--ink-4); background: var(--paper-2); }
.wb-tool.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.wb-tools input[type="color"] { width: 30px; height: 28px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.wb-tools select { width: auto; padding: 5px 8px; margin: 0; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.wb-tools .button { border-color: var(--line); }
.wb-sep { width: 1px; height: 18px; background: var(--line); }
.wb-break { flex-basis: 100%; height: 0; }
.wb-page { font-family: var(--font-mono); font-size: 11.5px; color: var(--ink-3); padding: 0 4px; }
.wb-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 56vh;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  touch-action: none;
}
.wb-bg { position: absolute; inset: 0; background-size: contain; background-position: center; background-repeat: no-repeat; }
.wb-bg.has-image { background-color: var(--paper-2); }
.wb-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; }
.wb-stage canvas.read-only { cursor: default; pointer-events: none; }
.wb-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: var(--ink-4); font-size: var(--fs-sm); pointer-events: none; }
.wb-foot { margin: 8px 2px 0; font-size: var(--fs-xs); color: var(--ink-4); }

/* hidden 属性必须压过组件自身的 display */
[hidden] { display: none !important; }

/* ---------- 成长档案缩略图 ---------- */
.work-thumb {
  flex: 0 0 84px;
  width: 84px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
}
.work-thumb img, .work-thumb video { width: 100%; height: 100%; object-fit: cover; display: block; background: #000; }
.work-thumb .work-file { font-size: 22px; }

/* ---------- 课堂媒体网格（课程页） ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; margin: var(--s3) 0 var(--s4); }
.media-grid figure { margin: 0; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.media-grid img, .media-grid video { width: 100%; display: block; max-height: 150px; object-fit: cover; }

/* ---------- 弹窗 ---------- */
.modal { position: fixed; inset: 0; background: rgba(20, 24, 31, .58); display: flex; align-items: center; justify-content: center; padding: var(--s4); z-index: 60; }
.modal-card { max-width: 470px; background: var(--surface); border-radius: var(--r-lg); padding: var(--s5); box-shadow: var(--shadow-2); }
.modal-card h2 { margin-top: 0; font-size: 18px; }
.modal-card p { color: var(--ink-2); line-height: 1.75; font-size: var(--fs-sm); }
.modal-card .row-actions { margin-top: var(--s4); }

/* ---------- 邀请码卡片 ---------- */
.invite-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: var(--s3);
  margin-top: var(--s4);
}
.invite-card {
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s3) var(--s4) var(--s4);
  background: var(--paper-2);
}
.invite-card.used { opacity: .68; }
.invite-card .invite-code,
.invite-card .code {
  font-family: var(--font-mono);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: .16em;
  margin: 8px 0 4px;
  color: var(--ink);
}
.invite-card .url-box { margin: 6px 0; }
.invite-card small { color: var(--ink-3); font-size: var(--fs-xs); }

/* ---------- 点评页作品缩略 ---------- */
.fb-item { display: flex; gap: var(--s3); align-items: flex-start; min-width: 0; }
.fb-item > .row-actions { margin-left: auto; flex: 0 0 auto; }
.admin-list > div.is-form { flex-wrap: wrap; align-items: flex-start; padding: var(--s4); }
.admin-list > div.is-form > .fb-item { flex: 1 1 100%; }
.admin-list > div.is-form > .feedback-form { flex: 1 1 100%; width: 100%; }
.fb-thumb {
  flex: 0 0 72px;
  width: 72px; height: 56px;
  border-radius: 9px;
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-size: 18px;
  color: var(--ink-4);
}
.fb-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fb-body { flex: 1 1 auto; min-width: 0; }
.feedback-form { display: flex; gap: var(--s2); width: 100%; align-items: flex-start; }
.feedback-form textarea { margin: 0; flex: 1 1 auto; font-size: var(--fs-sm); }
.feedback-form button { margin: 0; flex: 0 0 auto; }

@media (max-width: 980px) {
  .room-layout { grid-template-columns: 1fr; }
  .room-side { position: static; }
}
@media (max-width: 700px) {
  .wb-tools { margin-left: 0; }
  .wb-stage { max-height: none; }
  .fb-item { flex-direction: column; align-items: stretch; gap: 10px; }
  .fb-item > .row-actions { margin-left: 0; }
  .work-thumb { flex: 0 0 100%; width: 100%; height: 150px; }
  .feedback-form { flex-direction: column; }
  .feedback-form button { width: 100%; }
  .room-controls { gap: 6px; padding: 10px; }
  .room-controls button, .room-controls select { flex: 1 1 calc(50% - 6px); min-width: 0; }
}

/* ============================================================================
   分享会：对外公开报名页（/share/<slug>）
   这一页会直接发到班级群和朋友圈，所以只做「一张邀请函 + 一张表」，
   不用后台那套密集排版；配色仍是同一套墨蓝 + 品牌蓝，不另起主题。
   ============================================================================ */
.share-wrap { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s4); }

.share-hero {
  padding: var(--s6) var(--s6) var(--s5);
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background:
    radial-gradient(115% 90% at 100% 0%, var(--accent-soft) 0%, rgba(232, 243, 255, 0) 62%),
    linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}
.share-kicker {
  margin: 0 0 var(--s3);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: flex;
  align-items: center;
  gap: var(--s2);
}
.share-kicker span {
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-3);
  letter-spacing: .04em;
}
.share-hero h1 {
  margin: 0 0 var(--s3);
  font-size: clamp(21px, 3.2vw, 27px);
  line-height: 1.4;
  letter-spacing: -.01em;
}
.share-theme {
  margin: 0 0 var(--s5);
  padding-left: var(--s3);
  border-left: 2px solid var(--accent);
  color: var(--ink-2);
  font-size: var(--fs-body);
  line-height: 1.7;
}

.share-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s4) var(--s5);
  margin: 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
}
.share-meta > div { min-width: 0; }
/* 嘉宾和面向人群内容长，各占整行；时间与地点配对成两列，避免上下参差 */
.share-meta > div:nth-child(1),
.share-meta > div:nth-child(4) { grid-column: 1 / -1; }
.share-meta dt {
  margin-bottom: 4px;
  font-size: var(--fs-xs);
  letter-spacing: .06em;
  color: var(--ink-4);
}
.share-meta dd { margin: 0; font-size: var(--fs-sm); color: var(--ink); line-height: 1.65; }
.share-address { font-size: var(--fs-xs); color: var(--ink-3); }
.share-guests { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.share-guests span { display: flex; flex-direction: column; }
.share-guests strong { font-size: var(--fs-body); color: var(--ink); }
.share-guests small { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.5; }

.share-taken {
  margin: var(--s4) 0 0;
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.share-taken strong { color: var(--accent-ink); font-size: var(--fs-sm); }

/* 表单：两列排，手机上自动变一列 */
.share-form { padding: var(--s5); }
.share-form-head h2 { margin-bottom: 4px; }
.share-form-head p { margin: 0 0 var(--s4); color: var(--ink-3); font-size: var(--fs-sm); }
/* 只作用于字段标签：写成 .share-form label 会因特异性更高，把身份卡片的 flex 覆盖成 block */
.share-form .share-field { display: block; color: var(--ink-2); font-size: var(--fs-sm); }
.share-form .share-field .required { color: var(--danger); font-size: var(--fs-xs); }
.share-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--s3) var(--s4);
}
.share-field--wide { grid-column: 1 / -1; }
/* author CSS 的 display:block 会盖掉 UA 的 [hidden]，必须显式隐藏 */
.share-field[hidden] { display: none !important; }
.share-audience { border: 0; padding: 0; margin: 0 0 var(--s4); }
.share-audience legend { padding: 0; margin-bottom: var(--s2); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600; }
.share-audience-opts { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s2); }
.share-audience-opt {
  display: flex; align-items: center; gap: 8px;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--surface); cursor: pointer;
}
.share-audience-opt:has(input:checked) { border-color: var(--accent); background: #f2f8ff; }
.share-audience-opt input { flex: 0 0 auto; margin: 0; }
.share-audience-opt strong { display: block; font-size: var(--fs-sm); color: var(--ink); white-space: nowrap; }
.share-form-error { margin: 0 0 var(--s3); }
.share-fine { margin: var(--s3) 0 0; font-size: var(--fs-xs); color: var(--ink-4); line-height: 1.7; }
/* 蜜罐：真人看不到，机器人会填 */
.share-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* 已报名 / 刚提交成功 */
.share-done { padding: var(--s5); }
.share-done-ico {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  margin-bottom: var(--s3);
  border-radius: 50%;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 17px;
}
.share-done h2 { margin-bottom: var(--s2); }
.share-done-line { margin: 0 0 var(--s4); color: var(--ink-2); font-size: var(--fs-sm); }
.share-done-list { margin: 0 0 var(--s4); display: grid; gap: var(--s2); }
.share-done-list div { display: flex; gap: var(--s3); font-size: var(--fs-sm); }
.share-done-list dt { flex: 0 0 96px; color: var(--ink-4); font-size: var(--fs-xs); padding-top: 2px; }
.share-done-list dd { margin: 0; color: var(--ink); }
.share-closed { padding: var(--s5); color: var(--ink-2); }

.share-foot { margin: 0; text-align: center; font-size: var(--fs-xs); color: var(--ink-4); line-height: 1.8; }

/* ---------- 报名凭证：保存图片 / 复制收藏 / 找回 ---------- */
.ticket-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin: 0 0 var(--s3); }
.ticket-actions .button, .ticket-actions button.primary { width: auto; }
.ticket-qr-src { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ticket-recall {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  padding: 12px var(--s4);
  border: 1px solid var(--line); border-left: 3px solid var(--teal);
  border-radius: var(--r); background: var(--surface);
}
.ticket-recall[hidden] { display: none; }
.ticket-recall strong { display: block; font-size: var(--fs-sm); }
.ticket-recall small { color: var(--ink-3); font-size: var(--fs-xs); }
.ticket-recall .button { flex: 0 0 auto; width: auto; }

.share-find { padding: var(--s5); }
.share-find-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: var(--s3); align-items: end; }
.share-find-form label { display: block; color: var(--ink-2); font-size: var(--fs-sm); }
.share-find-form button.primary { width: auto; white-space: nowrap; }

.ticket-modal {
  position: fixed; inset: 0; z-index: 120;
  display: flex; align-items: center; justify-content: center;
  padding: var(--s4); background: rgba(16, 42, 67, .62); overflow: auto;
}
.ticket-modal[hidden] { display: none; }
.ticket-modal-box {
  width: 100%; max-width: 430px; padding: var(--s4);
  border-radius: var(--r-lg); background: var(--surface); text-align: center;
}
.ticket-modal-box img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: var(--r); }
.ticket-modal-tip { margin: var(--s3) 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.7; }
.ticket-modal-actions { display: flex; gap: var(--s2); justify-content: center; }
.ticket-modal-actions .button { width: auto; }
.ticket-modal-box--sm { max-width: 380px; }
/* 需要比 .ticket-modal-box img 更高优先级，才能覆盖它的 width:100% */
.ticket-modal-box img.qr-large {
  display: block; width: min(320px, 76vw); height: auto;
  margin: 0 auto var(--s3); padding: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  image-rendering: pixelated;  /* 二维码保持锐利，别被浏览器糊掉 */
}

@media (max-width: 620px) {
  .ticket-actions > * { flex: 1 1 100%; text-align: center; }
  .share-find-form { grid-template-columns: 1fr; }
  .share-find-form button.primary { width: 100%; }
}

/* 家长端首页那条引导（点进去才报名，权限仍在班级与报名表上） */
.share-strip {
  display: flex;
  align-items: center;
  gap: var(--s3);
  margin: var(--s4) 0 0;
  padding: 12px var(--s4);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.share-strip:hover {
  border-color: var(--line-2);
  border-left-color: var(--accent-ink);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.share-strip-kicker {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: var(--r-pill);
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: var(--fs-xs);
}
.share-strip-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.share-strip-body strong { font-size: var(--fs-sm); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-strip-body small { font-size: var(--fs-xs); color: var(--ink-3); }
.share-strip-go { flex: 0 0 auto; font-size: var(--fs-xs); color: var(--accent-ink); }

/* 教师端：分享会名单页 */
.share-link-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--s4) var(--s5);
  align-items: center;
}
.share-link-main { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.share-link-card h2 { font-size: var(--fs-h2); margin-bottom: 2px; }
/* 右上角二维码：手机相机或微信扫一扫直接打开报名页 */
.share-qr { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.share-qr canvas {
  display: block;
  width: 148px;
  height: 148px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: #fff;
}
.share-link-row { display: flex; align-items: center; gap: var(--s2); flex-wrap: wrap; }
.share-link-row code {
  flex: 1 1 260px;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
  font-size: var(--fs-xs);
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .share-hero { padding: var(--s5) var(--s4); }
  .share-meta { grid-template-columns: 1fr; gap: var(--s3); }
  .share-grid { grid-template-columns: 1fr; }
  .share-audience-opts { grid-template-columns: 1fr; }
  .share-form, .share-done, .share-closed { padding: var(--s4); }
  .share-strip { flex-wrap: wrap; }
  .share-strip-body strong { white-space: normal; }
  /* 窄屏：链接在上、二维码在下居中，避免把链接挤成一条缝 */
  .share-link-card { grid-template-columns: 1fr; justify-items: start; }
  .share-qr { justify-self: center; }
}

/* ============================================================================
   错误页：下载失败、链接失效、无权限
   以前这些都吐 JSON，浏览器会存下一个 2.json 并提示「无法从网站上下载文件」，
   现在统一给一张能看懂的中文说明页。
   ============================================================================ */
.err-page {
  max-width: 480px;
  margin: clamp(40px, 9vh, 96px) auto;
  padding: var(--s6);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-align: center;
}
.err-code {
  margin: 0 0 var(--s2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: .18em;
  color: var(--accent-ink);
}
.err-page h1 { margin: 0 0 var(--s3); font-size: clamp(19px, 3vw, 23px); }
.err-msg { margin: 0 0 var(--s5); color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.8; }
.err-acts { display: flex; justify-content: center; gap: var(--s2); flex-wrap: wrap; }
.err-hint {
  margin: var(--s5) 0 0;
  padding-top: var(--s4);
  border-top: 1px solid var(--line);
  color: var(--ink-4);
  font-size: var(--fs-xs);
  line-height: 1.8;
}

/* 教师端导航角标：待审核家长数 */
.side-nav a .nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  vertical-align: 1px;
}

/* 顶部统计里的「N 个班级」可点，直接跳到班级列表 */
.mini-stats .mini-link {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dashed var(--line-2);
  padding-bottom: 1px;
}
.mini-stats .mini-link:hover { border-bottom-color: var(--accent); }
.mini-stats .mini-link:hover strong { color: var(--accent); }

/* 锚点跳转时给顶部导航留出空隙，别把标题挡住 */
#classes { scroll-margin-top: 96px; }

/* 经营数据：区块指标卡与紧凑表格 */
.ops-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: var(--s2);
  margin: var(--s3) 0 var(--s4);
}
.ops-metrics > div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
}
.ops-metrics strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.ops-metrics span { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--ink-3); }
.ops-table th, .ops-table td { padding-top: 8px; padding-bottom: 8px; white-space: nowrap; }
.ops-meta {
  margin: var(--s2) 0 var(--s3);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
.ops-alerts .alert-list { margin-top: var(--s3); }

/* 全站下拉框加回可见箭头：style.css 里 select 去掉了原生外观，
   不加箭头时和文本框长得一模一样，家长看不出「年级」可以选。 */
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' fill='none' stroke='%23627d98' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px 8px;
  padding-right: 34px;
}

/* ---------- 分享会报名名单：列宽更紧，状态与删除相邻 ---------- */
/* 学校、年级、身份这类短字段不折行，避免「太原师范」被拆成「太原师／范」 */
.share-table td.nowrap { white-space: nowrap; }
.share-notes-table td.nowrap { white-space: nowrap; }
/* 状态和删除两列压到最小宽度，多余空间让给前面的文本列，两列因此贴在一起 */
.share-table .cell-status { width: 1%; white-space: nowrap; }
.share-table .cell-status .form-inline { flex-wrap: nowrap; gap: 6px; }
/* 表格内联表单把 padding 重置过，会把下拉箭头压到文字上，单独留出箭头位 */
.share-table .cell-status select { padding-right: 26px; }
.share-table .cell-del { width: 1%; padding-left: 0; white-space: nowrap; }
/* 报名时间两行：日期一行、时间一行，列宽固定不折 */
.share-table .cell-time { white-space: nowrap; line-height: 1.32; color: var(--ink-2); }

/* 学生姓名：这一列原先没有 nowrap，被长校名挤压后一个字一行，补上后姓名整行显示 */
.share-table .cell-student { white-space: nowrap; }
/* 学校、年级收紧：左右内边距减半，把宽度让给姓名列 */
.share-table .cell-school,
.share-table .cell-grade { padding-left: 8px; padding-right: 8px; }
/* 长校名限宽 + 省略号，完整名称放在 title 里（悬停可见，CSV 导出仍是全称），不折行 */
.share-table .cell-school .school-text {
  display: block;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 年级只有三个字，收缩到内容宽度 */
.share-table .cell-grade { width: 1%; }

/* ---------- 想了解的问题：从名单里抽出来单独成表，长文本自动换行 ---------- */
/* 与上方报名名单表格拉开距离：.section-title:first-child 会把标题自身的 margin-top 归零，间距全靠这一条 */
.share-notes { margin-top: 40px; }
.share-notes[hidden] { display: none; }
.share-notes-table .note-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.55;
  min-width: 280px;
}

/* ---------- 家长端：自助绑定孩子 ---------- */
#children { scroll-margin-top: 96px; }
.child-add {
  margin-top: var(--s3);
  border: 1px dashed var(--line-2);
  border-radius: var(--r);
  background: var(--surface);
}
.child-add > summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  font-size: var(--fs-sm, 13px);
  color: var(--accent-ink);
  cursor: pointer;
  list-style: none;
}
.child-add > summary::-webkit-details-marker { display: none; }
.child-add[open] > summary { border-bottom: 1px dashed var(--line); }
.child-add-plus { font-size: 15px; line-height: 1; }
.child-add-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--s3);
  padding: 13px 14px;
  margin: 0;
  background: none;
  border: 0;
}
.child-add-field { display: flex; flex-direction: column; gap: 5px; min-width: 180px; }
.child-add-field > span { font-size: var(--fs-xs); color: var(--ink-4); }
.child-add-field input, .child-add-field select { width: 100%; }
.child-add-form button { flex: 0 0 auto; }

@media (max-width: 640px) {
  .child-add-form { flex-direction: column; align-items: stretch; }
  .child-add-field { min-width: 0; }
  .child-add-form button { width: 100%; }
}


/* ---------- 家长端课程页：上下单列布局（内容再长也不挤压、不留白） ---------- */
/* 仅作用于课程页，不影响共用 .two-columns 的教师端等其它页面 */
.course-stack { display: flex; flex-direction: column; gap: var(--s5); }
.course-stack > section { min-width: 0; }
/* 下半区（材料/媒体/提交）在宽屏下两栏并排，窄屏回落为单列。
   用 grid-template-areas 精确定位：避免 :nth-of-type 按标签类型计数而错选元素 */
.course-stack > section:last-child {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas:
    "mattitle mediatitle"
    "matlist  mediagrid"
    "submit   submit";
  column-gap: var(--s5);
  align-items: start;
}
.course-stack > section:last-child > :nth-child(1) { grid-area: mattitle; }
.course-stack > section:last-child > :nth-child(2) { grid-area: matlist; }
.course-stack > section:last-child > :nth-child(3) { grid-area: mediatitle; }
.course-stack > section:last-child > :nth-child(4) { grid-area: mediagrid; }
.course-stack > section:last-child > :nth-child(5) { grid-area: submit; }
@media (max-width: 860px) {
  .course-stack > section:last-child { grid-template-columns: 1fr; grid-template-areas: none; }
  .course-stack > section:last-child > * { grid-area: auto !important; }
}

/* ---------- 教师端学员名单：转班工具条（只作用于本页，不影响其它表格） ---------- */
.transfer-bar { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-bottom: var(--s3); }
.transfer-bar .hint { margin: 0; flex: 1 1 240px; }
/* 全局 select 是 width:100%，这里覆盖掉，避免下拉撑满一行把按钮挤下去 */
.transfer-bar select { flex: 0 0 180px; width: 180px; min-width: 0; margin-top: 0; }
.transfer-bar button { flex: 0 0 auto; margin-top: 0; }
#enrollments .check-table input[type="checkbox"] { width: 15px; height: 15px; margin-top: 0; cursor: pointer; accent-color: var(--accent); }
#transfer-modal .modal-card label { display: block; margin: var(--s3) 0; }
#transfer-modal .modal-card select { width: 100%; }
#transfer-modal .modal-card .row-actions { display: flex; gap: var(--s2); }

/* ---------- 教师端班级列表：修改班级弹窗 ---------- */
#class-edit-modal .modal-card .hint { margin: 0; }
#class-edit-modal .modal-card label { display: block; margin: var(--s3) 0; }
#class-edit-modal .modal-card input,
#class-edit-modal .modal-card select { width: 100%; }
#class-edit-modal .modal-card .row-actions { display: flex; gap: var(--s2); }

/* ---------- 教师端学员名单：修改报名弹窗 ---------- */
#enroll-edit-modal .modal-card .hint { margin: 0; }
#enroll-edit-modal .modal-card label { display: block; margin: var(--s3) 0; }
#enroll-edit-modal .modal-card input { width: 100%; }
#enroll-edit-modal .modal-card .row-actions { display: flex; gap: var(--s2); }

/* ---------- 教师端学员名单：文字不换行、状态/操作按钮横排，压低行高 ---------- */
/* 操作列多了「修改」按钮，整表给足宽度，列宽不够时横向滚动而不是挤成一团 */
#enrollments .table-wrap table { min-width: 1060px; }
#enrollments .check-table th,
#enrollments .check-table td { white-space: nowrap; padding: 9px 12px; }
#enrollments .check-table th:first-child,
#enrollments .check-table td:first-child { width: 42px; padding-left: 12px; padding-right: 2px; }
#enrollments .check-table th:nth-child(2),
#enrollments .check-table td:nth-child(2) { min-width: 74px; }
/* 家长与班级两列挨紧一点 */
#enrollments .check-table th:nth-child(3),
#enrollments .check-table td:nth-child(3) { min-width: 112px; padding-right: 4px; }
#enrollments .check-table th:nth-child(4),
#enrollments .check-table td:nth-child(4) { min-width: 58px; padding-left: 4px; }
/* 报名档位是备注性质，长文本完整换行显示，不截断 */
#enrollments .plan-cell { display: inline-block; max-width: 132px; white-space: normal; overflow-wrap: anywhere; vertical-align: middle; line-height: 1.5; }
/* 状态下拉、修改、转班、删除同排；切换状态即自动提交 */
#enrollments td .form-inline { display: inline-flex; flex-wrap: nowrap; gap: 4px; }
#enrollments td .status-form { margin-right: 6px; }
#enrollments td .form-inline select { width: 68px; flex: 0 0 68px; }
/* 学习时间数据小一号，表头字号与其他列保持一致 */
#enrollments .check-table td:nth-child(7),
#enrollments .study-cell { font-size: 11px; letter-spacing: -.2px; }
#enrollments .check-table td:last-child > form { margin-left: 0; }
#enrollments .check-table td:last-child > button { margin-right: 6px; }

/* ---------- 删除操作：文字按钮 → 垃圾桶图标按钮 ---------- */
/* 表格操作列里「删除」两字连内边距约占 50px，换成 30px 图标后每行省约 20px，
   让给姓名、学校、报名时间这些真正需要宽度的列。
   图标形状沿用细线垃圾桶（盖 + 提手 + 两道竖线），线条用 currentColor 跟随
   浅色主题；参考图是深色底白线，直接照搬白线在白底上会看不见。 */
button.small.btn-trash {
  width: 30px;
  height: 30px;
  padding: 0;
  flex: 0 0 30px;
  line-height: 1;
  vertical-align: middle;
}
button.btn-trash svg { width: 16px; height: 16px; display: block; }
/* 平时保持安静，悬停/聚焦才显红，避免整列都是警示色；点击前仍有 confirm 二次确认 */
button.btn-trash:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-soft);
}
button.btn-trash:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* 图标按钮没有文字，靠 title 悬停提示 + aria-label 供读屏/自动化识别 */
.share-table .cell-del { text-align: center; }
