:root {
  --bg: #05060f;
  --ink: #eaf0ff;
  --muted: #9fb0d6;
  --card: rgba(20, 30, 58, 0.55);
  --card-solid: rgba(16, 24, 48, 0.96);
  --line: rgba(255, 255, 255, 0.12);
  --shadow: 0 12px 34px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 18px rgba(0, 0, 0, 0.35);
  --pA: #ff6b6b;
  --pB: #ffa94d;
  --pC: #ffd43b;
  --pD: #51cf66;
  --pG: #4dabf7;
  --pW: #b197fc;
}

* { box-sizing: border-box; }

/* 背景色放在 html 上；body 透明，避免遮挡负层级的星空 #sky */
html { background: #04060f; }
html, body {
  margin: 0;
  padding: 0;
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Noto Sans CJK SC", system-ui, -apple-system,
               "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
  color: var(--ink);
  min-height: 100vh;
}
body { background: transparent; }

/* ---------- 星空背景 ---------- */
#sky {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 74% 10%, #2c4685 0%, rgba(44,70,133,0) 44%),
    radial-gradient(ellipse at 16% 78%, #1f3364 0%, rgba(31,51,100,0) 50%),
    radial-gradient(ellipse at 50% 118%, #17224d 0%, rgba(23,34,77,0) 62%),
    linear-gradient(160deg, #0e1b40 0%, #070d24 55%, #03040c 100%);
}
#sky .star {
  position: absolute;
  background: #fff;
  border-radius: 50%;
  opacity: .9;
  will-change: opacity, transform;
  animation: twinkle var(--dur, 3s) ease-in-out infinite;
}
#sky .star.big {
  box-shadow: 0 0 7px 1.5px rgba(200, 222, 255, .9);
  animation-name: twinkleBig;
}
@keyframes twinkle {
  0%, 100% { opacity: .12; transform: scale(.65); }
  50% { opacity: 1; transform: scale(1); }
}
@keyframes twinkleBig {
  0%, 100% { opacity: .35; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.15); }
}
/* 流星 */
#sky .shoot {
  position: absolute;
  left: -12%;
  width: 140px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.95));
  filter: drop-shadow(0 0 5px rgba(200, 225, 255, .9));
  opacity: 0;
  transform: rotate(22deg);
  animation: shoot 9s linear infinite;
}
@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(22deg); }
  4% { opacity: 1; }
  18% { opacity: 1; }
  22% { opacity: 0; transform: translate(58vw, 24vw) rotate(22deg); }
  100% { opacity: 0; transform: translate(58vw, 24vw) rotate(22deg); }
}
#sky .moon {
  position: absolute;
  top: 7%;
  right: 11%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 36% 34%, #fffdf0, #ffe9a8 58%, #f3cf78 100%);
  box-shadow: 0 0 46px 12px rgba(255, 233, 168, 0.32);
}
#sky .hills {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 26%;
  background:
    radial-gradient(120% 100% at 15% 100%, #0a1226 0%, rgba(10,18,38,0) 60%),
    radial-gradient(120% 100% at 80% 100%, #0a1226 0%, rgba(10,18,38,0) 60%),
    linear-gradient(180deg, rgba(8,14,30,0) 0%, #060a18 70%, #04060f 100%);
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(10, 16, 38, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
/* margin-right:auto 把身份切换与徽章推到右侧，同时保持 DOM 顺序（brand → 身份 → 徽章），
   这样手机端 flex-wrap 时身份切换能优先与品牌名同行 */
.brand-group { display: flex; align-items: center; gap: 16px; min-width: 0; flex-wrap: wrap; margin-right: auto; }
.brand { display: flex; align-items: center; gap: 14px; }
/* 程序所有者标识：顶栏金色胶囊 */
.owner-badge {
  font-size: 12.5px; letter-spacing: .5px; color: #e9cf86; white-space: nowrap;
  padding: 5px 13px; border-radius: 999px;
  background: rgba(255, 212, 59, .10); border: 1px solid rgba(255, 212, 59, .30);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .4);
  max-height: 40px; overflow: hidden;
  transition: opacity .2s ease, max-height .25s ease, padding .25s ease, margin .25s ease;
}
/* 向下翻阅时收起徽章（高度归零），把空间让给内容；回到顶部自动恢复 */
body.scrolled .owner-badge {
  opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0;
  border-top-width: 0; border-bottom-width: 0; pointer-events: none;
}
/* 徽章收起后，顺带清掉 flex 换行残留的行间距 */
body.scrolled .topbar { row-gap: 0; }
.logo {
  width: 42px; height: 42px; border-radius: 12px; flex: none;
  background: linear-gradient(160deg, #2a3f72, #0e1630);
  border: 1px solid rgba(255, 255, 255, 0.14);
  display: flex; align-items: flex-end; justify-content: center;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45); overflow: hidden;
}
.logo i {
  display: block; width: 20px; height: 26px; margin-bottom: 7px;
  background: #0b1330; border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px 2px 0 0; position: relative;
  background-image:
    linear-gradient(rgba(255,255,255,.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.18) 1px, transparent 1px);
  background-size: 6px 6px;
  box-shadow: 0 0 10px 1px rgba(177, 151, 252, .5);
}
.logo i::after {
  content: ""; position: absolute; inset: 3px;
  background:
    radial-gradient(circle, var(--pW) 1.3px, transparent 1.5px) 0 0 / 6px 6px,
    radial-gradient(circle, var(--pG) 1.3px, transparent 1.5px) 3px 3px / 6px 6px;
  opacity: .9;
}
.brand-text { min-width: 0; }
.brand-text h1 { font-size: 19px; margin: 0; letter-spacing: 0.3px; font-weight: 800; white-space: nowrap; }
/* 金色闪光：星空背诵城 与 学校名 共用，带流动光泽 */
.brand-text h1 .gold {
  background: linear-gradient(100deg, #ffe08a 0%, #ffd43b 22%, #fff6cf 48%, #ffb347 72%, #ffe08a 100%);
  background-size: 220% auto;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: goldShimmer 3.6s linear infinite;
  text-shadow: 0 1px 12px rgba(255, 201, 60, .22);
}
.brand-text h1 .dot { color: rgba(255, 212, 59, .55); margin: 0 2px; font-weight: 400; }
@keyframes goldShimmer { to { background-position: 220% center; } }
.brand-text .sub { font-size: 12.5px; margin: 2px 0 0; color: var(--muted); }

.role-switch {
  display: inline-flex; background: rgba(255,255,255,.08); border-radius: 999px; padding: 4px;
}
.role-btn {
  border: none; background: transparent; cursor: pointer;
  padding: 8px 18px; border-radius: 999px; font-size: 14px; color: var(--muted);
  font-weight: 600; transition: all .2s;
}
.role-btn.active { background: #fff; color: #1a2238; box-shadow: var(--shadow-sm); }

/* ---------- 班级切换 ---------- */
.class-tabs {
  display: flex; gap: 10px; padding: 16px 22px 4px; flex-wrap: wrap;
}
.class-tab {
  border: 1px solid var(--line); background: rgba(255,255,255,.06); cursor: pointer;
  padding: 9px 20px; border-radius: 12px; font-size: 14.5px; font-weight: 600;
  color: var(--muted); transition: all .2s;
}
.class-tab:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.class-tab.active {
  background: linear-gradient(135deg, var(--pG), var(--pW));
  color: #06101f; border-color: transparent; box-shadow: 0 8px 20px rgba(77, 171, 247, 0.35);
}

/* ---------- 主体 ---------- */
main { padding: 14px 22px 40px; }

.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px; margin: 8px 2px 14px; flex-wrap: wrap;
}
.section-head h2 { font-size: 17px; margin: 0; }
.section-head .hint { font-size: 13px; color: var(--muted); }

.search-bar {
  display: flex; gap: 10px; margin: 4px 2px 16px; flex-wrap: wrap; align-items: center;
}
.search-bar input {
  flex: 1 1 260px; min-width: 200px; padding: 11px 14px; border-radius: 12px;
  border: 1px solid var(--line); font-size: 15px; outline: none;
  background: rgba(255,255,255,.06); color: var(--ink);
}
.search-bar input::placeholder { color: rgba(159,176,214,.65); }
.search-bar input:focus { border-color: var(--pG); box-shadow: 0 0 0 3px rgba(77,171,247,.2); }
.btn {
  border: none; cursor: pointer; border-radius: 12px; padding: 11px 18px;
  font-size: 14px; font-weight: 600; transition: all .15s;
  font-family: inherit; line-height: 1.35; white-space: nowrap;
}
.btn.primary { background: linear-gradient(135deg, var(--pG), var(--pW)); color: #06101f; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: rgba(255,255,255,.1); color: var(--ink); }
.btn.ghost:hover { background: rgba(255,255,255,.18); }
.btn.small { padding: 7px 13px; font-size: 13px; border-radius: 10px; }

/* ---------- 老师端工具栏折叠（手机端） ---------- */
/* 桌面端：折叠容器不产生盒子，按钮照旧平铺在 .search-bar 里；开关按钮隐藏 → 版面与原来一致 */
.tools { display: contents; }
.tools-toggle { display: none; }
@media (max-width: 620px) {
  .search-bar { gap: 8px; }
  .tools-toggle {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; background: rgba(255,255,255,.09); border: 1px solid var(--line);
  }
  .tools { display: none; }                       /* 手机端默认收起 */
  .search-bar.tools-open .tools {                 /* 点开后才铺出来 */
    display: flex; flex-wrap: wrap; gap: 8px; width: 100%;
  }
  .tt-arrow { font-size: 11px; transition: transform .2s; }
  .search-bar.tools-open .tt-arrow { transform: rotate(180deg); }

  /* 顶栏手机端紧凑化：品牌名与身份切换同行，徽章另起一行且翻阅时收起 */
  .topbar { padding: 6px 10px; gap: 4px 8px; }
  .brand-group { gap: 6px; margin-right: auto; }
  .brand { gap: 8px; }
  .logo { width: 26px; height: 26px; border-radius: 8px; }
  .logo i { width: 12px; height: 16px; margin-bottom: 4px; background-size: 4px 4px; }
  .logo i::after { inset: 2px; background-size: 4px 4px; }
  .brand-text h1 { font-size: 14px; letter-spacing: 0; }
  .brand-text .sub { display: none; }              /* 副标题在手机上纯装饰，隐藏省一行 */
  .owner-badge { font-size: 10px; padding: 2px 8px; letter-spacing: .2px; }
  .role-switch { padding: 3px; }
  .role-btn { padding: 4px 10px; font-size: 12px; }
  .class-tabs { padding: 10px 12px 2px; gap: 8px; }
  .class-tab { padding: 7px 14px; font-size: 13.5px; }
}

/* ---------- 找学生（老师端搜索） ---------- */
.find-bar {
  display: flex; gap: 10px; align-items: center; margin: 2px 2px 12px; flex-wrap: wrap;
}
.find-input { flex: 1 1 260px; min-width: 180px; }
.find-count { font-size: 13px; color: var(--pG); white-space: nowrap; }
.stu-card .name-row { gap: 7px; }
.stu-card .name { flex: 1 1 auto; }
.stu-card .mini-stat { margin-left: auto; font-size: 12px; color: var(--muted); }
.stu-no {
  flex: 0 0 auto; min-width: 22px; height: 18px; padding: 0 5px; border-radius: 6px;
  font-size: 11px; line-height: 18px; text-align: center; font-weight: 700;
  background: rgba(255, 212, 59, .16); color: #ffd43b;
}

/* ---------- 身份徽章（组长 / 组员 / 课代表） ---------- */
.role-tag {
  flex: 0 0 auto; font-size: 11px; font-weight: 800; line-height: 1; padding: 3px 7px;
  border-radius: 999px; white-space: nowrap;
}
/* 组员：素色小标，不抢眼 */
.role-tag.member {
  background: rgba(159, 176, 214, .14); color: var(--muted);
  border: 1px solid rgba(159, 176, 214, .28);
}
/* 组长：金色描边 + 柔光 */
.role-tag.leader {
  color: #ffe08a; background: rgba(255, 200, 70, .14);
  border: 1px solid rgba(255, 200, 70, .55);
  text-shadow: 0 0 6px rgba(255, 200, 70, .9);
  box-shadow: 0 0 8px rgba(255, 200, 70, .45), inset 0 0 6px rgba(255, 200, 70, .25);
  animation: goldGlow 2.6s ease-in-out infinite;
}
/* 课代表：更亮的金 + 更强闪光，明显盖过组长 */
.role-tag.rep {
  color: #fff6d6; background: linear-gradient(180deg, rgba(255, 222, 120, .28), rgba(255, 184, 40, .18));
  border: 1px solid rgba(255, 224, 130, .85);
  text-shadow: 0 0 9px rgba(255, 224, 130, 1), 0 0 16px rgba(255, 200, 70, .9);
  box-shadow: 0 0 14px rgba(255, 210, 90, .8), 0 0 26px rgba(255, 190, 50, .5),
              inset 0 0 10px rgba(255, 224, 130, .4);
  animation: goldGlowStrong 1.9s ease-in-out infinite;
}
@keyframes goldGlow {
  0%, 100% { box-shadow: 0 0 7px rgba(255, 200, 70, .4), inset 0 0 5px rgba(255, 200, 70, .2); }
  50%      { box-shadow: 0 0 13px rgba(255, 200, 70, .7), inset 0 0 8px rgba(255, 200, 70, .35); }
}
@keyframes goldGlowStrong {
  0%, 100% { box-shadow: 0 0 12px rgba(255, 210, 90, .7), 0 0 22px rgba(255, 190, 50, .4), inset 0 0 8px rgba(255, 224, 130, .35); }
  50%      { box-shadow: 0 0 20px rgba(255, 220, 110, 1), 0 0 36px rgba(255, 195, 55, .7), inset 0 0 14px rgba(255, 228, 140, .6); }
}
@media (prefers-reduced-motion: reduce) {
  .role-tag.leader, .role-tag.rep { animation: none; }
}

/* ---------- 快速点名 ---------- */
.modal.roll { max-width: 720px; max-height: 90vh; overflow-y: auto; }
.roll-body { margin-top: 14px; }
.roll-stat {
  font-size: 15px; margin: 12px 0 10px; line-height: 1.6;
}
.roll-stat b { color: #fff; }
.roll-stat .roll-hit { color: #ffd43b; font-size: 17px; }
.roll-bar {
  margin-top: 8px; height: 7px; border-radius: 99px; overflow: hidden;
  background: rgba(255, 255, 255, .1);
}
.roll-bar i {
  display: block; height: 100%; border-radius: 99px; transition: width .3s ease;
  background: linear-gradient(90deg, #4dabf7, #ffd43b);
}
.roll-tools { display: flex; gap: 9px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.roll-search { flex: 1 1 200px; width: auto; }
.roll-check {
  display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: var(--muted); white-space: nowrap; cursor: pointer;
}
.roll-check input { accent-color: var(--pG); width: 15px; height: 15px; }
.roll-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; padding-right: 2px; }
.roll-row {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer;
  border-radius: 11px; border: 1px solid var(--line); background: rgba(255, 255, 255, .04);
  transition: background .15s, border-color .15s;
}
.roll-row:hover { background: rgba(255, 255, 255, .08); }
.roll-row.done { background: rgba(77, 171, 247, .12); border-color: rgba(77, 171, 247, .3); }
.roll-idx {
  flex: 0 0 26px; text-align: center; font-size: 12px; font-weight: 700;
  color: #ffd43b; opacity: .85;
}
.roll-name { flex: 1 1 auto; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roll-prog { flex: 0 0 auto; font-size: 12px; color: var(--muted); }
.roll-btn {
  flex: 0 0 auto; min-width: 82px; border: none; cursor: pointer; font-size: 13px;
  font-weight: 700; padding: 7px 12px; border-radius: 9px; transition: all .15s;
  background: rgba(255, 255, 255, .1); color: var(--muted);
}
.roll-btn.on { background: linear-gradient(135deg, #4dabf7, #74c0fc); color: #06101f; }

@media (max-width: 520px) {
  .roll-list { max-height: 60vh; }
  .roll-row { padding: 10px 10px; gap: 8px; }
  .roll-btn { min-width: 72px; font-size: 12.5px; padding: 7px 9px; }
  .roll-prog { display: none; }
}

/* ---------- 学生卡片网格 ---------- */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(214px, 1fr));
}
.stu-card {
  background: var(--card); border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow-sm); border: 1px solid var(--line);
  backdrop-filter: blur(6px);
  display: flex; flex-direction: column; gap: 10px; transition: all .2s;
}
.stu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: rgba(255,255,255,.22); }
/* 搜索过滤：.stu-card 自带 display:flex，必须显式覆盖 hidden 才能真正隐藏 */
.stu-card[hidden] { display: none; }
.stu-card .name-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.stu-card .name { font-size: 15.5px; font-weight: 700; }
.stu-card .mini-stat { font-size: 12px; color: var(--muted); }
/* 星光热度：老师端 / 家长端都放在卡片底部（避开顶部最终大皇冠） */
.watch-chip {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 3px 8px;
  border-radius: 999px;
  color: #ffe9a8;
  background: linear-gradient(135deg, rgba(255,233,168,.18), rgba(243,207,120,.10));
  border: 1px solid rgba(255,233,168,.45);
  box-shadow: 0 0 8px rgba(255,233,168,.25);
  white-space: nowrap;
}
.modal-head .detail-watch { margin-left: 10px; font-size: 13px; }
/* 卡片底部的星光热度行（家长端 / 老师端通用） */
.stu-foot { display: flex; justify-content: center; margin-top: 8px; }

/* ---------- 大楼（共享房顶 + 单元标签） ---------- */
.city-mini { position: relative; display: flex; flex-direction: column; align-items: stretch; padding: 5px 0 4px; width: fit-content; margin: 0 auto; }
.city-big {
  position: relative;
  display: flex; flex-direction: column; align-items: stretch;
  padding: 12px 6px 10px; border-bottom: 2px solid rgba(255,255,255,.14);
  /* 宽度跟随容器，避免在窄屏（手机）上房顶比楼体宽出一截 */
  width: 100%; max-width: 520px; margin: 0 auto;
}
.floors-row { display: flex; gap: 2px; justify-content: center; align-items: flex-end; }
/* 详情（大图）里楼层与单元皇冠行都按等分宽度排布，保证每列左右严格对齐 */
.city-big .floors-row { gap: 5px; width: 100%; }
.bcol { display: flex; flex-direction: column; align-items: center; }
.bcol.big { flex: 1 1 0; min-width: 0; align-items: stretch; }
.bcol.big .floors { gap: 3px; }

/* 所有单元共用的大房顶（三角形尖顶，屋檐与楼群等宽） */
.roof-bar {
  position: relative; width: 100%; height: 42px; margin-bottom: 6px;
  transition: transform .8s ease;
}
.city-mini .roof-bar { height: 26px; margin-bottom: 4px; --merge-shift: 0px; }
.city-big .roof-bar { height: 34px; margin-bottom: 5px; --merge-shift: 0px; }
/* 全部背完：房顶顺势下滑，与第六层楼顶相接 */
.city-big.merging .roof-bar, .city-mini.merging .roof-bar { transform: translateY(var(--merge-shift)); }
.roof-tri, .roof-glow {
  position: absolute; inset: 0;
  clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
}
.roof-tri { background: rgba(170,195,255,.14); transition: background .45s; }
.roof-glow {
  background: linear-gradient(180deg, #ffe8a3, #ffc93c 55%, #ffa94d);
  opacity: var(--lit, 0); transition: opacity .45s;
}
.roof-tri.full {
  background: linear-gradient(180deg, #ffe8a3, #ffc93c 55%, #ffb347);
  animation: roofPulse 1.6s ease-in-out infinite alternate;
}
@keyframes roofPulse {
  from { background: linear-gradient(180deg, #ffe8a3, #ffc93c 55%, #ffb347); }
  to   { background: linear-gradient(180deg, #fff1c4, #ffd966 55%, #ffc266); }
}

/* 皇冠：作为房顶子元素，居中于三角尖顶；合并时随房顶下滑、尖顶插入皇冠下缘豁口 */
.crown {
  position: absolute; left: 50%; top: -50px;
  transform: translateX(-50%) scale(.5);
  width: 92px; height: 60px; z-index: 6; pointer-events: none;
  background: url("/static/crown.webp") center/contain no-repeat;
  opacity: 0; transition: opacity .4s, transform .4s;
}
.city-big .crown { width: 104px; height: 68px; top: -56px; }
.city-mini .crown { width: 46px; height: 30px; top: -26px; }
.crown.show {
  opacity: 1; transform: translateX(-50%) scale(1);
  animation: crownBlink 1.4s ease-in-out infinite alternate;
}
@keyframes crownBlink {
  from { opacity: .72; }
  to   { opacity: 1; }
}
@media (max-width: 520px) {
  .crown { width: 40px; height: 26px; top: -18px; }
}
@keyframes crownGlow {
  from { box-shadow: 0 0 10px 2px rgba(255,201,60,.5); }
  to   { box-shadow: 0 0 24px 6px rgba(255,201,60,.95); }
}

/* 每单元小皇冠：放在单元号（U1…U10）下方那一排（「详情 / 全屏」按钮上方）。
   高度统一固定预留，亮不亮都占位，这样某一列点亮也不会把其它列顶出顶部空白行。
   未点亮时 👑 隐藏，但那一行位置仍留着。 */
.ucell {
  display: flex; align-items: center; justify-content: center;
  height: 14px; margin-top: 2px; overflow: hidden; flex: 0 0 auto;
}
.city-big .ucell { height: 22px; margin-top: 3px; }
.ucrown {
  font-size: 12px; line-height: 1;
  opacity: 0; transform: scale(.3) translateY(4px);
  transition: opacity .35s ease, transform .35s ease;
  filter: drop-shadow(0 0 3px rgba(255,201,60,.85));
}
.city-big .ucrown { font-size: 16px; }
.ucrown > span { display: inline-block; }
.ucrown.on > span { animation: ucrownBob 2.4s ease-in-out infinite; }
.ucrown.on { opacity: 1; transform: scale(1) translateY(0); }
/* 合并时小皇冠飞升合并成大皇冠 */
.city-mini.merging .ucrown, .city-big.merging .ucrown { animation: ucrownMerge .7s ease-in forwards; }

/* 全部单元背完：小皇冠飞升合并，大皇冠随房顶降到楼顶、三角尖顶插入皇冠 */
@keyframes ucrownMerge {
  0%   { opacity: 1; transform: translateY(0) scale(1); }
  55%  { opacity: 1; transform: translateY(-30px) scale(.7); }
  100% { opacity: 0; transform: translateY(-48px) scale(.16); }
}
.city-mini.merging .crown.show, .city-big.merging .crown.show {
  animation: crownLand .8s ease-out, crownBlink 1.4s ease-in-out .8s infinite alternate;
}
/* 大皇冠下降：起点更高，落点正好让三角尖顶插入皇冠下缘豁口 */
@keyframes crownLand {
  0%   { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(.5); }
  55%  { opacity: 1; transform: translateX(-50%) translateY(5px) scale(1.12); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
@keyframes ucrownBob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-2px) scale(1.07); }
}

.floors { display: flex; flex-direction: column-reverse; gap: 2px; }

.floor {
  width: 14px; height: 12px; border-radius: 2.5px;
  background-color: #121d3a;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 5px 6px;
  border: 1px solid rgba(255,255,255,.10);
  position: relative;
  display: flex; align-items: center; justify-content: center;
  transition: transform .08s;
}
.floor.big { width: 100%; height: 26px; border-radius: 4px; background-size: 11px 11px; }
.floor.A { --c: var(--pA); } .floor.B { --c: var(--pB); }
.floor.C { --c: var(--pC); } .floor.D { --c: var(--pD); }
.floor.G { --c: var(--pG); } .floor.W { --c: var(--pW); }
.floor.lit {
  background-color: var(--c);
  background-image:
    linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px);
  box-shadow: 0 0 14px 1px var(--c), inset 0 0 7px rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.4);
}
.floor .flabel {
  font-size: 8px; font-weight: 700; color: rgba(255,255,255,.5);
  z-index: 1; white-space: nowrap; line-height: 1; padding: 0 1px;
  overflow: hidden; text-overflow: clip;
}
.floor.big .flabel { font-size: 11px; }
.floor.lit .flabel { color: #0d1430; }
.floor.clickable { cursor: pointer; }
.floor.clickable:hover { transform: scale(1.12); }
.unit-label { text-align: center; font-size: 11px; color: var(--muted); margin-top: 4px; white-space: nowrap; }
.city-mini .unit-label { font-size: 8px; margin-top: 3px; color: #8294bb; }

/* ---------- 弹窗（深色玻璃） ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(6, 10, 26, 0.62);
  display: flex; align-items: center; justify-content: center; z-index: 50;
  padding: 18px; backdrop-filter: blur(3px);
}
.modal {
  background: var(--card-solid); border: 1px solid var(--line); border-radius: 20px;
  padding: 22px; width: 100%; max-width: 380px; color: var(--ink);
  box-shadow: 0 30px 80px rgba(0,0,0,.55); animation: pop .2s ease;
}
.modal.detail { max-width: 780px; max-height: 90vh; overflow-y: auto; }
.modal.wide { max-width: 560px; }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h2 { margin: 0 0 6px; font-size: 19px; }
.modal .muted { color: var(--muted); font-size: 13.5px; margin: 0 0 14px; }
.modal input[type=password], .modal input[type=text] {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  font-size: 15px; outline: none; margin-bottom: 6px;
  background: rgba(255,255,255,.06); color: var(--ink);
}
.modal input:focus { border-color: var(--pG); }
.modal .err { color: var(--pA); font-size: 13px; margin: 4px 0 0; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 16px; }

.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.icon-btn {
  border: none; background: rgba(255,255,255,.1); width: 34px; height: 34px; border-radius: 10px;
  font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { background: rgba(255,255,255,.2); }
.detail-body { display: flex; gap: 24px; margin-top: 18px; flex-wrap: wrap; justify-content: center; }
.pillar-wrap { flex: 1 1 380px; display: flex; justify-content: center; overflow: visible; }
.detail-side { flex: 1 1 240px; display: flex; flex-direction: column; gap: 16px; }

.stat-card {
  background: linear-gradient(135deg, rgba(77,171,247,.18), rgba(177,151,252,.18));
  border: 1px solid var(--line); border-radius: 16px; padding: 16px; text-align: center;
}
.stat-num { font-size: 26px; font-weight: 800; }
.stat-label { font-size: 12.5px; color: var(--muted); margin: 2px 0 10px; }
.progress-track { height: 10px; background: rgba(255,255,255,.1); border-radius: 999px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--pD), var(--pG), var(--pW)); transition: width .4s; }
.stat-pct { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 600; }

/* ---------- 背诵明细（明文清单） ---------- */
.breakdown { flex: 1 1 100%; margin-top: 6px; }
.breakdown-head { font-size: 15px; font-weight: 600; color: #e8eefc; margin-bottom: 12px; }
.breakdown-head .muted { font-weight: 400; font-size: 13px; }
.unit-grid { display: flex; flex-direction: column; gap: 7px; }
.unit-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; padding: 6px 8px; border-radius: 10px; background: rgba(255,255,255,.04); }
.unit-tag { width: 38px; flex: 0 0 38px; font-weight: 700; color: #9fb3e6; font-size: 13px; }
.part-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; transition: background .15s; }
.part-chip.done { background: rgba(255,255,255,.08); color: #f2f5ff; }
.part-chip.todo { background: rgba(255,255,255,.05); color: #8a96b3; border-color: rgba(255,255,255,.12); }
.part-chip .mark { font-weight: 700; margin-right: 2px; }

/* 待背诵清单 */
.todo-summary { margin-bottom: 14px; line-height: 1.9; font-size: 13px; }
.todo-summary .ts-label { color: #ffa94d; font-weight: 600; }
.todo-summary .ts-item { display: inline-block; margin: 0 4px 0 0; padding: 2px 8px; border-radius: 999px;
  background: rgba(255,138,76,.14); color: #ffc078; border: 1px solid rgba(255,138,76,.35); }
.todo-summary .all-done { color: #8ce99a; font-weight: 700; }

.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; }
.legend .item { display: flex; align-items: center; gap: 8px; font-size: 13px; white-space: nowrap; }
.legend .dot { width: 16px; height: 16px; border-radius: 5px; flex: none; box-shadow: 0 0 8px 0 var(--c, transparent); }
.legend .dot.A { --c: var(--pA); background: var(--pA); }
.legend .dot.B { --c: var(--pB); background: var(--pB); }
.legend .dot.C { --c: var(--pC); background: var(--pC); }
.legend .dot.D { --c: var(--pD); background: var(--pD); }
.legend .dot.G { --c: var(--pG); background: var(--pG); }

/* ---------- 班级管理 / 检查背诵 弹窗 ---------- */
.modal.manage, .modal.check { max-width: 760px; max-height: 90vh; overflow-y: auto; }
.modal.check { max-width: 820px; }
.manage-body { margin-top: 14px; }
.manage-list { display: flex; flex-direction: column; gap: 8px; }
.manage-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: rgba(255,255,255,.04); }
.manage-name { font-weight: 600; flex: 1; }
.manage-count { color: var(--muted); font-size: 13px; margin-right: 4px; }
.manage-add { display: flex; gap: 8px; margin-top: 12px; }
.manage-add input { flex: 1; width: auto; margin-bottom: 0; }
.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }
.import-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; }
.sel { width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); font-size: 14px; margin-bottom: 8px; outline: none;
  color-scheme: light; }   /* 下拉弹窗走浅色外观，原生控件/未着色字也清晰 */
.sel:focus { border-color: var(--pG); }
/* 下拉弹窗里的待选项：原生列表多为浅底，若不显式给深色字，浅色 --ink 落在白底上几乎看不清 */
select option, select optgroup {
  color: #16223c;            /* 深藏青，浅底上清晰可读 */
  background: #ffffff;       /* 强制浅底，杜绝“浅字浅底” */
  font-weight: 600;
}
.si-role option { color: #16223c; background: #ffffff; }   /* 成绩面板的下拉同样处理 */
#rosterInput { width: 100%; min-height: 130px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); font-size: 14px; resize: vertical; font-family: inherit; outline: none; }
#rosterInput:focus { border-color: var(--pG); }
.import-row { display: flex; gap: 18px; margin: 10px 0; font-size: 13.5px; color: var(--muted); flex-wrap: wrap; }
.radio { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.import-actions { display: flex; align-items: center; gap: 12px; }
.import-result { font-size: 13px; color: #8ce99a; }

/* ---------- 人员微调 ---------- */
.modal.fine-tune { max-width: 780px; max-height: 90vh; overflow-y: auto; }
.ft-body { margin-top: 14px; }
.ft-list { display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow-y: auto; margin-top: 12px; }
.ft-item { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px;
  background: rgba(255,255,255,.04); }
.ft-name { display: flex; align-items: center; gap: 6px; flex: 1; min-width: 150px; font-weight: 600; }
.ft-tx { font-size: 14px; }
.ft-role, .ft-group { width: auto; min-width: 112px; margin-bottom: 0; }
.ft-group:disabled { opacity: .45; }
@media (max-width: 560px) {
  .ft-item { flex-wrap: wrap; gap: 8px; }
  .ft-name { min-width: 100%; }
}

/* ---------- 背诵结构编辑（年级升高时改部分） ---------- */
.struct-box { margin-top: 2px; }
.struct-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.struct-row label { font-size: 14px; color: var(--muted); }
.struct-row .sel { width: 96px; margin-bottom: 0; }
.struct-row #structTotal { font-size: 13px; color: var(--pG); font-weight: 600; }
.struct-head, .struct-part { display: grid; grid-template-columns: 40px 1fr 78px 66px 100px; gap: 6px; align-items: center; }
.struct-head { font-size: 12px; color: var(--muted); padding: 0 4px 6px; }
.struct-parts { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.struct-part { background: rgba(255,255,255,.04); border-radius: 10px; padding: 6px 4px; }
.struct-no { font-size: 12px; color: #9fb3e6; font-weight: 700; text-align: center; }
.struct-inp { width: 100%; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); font-size: 13px; outline: none; font-family: inherit; }
.struct-inp:focus { border-color: var(--pG); }
.struct-ops { display: flex; gap: 4px; justify-content: flex-end; }
.icon-btn.tiny { width: 24px; height: 24px; border-radius: 7px; font-size: 13px; }
.icon-btn.tiny:disabled { opacity: .3; cursor: not-allowed; }
.icon-btn.tiny.danger { color: #ff6b6b; }
.struct-tip { font-size: 12.5px; line-height: 1.7; margin-top: 10px; }
.struct-tip strong { color: var(--pG); }
@media (max-width: 560px) {
  .struct-head, .struct-part { grid-template-columns: 34px 1fr 58px 50px 84px; gap: 4px; }
  .struct-inp { padding: 5px 6px; font-size: 12px; }
}

/* ---------- 今日复习（遗忘曲线） ---------- */
.due-badge { display: inline-flex; align-items: center; gap: 3px; margin-left: 6px;
  padding: 1px 7px; border-radius: 20px; font-size: 11px; font-weight: 700;
  background: rgba(255,159,67,.18); color: #ffd8a8; border: 1px solid rgba(255,159,67,.4); }
.btn.ghost.hot { border-color: rgba(255,159,67,.55); color: #ffd8a8; background: rgba(255,159,67,.14); }
.btn.ghost.hot:hover { background: rgba(255,159,67,.22); }
.rv-top { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; flex-wrap: wrap; }
.rv-top .sel { width: auto; min-width: 140px; margin: 0; }
.rv-stat { font-size: 13px; color: var(--muted); }
.rv-stat b { color: #ffa94d; }
.rv-actions { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.rv-list { display: flex; flex-direction: column; gap: 8px; max-height: 46vh; overflow-y: auto; }
.rv-item { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px;
  background: rgba(255,255,255,.04); border-radius: 12px; }
.rv-who { min-width: 92px; font-weight: 600; font-size: 14px; }
.rv-who small { display: block; font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; }
.rv-keys { display: flex; flex-wrap: wrap; gap: 5px; flex: 1; }
.rv-key { padding: 2px 9px; border-radius: 8px; font-size: 12px;
  background: rgba(255,159,67,.14); color: #ffd8a8; border: 1px solid rgba(255,159,67,.3); }
.rv-btn { flex-shrink: 0; }
/* 三段统计条 */
.rv-sum { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.rv-s { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); }
.rv-s b { font-size: 13px; margin-left: 2px; }
.rv-s.ov { color: #ffb3b3; background: rgba(255,95,109,.12); border-color: rgba(255,95,109,.32); }
.rv-s.td { color: #ffd8a8; background: rgba(255,159,67,.12); border-color: rgba(255,159,67,.32); }
.rv-s.nx { color: #b7f5d8; background: rgba(94,234,212,.12); border-color: rgba(94,234,212,.3); }
/* 三段任务标签 */
.rv-key.ov { background: rgba(255,95,109,.16); color: #ffc9c9; border-color: rgba(255,95,109,.38); }
.rv-key.td { background: rgba(255,159,67,.14); color: #ffd8a8; border-color: rgba(255,159,67,.3); }
.rv-key.nx { background: rgba(94,234,212,.12); color: #b7f5d8; border-color: rgba(94,234,212,.28); }
.rv-key b { font-weight: 800; margin-right: 5px; opacity: .85; }
.rv-key i { font-style: normal; margin-left: 5px; font-size: 11px; opacity: .8; }
.rv-hint { flex: 1 1 100%; font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.rv-acts { display: flex; gap: 6px; flex-shrink: 0; }
.rv-item.rv-idle { opacity: .72; }
.rv-idle-tip { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.rv-check { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); cursor: pointer; }
.rv-check input { width: 15px; height: 15px; accent-color: var(--gold, #ffcf6b); }
.rv-empty { padding: 24px 10px; text-align: center; color: var(--muted); font-size: 14px; line-height: 1.8; }

/* ---------- 组长纸条（A4 一页 8 张，裁剪后发给组长） ---------- */
.modal.slip { max-width: 760px; }
.slip-body { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-height: 62vh; overflow: auto; }
.slip {
  border: 1px dashed rgba(255,255,255,.22); border-radius: 10px;
  padding: 8px 10px; background: rgba(255,255,255,.03); page-break-inside: avoid;
}
.slip-head { display: flex; align-items: baseline; gap: 8px; border-bottom: 1px solid var(--line);
  padding-bottom: 5px; margin-bottom: 6px; }
.slip-head b { font-size: 14px; }
.slip-head span { font-size: 11.5px; color: var(--muted); flex: 1; }
.slip-head i { font-style: normal; font-size: 11px; color: var(--muted); }
.slip-tick { font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.cls-slip-btn { margin-left: auto; }
.slip-list { display: flex; flex-direction: column; gap: 5px; }
.slip-row { display: flex; align-items: flex-start; gap: 6px; }
.slip-no {
  flex-shrink: 0; width: 17px; height: 17px; line-height: 17px; text-align: center;
  font-size: 10.5px; border-radius: 50%; background: rgba(255,255,255,.1);
}
.slip-name { flex-shrink: 0; min-width: 52px; font-size: 12.5px; font-weight: 700; }
.slip-keys { display: flex; flex-wrap: wrap; gap: 3px; flex: 1; }
.slip-chip { font-size: 10.5px; padding: 1px 6px; border-radius: 6px; border: 1px solid var(--line); }
.slip-chip.ov { color: #ffc9c9; background: rgba(255,95,109,.14); border-color: rgba(255,95,109,.34); }
.slip-chip.td { color: #ffd8a8; background: rgba(255,159,67,.12); border-color: rgba(255,159,67,.3); }
.slip-chip.nx { color: #b7f5d8; background: rgba(94,234,212,.1); border-color: rgba(94,234,212,.26); }
.slip-chip.more { color: var(--muted); }
.slip-check { flex-shrink: 0; font-size: 10.5px; color: var(--muted); letter-spacing: -.5px; }
.slip-foot { margin-top: 6px; padding-top: 5px; border-top: 1px dotted var(--line);
  font-size: 10px; color: var(--muted); line-height: 1.5; }
@media (max-width: 620px) { .slip-body { grid-template-columns: 1fr; } }

@media print {
  @page { size: A4 portrait; margin: 8mm; }
  body.printing-slip > *:not(#slipMask) { display: none !important; }
  body.printing-slip #slipMask {
    position: static !important; display: block !important; background: #fff !important;
    padding: 0 !important; backdrop-filter: none !important;
  }
  body.printing-slip #slipMask .modal.slip {
    max-width: none !important; max-height: none !important;
    box-shadow: none !important; border: none !important;
    background: #fff !important; padding: 0 !important; color: #000 !important;
  }
  body.printing-slip #slipMask .detail-head { display: none !important; }
  body.printing-slip .slip-body {
    display: grid !important; grid-template-columns: 1fr 1fr !important;
    gap: 4mm !important; max-height: none !important; overflow: visible !important;
  }
  body.printing-slip .slip {
    border: 1px dashed #888 !important; background: #fff !important; color: #000 !important;
    break-inside: avoid; page-break-inside: avoid;
  }
  body.printing-slip .slip-head { border-bottom: 1px solid #999 !important; }
  body.printing-slip .slip-head b,
  body.printing-slip .slip-name { color: #000 !important; }
  body.printing-slip .slip-head span,
  body.printing-slip .slip-head i,
  body.printing-slip .slip-no,
  body.printing-slip .slip-check,
  body.printing-slip .slip-foot { color: #444 !important; }
  body.printing-slip .slip-chip {
    border: 1px solid #999 !important; color: #000 !important; background: none !important;
  }
  body.printing-slip .slip-foot { border-top: 1px dotted #999 !important; }
}
.rv-cfg { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap;
  padding-top: 12px; border-top: 1px solid var(--line); font-size: 13px; }
.rv-cfg label { color: var(--muted); }
.rv-cfg input { width: 120px; padding: 6px 10px; border-radius: 9px; border: 1px solid var(--line);
  background: rgba(255,255,255,.06); color: var(--ink); font-size: 13px; outline: none; font-family: inherit; }
.rv-cfg input:focus { border-color: var(--pG); }
.rv-tip { flex: 1 1 100%; font-size: 12px; line-height: 1.7; }
/* 详情弹窗里的今日复习条 */
.rev-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0 2px;
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255,159,67,.1); border: 1px solid rgba(255,159,67,.28); font-size: 13px; }
.rev-strip .rv-key { background: rgba(255,159,67,.2); }
.rev-strip .lbl { color: #ffd8a8; font-weight: 600; }
@media (max-width: 560px) {
  .rv-item { flex-wrap: wrap; }
  .rv-who { min-width: 70px; }
  .rv-list { max-height: 40vh; }
}

/* ---------- 通用确认弹窗（危险操作） ---------- */
.oplog-filter { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
.oplog-filter .sel { width: auto; min-width: 120px; margin: 0 0 0 6px; padding: 5px 8px; font-size: 12.5px; }
.op-actor { display: inline-block; margin-top: 4px; padding: 1px 8px; border-radius: 20px;
  font-size: 11.5px; background: rgba(255,193,7,.14); color: #ffd43b; border: 1px solid rgba(255,193,7,.28); }
.confirm-box { max-width: 400px; }
.confirm-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.confirm-head h2 { font-size: 18px; }
.confirm-icon { font-size: 22px; line-height: 1; }
.confirm-body p { font-size: 14.5px; line-height: 1.75; color: var(--ink); white-space: pre-line; }
.confirm-facts { margin: 10px 0 2px; padding: 10px 12px; list-style: none;
  background: rgba(255,255,255,.05); border-radius: 10px; font-size: 13px; color: var(--muted); }
.confirm-facts li { padding: 2px 0; }
.confirm-facts li b { color: var(--pG); font-weight: 700; }
.confirm-facts li.warn b { color: #ffd43b; }
.confirm-input-row { margin-top: 12px; }
.confirm-input-row input { width: 100%; padding: 9px 12px; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink);
  font-size: 14px; outline: none; font-family: inherit; }
.confirm-input-row input:focus { border-color: var(--pG); }
.confirm-hint { font-size: 12.5px; margin-top: 8px; }
.confirm-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.confirm-box.danger .confirm-actions #confirmOk { background: #e03131; border-color: #e03131; color: #fff; }
.confirm-box.danger .confirm-actions #confirmOk:hover { background: #c92a2a; }

/* ---------- 分组分工总览（可打印） ---------- */
.modal.division { max-width: 920px; max-height: 92vh; overflow-y: auto; }
.division-body { margin-top: 14px; display: flex; flex-direction: column; gap: 18px; }
.div-rep-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 10px;
  padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.div-rep-name { font-size: 18px; font-weight: 800; color: #ffe08a;
  text-shadow: 0 0 10px rgba(255, 210, 90, .7); }
.div-rep-sub { font-size: 12.5px; color: var(--muted); }
.div-group-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.div-group { background: rgba(255,255,255,.05); border: 1px solid var(--line);
  border-radius: 12px; padding: 10px 12px; page-break-inside: avoid; }
.div-group-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline;
  margin-bottom: 6px; }
.div-gname { font-weight: 800; font-size: 15px; color: var(--ink); }
.div-leader { font-size: 13px; color: #ffd98a; font-weight: 600; }
.div-pwd { font-size: 12px; color: var(--pG); font-family: ui-monospace, Menlo, Consolas, monospace;
  margin-left: auto; background: rgba(77,171,247,.12); padding: 1px 7px; border-radius: 6px; }
.div-members { font-size: 13px; line-height: 1.7; color: var(--muted); }
.div-no-group { padding: 6px 2px; }
/* 课代表端密码修改按钮（贴在课代表标题右侧） */
.div-rep-head { flex-wrap: wrap; }
.div-rep-pwd { margin-left: auto; }
.div-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.div-cls-label { font-size: 13px; color: var(--muted); }

/* ---------- 成绩单导入自动分组 ---------- */
.modal.score-import { max-width: 760px; max-height: 92vh; overflow-y: auto; }
.si-body { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.si-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.si-row label { font-size: 14px; color: var(--muted); min-width: 52px; }
.si-text { width: 100%; min-height: 130px; resize: vertical; border-radius: 10px;
  background: rgba(0,0,0,.25); color: var(--ink); border: 1px solid var(--line);
  padding: 10px 12px; font-size: 13px; line-height: 1.6; font-family: ui-monospace, Menlo, Consolas, monospace; }
.si-actions { display: flex; align-items: center; gap: 12px; }
.si-table-wrap { border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow-x: auto; }
.si-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.si-table th, .si-table td { padding: 6px 8px; border-bottom: 1px solid var(--line); text-align: left; }
.si-table th { color: var(--muted); font-weight: 600; }
.si-role { background: rgba(0,0,0,.3); color: var(--ink); border: 1px solid var(--line);
  border-radius: 7px; padding: 4px 6px; font-size: 13px; color-scheme: light; }
.si-config { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 10px; }
.si-config b { color: var(--pC); }
.si-preview { border: 1px solid var(--line); border-radius: 12px; padding: 12px; }

/* ---------- 打印：五个场景互不干扰 ----------
   ① 分组分工  → body.printing-division（黑白上墙）
   ② 组长纸条  → body.printing-slip（A4 一页 8 张，裁开发给组长）
   ③ 待发花名单 → body.printing-award（照着盖章）
   ④ 房子迷你卡 → body.printing-mini（名片大小，裁开贴备用本）
   靠 body 上的类区分，各套规则互不打架。 */
@media print {
  @page { size: A4; margin: 8mm; }
  /* ③ 待发花名单：黑白打印，照着盖章 */
  body.printing-award > *:not(#toast) { display: none !important; }
  body.printing-award {
    background: #fff !important; color: #000 !important;
  }
  body.printing-award #main {
    display: block !important; max-width: none !important; margin: 0 !important; padding: 0 !important;
  }
  body.printing-award .role-switch, body.printing-award .class-tabs,
  body.printing-award #sky, body.printing-award .topbar .owner-badge,
  body.printing-award .award-bar, body.printing-award .slogan { display: none !important; }
  body.printing-award .topbar { display: block !important; padding: 0 !important; margin-bottom: 6px !important; }
  body.printing-award .award-wrap { max-height: none !important; overflow: visible !important; }
  body.printing-award .section-head h2 { color: #000 !important; font-size: 16px !important; }
  body.printing-award .section-head .hint { color: #444 !important; }
  body.printing-award .aw-sec { border: 1px solid #999 !important; background: none !important;
    break-inside: avoid; page-break-inside: avoid; margin-bottom: 4mm; }
  body.printing-award .aw-sec-h { border-bottom: 1px solid #999 !important; }
  body.printing-award .aw-sec-h b { color: #000 !important; }
  body.printing-award .aw-sec-h .muted,
  body.printing-award .aw-sec-h i,
  body.printing-award .aw-no,
  body.printing-award .aw-desc,
  body.printing-award .aw-given,
  body.printing-award .aw-sum { color: #333 !important; }
  body.printing-award .aw-name { color: #000 !important; }
  body.printing-award .aw-row { border-bottom: 1px dotted #ccc; }
  body.printing-award .aw-row .btn { display: none !important; }
  body.printing-award .aw-row:not(.done)::after {
    content: "□"; margin-left: auto; font-size: 14px; color: #333;
  }
  body.printing-award .empty { color: #333 !important; }

  /* ① 分组分工：黑白上墙 */
  body.printing-division > *:not(#divisionMask) { display: none !important; }
  body.printing-division #divisionMask {
    position: static; display: block; background: #fff; padding: 0; backdrop-filter: none;
  }
  body.printing-division .modal.division {
    box-shadow: none; border: none; background: #fff; color: #111;
    max-width: none; max-height: none; padding: 0;
  }
  body.printing-division .detail-head { display: none !important; }
  body.printing-division .modal.division h2,
  body.printing-division .div-rep-name,
  body.printing-division .div-gname,
  body.printing-division .div-leader { color: #111 !important; text-shadow: none !important; }
  body.printing-division .div-rep-sub,
  body.printing-division .div-members,
  body.printing-division .div-pwd { color: #333 !important; }
  body.printing-division .div-group { background: #fff; border: 1px solid #999; }
  body.printing-division .div-rep-head { border-color: #999; }

  /* ④ 房子迷你卡：名片大小，黑白、沿虚线裁开 */
  @page { size: A4; margin: 6mm; }          /* 后写的会覆盖上面的 margin，迷你卡专用紧凑边距 */
  body.printing-mini > *:not(#miniMask) { display: none !important; }
  body.printing-mini {
    background: #fff !important; color: #000 !important;
  }
  body.printing-mini #miniMask {
    position: static; display: block; background: #fff; padding: 0; backdrop-filter: none;
  }
  body.printing-mini .modal.mini-modal {
    box-shadow: none; border: none; background: #fff; color: #000;
    max-width: none; max-height: none; padding: 0; margin: 0;
  }
  body.printing-mini .detail-head,
  body.printing-mini .mini-foot { display: none !important; }
  body.printing-mini .mini-body { max-height: none !important; overflow: visible !important; padding: 0 !important; }
  body.printing-mini .mini-sheet {
    background: #fff !important; gap: 0 !important; padding: 0 !important;
  }
  body.printing-mini .mini-card {
    align-self: stretch !important;
    min-height: 62mm !important;      /* 名片的实际高度：8 张/页 ≈ 4 行 */
    background: #fff !important; border: 1px dashed #999 !important; border-radius: 0 !important;
    box-shadow: none !important;
  }
  body.printing-mini .mini-body.per-8 .mini-card { min-height: 66mm !important; }
  body.printing-mini .mini-body.per-12 .mini-card { min-height: 44mm !important; }
  body.printing-mini .mc-no { background: #000 !important; color: #fff !important; }
  body.printing-mini .mc-name,
  body.printing-mini .mc-role,
  body.printing-mini .mc-lit { color: #000 !important; }
  body.printing-mini .mc-role { border-color: #666 !important; }
  body.printing-mini .mc-track { background: #eee !important; border: 1px solid #bbb !important; }
  body.printing-mini .mc-track > i { background: #555 !important; }
  body.printing-mini .mc-badge { color: #000 !important; border-color: #666 !important; }
  body.printing-mini .mc-blank { border-color: #999 !important; color: #555 !important; }
  /* 迷你卡简化楼：打印时压成灰阶，亮/暗一眼分得清 */
  body.printing-mini .mc-roof { background: #555 !important; }
  body.printing-mini .mc-b.gold .mc-roof { background: #111 !important; }
  body.printing-mini .mc-fl > i { background: #fff !important; border: 1px solid #bbb !important; }
  body.printing-mini .mc-fl > i.on { background: #333 !important; border-color: #333 !important; }
}

/* ---------- 组长管理（老师端） ---------- */
.gm-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.gm-row label { font-size: 14px; color: var(--muted); }
.gm-row .sel { width: auto; min-width: 150px; margin-bottom: 0; }
.gm-stats { font-size: 13px; color: var(--muted); margin-bottom: 10px; padding: 8px 12px;
  background: rgba(255,255,255,.04); border-radius: 10px; }
.gm-list { display: flex; flex-direction: column; gap: 6px; max-height: 300px; overflow-y: auto; margin-bottom: 12px; }
.gm-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: rgba(255,255,255,.04);
  border-radius: 10px; padding: 8px 10px; }
.gm-name { font-weight: 600; font-size: 14px; min-width: 88px; }
.gm-pwd { font-size: 12.5px; color: var(--pG); font-family: ui-monospace, Menlo, Consolas, monospace;
  letter-spacing: .5px; min-width: 96px; }
.gm-count { font-size: 12.5px; color: var(--muted); margin-right: auto; }
.gm-members { flex: 1 1 100%; font-size: 12.5px; color: var(--muted); line-height: 1.7; margin-top: 2px; }
.gm-add { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.gm-add input { flex: 1 1 120px; min-width: 110px; padding: 7px 10px; border-radius: 9px;
  border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink);
  font-size: 13px; outline: none; font-family: inherit; }
.gm-add input:focus { border-color: var(--pG); }
.gm-add .gm-num { flex: 0 0 62px; min-width: 62px; text-align: center; }
.gm-add .muted { font-size: 13px; }
@media (max-width: 560px) {
  .gm-item { flex-wrap: wrap; gap: 8px; }
  .gm-name { min-width: 70px; }
  .gm-pwd { min-width: 80px; }
  .gm-count { margin-right: 0; }
  .gm-list { max-height: 240px; }
}

.check-body { margin-top: 14px; }
.check-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.check-filters label { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted); }
.check-filters .sel { width: auto; margin: 0; }
.check-summary { font-size: 14px; margin-bottom: 10px; color: #e8eefc; }
.check-summary .all-done { color: #8ce99a; }
.check-list { display: flex; flex-direction: column; gap: 6px; max-height: 52vh; overflow-y: auto; }
.check-item { display: flex; gap: 12px; padding: 9px 12px; border-radius: 10px; background: rgba(255,255,255,.04); align-items: baseline; }
.check-name { font-weight: 700; color: #fff; flex: 0 0 84px; }
.check-missing { font-size: 13px; color: #ffc078; line-height: 1.6; }
.legend .dot.W { --c: var(--pW); background: var(--pW); }

.detail-tools { display: flex; flex-direction: column; gap: 8px; }
.detail-tools .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 杂项 ---------- */
.foot { text-align: center; color: var(--muted); font-size: 12.5px; padding: 18px; }
.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(10,16,38,.95); color: #fff; padding: 10px 18px; border-radius: 999px;
  font-size: 13.5px; z-index: 80; box-shadow: 0 10px 30px rgba(0,0,0,.4); border: 1px solid var(--line);
}
.empty { text-align: center; color: var(--muted); padding: 40px; font-size: 14px; }
/* 非本班模糊展示（家长端看不到其它班真实进度） */
.blurred-class { max-width: 880px; margin: 0 auto; padding: 8px 14px 30px; }
.blur-note { text-align: center; color: var(--muted); background: rgba(255,212,59,.08); border: 1px dashed rgba(255,212,59,.35); border-radius: 12px; padding: 12px 14px; margin: 10px 0 18px; font-size: 13.5px; line-height: 1.7; }
.blur-note b { color: #ffd43b; }
.blur-tower { display: flex; justify-content: center; padding: 10px 0 4px; }
.blur-tower .tower { display: flex; flex-direction: column-reverse; gap: 6px; width: min(320px, 80%); filter: blur(6px); opacity: .55; pointer-events: none; }
.blur-tower .tfloor { height: 26px; border-radius: 7px; background: linear-gradient(90deg, rgba(255,207,107,.5), rgba(255,143,171,.4)); border: 1px solid rgba(255,255,255,.25); }

@media (max-width: 520px) {
  .topbar { padding: 12px 14px; }
  .brand-text h1 { font-size: 15px; letter-spacing: 0; }
  .brand-text .sub { font-size: 11px; }
  .owner-badge { font-size: 11.5px; padding: 4px 10px; }
  main { padding: 12px 14px 40px; }
  .class-tabs { padding: 12px 14px 4px; }
}
.hidden { display: none !important; }
/* 修复：hidden 属性需强制隐藏，否则会被 display:flex 覆盖导致弹窗常驻 */
[hidden] { display: none !important; }

/* ---------- 暖心寄语 / 查看记录 ---------- */
.msg-wall { flex: 1 1 100%; margin-top: 14px; border-top: 1px dashed var(--line); padding-top: 12px; }
.wall-title { font-size: 14px; font-weight: 700; color: #ffd43b; margin: 10px 0 8px; }
.view-logs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.log-chip { font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(77,171,247,.16); color: #a5d8ff; }
.log-empty { font-size: 12px; color: var(--muted); }
.msg-list { display: flex; flex-direction: column; gap: 8px; max-height: 210px; overflow-y: auto; }
.msg-item { position: relative; background: rgba(255,255,255,.05); border: 1px solid var(--line); border-left: 3px solid #ffd43b; border-radius: 10px; padding: 8px 10px; }
.msg-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 3px; }
.msg-author { font-weight: 700; color: #ffe08a; }
.msg-body { font-size: 14px; color: #f2f5ff; line-height: 1.5; }
.msg-del { position: absolute; top: 6px; right: 8px; font-size: 11px; color: #ff8787; background: none; border: none; cursor: pointer; }
.msg-empty { font-size: 13.5px; color: var(--muted); padding: 14px 12px; line-height: 1.8; text-align: center;
  background: rgba(255,212,59,.06); border: 1px dashed rgba(255,212,59,.3); border-radius: 10px; }
.msg-empty-icon { display: block; font-size: 24px; margin-bottom: 4px; }
.msg-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.msg-form input, .msg-form textarea { width: 100%; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(255,255,255,.06); color: var(--ink); font-size: 14px; font-family: inherit; outline: none; }
.msg-form textarea { min-height: 56px; resize: vertical; }
.msg-form input:focus, .msg-form textarea:focus { border-color: var(--pG); }
.msg-note { font-size: 12px; margin-top: 2px; }
.msg-pending { font-size: 11px; color: #ffd43b; background: rgba(255,212,59,.14); border: 1px solid rgba(255,212,59,.4); border-radius: 999px; padding: 1px 8px; margin-left: 6px; }
.msg-item.review { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; position: relative; }
.msg-item.review .msg-meta { font-size: 11.5px; color: var(--muted); margin-left: 8px; }
.msg-item.review .msg-acts { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }
.msg-del.approve { color: #69db7c; background: none; border: 1px solid rgba(105,219,124,.5); border-radius: 8px; padding: 2px 10px; font-size: 12px; cursor: pointer; }

/* ---------- 弹幕放映 ---------- */
#danmuMask { background: rgba(3,5,14,.96); flex-direction: column; }
.danmu-stage { position: relative; width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.danmu-stage .city-big { transform: scale(1.12); opacity: .5; filter: blur(1px); margin-top: 120px; }
.danmu-title { position: absolute; top: 28px; left: 0; right: 0; text-align: center; font-size: 22px; font-weight: 800; color: #ffe08a; text-shadow: 0 0 12px rgba(255,201,60,.6); z-index: 5; }
.danmu-item { position: absolute; left: 100%; white-space: nowrap; font-size: 22px; font-weight: 700; color: #fff; padding: 6px 18px; border-radius: 999px; background: rgba(255,201,60,.16); border: 1px solid rgba(255,201,60,.4); text-shadow: 0 0 8px rgba(255,201,60,.5); animation: fly 9s linear infinite; z-index: 4; }
@keyframes fly { from { transform: translateX(0); } to { transform: translateX(-120vw); } }
.danmu-hint { position: absolute; bottom: 40px; left: 0; right: 0; text-align: center; color: var(--muted); }
.danmu-close { position: absolute; top: 18px; right: 18px; z-index: 10; }

/* ---------- 家长端标语 ---------- */
.slogan {
  text-align: center;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 3px;
  color: #ffd43b;
  background: linear-gradient(90deg, rgba(255,212,59,.10), rgba(77,171,247,.12), rgba(255,212,59,.10));
  padding: 11px 16px;
  margin: 12px auto 2px;
  max-width: 960px;
  border-radius: 12px;
  border: 1px solid rgba(255,212,59,.22);
  text-shadow: 0 1px 8px rgba(0,0,0,.45);
}

/* ---------- 数据导出 ---------- */
.modal.export { max-width: 520px; }
.export-body { margin-top: 16px; }
.export-row { margin-bottom: 12px; }
.export-row label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.export-row .sel { margin-bottom: 0; }
.export-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.export-actions .btn { flex: 1 1 auto; }
.export-note {
  font-size: 12.5px; color: var(--muted); margin: 0 0 14px; line-height: 1.75;
  padding: 10px 12px; border-radius: 10px;
  background: rgba(255, 212, 59, .07);
  border: 1px solid rgba(255, 212, 59, .18);
}

/* ---------- 操作记录 ---------- */
.oplog-body { max-height: 62vh; overflow-y: auto; padding: 4px 2px; }
.oplog-list { display: flex; flex-direction: column; gap: 9px; }
.op-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 13px; background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: 11px; }
.op-row.undone { opacity: .45; }
.op-info { flex: 1 1 auto; min-width: 0; }
.op-title { font-size: 14.5px; font-weight: 700; color: #fff; line-height: 1.45; }
.op-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.op-act { flex: 0 0 auto; }
.op-undone-tag { font-size: 12.5px; color: #ff8787; font-weight: 700; }
.op-empty, .op-loading { padding: 26px 16px; text-align: center; color: var(--muted); line-height: 1.7; }

/* ---------- 教室版：小组比拼（小区） ---------- */
.contest-wrap { display: flex; flex-direction: column; gap: 14px; }
.cd-block {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 12px 14px 14px; box-shadow: var(--shadow-sm); backdrop-filter: blur(6px);
}
.cd-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cd-title { font-size: 15.5px; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; }
.cd-medal { font-size: 16px; }
.cd-size {
  font-size: 11.5px; font-weight: 600; color: var(--muted);
  background: rgba(255,255,255,.08); padding: 2px 8px; border-radius: 999px;
}
.cd-sub { font-size: 12px; color: var(--muted); }
/* 彩虹条：填充宽度 = 该组人均完成率 */
.cd-rainbow {
  height: 13px; border-radius: 999px; background: rgba(255,255,255,.10);
  overflow: hidden; margin: 9px 0 7px;
}
.cd-fill {
  height: 100%; border-radius: 999px; transition: width .45s ease;
  background: linear-gradient(90deg,#ff5f6d,#ffa94d,#ffd43b,#51cf66,#22b8cf);
}
.cd-metrics { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin-bottom: 9px; }
.cd-metrics b { color: var(--ink); font-weight: 800; }
.cd-needy-tip { color: #ff8b8b; font-weight: 700; }
.cd-finish { color: #7ee0a3; }
/* 卡位最小值必须容得下里面那栋「10 单元」的楼（约 159px）＋卡片左右内边距，
   否则房子的楼体会撑出卡框（旧值 132px 太窄，房子比框大）。 */
.cd-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
/* 待帮扶：本组未完成且进度最低的房子，组长重点盯这几位 */
.stu-card.needy { border-color: rgba(255,95,109,.6); box-shadow: 0 0 0 2px rgba(255,95,109,.20); }
.need-badge {
  align-self: flex-start; font-size: 11px; font-weight: 800;
  color: #ffd9d9; background: rgba(255,95,109,.26);
  border: 1px solid rgba(255,95,109,.45); border-radius: 999px; padding: 2px 8px;
}

/* ---------- 每个「小区」一个不断变幻的彩虹框（仅教室端小区大区） ---------- */
@property --rc { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.cd-block.rainbow { position: relative; }
.cd-block.rainbow::after {
  content: ""; position: absolute; inset: -1px; border-radius: 17px; padding: 2px;
  background: conic-gradient(from var(--rc),
    #ff5f6d, #ffb74d, #ffe066, #51cf66, #22b8cf, #845ef7, #ff5f6d);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: rcSpin 6s linear infinite;
  pointer-events: none;
}
@keyframes rcSpin { to { --rc: 360deg; } }
/* 不支持 @property 的旧内核：退化成静态彩虹框（不影响布局） */
@media (prefers-reduced-motion: reduce) {
  .cd-block.rainbow::after { animation: none; }
}

/* 课代表大区：她本人金色描边，管的组长浅色描边，一眼分出层级 */
.cd-block.rep-clan { border-color: rgba(132,94,247,.45); }
.stu-card.clan-boss { box-shadow: 0 0 0 2px rgba(255,207,107,.55), 0 0 18px rgba(255,207,107,.30); }
.stu-card.clan-leader { box-shadow: 0 0 0 2px rgba(255,255,255,.20); }

/* ---------- 欠交作业（教室端通报 + 教师端登记） ---------- */
.cd-due { border-color: rgba(255,95,109,.35); }
.cd-due .cd-title { color: #ffdede; }
.due-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 8px; }
.due-chip {
  font-size: 12.5px; font-weight: 700; color: #ffd9d9;
  background: rgba(255,95,109,.18); border: 1px solid rgba(255,95,109,.4);
  border-radius: 999px; padding: 3px 10px;
}
.due-chip.warn { background: rgba(255,95,109,.34); border-color: rgba(255,95,109,.7); }
.due-bar { display: flex; gap: 8px; margin-bottom: 10px; }
.due-wrap { display: flex; flex-direction: column; gap: 6px; }
.due-sum { display: flex; gap: 18px; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.due-sum b { color: var(--ink); font-weight: 800; }
.due-row {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 12px; padding: 8px 11px;
}
.due-row.on { border-color: rgba(255,95,109,.45); background: rgba(255,95,109,.07); }
.due-no { min-width: 24px; font-size: 12px; color: var(--muted); font-weight: 800; }
.due-name { font-size: 14.5px; font-weight: 700; min-width: 74px; color: var(--ink); }
.due-cnt { font-size: 12px; color: var(--muted); margin-right: auto; }
.due-cnt.warn { color: #ff8b8b; font-weight: 800; }
.due-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: #ffd9d9; background: rgba(255,95,109,.16);
  border: 1px solid rgba(255,95,109,.32); border-radius: 999px; padding: 2px 4px 2px 9px;
}
.btn.tiny { padding: 2px 9px; font-size: 11.5px; border-radius: 8px; }

/* ---------- 班级码门禁 ---------- */
.modal.gate { max-width: 380px; text-align: center; }
.modal.gate input#gateCode {
  width: 100%; margin-top: 14px; text-align: center;
  font-size: 26px; letter-spacing: 10px; font-weight: 800;
  padding: 10px 12px 10px 22px;
}
.gate-remember {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; font-size: 12.5px; color: var(--muted); cursor: pointer;
}
.gate-remember input { width: 15px; height: 15px; accent-color: var(--gold, #ffcf6b); }
.gate-foot { margin-top: 10px; font-size: 11.5px; }

/* ---------- 随机抽背器（投屏用，字要大） ---------- */
.draw-mask { background: rgba(4, 8, 24, .92); }
.draw-stage {
  position: relative; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center;
  padding: 16px 20px 14px; box-sizing: border-box; overflow: auto;
}
.draw-close { position: absolute; right: 14px; top: 10px; z-index: 3; }
.draw-bar {
  display: flex; gap: 12px; flex-wrap: wrap; justify-content: center;
  align-items: center; margin-bottom: 6px;
}
.draw-modes, .draw-filter { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.dr-chip {
  padding: 6px 14px; border-radius: 999px; font-size: 14px; cursor: pointer;
  border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.05); color: var(--muted);
  white-space: nowrap; transition: all .15s;
}
.dr-chip:hover { border-color: rgba(255,207,107,.4); color: #fff3d6; }
.dr-chip.on {
  color: #ffe9b8; border-color: rgba(255,207,107,.6); background: rgba(255,207,107,.16);
  font-weight: 700;
}
.draw-filter .sel { width: auto; min-width: 92px; margin: 0; padding: 4px 8px; font-size: 12.5px; }
.draw-center { flex: 1; display: flex; flex-direction: column; justify-content: center; align-items: center; }
.draw-no { font-size: 15px; color: var(--muted); letter-spacing: 2px; height: 22px; }
.draw-name {
  font-size: clamp(48px, 12vw, 132px); font-weight: 900; line-height: 1.15;
  letter-spacing: 6px; text-align: center;
  background: linear-gradient(180deg, #fff8e1, #ffcf6b 55%, #ff9f43);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  text-shadow: 0 0 40px rgba(255,207,107,.25);
}
.draw-name.rolling { opacity: .82; filter: blur(.6px); }
.draw-name.land { animation: drawPop .5s cubic-bezier(.2,1.4,.4,1); }
@keyframes drawPop {
  0% { transform: scale(.72); opacity: .3; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
.draw-sub { margin-top: 8px; font-size: clamp(14px, 2.2vw, 20px); color: #ffe9b8; min-height: 26px; }
.draw-panel {
  display: flex; gap: 16px; align-items: center; justify-content: center;
  flex-wrap: wrap; margin: 6px 0 10px; min-height: 0;
}
.draw-info { display: flex; flex-direction: column; gap: 4px; font-size: 14px; color: var(--muted); }
.draw-task {
  font-size: clamp(16px, 2.6vw, 24px); font-weight: 800; color: #fff; padding: 6px 18px;
  border-radius: 12px; background: rgba(255,159,67,.16); border: 1px solid rgba(255,159,67,.45);
}
.draw-house { transform: scale(.72); transform-origin: top center; }
.draw-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.draw-actions .btn { padding: 9px 20px; font-size: 15px; }
.draw-actions .btn.big-roll { padding: 10px 34px; font-size: 17px; font-weight: 800; }
.draw-history {
  margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; justify-content: center;
  max-width: 900px;
}
.dh-item {
  font-size: 12px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid rgba(255,255,255,.16); background: rgba(255,255,255,.05);
}
.dh-item.ok { color: #9ff5c9; border-color: rgba(94,234,212,.45); background: rgba(94,234,212,.12); }
.dh-item.no { color: #ffb3b3; border-color: rgba(255,95,109,.45); background: rgba(255,95,109,.12); }

.foot-gate {
  margin-left: auto; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12px; padding: 2px 8px; border-radius: 8px;
}
.foot-gate:hover { color: #fff; background: rgba(255,255,255,.08); }
/* 全站 ICP 备案号栏（工信部合规悬挂） */
.site-beian {
  text-align: center; color: var(--muted); font-size: 12px;
  padding: 4px 16px 22px; line-height: 1.8;
}
.site-beian a { color: var(--muted); text-decoration: none; }
.site-beian a:hover { color: #fff; text-decoration: underline; }
/* 详情弹窗里的徽章墙（家长端也能看到） */
.badge-wall { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.bw-label { font-size: 12px; color: var(--muted); }
.bw-item {
  font-size: 12px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  background: linear-gradient(135deg, rgba(255,207,107,.3), rgba(255,143,171,.22));
  border: 1px solid rgba(255,207,107,.55); color: #ffe0a3;
  animation: badgeShine 2.6s ease-in-out infinite;
}
.bw-item.gold {
  background: linear-gradient(135deg, #ffcf6b, #ff8fab); color: #3b2600; border-color: #fff3c4;
}
.bw-tip { font-size: 11.5px; color: var(--muted); }
.btn-link {
  margin-top: 8px; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 12px; text-decoration: underline;
}
.btn-link:hover { color: #fff; }

/* ---------- 待发小红花清单 ---------- */
.award-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.aw-check { display: flex; align-items: center; gap: 5px; margin-left: auto;
  font-size: 12.5px; color: var(--muted); cursor: pointer; }
.aw-check input { width: 15px; height: 15px; accent-color: var(--gold, #ffcf6b); }
.award-wrap { display: flex; flex-direction: column; gap: 12px; max-height: 62vh; overflow: auto; }
.aw-sum { display: flex; gap: 14px; font-size: 13px; color: var(--muted); }
.aw-sum b { color: #ffcf6b; font-size: 15px; }
.aw-sec { border-radius: 12px; padding: 10px 12px; background: rgba(255,255,255,.04);
  border: 1px solid var(--line); }
.aw-sec.unit { border-left: 3px solid #ff8fab; }
.aw-sec.group { border-left: 3px solid #ffcf6b; }
.aw-sec.rep { border-left: 3px solid #7ee6d0; }
.aw-sec-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px dashed var(--line); }
.aw-sec-h b { font-size: 13.5px; }
.aw-sec-h .muted { font-size: 11.5px; flex: 1; }
.aw-sec-h i { font-style: normal; font-size: 12px; color: var(--muted); }
.aw-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; }
.aw-row.done { opacity: .5; }
.aw-no { flex-shrink: 0; width: 22px; text-align: center; font-size: 11.5px; color: var(--muted); }
.aw-name { flex-shrink: 0; min-width: 68px; font-weight: 700; }
.aw-desc { flex: 1; font-size: 12px; color: var(--muted); }
.aw-given { flex-shrink: 0; font-size: 11.5px; color: #7ee6d0; }
/* 🏅 单元通关徽章（卡片 / 家长端 / 教室端通用） */
.unit-badge {
  font-size: 11px; padding: 1px 7px; border-radius: 999px; flex-shrink: 0;
  background: linear-gradient(135deg, rgba(255,207,107,.28), rgba(255,143,171,.2));
  border: 1px solid rgba(255,207,107,.5); color: #ffe0a3; font-weight: 800;
  animation: badgeShine 2.6s ease-in-out infinite;
}
@keyframes badgeShine {
  0%, 100% { box-shadow: 0 0 0 rgba(255,207,107,0); }
  50% { box-shadow: 0 0 8px rgba(255,207,107,.55); }
}
/* 小组全组通关标记 */
.cd-allclear {
  font-size: 11px; padding: 1px 8px; border-radius: 999px; margin-left: 6px;
  background: rgba(255,207,107,.18); border: 1px solid rgba(255,207,107,.45); color: #ffe0a3;
}

/* ---------- 房子迷你卡（打印裁开，贴备用本/家校本） ---------- */
.modal.mini-modal { max-width: 900px; }
.mini-body { max-height: 62vh; overflow: auto; padding: 4px 2px 10px; }
.mini-sheet {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; padding: 4px; align-items: start;
}
.mini-body.per-8 .mini-sheet { grid-template-columns: repeat(2, 1fr); gap: 12px; }
.mini-body.per-12 .mini-sheet { grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mini-card {
  position: relative; border: 1px dashed var(--line); border-radius: 12px;
  padding: 8px 9px 7px; background: rgba(255,255,255,.04);
  display: flex; flex-direction: column; gap: 4px; break-inside: avoid;
  align-self: start;                 /* 别让网格把卡片拉得老高 */
}
.mini-body.per-8 .mini-card { padding: 11px 12px 9px; }
.mini-body.per-8 .mini-sheet { grid-auto-rows: min-content; }
.mc-head { display: flex; align-items: center; gap: 6px; }
.mc-no {
  flex: 0 0 auto; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 6px;
  background: rgba(255,255,255,.14); color: var(--ink);
  font-size: 11.5px; font-weight: 800; line-height: 20px; text-align: center;
}
.mc-name { font-size: 15px; font-weight: 800; letter-spacing: .5px; }
.mini-body.per-8 .mc-name { font-size: 17px; }
.mc-role {
  font-size: 10px; font-weight: 700; color: var(--muted);
  border: 1px solid var(--line); border-radius: 999px; padding: 0 5px; line-height: 15px;
}
.mc-house { display: flex; justify-content: center; padding: 3px 0 1px; min-height: 62px; }
.mini-body.per-8 .mc-house { min-height: 78px; }

/* 迷你卡专用简化楼：楼层一行一格，纯色块，黑白打印也清楚
   （不走 buildBuilding 那套尖顶/渐变，避免打印时糊成一团） */
.mc-b { display: flex; flex-direction: column; gap: 1.5px; width: 100%; max-width: 150px; }
.mc-roof {
  height: 10px; clip-path: polygon(50% 0%, 100% 100%, 0% 100%);
  background: #4a5a78; margin: 0 5px;
}
.mc-b.gold .mc-roof { background: #b98b2e; }
.mc-fl { display: flex; gap: 1.5px; height: 7px; }
.mc-fl > i {
  flex: 1 1 0; border-radius: 1.5px; background: #dfe4ec; border: 1px solid #c3cad6;
}
.mc-fl > i.on { background: var(--c, #4dabf7); border-color: rgba(0,0,0,.18); }
.mc-fl.W > i.on { background: #8e7bef; }
.mc-fl.A > i.on { background: #ff6b81; }
.mc-fl.B > i.on { background: #ff9f43; }
.mc-fl.C > i.on { background: #ffd43b; }
.mc-fl.D > i.on { background: #51cf66; }
.mc-fl.G > i.on { background: #4dabf7; }
.mc-bar { display: flex; align-items: center; gap: 6px; }
.mc-lit { font-size: 11.5px; font-weight: 700; color: var(--pG); flex: 0 0 auto; }
.mc-track {
  flex: 1 1 auto; height: 6px; border-radius: 999px; background: rgba(255,255,255,.12);
  overflow: hidden; min-width: 24px;
}
.mc-track > i { display: block; height: 100%; border-radius: 999px;
  background: linear-gradient(90deg, var(--pG), var(--pW)); }
.mc-badge { font-size: 11px; flex: 0 0 auto; }
.mc-blank {
  position: absolute; top: 7px; right: 8px; width: 34px; height: 34px;
  border: 1px dashed var(--line); border-radius: 8px;
  font-size: 9px; color: var(--muted); line-height: 34px; text-align: center;
}
.mini-foot { font-size: 12px; margin-top: 8px; }

/* ---------- 家长视角预览（老师端核对用） ---------- */
.preview-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 14px; margin: 6px 0 14px; border-radius: 14px;
  border: 1px dashed rgba(255,207,107,.55); background: rgba(255,207,107,.1);
}
.preview-bar .pb-text { flex: 1 1 260px; min-width: 0; line-height: 1.65; }
.preview-bar .pb-text b { display: block; font-size: 14px; color: #ffd98a; margin-bottom: 2px; }
.preview-bar .pb-text span { font-size: 12.5px; color: var(--muted); }
@media print {
  .preview-bar { display: none !important; }
}

/* ---------- 教师端控制器：功能开关 ---------- */
.modal.feature { max-width: 660px; }
.feature-body { max-height: 70vh; overflow: auto; }
.feature-tip {
  font-size: 12.5px; line-height: 1.7; padding: 10px 12px; margin-bottom: 12px;
  border-radius: 10px; background: rgba(255,255,255,.05); border: 1px dashed var(--line);
}
.fl-sec-h {
  font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 1px;
  margin: 14px 2px 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line);
}
.fl-row {
  display: flex; align-items: flex-start; gap: 12px; padding: 9px 10px;
  border-radius: 12px; cursor: pointer; transition: background .15s;
  border: 1px solid transparent;
}
.fl-row:hover { background: rgba(255,255,255,.05); }
.fl-row.on { background: rgba(122,200,120,.08); border-color: rgba(122,200,120,.22); }
.fl-row.soon { opacity: .55; cursor: not-allowed; }
.fl-sw {
  flex: 0 0 auto; width: 42px; height: 24px; border-radius: 999px; border: none;
  background: rgba(255,255,255,.16); position: relative; cursor: pointer;
  transition: background .18s; margin-top: 2px;
}
.fl-sw::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
  border-radius: 50%; background: #fff; transition: transform .18s;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.fl-sw.on { background: linear-gradient(135deg, #7ad878, #4bbf6b); }
.fl-sw.on::after { transform: translateX(18px); }
.fl-sw:disabled { cursor: not-allowed; }
.fl-body { flex: 1; min-width: 0; }
.fl-name { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.fl-tag {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: var(--muted); letter-spacing: .3px;
}
.fl-tag.front { background: rgba(77,171,247,.16); color: #9fd6ff; }
.fl-tag.teacher { background: rgba(255,207,107,.16); color: #ffd98a; }
.fl-soon {
  font-size: 10.5px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: var(--muted);
}
.fl-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.feature-foot {
  display: flex; gap: 10px; align-items: center; justify-content: flex-end;
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line);
}
.feature-foot .btn:first-child { margin-right: auto; }
.feature-note { font-size: 12px; margin-top: 8px; text-align: right; }

/* ---------- 门禁管理 ---------- */
.modal.access { max-width: 640px; }
.access-body { max-height: 66vh; overflow: auto; }
.ac-row { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.ac-row > label { font-weight: 700; font-size: 13px; min-width: 72px; }
/* 网页有效期卡片 */
.ac-exp-card {
  display: flex; gap: 18px; align-items: stretch; flex-wrap: wrap;
  padding: 14px 16px; margin-bottom: 14px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(94,234,212,.10), rgba(255,255,255,.04));
  border: 1px solid rgba(255,255,255,.10);
}
.ac-exp-card.warn {
  background: linear-gradient(135deg, rgba(255,207,107,.14), rgba(255,255,255,.04));
  border-color: rgba(255,207,107,.38);
}
.ac-exp-card.bad {
  background: linear-gradient(135deg, rgba(255,95,109,.16), rgba(255,255,255,.04));
  border-color: rgba(255,95,109,.45);
}
.aec-main {
  min-width: 168px; display: flex; flex-direction: column; justify-content: center;
  padding-right: 18px; border-right: 1px dashed rgba(255,255,255,.16);
}
.aec-label { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.aec-date {
  font-size: 27px; font-weight: 900; letter-spacing: 1px; margin: 2px 0 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.aec-left { font-size: 12.5px; color: #7ee6d0; font-weight: 700; }
.ac-exp-card.warn .aec-left { color: #ffcf6b; }
.ac-exp-card.bad .aec-left { color: #ff8b8b; }
.aec-side { flex: 1; min-width: 260px; display: flex; flex-direction: column; gap: 9px; }
.aec-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; }
.aec-row > input[type="date"] { padding: 4px 8px; }
.aec-quick .btn.tiny { padding: 3px 10px; }
.aec-note { font-size: 11.8px; line-height: 1.6; }
.aec-note b { color: #ffd9d9; }
.ac-row .muted { font-size: 12px; }
.ac-title { font-weight: 800; font-size: 13.5px; margin: 4px 0 10px; }
.ac-list { display: flex; flex-direction: column; gap: 8px; }
.ac-item {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 12px; border-radius: 12px;
  background: rgba(255,255,255,.05); border: 1px solid rgba(255,255,255,.09);
}
.ac-item b { font-size: 13.5px; min-width: 92px; }
.ac-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px; font-weight: 800; letter-spacing: 3px;
  color: var(--gold, #ffcf6b); background: rgba(255,207,107,.12);
  border: 1px dashed rgba(255,207,107,.45); border-radius: 8px; padding: 2px 10px;
}
.ac-item .btn.tiny { margin-left: 0; }
.ac-item .btn.tiny:first-of-type { margin-left: auto; }

/* ---------- 喊麦视频点播 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 9000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(4, 8, 24, .72); backdrop-filter: blur(3px);
  padding: 24px;
}
.mask[hidden] { display: none; }
.vpanel {
  width: min(720px, 94vw); max-height: 88vh; overflow: auto;
  background: linear-gradient(180deg, #141d3a, #0f1730);
  border: 1px solid rgba(255,255,255,.12); border-radius: 18px;
  box-shadow: 0 24px 80px rgba(0,0,0,.5);
  padding: 18px 20px 22px;
}
.vpanel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.vpanel-head h3 { margin: 0; font-size: 17px; color: #fff; }
.vclose {
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  color: #fff; border-radius: 10px; width: 34px; height: 34px; font-size: 16px; cursor: pointer;
}
.vclose:hover { background: rgba(255,255,255,.16); }
.vplayer {
  width: 100%; max-height: 46vh; background: #000; border-radius: 12px;
  display: block; margin-bottom: 14px;
}
.vlist { display: flex; flex-direction: column; gap: 12px; margin-bottom: 14px; }
.vunit-h { font-size: 13px; font-weight: 800; color: var(--gold, #ffcf6b); letter-spacing: 1px; margin-bottom: 7px; }
.vgroup-h { font-size: 15px; font-weight: 800; color: #fff; margin: 16px 0 4px;
  padding: 7px 11px; border-radius: 9px; letter-spacing: .5px;
  background: linear-gradient(90deg, rgba(255,207,107,.24), rgba(255,207,107,.03));
  border-left: 3px solid var(--gold, #ffcf6b); }
.vgroup-h:first-child { margin-top: 0; }
.vitems { display: flex; flex-wrap: wrap; gap: 8px; }
.vitem {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px;
  color: #eaf0ff; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12);
}
.vitem:hover { background: rgba(255,207,107,.16); border-color: rgba(255,207,107,.5); }
.vdel { color: #ff9a9a; font-size: 13px; margin-left: 2px; }
.vdel:hover { color: #ff5a5a; }
.vupload { border-top: 1px dashed rgba(255,255,255,.14); padding-top: 14px; }
.vup-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.vup-row .sel.small, .vup-row .inp.small { width: auto; margin-bottom: 0; }
.vup-row .inp.small {
  padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line, rgba(255,255,255,.14));
  background: rgba(255,255,255,.06); color: var(--ink, #eaf0ff); font-size: 13px;
}
.vup-row input[type=file] { color: #cfe0ff; font-size: 13px; max-width: 220px; }
.vup-tip { font-size: 12px; color: var(--muted, #9fb0d0); line-height: 1.5; margin-bottom: 8px; }
.vup-tip b { color: var(--gold, #ffcf6b); }
.vup-unit-hint { font-size: 11px; color: var(--muted, #9fb0d0); }

/* ---------- 点读（课文跟读）· 薄荷绿玻璃风（模仿点读模板） ---------- */
.mask.reading-mask { background: rgba(9,52,48,.45); -webkit-backdrop-filter: blur(8px) saturate(140%); backdrop-filter: blur(8px) saturate(140%); }
.rpanel {
  width: min(820px, 96vw); max-height: 90vh; overflow: auto;
  padding: 0 0 86px;
  background:
    radial-gradient(60vw 60vw at 4% 0%, rgba(94,234,212,.5), transparent 60%),
    radial-gradient(50vw 50vw at 100% 4%, rgba(253,186,116,.32), transparent 60%),
    radial-gradient(66vw 66vw at 50% 110%, rgba(165,243,252,.45), transparent 64%),
    linear-gradient(160deg,#f2fdfb,#eefafb 46%,#f4fdfc);
  border: 1px solid rgba(255,255,255,.8); border-radius: 24px;
  box-shadow: 0 26px 70px rgba(13,88,80,.28), inset 0 1px 0 rgba(255,255,255,.9);
}
.rpanel-head {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; margin: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,255,255,.66));
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border-bottom: 1px solid rgba(255,255,255,.7);
  border-radius: 24px 24px 0 0;
}
.rpanel-head h3 { margin: 0; font-size: 17px; font-weight: 900; color: #0f766e; letter-spacing: .2px; line-height: 1.2; }
.rpanel-head h3 .sub { display: block; font-size: 11.5px; font-weight: 800; color: #62847e; margin-top: 2px; }
.rpanel .vclose {
  margin-left: auto; color: #0f766e; background: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.9); box-shadow: 0 3px 10px rgba(13,88,80,.1);
}
.rpanel .vclose:hover { background: #fff; }
.rdemo { background: rgba(245,158,11,.12); border: 1px solid rgba(245,158,11,.4); color: #b45309;
  font-size: 12.5px; padding: 8px 10px; border-radius: 12px; margin: 12px 14px 0; line-height: 1.5; }
.rtabs { display: flex; flex-wrap: wrap; gap: 7px; padding: 12px 14px 4px; }
.rtab { padding: 7px 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.9);
  background: rgba(255,255,255,.7); color: #0f766e; font-weight: 800; font-size: 13px; cursor: pointer;
  box-shadow: 0 3px 10px rgba(13,88,80,.08); transition: .16s; }
.rtab.active { background: linear-gradient(135deg,#14b8a6,#0f766e); color: #fff; border-color: transparent; }
.rbody { padding: 4px 14px 0; }
.runit-title { font-size: 16px; font-weight: 900; color: #0d3b36; margin: 10px 2px 2px; }
/* 板块头（字母 tag） */
.rsec-h { display: flex; align-items: center; gap: 9px 11px; margin: 16px 2px 8px;
  padding: 10px 13px; border-radius: 16px;
  background: linear-gradient(135deg, rgba(20,184,166,.16), rgba(15,118,110,.08));
  border: 1px solid rgba(255,255,255,.82); box-shadow: 0 5px 18px rgba(13,88,80,.08); }
.rsec-h .tag { flex: 0 0 auto; width: 36px; height: 36px; border-radius: 12px;
  background: linear-gradient(140deg,#14b8a6,#0f766e); color: #fff; font-size: 19px; font-weight: 900;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(15,118,110,.34); }
.rsec-h .nm { font-size: 18px; font-weight: 900; color: #0f766e; letter-spacing: .2px; }
.rsec-h .cn { color: #e11d48; font-weight: 800; font-size: 13px; }
.rsec-h .hr { flex: 1 1 auto; height: 1px; min-width: 10px; background: linear-gradient(90deg, rgba(20,184,166,.45), transparent); }
/* 单词网格 */
.rwords { display: grid; grid-template-columns: repeat(auto-fill, minmax(122px,1fr)); gap: 10px; }
.ritem.word {
  text-align: left; border-radius: 16px; padding: 12px;
  background: linear-gradient(150deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
  border: 1px solid rgba(255,255,255,.85);
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: 0 4px 14px rgba(13,88,80,.09), inset 0 1px 0 rgba(255,255,255,.9);
  cursor: pointer; transition: transform .16s, box-shadow .2s, background .2s; min-height: 62px;
  display: flex; flex-direction: column; gap: 4px; position: relative;
}
.ritem.word .ren { font-size: clamp(16px,4.4vw,20px); font-weight: 800; color: #0b3b35; line-height: 1.3; word-break: break-word; }
.ritem.word .rzh { font-size: 12.5px; font-weight: 800; color: #e11d48; line-height: 1.35; }
/* 句子行 */
.rsentences { display: flex; flex-direction: column; gap: 9px; }
.ritem.sent {
  display: flex; align-items: center; gap: 10px; text-align: left;
  background: linear-gradient(150deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
  border: 1px solid rgba(255,255,255,.85); border-radius: 16px; padding: 12px;
  -webkit-backdrop-filter: blur(14px) saturate(170%); backdrop-filter: blur(14px) saturate(170%);
  box-shadow: 0 4px 14px rgba(13,88,80,.09), inset 0 1px 0 rgba(255,255,255,.9);
  cursor: pointer; transition: transform .16s, box-shadow .2s, background .2s; min-height: 56px; position: relative;
}
.ritem.sent:active { transform: scale(.988); }
.ritem.sent .rn { flex: 0 0 auto; width: 27px; height: 27px; border-radius: 9px;
  background: linear-gradient(150deg,#e7fdf8,#ccfbf1); color: #0f766e; font-weight: 900; font-size: 13px;
  display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,.9); box-shadow: 0 2px 6px rgba(13,88,80,.1); }
.ritem.sent .rtxt { flex: 1 1 auto; min-width: 0; }
.ritem.sent .ren { display: block; font-size: clamp(16px,4.6vw,20px); font-weight: 800; color: #0b3b35; line-height: 1.36; word-break: break-word; }
.ritem.sent .rzh { display: block; font-size: 13px; font-weight: 800; color: #e11d48; margin-top: 3px; line-height: 1.4; }
.ritem .spk { flex: 0 0 auto; width: 22px; height: 22px; color: #14b8a6; opacity: .55; transition: .18s; }
/* 播放中高亮 */
.ritem.spk-active {
  background: linear-gradient(135deg, rgba(45,212,191,.95), rgba(13,148,136,.96))!important;
  border-color: rgba(255,255,255,.5)!important;
  box-shadow: 0 12px 30px rgba(13,148,136,.38), inset 0 1px 0 rgba(255,255,255,.5)!important;
}
.ritem.spk-active .ren, .ritem.spk-active .rzh { color: #fff!important; }
.ritem.spk-active .rn { background: rgba(255,255,255,.94)!important; color: #0f766e!important; }
.ritem.sent.spk-active .spk { color: #fff; opacity: 1; animation: rdpulse .9s ease-in-out infinite; }
@keyframes rdpulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.28); } }
/* 中文显隐 */
.rpanel.hidecn .ritem .rzh { display: none; }
/* 整篇连读：给学生跟读的间隙标记 */
.ritem.wait::after {
  content: "该你读"; position: absolute; right: 9px; top: -9px; z-index: 2;
  font-size: 10.5px; font-weight: 900; letter-spacing: .5px; color: #fff;
  background: linear-gradient(135deg,#f59e0b,#e11d48);
  padding: 3px 9px; border-radius: 999px;
  box-shadow: 0 4px 12px rgba(225,29,72,.32);
  animation: rdwink 1.1s ease-in-out infinite;
}
@keyframes rdwink { 0%,100% { opacity: .55; transform: scale(.96); } 50% { opacity: 1; transform: scale(1); } }
/* 底部固定工具条（药丸） */
.rd-tools {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 60;
  display: flex; gap: 7px; padding: 8px 10px; border-radius: 999px; max-width: calc(100vw - 16px);
  background: linear-gradient(150deg, rgba(255,255,255,.92), rgba(255,255,255,.7));
  -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(255,255,255,.92);
  box-shadow: 0 12px 34px rgba(13,88,80,.22), inset 0 1px 0 rgba(255,255,255,.9);
}
.rd-pill { border: 1px solid rgba(255,255,255,.9); background: rgba(255,255,255,.74); color: #0f766e;
  font-weight: 800; font-size: 13px; padding: 8px 13px; border-radius: 999px; cursor: pointer;
  font-family: inherit; transition: .16s; white-space: nowrap; display: inline-flex; align-items: center; gap: 5px;
  box-shadow: 0 3px 12px rgba(13,88,80,.1); }
.rd-pill:active { transform: scale(.94); }
.rd-pill.on { background: linear-gradient(135deg,#2dd4bf,#0f766e); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(15,118,110,.35); }
.rd-pill.gold { background: linear-gradient(135deg,#fbbf24,#f59e0b); border-color: transparent; color: #fff; box-shadow: 0 6px 18px rgba(245,158,11,.35); }
.rd-pill.ghost { background: rgba(255,255,255,.6); }
  /* 板块插图（模仿点读模板的图片卡片） */
  .rcard.pic { margin: 0 0 12px; border-radius: 18px; overflow: hidden; background: rgba(255,255,255,.6);
    border: 1px solid rgba(255,255,255,.8); box-shadow: 0 5px 18px rgba(13,88,80,.1); }
  .rcard.pic img { display: block; width: 100%; border-radius: 18px; }
  /* 短语缩略图 */
  .ritem.sent .rthumb { flex: 0 0 auto; width: 60px; height: 46px; object-fit: cover; border-radius: 10px;
    background: #fff; border: 1px solid rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(13,88,80,.1); }
  .ritem.sent.has-img { padding-left: 14px; }
  .ritem.sent.has-img .rn { position: absolute; left: 6px; top: 6px; width: 22px; height: 22px; font-size: 11px; border-radius: 7px; }
  /* 录音面板 */
  .recpanel { padding-bottom: 20px; }
  .rec-tip { margin: 10px 14px; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 700;
    color: #0f766e; background: rgba(20,184,166,.12); border: 1px solid rgba(20,184,166,.3); line-height: 1.5; }
  .rec-list { padding: 4px 14px 0; }
  .rec-rows { display: flex; flex-direction: column; gap: 9px; }
  .rec-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 16px;
    background: linear-gradient(150deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
    border: 1px solid rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(13,88,80,.09); }
  .rec-row .rn { flex: 0 0 auto; width: 26px; height: 26px; border-radius: 9px; font-size: 12px; font-weight: 900;
    color: #0f766e; background: linear-gradient(150deg,#e7fdf8,#ccfbf1); display: flex; align-items: center; justify-content: center; }
  .rec-row .rtxt { flex: 1 1 auto; min-width: 0; }
  .rec-row .ren { font-size: 15px; font-weight: 800; color: #0b3b35; line-height: 1.3; }
  .rec-row .rzh { font-size: 12px; font-weight: 800; color: #e11d48; margin-top: 2px; }
  .rec-mic { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; cursor: pointer; font-size: 17px;
    color: #0f766e; background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.95);
    box-shadow: 0 3px 10px rgba(13,88,80,.14); transition: .16s; }
  .rec-mic:active { transform: scale(.94); }
  .rec-mic.rec { background: linear-gradient(135deg,#f43f5e,#e11d48); color: #fff; border-color: transparent;
    animation: rdpulse .9s ease-in-out infinite; }
  .rec-mic.done { background: linear-gradient(135deg,#2dd4bf,#0f766e); color: #fff; border-color: transparent; }
  .rec-play { flex: 0 0 auto; height: 34px; width: 190px; max-width: 34vw; display: none; }
  @media (max-width: 430px) { .rec-play { width: 140px; } }
  /* 教师端 · 点读配图管理 */
  .imgpanel { padding-bottom: 20px; }
  .img-tip { margin: 10px 14px; padding: 9px 12px; border-radius: 12px; font-size: 12.5px; font-weight: 700;
    color: #0f766e; background: rgba(20,184,166,.12); border: 1px solid rgba(20,184,166,.3); line-height: 1.5; }
  .img-list { padding: 4px 14px 0; display: flex; flex-direction: column; gap: 11px; }
  .img-row { display: flex; align-items: center; gap: 11px; padding: 11px; border-radius: 16px;
    background: linear-gradient(150deg, rgba(255,255,255,.86), rgba(255,255,255,.62));
    border: 1px solid rgba(255,255,255,.85); box-shadow: 0 4px 14px rgba(13,88,80,.09); }
  .img-sec { flex: 1 1 auto; min-width: 0; font-size: 15px; font-weight: 900; color: #0f766e; }
  .img-prev { flex: 0 0 auto; width: 96px; height: 64px; border-radius: 12px; overflow: hidden;
    background: #fff; border: 1px solid rgba(255,255,255,.9); box-shadow: 0 2px 8px rgba(13,88,80,.1);
    display: flex; align-items: center; justify-content: center; }
  .img-prev img { width: 100%; height: 100%; object-fit: cover; }
  .img-none { font-size: 12px; color: #9fb0d0; font-weight: 700; }
  .img-pick { flex: 0 0 auto; cursor: pointer; font-size: 13px; font-weight: 800; color: #0f766e;
    background: rgba(255,255,255,.9); border: 1px solid rgba(255,255,255,.95); padding: 8px 12px; border-radius: 10px;
    box-shadow: 0 3px 10px rgba(13,88,80,.12); }
  .img-pick input { display: none; }
  .img-up { flex: 0 0 auto; cursor: pointer; font-size: 13px; font-weight: 800; color: #fff;
    background: linear-gradient(135deg,#2dd4bf,#0f766e); border: none; padding: 9px 14px; border-radius: 10px;
    box-shadow: 0 3px 12px rgba(15,118,110,.32); }
  .img-up:disabled { background: rgba(255,255,255,.6); color: #9fb0d0; box-shadow: none; cursor: not-allowed; }
  @media (max-width: 430px) { .img-prev { width: 72px; height: 52px; } .img-sec { font-size: 13px; } }
  /* 教师端 · 点读单元编辑器 */
  .editpanel { padding-bottom: 16px; }
  .edit-body { padding: 12px 14px 0; max-height: 60vh; overflow: auto; }
  .edit-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
  .edit-row label { flex: 0 0 auto; width: 52px; font-size: 13px; font-weight: 900; color: #0f766e; }
  .edit-row .inp { flex: 1 1 auto; }
  .inp { padding: 9px 11px; border-radius: 11px; border: 1px solid rgba(255,255,255,.9);
    background: rgba(255,255,255,.7); color: #0b3b35; font-size: 14px; font-family: inherit; min-width: 0; }
  .inp:focus { outline: none; border-color: #14b8a6; box-shadow: 0 0 0 3px rgba(20,184,166,.22); }
  .edit-sec-title { display: flex; align-items: center; gap: 10px; margin: 14px 0 8px;
    font-size: 14px; font-weight: 900; color: #0f766e; }
  .edit-kv { display: flex; gap: 8px; margin-bottom: 8px; align-items: center; }
  .edit-kv .en { flex: 2 1 auto; }
  .edit-kv .zh { flex: 1 1 auto; }
  .edit-sec { background: rgba(255,255,255,.5); border: 1px solid rgba(255,255,255,.8);
    border-radius: 14px; padding: 11px; margin-bottom: 11px; }
  .edit-sec-head { display: flex; gap: 8px; align-items: center; margin-bottom: 9px; }
  .edit-sec-head .secname { flex: 1 1 auto; }
  .edit-items .edit-kv .en { flex: 2 1 auto; }
  .mini { cursor: pointer; font-size: 12.5px; font-weight: 800; color: #0f766e;
    background: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.95); padding: 7px 11px; border-radius: 9px;
    box-shadow: 0 2px 8px rgba(13,88,80,.1); }
  .mini.del { color: #e11d48; }
  .edit-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 14px 0; }

/* ---------- 字帖生成器挂载容器（仅容器/关闭按钮，模块内部样式均用 vs- 前缀） ---------- */
#sheet { position: fixed; inset: 0; z-index: 9000; background: #fff; overflow: auto; }
#sheet[hidden] { display: none; }
.vs-close {
  position: fixed; top: 14px; right: 16px; z-index: 9100;
  width: 42px; height: 42px; border: none; border-radius: 50%;
  background: rgba(15,23,42,.10); color: #1f2937; font-size: 22px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.18); transition: background .15s;
}
.vs-close[hidden] { display: none; }
.vs-close:hover { background: rgba(15,23,42,.22); }
body.vs-modal-open { overflow: hidden; }

/* ---------- 教师端：紧凑名字名册（替代高楼卡片 / 宽卡片） ---------- */
.roster-list { display: flex; flex-direction: column; gap: 16px; }
.roster-list .sur-group { display: block; }
.roster-list .sur-group[hidden] { display: none; }
.roster-list .sur-group .head {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 8px; padding: 4px 0 6px;
  border-bottom: 1px dashed rgba(124,242,214,.35);
}
.sur-group .sur-char-big {
  font-size: 18px; font-weight: 800; color: #06281f;
  width: 28px; height: 28px; line-height: 28px; text-align: center;
  background: linear-gradient(135deg, #7cf2d6, #4fd6b0); border-radius: 8px;
}
.sur-group .sur-count { font-size: 12px; color: var(--muted); }

.roster-row { display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; }

.stu-card.roster-card {
  width: 88px; min-height: 56px; padding: 7px 4px 6px;
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; cursor: pointer; gap: 3px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(124,242,214,.22); border-radius: 10px;
}
.stu-card.roster-card:hover {
  transform: translateY(-2px);
  border-color: rgba(124,242,214,.7);
  box-shadow: 0 4px 14px rgba(0,0,0,.28);
  background: rgba(124,242,214,.10);
}
.stu-card.roster-card .name-row { justify-content: center; gap: 3px; flex-wrap: nowrap; }
.stu-card.roster-card .name {
  font-size: 14.5px; font-weight: 700; line-height: 1.15;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 78px;
}
.stu-card.roster-card .role-tag { transform: scale(.82); margin: 0; }
.stu-card.roster-card .roster-foot {
  font-size: 10.5px; color: var(--muted); line-height: 1;
  white-space: nowrap;
}
.stu-card.roster-card .roster-foot.due { color: #ffd166; }
.stu-card.roster-card[hidden] { display: none; }

