/* 教培帝国 · 暖纸纹红金主题（原创风格，方向对齐同类经营模拟的视觉气质） */

:root {
  --paper: #f5efe1;
  --paper-deep: #ece2cd;
  --card: #fffaf0;
  --ink: #3b2f2a;
  --ink-soft: #7a6a5f;
  --red: #b23a2e;
  --red-deep: #8e2b22;
  --gold: #c9a24b;
  --green: #4a7c59;
  --danger: #c0392b;
  --radius: 14px;
  --shadow: 0 2px 8px rgba(59, 47, 42, 0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  background: var(--paper);
  background-image:
    repeating-linear-gradient(0deg, rgba(59, 47, 42, 0.025) 0 2px, transparent 2px 4px),
    radial-gradient(ellipse at 50% 0%, #f9f4e8 0%, var(--paper) 55%, var(--paper-deep) 100%);
  color: var(--ink);
  display: flex;
  justify-content: center;
  overflow-x: hidden; /* 真机窄屏防意外横向滚动 */
}

button { touch-action: manipulation; } /* 双击缩放/点击延迟防护（真机竖屏） */

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  /* 底栏占位：不能用 padding-bottom（内容超高时 #app 停留在视口高度、padding 被吞进盒内、溢出尾部贴底被固定底栏盖住——
     用 ::after 空件垫在内容尾部之后，短页长页都生效 */
}
#app::after {
  content: '';
  display: block;
  height: calc(76px + env(safe-area-inset-bottom));
  flex-shrink: 0;
}

.boot { text-align: center; padding: 40vh 0 0; color: var(--ink-soft); }

/* ── 顶栏 ─────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(180deg, #fffdf7 0%, #fbf5e6 100%);
  border-bottom: 2px solid var(--gold);
  padding: 10px 14px 8px;
  box-shadow: var(--shadow);
}
.topbar-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--red-deep);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}
.status-pill {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  background: #fff8e6;
  color: var(--ink-soft);
  white-space: nowrap;
}
.status-pill.waiting { border-color: var(--red); color: var(--red); background: #fdeeea; font-weight: 600; }
.status-pill.paused { border-color: #b58a4a; color: #8a6d1f; background: #faf0d8; font-weight: 800; }
.status-pill.paused::before { content: '⏸ '; }
.speed-group { display: flex; gap: 4px; }
.speed-btn {
  font-size: 11px;
  padding: 3px 7px;
  min-height: 40px; /* 真机触控目标 ≥40px（原 23px 过小） */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--paper-deep);
  background: var(--card);
  color: var(--ink-soft);
  cursor: pointer;
}
.speed-btn.active { background: var(--red); border-color: var(--red); color: #fff; font-weight: 700; }
.speed-btn.locked { opacity: 0.45; cursor: not-allowed; }

.topbar-row2 {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 5px 4px;
  border-radius: 10px;
  background: var(--card);
  border: 1px solid var(--paper-deep);
  box-shadow: var(--shadow);
}
.chip .label { font-size: 10px; color: var(--ink-soft); }
.chip .value { font-size: 13px; font-weight: 700; white-space: nowrap; }
.chip.chip-date { flex: 1.7; }
.chip.chip-date .value { font-size: 12px; }
.chip .value.funds { color: var(--red); }
.chip .value.rep { color: var(--gold); }
.chip .value.deficit { color: var(--danger); }
.chip-date .week-tag { font-size: 10px; color: var(--ink-soft); font-weight: 400; margin-left: 2px; }

/* ── 时间流逝进度条（顶栏底部，反映当月周进度） ── */
.time-flow { margin-top: 8px; }
.tf-track {
  height: 6px;
  border-radius: 3px;
  background: rgba(142, 43, 34, 0.10);
  overflow: hidden;
}
.tf-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--gold), var(--red));
  transition: width 0.35s linear;
}

/* ── 主区 ─────────────────────────── */
.main { flex: 1; padding: 12px 14px; }
.page-title { font-size: 15px; font-weight: 700; color: var(--red-deep); margin-bottom: 10px; }
.page-title small { color: var(--ink-soft); font-weight: 400; font-size: 11px; margin-left: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.stat-card {
  background: var(--card);
  border: 1px solid var(--paper-deep);
  border-radius: var(--radius);
  padding: 10px 6px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-card .num { font-size: 16px; font-weight: 800; color: var(--red-deep); }
.stat-card .cap { font-size: 10px; color: var(--ink-soft); margin-top: 2px; }

.campus-frame {
  position: relative;
  border-radius: var(--radius);
  border: 2px solid var(--gold);
  background:
    linear-gradient(180deg, rgba(201, 162, 75, 0.10), rgba(201, 162, 75, 0.02)),
    repeating-linear-gradient(45deg, rgba(178, 58, 46, 0.03) 0 12px, transparent 12px 24px),
    var(--card);
  padding: 14px;
  box-shadow: var(--shadow);
}
.campus-frame .campus-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.campus-name { font-weight: 800; font-size: 16px; color: var(--red-deep); }
.campus-level { font-size: 11px; color: var(--gold); font-weight: 700; }
.building-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.building {
  border: 1px dashed var(--paper-deep);
  border-radius: 12px;
  background: #fffef9;
  padding: 14px 8px;
  text-align: center;
}
.building .icon { font-size: 30px; }
.building .name { font-size: 12px; font-weight: 600; margin-top: 6px; }
.building .lv { font-size: 10px; color: var(--ink-soft); margin-top: 2px; }

.hint {
  margin-top: 12px;
  font-size: 11px;
  color: var(--ink-soft);
  text-align: center;
}

.placeholder-page {
  padding: 60px 0;
  text-align: center;
  color: var(--ink-soft);
  font-size: 13px;
}
.placeholder-page .big { font-size: 40px; display: block; margin-bottom: 10px; }

/* ── 全屏等待横幅 ─────────────────── */
.wait-banner {
  position: fixed;
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: calc(90px + env(safe-area-inset-bottom));
  z-index: 30;
  width: min(440px, calc(100% - 28px));
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: 0 4px 16px rgba(142, 43, 34, 0.4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.wait-banner .txt .t1 { font-weight: 800; font-size: 15px; }
.wait-banner .txt .t2 { font-size: 11px; opacity: 0.85; margin-top: 2px; }
.wait-banner button {
  border: none;
  border-radius: 10px;
  padding: 9px 14px;
  min-height: 44px; /* 真机主 CTA ≥44px（原 37px） */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  background: #fff;
  color: var(--red-deep);
  cursor: pointer;
  white-space: nowrap;
}

/* ── 底栏 ─────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: 100%;
  max-width: 480px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(8, 1fr); /* M28：加「排行榜」后 8 项一行不换行（原 7 列导致第 8 项掉行） */
  background: linear-gradient(0deg, #fffdf7 0%, #fbf5e6 100%);
  border-top: 2px solid var(--gold);
  box-shadow: 0 -2px 8px rgba(59, 47, 42, 0.10);
  padding-bottom: env(safe-area-inset-bottom); /* 苹果 Home 条安全区：底栏整体上移 */
}
.nav-item {
  padding: 6px 0 7px; /* M28：8 项一行，紧凑化 */
  text-align: center;
  font-size: 9px;
  color: var(--ink-soft);
  cursor: pointer;
  touch-action: manipulation;
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
  min-width: 0;
}
.nav-item .nlabel { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nicon { font-size: 16px; }
.nav-item.active { color: var(--red); font-weight: 700; }
.nav-item.active .nicon { transform: scale(1.12); }

/* ── 招生页 ─────────────────────── */
.adm-section {
  background: var(--card);
  border: 1px solid var(--paper-deep);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.adm-cap { font-size: 11px; color: var(--ink-soft); margin-bottom: 8px; }
.adm-cap .hire-btn.open-all {
  margin-left: 8px;
  min-height: 30px;
  padding: 2px 10px;
  font-size: 11px;
  border: 1px solid var(--gold);
  background: #fff8e6;
  color: var(--red-deep);
  border-radius: 999px;
  white-space: nowrap;
}
.slider-row { display: flex; align-items: center; gap: 10px; }
.slider-row input[type='range'] { flex: 1; accent-color: var(--red); height: 22px; }
.slider-val { font-size: 13px; font-weight: 700; color: var(--red-deep); min-width: 52px; text-align: right; }
.opt-row { display: flex; gap: 8px; margin-bottom: 8px; }
.opt-row .opt-btn { flex: 1; }
.opt-btn {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: flex-start;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1.5px solid var(--paper-deep);
  background: #fffef9;
  cursor: pointer;
  text-align: left;
  width: 100%;
  margin-bottom: 0;
}
.opt-row .opt-btn { width: auto; margin-bottom: 0; }
.adm-section > .opt-btn { margin-bottom: 8px; }
.opt-btn.on { border-color: var(--red); background: #fdeeea; }
.opt-btn.off, .opt-btn[disabled] { opacity: .45; cursor: not-allowed; filter: grayscale(.4); }
.opt-btn .opt-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.opt-btn.on .opt-name { color: var(--red-deep); }
.opt-btn .opt-sub { font-size: 10px; color: var(--ink-soft); }
.predict-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.predict-card {
  background: #fff8e6;
  border: 1px solid var(--gold);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
}
.predict-card .num { font-size: 15px; font-weight: 800; color: var(--red-deep); }
.predict-card .cap { font-size: 10px; color: var(--ink-soft); margin-top: 2px; }
.primary-btn {
  width: 100%;
  padding: 13px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--red) 0%, var(--red-deep) 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(142, 43, 34, 0.35);
}
.primary-btn.warn { background: linear-gradient(135deg, #d68a32 0%, #b06a1e 100%); }

/* ── 师资 ─────────────────────── */
.teacher-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr)); gap: 8px; margin-bottom: 4px; }
.teacher-grid > * { min-width: 0; } /* 窄视口修复：教师卡内容不可收缩会把第二列推出右边界 */
@media (max-width: 380px) { .teacher-grid { grid-template-columns: 1fr; } }
.detail-head { display: flex; align-items: center; gap: 10px; margin: 2px 0 12px; }
.detail-title { font-size: 17px; font-weight: 900; color: var(--red-deep); }
.t-card {
  border: 1px solid var(--paper-deep);
  border-radius: 10px;
  background: #fffef9;
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.t-card.cand { border-style: dashed; }
.t-row1 { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.t-name { font-size: 13px; font-weight: 700; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.t-trait { font-size: 10px; color: var(--gold); border: 1px solid var(--gold); border-radius: 999px; padding: 1px 6px; white-space: nowrap; }
.t-sub { font-size: 10px; color: var(--ink-soft); }
.g-badge {
  font-size: 10px;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0; /* M26：窄屏不被压缩到不可见（真机候选卡定级消失根因） */
}
.g-d { background: #9a9a9a; }
.g-c { background: #4a7c59; }
.g-b { background: #3d6fa8; }
.g-a { background: #7a4fa3; }
.g-s { background: linear-gradient(135deg, #d4a017, #b23a2e); }
.t-bars { display: flex; flex-direction: column; gap: 2px; }
.stat-bar { display: flex; align-items: center; gap: 5px; font-size: 9px; color: var(--ink-soft); }
.sb-cap { width: 22px; }
.sb-track { flex: 1; height: 5px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }
.sb-fill { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--red)); border-radius: 999px; }
.sb-val { width: 20px; text-align: right; font-weight: 700; }
.hire-btn {
  border: none;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 7px;
  min-height: 40px; /* 真机触控目标 ≥40px（原 27px 过小） */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.empty-hint { font-size: 11px; color: var(--ink-soft); padding: 6px 0; }

/* ── M26 自绘下拉选择器（替代原生 select，与卡片/徽章风格一致） ── */
.pick-wrap { position: relative; flex: 1; min-width: 0; }
.pick-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--paper-deep);
  background: var(--card);
  border-radius: 10px;
  padding: 8px 10px;
  min-height: 40px; /* 真机触控目标 ≥40px */
  cursor: pointer;
  font-size: 12px;
  text-align: left;
}
.pick-btn.on { border-color: var(--gold); }
.pick-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; color: var(--ink); }
.pick-label.empty { color: var(--ink-soft); font-weight: 500; }
.pick-caret { color: var(--ink-soft); }
.pick-pop[hidden] { display: none; } /* M27 修复：display:flex 会覆盖 hidden 属性的 UA 隐藏样式 → 所有选项面板常驻平铺（真机杂乱根因） */
.pick-pop {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: auto; /* M27：不铺满窄容器（社团页同行按钮挤压） */
  min-width: min(300px, calc(100vw - 40px)); /* M27：选项完整可见 */
  max-height: 260px;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--paper-deep);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(59, 47, 42, 0.18);
  padding: 4px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.pick-opt {
  display: flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: transparent;
  border-radius: 8px;
  padding: 7px 8px;
  min-height: 40px; /* 触控友好 */
  cursor: pointer;
  text-align: left;
  font-size: 12px;
}
.pick-opt.on { background: var(--paper-deep); }
.pick-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.pick-opt-label { font-weight: 700; color: var(--ink); }
.pick-opt-sub { font-size: 10px; color: var(--ink-soft); }
.pick-check { color: var(--gold); font-weight: 800; }

/* ── M26 班级教师席位矩阵（两列布局：左科目+状态，右选择器） ── */
.seat-row { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--paper-deep); }
.seat-row:last-child { border-bottom: none; }
.seat-cap { width: 76px; flex-shrink: 0; display: flex; flex-direction: column; gap: 1px; font-size: 12px; }
.seat-cap b { color: var(--ink); line-height: 1.2; }
.seat-state { font-size: 9px; color: var(--ink-soft); }
.seat-state.on { color: var(--gold); font-weight: 700; }
.seat-matrix .pick-btn { min-height: 38px; padding: 6px 9px; }

/* ── 教学页 ─────────────────────── */
.class-card { text-align: left; cursor: pointer; font: inherit; }
.class-card.sel { border-color: var(--red); background: #fdeeea; }
.key-badge {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--gold), var(--red));
  border-radius: 5px;
  padding: 2px 5px;
  white-space: nowrap;
}
.spark { width: 100%; height: 30px; display: block; }
.spark-empty { font-size: 9px; color: var(--ink-soft); padding: 8px 0; text-align: center; }
.subject-bars { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.subject-bars .sb-track { height: 8px; }
.sb-diff { width: 38px; text-align: right; font-weight: 700; }
.sb-diff.up { color: var(--green); }
.sb-diff.down { color: var(--danger); }
.top-list { display: flex; flex-direction: column; gap: 6px; }
.top-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--paper-deep);
  border-radius: 8px;
  padding: 6px 8px;
  flex-wrap: wrap;
}
.top-row .rank { font-size: 10px; font-weight: 800; color: var(--gold); width: 22px; }
/* M28：均分/心态/标签独占第二行，姓名首行拿满宽度不再被截断 */
.top-row .t-sub { flex: 1 1 100%; order: 10; padding-left: 30px; }
.top-row .mini-tag { order: 11; }
.top-row .hire-btn { order: 9; margin-left: auto; }
.mini-tag {
  font-size: 9px;
  color: var(--ink-soft);
  border: 1px solid var(--paper-deep);
  border-radius: 999px;
  padding: 1px 6px;
  white-space: nowrap;
}
.hire-btn.ghost {
  background: #fff;
  color: var(--red-deep);
  border: 1.5px solid var(--red);
  padding: 4px 8px;
  font-size: 11px;
}
.hire-btn.ghost:disabled { border-color: var(--paper-deep); color: var(--ink-soft); cursor: not-allowed; }

/* ── 事件弹窗与待处理 ─────────── */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(60, 34, 20, 0.45);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 60;
  padding: 16px;
}
.event-modal {
  background: var(--paper);
  border: 2px solid var(--gold);
  border-radius: 14px;
  padding: 18px 20px 16px;
  width: 100%;
  max-width: 360px;
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 12px 32px rgba(60, 34, 20, 0.35);
  word-break: break-word;
  overflow-wrap: anywhere;
}
.ev-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.cat-tag {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  border-radius: 5px;
  padding: 2px 6px;
  white-space: nowrap;
}
.cat-parent { background: #b5654a; }
.cat-teacher { background: #4a7fb5; }
.cat-student { background: #3e8e5a; }
.cat-check { background: #8a6d3b; }
.cat-biz { background: #4a7a5c; }
.cat-rival { background: #8b3a62; }
.cat-research { background: #5a5a8e; }
.imp-tag {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: var(--danger);
  border-radius: 5px;
  padding: 2px 6px;
}
.ev-due { margin-left: auto; font-size: 9px; color: var(--ink-soft); }
.ev-title { font-size: 16px; font-weight: 900; color: var(--red-deep); margin: 0 0 6px; }
.ev-text { font-size: 11px; line-height: 1.6; color: var(--ink); margin: 0 0 10px; overflow-wrap: anywhere; }
.ev-options { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.ev-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  font: inherit;
  text-align: left;
  border: 1.5px solid var(--paper-deep);
  border-left-width: 4px;
  border-radius: 8px;
  padding: 10px 12px;
  background: #fff;
  cursor: pointer;
}
.ev-option:active { transform: scale(0.99); }
.ev-option.tone-good { border-left-color: #3e8e5a; }
.ev-option.tone-mid { border-left-color: #4a7fb5; }
.ev-option.tone-default { border-left-color: #b58a4a; }
.ev-option.tone-quit { border-left-color: #999; }
.ev-option.disabled { opacity: 0.45; cursor: not-allowed; }
.ov-label { font-size: 13px; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; }
.ov-desc { font-size: 10px; color: var(--ink-soft); overflow-wrap: anywhere; }
.ev-option.ov-default { border-color: #c9a24a; box-shadow: inset 0 0 0 1px #c9a24a; }
.ov-default-tag {
  font-size: 9px;
  font-weight: 700;
  color: #8a6d1f;
  background: #faf0d8;
  border: 1px solid #e3c98a;
  border-radius: 4px;
  padding: 1px 5px;
  margin-top: 2px;
  white-space: nowrap;
}
.ev-foot { display: flex; justify-content: flex-end; }
.ev-snooze {
  font: inherit;
  font-size: 10px;
  border: none;
  background: none;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
  padding: 4px;
}
.pending-list { display: flex; flex-direction: column; gap: 6px; }
.pending-row {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px dashed var(--paper-deep);
  border-radius: 8px;
  padding: 6px 8px;
}
.pending-row .pd-title { flex: 1; font-size: 12px; font-weight: 700; }
.pending-row .pd-due { font-size: 9px; color: var(--ink-soft); white-space: nowrap; }

/* ── 校区与设施（M6） ─────────── */
.upgrade-card {
  border: 1.5px solid var(--gold);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 10px;
  background: #fffdf5;
}
.up-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.up-name { font-size: 15px; font-weight: 900; color: var(--red-deep); }
.up-cap { font-size: 11px; color: var(--ink-soft); }
.upgrade-btn {
  width: 100%;
  font: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  border: 1.5px solid var(--red);
  background: #fdeeea;
  color: var(--red-deep);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
}
.upgrade-btn .opt-name { font-size: 13px; font-weight: 800; }
.upgrade-btn .opt-sub { font-size: 10px; color: var(--ink-soft); }
.facility-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.facility {
  border: 1.5px solid var(--paper-deep);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
}
.facility.done { border-color: var(--green); background: #f2f9f2; }
.facility.locked { opacity: 0.55; }
.facility .ficon { font-size: 22px; }
.facility .fname { font-size: 12px; font-weight: 800; }
.facility .fdesc { font-size: 9px; color: var(--ink-soft); line-height: 1.4; min-height: 24px; }
.facility .fstate { font-size: 10px; font-weight: 700; color: var(--ink-soft); }
.facility .fstate.ok { color: var(--green); }
.facility .hire-btn.ghost { width: 100%; }

/* ── toast ───────────────────────── */
/* ── toast ───────────────────────── */
.toast-stack {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  z-index: 99;
}
.toast {
  background: rgba(59, 47, 42, 0.92);
  color: #fff;
  font-size: 12px;
  padding: 9px 16px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  transform: translateY(20px);
  max-width: 80%;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ===== M7 荣誉页 ===== */
.report-card { background: linear-gradient(180deg, #fffdf8, #fdf6e9); border: 1px solid #e8d9b8; border-radius: 14px; padding: 12px; }
.report-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 10px 0; }
.report-grid .stat-card { padding: 10px 4px; }
.report-grid .num { font-size: 20px; }
.report-grid .cap { font-size: 11px; }
.valedictorian { display: flex; align-items: center; gap: 10px; background: #fff7e6; border: 1px solid #e9c46a; border-radius: 10px; padding: 10px; margin-bottom: 8px; }
.vc-crown { font-size: 22px; }
.vc-name { font-weight: 700; color: #8c2f1b; }
.vc-sub { font-size: 11px; color: #8a7a5c; }
.admit-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin: 8px 0 10px; }
.admit { border: 1.5px solid #d8c49a; background: #fbf3df; border-radius: 9px; min-height: 44px; padding: 4px; font-size: 11px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.admit .ad-seal { font-size: 15px; color: #a0522d; font-weight: 700; }
.admit.open { background: #fff; border-color: #c9a86a; }
.admit.star { border-color: #d4a017; background: #fff9e3; }
.ad-name { font-weight: 600; color: #5b4632; }
.ad-score { color: #8c2f1b; font-weight: 700; }
.ad-tier { color: #8a7a5c; font-size: 10px; }
.rank-row { display: flex; align-items: baseline; gap: 12px; margin-top: 6px; }
.rank-big { font-size: 26px; font-weight: 800; color: #8c2f1b; }
.rank-sub { color: #6b5b3e; font-size: 12px; }
.rank-strength { margin-left: auto; color: #8a7a5c; font-size: 11px; }
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.wall-card { background: #fffdf6; border: 1px solid #e5d5b3; border-radius: 10px; padding: 8px; }
.w-year { font-weight: 700; color: #7a5c2e; font-size: 12px; }
.w-top { font-size: 12px; color: #8c2f1b; font-weight: 600; margin: 2px 0; }
.w-stats, .w-rank { font-size: 11px; color: #8a7a5c; }
.stage-list { margin-top: 6px; }
.stage-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px; font-size: 13px; }
.stage-row.done { color: #8a7a5c; }
.stage-row.now { background: #fff7e6; border: 1px solid #e9c46a; font-weight: 700; color: #5b4632; }
.stage-row.lock { color: #b8ab90; }
.st-mark { width: 20px; text-align: center; }
.st-desc { flex: 1; }
.st-reward { font-size: 11px; color: #a0522d; }
.stage-row.lock .st-reward { color: #c0b49a; }
.milestone-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border-radius: 8px; font-size: 13px; color: #8a7a5c; }
.milestone-row.done { color: #6b7f4a; background: #f3f7ea; }

/* ===== M8 集团页 ===== */
.partner-card { background: #fffdf8; border: 1px solid #e5d5b3; border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.p-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.p-name { font-weight: 700; color: #5b4632; }
.p-quality { font-size: 12px; color: #8c2f1b; }
.q-bar { height: 6px; background: #efe4cb; border-radius: 3px; overflow: hidden; margin-bottom: 8px; }
.q-fill { height: 100%; background: linear-gradient(90deg, #d4a017, #a0522d); border-radius: 3px; }
.p-row { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: #6b5b3e; }
.p-row > span:first-child { width: 62px; color: #8a7a5c; }
.tier-btn { border: 1px solid #d8c49a; background: #fbf3df; border-radius: 7px; padding: 3px 10px; font-size: 12px; cursor: pointer; color: #6b5b3e; }
.tier-btn.active { background: #8c2f1b; color: #fff; border-color: #8c2f1b; }
.principal-select { flex: 1; border: 1px solid #d8c49a; border-radius: 8px; padding: 5px; font-size: 12px; background: #fff; color: #5b4632; }
.offer-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 10px; border: 1px dashed #d8c49a; border-radius: 10px; margin-bottom: 8px; }
.o-name { font-weight: 600; color: #5b4632; margin-right: 8px; }
.o-quality { font-size: 12px; color: #8a7a5c; }
.lock-hint { border: 1px dashed #d8c49a; border-radius: 12px; padding: 16px; margin-top: 10px; text-align: center; }

/* ===== M9 模拟广告 ===== */
.ad-mask { position: fixed; inset: 0; background: rgba(30, 20, 10, 0.72); z-index: 300; display: flex; align-items: center; justify-content: center; }
.ad-box { width: min(88vw, 360px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); overflow-y: auto; -webkit-overflow-scrolling: touch; background: linear-gradient(160deg, #3b2a18, #5b3d1e); border: 2px solid #d4a017; border-radius: 16px; padding: 22px 18px; color: #f7ecd8; text-align: center; }
.ad-tag { display: inline-block; background: #d4a017; color: #3b2a18; font-size: 11px; font-weight: 700; border-radius: 20px; padding: 2px 10px; margin-bottom: 10px; }
.ad-title { font-size: 20px; font-weight: 800; letter-spacing: 1px; }
.ad-sub { font-size: 12px; opacity: 0.8; margin: 6px 0 16px; }
.ad-progress { height: 6px; background: rgba(255,255,255,0.18); border-radius: 3px; overflow: hidden; }
.ad-bar { height: 100%; background: linear-gradient(90deg, #d4a017, #f0c96a); width: 0; }
.ad-count { font-size: 12px; opacity: 0.85; margin: 10px 0; min-height: 16px; }
.ad-skip { border: 1.5px solid rgba(255,255,255,0.4); background: transparent; color: rgba(255,255,255,0.5); border-radius: 20px; padding: 8px 22px; font-size: 13px; cursor: not-allowed; }
.ad-skip.ready { border-color: #f0c96a; color: #3b2a18; background: #f0c96a; font-weight: 700; cursor: pointer; }
.ad-btn { position: relative; }
.ad-btn::after { content: 'AD'; position: absolute; top: 6px; right: 8px; font-size: 9px; font-weight: 700; color: #d4a017; border: 1px solid #d4a017; border-radius: 4px; padding: 0 3px; }

/* 解约按钮（M10） */
.fire-btn { margin-left: auto; border: 1px solid #e8b4b0; background: transparent; color: #c66; border-radius: 8px; font-size: 11px; padding: 2px 8px; cursor: pointer; }
/* ===== M20 自建分校 / 校友网络 / 名师堂 ===== */
.branch-grid { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.branch-card { background: #fffdf8; border: 1px solid #e5d5b3; border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.b-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.b-name { font-weight: 700; color: #5b4632; }
.b-util { font-size: 12px; color: #4a7fb5; }
.b-util.stalled { color: #c0392b; font-weight: 700; }
.alum-card { background: #fdf9ef; border: 1px solid #e9dcc0; border-radius: 10px; padding: 7px 9px; display: flex; flex-direction: column; gap: 2px; }
.alum-card.hall { border-color: #d4a017; background: #fdf6e3; }
.a-name { font-size: 12px; font-weight: 700; color: #5b4632; }
.a-sub { font-size: 10px; color: #8a7a5c; }
.retire-btn { margin-left: auto; border: 1px solid #d4a017; background: #fdf3d8; color: #8a6d1f; border-radius: 8px; font-size: 11px; padding: 2px 8px; cursor: pointer; font-weight: 700; }

/* ===== M22 素质页·社团 & 校友会光荣榜 ===== */
.soc-progress { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.soc-prog-cell { background: #fbf3df; border: 1px solid #e5d5b3; border-radius: 9px; padding: 5px 8px; font-size: 11px; color: #5b4632; display: flex; align-items: center; gap: 4px; }
.soc-prog-ic { font-size: 14px; }
.soc-card .hint { margin: 2px 0 6px; }
.soc-level { margin-left: auto; font-size: 11px; font-weight: 700; border-radius: 8px; padding: 1px 8px; }
.soc-level.lv-0 { background: #f0e9da; color: #8a7a5c; }
.soc-level.lv-1 { background: #e7f1dc; color: #4a7a2f; }
.soc-level.lv-2 { background: #fdf3d6; color: #a06a1f; }
.soc-level.lv-3 { background: #f6e0d0; color: #a03a1b; }
.soc-stats { font-size: 12px; color: #6b5b3e; margin: 6px 0 4px; }
.soc-advisor { font-size: 11px; color: #4a7fb5; margin-bottom: 8px; }
.soc-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.fame-field { margin-top: 10px; }
.fame-field-cap { display: flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: #7a5c2e; margin-bottom: 2px; }
.alum-card.fame { border-color: #d4a017; background: #fdf8e8; }
.fire-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== M11 素材接入（无素材时零占位影响） ===== */
.t-avatar { width: 34px; height: 34px; border-radius: 50%; background-size: cover; background-position: center; border: 1.5px solid #d4a017; flex: none; }
.ev-art { height: 110px; border-radius: 10px; background-size: cover; background-position: center; margin-bottom: 10px; }
/* M11 补充接入：设施图/学员头像/家长说话人 */
.facility .ficon.img { width: 100%; height: 44px; border-radius: 8px; background-size: cover; background-position: center; }
.s-avatar { width: 26px; height: 26px; border-radius: 50%; background-size: cover; background-position: center; border: 1.5px solid #d4a017; flex: none; }
.ev-speaker { width: 26px; height: 26px; border-radius: 50%; background-size: cover; background-position: center; border: 1.5px solid #d4a017; flex: none; }
/* M12 新手引导 */
.tutorial { text-align: center; }
.tut-art { width: 150px; height: 190px; margin: 0 auto 8px; background-size: contain; background-position: center; background-repeat: no-repeat; }
.tut-dots { display: flex; justify-content: center; gap: 6px; margin: 10px 0 2px; }
.tut-dots .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--paper-deep); }
.tut-dots .dot.on { background: #b23a2e; }

/* ===== M12 素材补挂 ===== */
.ad-art { height: 110px; border-radius: 10px; background-size: cover; background-position: center; margin-bottom: 10px; border: 1px solid rgba(212,160,23,.5); }
.vc-badge { width: 44px; height: 44px; flex: none; background-size: contain; background-repeat: no-repeat; background-position: center; display: inline-block; }
.st-mark.st-medal { width: 22px; height: 22px; background-size: contain; background-repeat: no-repeat; background-position: center; display: inline-block; }
.about-card { display: flex; align-items: center; gap: 10px; padding: 14px; border-radius: 12px; background-color: #fbf3df; background-size: cover; }
.about-card .about-text { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.about-card .about-title { font-size: 17px; color: #8c2f1b; }
.about-card .about-sub { font-size: 11px; color: #5b4632; }
.about-card .about-mascot { width: 58px; height: 84px; flex: none; background-size: contain; background-repeat: no-repeat; background-position: center; border-radius: 8px; }
.admit:not(.open) .ad-seal { color: #fff7e0; text-shadow: 0 1px 2px rgba(90,30,10,.85); }

/* ===== M13 教培特色包 ===== */
.m13-dash { margin-top: 10px; }
.m13-cap { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 8px; flex-wrap: wrap; }
.m13-cap b { color: var(--red-deep); }
.m13-warn { font-size: 11px; color: #a0522d; background: #fff3d6; border: 1px solid #e5d5b3; border-radius: 8px; padding: 2px 8px; }
.m13-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.m13-cell { background: #fffdf8; border: 1px solid #e5d5b3; border-radius: 10px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; }
.m13-cell b { font-size: 16px; color: var(--red-deep); }
.m13-cell span { font-size: 10px; color: #8a7a5c; }
.share-bar { display: flex; height: 10px; border-radius: 6px; overflow: hidden; margin-top: 8px; border: 1px solid #e5d5b3; }
.share-seg { height: 100%; }
.share-legend { display: flex; flex-wrap: wrap; gap: 6px; font-size: 10px; color: #8a7a5c; margin-top: 4px; }
.badge-wall { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.badge { background: #f6efdd; border: 1px solid #e5d5b3; border-radius: 10px; padding: 8px 6px; text-align: center; display: flex; flex-direction: column; gap: 2px; opacity: 0.45; filter: grayscale(1); }
.badge.on { opacity: 1; filter: none; background: #fff9e3; border-color: #d4a017; }
.badge-icon { font-size: 20px; }
.badge-name { font-size: 12px; color: #5b4632; }
.badge-desc { font-size: 9px; color: #8a7a5c; }
.fame-star { font-size: 11px; color: #b8860b; background: #fff3d6; border: 1px solid #d4a017; border-radius: 8px; padding: 1px 6px; flex: none; }

/* —— M19 教研科技树 —— */
.research-grid { display: flex; flex-direction: column; gap: 10px; }
.research-branch { border: 1px solid #e4d9c4; border-radius: 10px; padding: 8px; background: #fffdf7; }
.research-branch-name { font-size: 13px; font-weight: 700; color: #6b4f2e; margin-bottom: 6px; }
.research-node { border: 1px solid #eadfca; border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; background: #fffaf0; }
.research-node.done { background: #f2f8ec; border-color: #9cc07a; }
.research-node.locked { opacity: 0.62; }
.rn-row1 { display: flex; align-items: center; gap: 6px; }
.rn-name { font-size: 12px; font-weight: 700; color: #5b4632; flex: 1; }
.rn-tag { font-size: 10px; border-radius: 8px; padding: 1px 6px; }
.rn-tag.ok { color: #3d7a24; background: #e9f4dd; border: 1px solid #9cc07a; }
.rn-desc { font-size: 11px; color: #6b5a40; margin-top: 2px; }
.rn-effect { font-size: 10px; color: #b8860b; margin-top: 2px; }
.rn-cost { font-size: 10px; color: #9a8767; margin-top: 2px; }
.research-node .opt-btn { margin-top: 6px; width: 100%; }

/* ===== M23 云排行榜 ===== */
.cloud-board .adm-cap { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cb-fold { border: 1px solid var(--line, #e0d6c8); background: #fff; border-radius: 6px; width: 26px; height: 26px; font-size: 12px; line-height: 1; cursor: pointer; color: var(--ink-soft, #8a7a63); }
.cb-tabs { display: flex; gap: 8px; margin: 8px 0; }
.cb-tabs .opt-btn { flex: 1; }
.cb-tier { display: flex; gap: 6px; margin: 0 0 8px; }
.tier-btn { flex: 1; padding: 7px 6px; border: 1px solid var(--line, #e0d6c8); background: #fff; border-radius: 8px; font-size: 12px; color: var(--ink, #3a3229); cursor: pointer; }
.tier-btn.on { border-color: var(--red, #c0392b); background: #fdeeea; color: var(--red-deep, #a02618); font-weight: 700; }
.cb-subhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.cb-refresh { font-size: 12px; padding: 4px 10px; }
.cb-list { display: flex; flex-direction: column; gap: 6px; }
.cb-row { display: block; padding: 7px 10px; background: #fff; border: 1px solid var(--line, #e0d6c8); border-radius: 8px; }
.cb-row.me { border-color: var(--red, #c0392b); background: #fdf2ef; box-shadow: inset 0 0 0 1px var(--red, #c0392b); }
.cb-main { display: flex; align-items: center; gap: 8px; }
.cb-detail { margin-top: 3px; font-size: 10px; color: var(--ink-soft, #8a7a63); line-height: 1.5; overflow-wrap: anywhere; }
.cb-rank { width: 30px; text-align: center; font-weight: 700; color: var(--ink-soft, #8a7a63); font-size: 13px; flex: none; }
.cb-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--ink, #3a3229); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cb-row.me .cb-name { color: var(--red-deep, #a02618); }
.cb-sub { font-size: 10px; color: var(--ink-soft, #8a7a63); flex: none; }
.cb-score { font-size: 13px; font-weight: 700; color: var(--red-deep, #a02618); flex: none; }
.cb-disclaimer { margin-top: 8px; font-size: 10px; }
.cb-rename { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 6px; }
.cb-rename .rename-input { flex: 1 1 100%; min-width: 0; padding: 8px 10px; border: 1px solid var(--line, #e0d6c8); border-radius: 8px; font-size: 13px; color: var(--ink, #3a3229); box-sizing: border-box; }
.cb-rename .opt-btn { flex: 1 1 40%; margin-bottom: 0; }

/* M23 放榜报告·云榜速报行 */
.cloud-flash { display: flex; align-items: center; gap: 6px 12px; flex-wrap: wrap; margin-top: 8px; padding: 7px 10px; background: #fdf6ee; border: 1px dashed var(--line, #e0d6c8); border-radius: 8px; font-size: 11px; color: var(--ink-soft, #8a7a63); }
.cloud-flash .cf-title { font-weight: 700; color: var(--ink, #3a3229); }
.cloud-flash .cf-item { white-space: nowrap; }

/* ── M23 成就页三 tab ── */
.honors-tabs { display: flex; gap: 6px; margin: 4px 0 10px; }
.honors-tab { flex: 1; padding: 9px 4px; border: 1.5px solid var(--line, #e0d6c8); border-radius: 10px; background: #fff; font-size: 13px; font-weight: 700; color: var(--ink-soft, #8a7a63); cursor: pointer; }
.honors-tab.on { background: linear-gradient(135deg, #c0392b 0%, #a02618 100%); color: #fff; border-color: var(--red-deep, #a02618); }

/* ── M23 放榜报告·督学点评与建议 ── */
.coach-block { margin-top: 10px; display: flex; flex-direction: column; gap: 8px; }
.coach-comment { background: #fdf6ee; border: 1px solid #ead9bd; border-radius: 10px; padding: 9px 11px; }
.coach-comment b { font-size: 12px; color: var(--gold, #b8860b); }
.coach-comment p { margin: 5px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--ink, #3a3229); }
.coach-advice { background: #f4f8f1; border: 1px solid #cfe0c3; border-radius: 10px; padding: 9px 11px; }
.coach-advice > b { font-size: 12px; color: #4a7a3a; }
.adv-row { display: flex; gap: 7px; margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--ink, #3a3229); }
.adv-icon { flex: none; }

/* ── M23 教师晋升答辩 ── */
.defense-board .defense-row { display: flex; flex-direction: column; gap: 6px; padding: 8px 10px; border: 1px solid var(--line, #e0d6c8); border-radius: 9px; margin-top: 7px; background: #fffef9; }
.defense-row .d-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.defense-row .d-main b { font-size: 13px; color: var(--ink, #3a3229); }
.defense-row .d-stats { font-size: 10.5px; color: var(--ink-soft, #8a7a63); line-height: 1.5; overflow-wrap: anywhere; }
.defense-row .d-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.defense-row .d-actions button { flex: 1 1 40%; min-width: 0; }

/* ── M23 班级主讲教师 ── */
.main-teacher select { width: 100%; margin-top: 4px; }
.report-grid.slim .stat-card .num { font-size: 15px; }

/* M27：社团选人框独占一行（用户建议——指派最优/撤下换行，框占满宽度选全教师） */
.soc-pick-row { flex: 1 1 100%; display: flex; margin-top: 6px; } /* 父 soc-actions 是 flex：必须 100% basis 才独占整行 */
.soc-pick-row .pick-wrap { flex: 1; }
.soc-actions-second { flex: 1 1 100%; margin-top: 6px; }

/* M28 八轮：排行榜官方主体模式（容器内）——面板入口按钮醒目、页面简洁 */
.official-board .cb-panel-btn.official-open {
  width: 100%;
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 800;
  margin: 10px 0 6px;
  box-shadow: 0 3px 10px rgba(140, 30, 25, 0.18);
}
.official-board .cb-subhead { justify-content: center; }
