/* 教室端样式 —— 参照「零音」提示条的四层结构。
   要点：不抢焦点、不遮教学软件的可视节奏、夜间可读、投影下对比度足够。 */

:root {
  --bg: #0d1117;
  --surface: #161b22;
  --line: #2a323d;
  --text: #e8edf3;
  --text-dim: #9aa7b6;
  --brand: #4f9cf9;
  --warn: #f0883e;
  --danger: #e5534b;
  --ok: #3fb950;
  --radius: 14px;
  --shadow: 0 12px 40px rgba(0, 0, 0, .5);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "Source Han Sans SC", "Noto Sans CJK SC", "PingFang SC",
               "Microsoft YaHei", system-ui, sans-serif;
  overflow: hidden;         /* 教室端不滚动，避免误触 */
  user-select: none;
  -webkit-user-select: none;
}

/* ---------- 提示音开关按钮（右上角，老师可关） ---------- */
.sound-toggle {
  position: fixed; right: 14px; top: 14px; z-index: 60;
  background: rgba(42, 50, 61, .8); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 6px 10px; font-size: 14px; cursor: pointer;
}
.sound-toggle:hover { color: var(--text); }

/* ---------- ① 连接状态条 ---------- */
.netbar {
  position: fixed; left: 50%; top: 14px; transform: translateX(-50%);
  z-index: 70; display: flex; align-items: center; gap: 8px;
  padding: 7px 16px; border-radius: 999px;
  background: rgba(240, 136, 62, .16);
  border: 1px solid rgba(240, 136, 62, .5);
  color: #ffd7b0; font-size: 15px;
}
.netbar .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); }

/* ---------- ③ 弹窗提示条 ---------- */
.banner {
  position: fixed; left: 50%; top: 0; transform: translateX(-50%) translateY(-120%);
  z-index: 50; width: min(920px, 92vw);
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .38s cubic-bezier(.2, .9, .25, 1);
}
.banner.show { transform: translateX(-50%) translateY(0); }
.banner.important { border-left-color: var(--danger); }
.banner.important .badge { background: rgba(229, 83, 75, .18); color: #ff9b95; border-color: rgba(229,83,75,.5); }

.bn-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px 6px;
}
.brand {
  font-weight: 700; font-size: 17px; color: var(--brand);
  letter-spacing: .3px;
}
.banner.important .brand { color: #ff9b95; }
.badge {
  font-size: 12.5px; padding: 2px 9px; border-radius: 999px;
  background: rgba(79, 156, 249, .16); color: #a8cdff;
  border: 1px solid rgba(79, 156, 249, .42);
}
.time { font-size: 13px; color: var(--text-dim); margin-left: auto; }
.bn-close {
  background: transparent; border: none; color: var(--text-dim);
  font-size: 17px; cursor: pointer; padding: 2px 6px; border-radius: 8px;
}
.bn-close:hover { background: rgba(255,255,255,.07); color: var(--text); }

.bn-body { padding: 2px 16px 10px; }
.bn-title { font-size: 25px; font-weight: 700; line-height: 1.35; margin-bottom: 6px; }
.bn-text {
  font-size: 18px; line-height: 1.6; color: #cbd5e1;
  white-space: pre-wrap; word-break: break-word;
  max-height: 34vh; overflow: hidden;
}
.bn-foot {
  padding: 0 16px 12px; font-size: 13.5px; color: var(--text-dim);
}
.bn-progress { height: 3px; background: rgba(255,255,255,.06); }
.bn-progress i {
  display: block; height: 100%; width: 100%;
  background: linear-gradient(90deg, var(--brand), #7ab8ff);
  transform-origin: left center;
}
.banner.important .bn-progress i { background: linear-gradient(90deg, var(--danger), #ff8a80); }

/* ---------- ② 全屏层 ---------- */
.fullscreen {
  position: fixed; inset: 0; z-index: 80;
  background: radial-gradient(1200px 700px at 50% 12%, #1b2330 0%, #0d1117 68%);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 6vh 8vw; text-align: center;
}
.fs-exit {
  position: absolute; right: 26px; top: 22px;
  background: rgba(255,255,255,.06); color: var(--text-dim);
  border: 1px solid var(--line); border-radius: 10px;
  padding: 8px 14px; font-size: 15px; cursor: pointer;
}
.fs-exit:hover { color: var(--text); background: rgba(255,255,255,.1); }
.fs-meta { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.fs-meta .brand { font-size: 20px; }
.fs-body h1 { font-size: clamp(30px, 5vw, 62px); margin: 0 0 22px; line-height: 1.25; }
.fs-body p {
  font-size: clamp(19px, 2.4vw, 30px); line-height: 1.65; color: #cbd5e1;
  margin: 0; white-space: pre-wrap; word-break: break-word;
  max-height: 46vh; overflow: hidden;
}
.fs-foot { position: absolute; bottom: 26px; font-size: 14px; color: #55606e; }

/* ---------- ④ 空状态 ---------- */
.idle {
  position: fixed; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  transition: opacity .4s; padding: 40px;
}
.idle.hide { opacity: 0; pointer-events: none; }
.idle-class {
  font-size: clamp(46px, 9vw, 140px); font-weight: 800;
  letter-spacing: .06em; color: #1d2530;
}
.idle-hint { font-size: 18px; color: #3d4757; }
.idle-status { display: flex; align-items: center; gap: 8px; font-size: 15px; color: #46505f; margin-top: 6px; }
.idle-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #46505f; }
.idle-status .dot.ok { background: var(--ok); box-shadow: 0 0 10px rgba(63,185,80,.6); }
.idle-status .dot.bad { background: var(--danger); }
.idle-count { font-size: 13.5px; color: #333c48; margin-top: 2px; }

/* ---------- 首次配置浮层 ---------- */
.setup {
  position: fixed; inset: 0; z-index: 99; display: flex;
  align-items: center; justify-content: center; background: rgba(5,8,12,.94);
}
.setup-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 30px 34px; width: min(520px, 90vw); box-shadow: var(--shadow);
}
.setup-card h2 { margin: 0 0 8px; font-size: 21px; }
.setup-card p { margin: 0 0 18px; color: var(--text-dim); font-size: 14.5px; line-height: 1.6; }
.setup-card input {
  width: 100%; padding: 12px 14px; font-size: 15px;
  background: #0d1117; border: 1px solid var(--line); border-radius: 10px;
  color: var(--text); margin-bottom: 14px;
}
.setup-card button {
  width: 100%; padding: 12px; font-size: 15.5px; font-weight: 600;
  background: var(--brand); color: #06121f; border: none;
  border-radius: 10px; cursor: pointer;
}
.setup-err { color: #ff9b95; font-size: 14px; margin-top: 10px; min-height: 20px; }
