/* ============================================================
   班级电子白板系统 — 全站样式
   ============================================================ */
:root {
  --primary: #4f6ef7;
  --primary-dark: #3d5ce5;
  --primary-soft: #eef1fe;
  --bg: #f3f6fc;
  --card: #ffffff;
  --text: #1f2937;
  --text-2: #5b6474;
  --text-3: #9aa3b2;
  --line: #e6eaf2;
  --red: #ef4444;
  --red-soft: #fef2f2;
  --green: #16a34a;
  --green-soft: #f0fdf4;
  --amber: #f59e0b;
  --amber-soft: #fffbeb;
  --shadow: 0 8px 28px rgba(31, 45, 90, 0.08);
  --shadow-lg: 0 18px 50px rgba(31, 45, 90, 0.16);
  --radius: 16px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.6;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; font-size: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--primary); text-decoration: none; }
img { display: block; }

.hide { display: none !important; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }
.row { display: flex; align-items: center; gap: 8px; }
.spacer { flex: 1; }

/* ---------------- 按钮 ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--primary); color: #fff; border-radius: var(--radius-sm);
  padding: 10px 18px; font-weight: 600; transition: all .18s ease;
  border: 1px solid transparent; white-space: nowrap;
}
.btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.ghost { background: #fff; border-color: var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--primary); color: var(--primary); background: #fff; }
.btn.soft { background: var(--primary-soft); color: var(--primary); }
.btn.soft:hover { background: #e2e8fd; }
.btn.danger { background: var(--red); }
.btn.danger:hover { background: #dc2626; }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 8px; }
.btn.xs { padding: 3px 10px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; }
.btn.big { padding: 14px 22px; font-size: 16px; border-radius: 12px; }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.input, textarea.input, select.input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 11px 14px; background: #fff; outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79, 110, 247, .13); }
textarea.input { resize: vertical; min-height: 80px; }
.form-error { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 4px; }

.switch { position: relative; display: inline-block; width: 44px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; background: #cdd5e3; border-radius: 999px; transition: .2s;
}
.switch i::after {
  content: ""; position: absolute; width: 18px; height: 18px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.switch input:checked + i { background: var(--green); }
.switch input:checked + i::after { transform: translateX(20px); }

input[type="range"] { width: 100%; accent-color: var(--primary); }

/* ---------------- 卡片 / 通用 ---------------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 20px; border: 1px solid rgba(230, 234, 242, .7);
}
.card h3 { font-size: 15px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px;
  border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--primary-soft); color: var(--primary);
}
.chip.gray { background: #eef1f6; color: var(--text-2); }
.chip.red { background: var(--red-soft); color: var(--red); }
.chip.green { background: var(--green-soft); color: var(--green); }
.chip.amber { background: var(--amber-soft); color: #b45309; }

.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.dot.green { background: var(--green); }
.dot.red { background: var(--red); }
.dot.gray { background: #c3cad6; }
.dot.pulse { animation: pulse 1.6s ease infinite; }
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .5); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

.empty { color: var(--text-3); text-align: center; padding: 28px 12px; font-size: 13px; }

/* ---------------- Toast ---------------- */
.toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast {
  background: rgba(23, 32, 54, .92); color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 14px; box-shadow: var(--shadow-lg); animation: toastIn .25s ease; max-width: 86vw;
}
.toast.ok { background: rgba(22, 163, 74, .95); }
.toast.warn { background: rgba(217, 119, 6, .95); }
.toast.err { background: rgba(220, 38, 38, .95); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: none; } }

/* ---------------- 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(20, 28, 48, .45); z-index: 900;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(3px); animation: fadeIn .18s ease;
}
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 560px;
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow-lg);
  animation: popIn .2s ease;
}
.modal.lg { max-width: 860px; }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h3 { font-size: 16px; flex: 1; }
.modal-body { padding: 20px; overflow: auto; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; }
.icon-btn {
  width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center;
  justify-content: center; color: var(--text-2); font-size: 16px; transition: .15s;
}
.icon-btn:hover { background: #eef1f6; color: var(--text); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(.96) translateY(8px); } to { opacity: 1; transform: none; } }

/* ============================================================
   登录页
   ============================================================ */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  background:
    radial-gradient(900px 600px at 12% -10%, #dfe6ff 0%, transparent 60%),
    radial-gradient(800px 620px at 108% 108%, #d9f4ff 0%, transparent 55%),
    linear-gradient(160deg, #f6f8ff 0%, #eef3fb 100%);
}
.login-shell {
  display: grid; grid-template-columns: 1.05fr .95fr; width: 100%; max-width: 920px;
  background: #fff; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-lg);
}
.login-brand {
  padding: 46px 42px; color: #fff; position: relative; overflow: hidden;
  background: linear-gradient(150deg, #4f6ef7 0%, #6a5df0 55%, #8b5cf6 100%);
}
.login-brand::after {
  content: ""; position: absolute; width: 320px; height: 320px; border-radius: 50%;
  background: rgba(255, 255, 255, .12); right: -110px; bottom: -130px;
}
.login-brand::before {
  content: ""; position: absolute; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255, 255, 255, .1); right: 40px; top: -80px;
}
.login-brand .logo { font-size: 34px; margin-bottom: 14px; }
.login-brand h1 { font-size: 26px; letter-spacing: 1px; margin-bottom: 10px; }
.login-brand p.slogan { opacity: .92; font-size: 14px; line-height: 1.8; margin-bottom: 30px; }
.login-brand ul { list-style: none; display: flex; flex-direction: column; gap: 12px; position: relative; z-index: 1; }
.login-brand li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; opacity: .96; }
.login-brand li .ico { font-size: 17px; line-height: 1.5; }
.login-form { padding: 46px 42px; display: flex; flex-direction: column; justify-content: center; }
.login-form h2 { font-size: 21px; margin-bottom: 6px; }
.login-form .sub { color: var(--text-2); font-size: 13px; margin-bottom: 26px; }
.login-form .class-badge {
  display: inline-block; background: var(--primary-soft); color: var(--primary); border-radius: 999px;
  padding: 2px 12px; font-size: 12px; font-weight: 600; margin-left: 6px;
}
.pwd-wrap { position: relative; }
.pwd-wrap .input { padding-right: 44px; }
.pwd-toggle { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.login-foot { margin-top: 22px; font-size: 12px; color: var(--text-3); line-height: 1.8; }

@media (max-width: 780px) {
  .login-shell { grid-template-columns: 1fr; max-width: 480px; }
  .login-brand { padding: 30px 28px; }
  .login-brand ul { display: none; }
  .login-form { padding: 30px 28px; }
}

/* ============================================================
   页脚（版权 / 备案）
   ============================================================ */
.site-footer {
  text-align: center; font-size: 12px; line-height: 1.9;
  color: var(--text-3); user-select: text;
}
.site-footer .cr { letter-spacing: .2px; }
.site-footer .sep-dot { margin: 0 8px; opacity: .5; }
.site-footer a {
  color: var(--text-3); text-decoration: none; transition: color .15s;
  border-bottom: 1px solid transparent;
}
.site-footer a:hover { color: var(--primary, #4f6ef7); border-bottom-color: currentColor; }

/* 登录页：卡片下方居中 */
.login-page { flex-direction: column; gap: 18px; }
.login-page .site-footer { max-width: 920px; }

/* 控制台页：页面底部通栏 */
.console-footer { padding: 0 22px 26px; }
.console-footer .site-footer {
  max-width: 1680px; margin: 0 auto; padding-top: 14px;
  border-top: 1px solid var(--line, rgba(0,0,0,.07));
}

/* 白板页：全屏布局放不下常规页脚，改低调角标（不干扰教学） */
.wb-footer {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 4px; z-index: 54;
  pointer-events: none;
}
.wb-footer .site-footer {
  font-size: 10.5px; line-height: 1.6; color: rgba(255, 255, 255, .62);
  text-shadow: 0 1px 6px rgba(10, 16, 40, .55);
}
.wb-footer .site-footer a { pointer-events: auto; color: rgba(255, 255, 255, .62); }
.wb-footer .site-footer a:hover { color: #fff; border-bottom-color: currentColor; }
@media (max-width: 720px) { .wb-footer { display: none; } }

/* ============================================================
   授权引导弹窗（摄像头 / 麦克风）
   ============================================================ */
.perm-mask {
  position: fixed; inset: 0; z-index: 500;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  background: rgba(12, 18, 38, .58); backdrop-filter: blur(10px);
  animation: permFade .25s ease;
}
.perm-mask.hide { display: none; }
@keyframes permFade { from { opacity: 0 } to { opacity: 1 } }

.perm-card {
  width: 100%; max-width: 430px; background: #fff; border-radius: 20px;
  padding: 30px 28px 24px; text-align: center;
  box-shadow: 0 24px 70px rgba(10, 16, 40, .34);
  animation: permUp .3s cubic-bezier(.2, .9, .3, 1.2);
}
@keyframes permUp { from { opacity: 0; transform: translateY(18px) scale(.97) } to { opacity: 1; transform: none } }

.perm-ico {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 18px;
  display: flex; align-items: center; justify-content: center; font-size: 30px;
  background: linear-gradient(140deg, #eef2ff 0%, #e0e7ff 100%);
}
.perm-card h2 { font-size: 19px; margin: 0 0 10px; }
.perm-sub { font-size: 13.5px; color: var(--text-2); line-height: 1.75; margin: 0 0 18px; }
.perm-sub b { color: var(--text); }

.perm-list { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 8px; }
.perm-list li {
  display: flex; align-items: center; gap: 10px; text-align: left;
  padding: 10px 13px; border-radius: 12px; background: var(--bg-soft, #f6f8fd);
  border: 1px solid var(--line, rgba(0, 0, 0, .06));
}
.perm-list li .ico { font-size: 17px; }
.perm-list li .txt { flex: 1; font-size: 13.5px; }
.perm-list li .txt b { color: var(--text-2); font-weight: 600; }
.perm-list li .st { font-size: 11.5px; }

.perm-note {
  font-size: 12.5px; color: var(--text-3); line-height: 1.7;
  background: #fff8e6; border: 1px solid #ffe6a8; border-radius: 10px;
  padding: 9px 12px; margin-bottom: 16px; text-align: left;
}
.perm-note.ok { background: #eafaf0; border-color: #b7ebc9; }
.perm-note.err { background: #fdecec; border-color: #f8c4c4; }
.perm-note b { color: inherit; }

.perm-done { font-size: 13px; color: var(--text-2); padding: 6px 0 2px; }

/* ============================================================
   学生白板页
   ============================================================ */
.wb-body {
  min-height: 100vh; overflow: hidden;
  background-size: cover; background-position: center; background-attachment: fixed;
}
.wb-dim { position: fixed; inset: 0; pointer-events: none; background: rgba(10, 16, 36, 0); transition: background .3s; z-index: 0; }
.wb-dim.blur { backdrop-filter: blur(0px); }

.wb-topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; gap: 10px; padding: 10px 16px;
  background: rgba(255, 255, 255, .82); backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(230, 234, 242, .8);
}
.wb-topbar .brand { font-weight: 800; font-size: 16px; display: flex; align-items: center; gap: 8px; }
.wb-topbar .brand .logo { font-size: 20px; }
.wb-topbar .chips { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-topbar .name-chip { font-weight: 700; }

.wb-banner {
  position: fixed; top: 62px; left: 50%; transform: translateX(-50%); z-index: 60;
  background: rgba(23, 32, 54, .9); color: #fff; border-radius: 14px; padding: 12px 20px;
  display: flex; gap: 10px; align-items: center; max-width: min(88vw, 720px);
  box-shadow: var(--shadow-lg); animation: slideDown .35s ease; font-size: 14px;
}
.wb-banner .ico { font-size: 18px; }
.wb-banner.hide-anim { animation: slideUp .3s ease forwards; }
@keyframes slideDown { from { opacity: 0; transform: translate(-50%, -14px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes slideUp { to { opacity: 0; transform: translate(-50%, -14px); } }

.wb-stage {
  position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 90px 20px 130px; text-align: center;
}
.wb-clock .time {
  font-size: clamp(64px, 13vw, 148px); font-weight: 800; letter-spacing: 4px;
  color: #fff; text-shadow: 0 6px 40px rgba(10, 16, 40, .45); font-variant-numeric: tabular-nums;
  line-height: 1.12;
}
.wb-clock .time .sec { font-size: .42em; font-weight: 600; opacity: .82; margin-left: 8px; }
.wb-clock .date { color: rgba(255,255,255,.94); font-size: clamp(15px, 1.9vw, 21px); margin-top: 8px; text-shadow: 0 2px 18px rgba(10,16,40,.5); font-weight: 500; letter-spacing: 1px; }
.wb-clock .greet { color: rgba(255,255,255,.8); margin-top: 22px; font-size: 15px; text-shadow: 0 2px 12px rgba(10,16,40,.5); }

.wb-dock {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 55;
  display: flex; gap: 6px; padding: 8px; border-radius: 20px;
  background: rgba(255, 255, 255, .86); backdrop-filter: blur(16px);
  box-shadow: var(--shadow-lg); border: 1px solid rgba(255,255,255,.7);
  max-width: calc(100vw - 24px); overflow-x: auto;
}
.wb-dock .dock-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 13px;
  border-radius: 14px; transition: .16s; min-width: 62px; position: relative;
}
.wb-dock .dock-btn .ico { font-size: 21px; line-height: 1.2; }
.wb-dock .dock-btn .lbl { font-size: 11.5px; color: var(--text-2); font-weight: 600; }
.wb-dock .dock-btn:hover { background: var(--primary-soft); transform: translateY(-3px); }
.wb-dock .dock-btn .badge {
  position: absolute; top: 2px; right: 6px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 999px; padding: 1px 6px;
}

.wb-panel {
  position: fixed; z-index: 120; left: 50%; bottom: 0; transform: translateX(-50%);
  width: min(760px, 100vw); background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -12px 50px rgba(20, 30, 70, .22); max-height: 82vh;
  display: flex; flex-direction: column; animation: sheetUp .26s ease;
}
@keyframes sheetUp { from { transform: translate(-50%, 30px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.wb-panel .panel-head { display: flex; align-items: center; gap: 10px; padding: 15px 20px 12px; border-bottom: 1px solid var(--line); }
.wb-panel .panel-head h3 { font-size: 16px; flex: 1; }
.wb-panel .panel-body { padding: 18px 20px 26px; overflow: auto; }

/* 分贝仪 */
.db-main { display: flex; align-items: baseline; gap: 10px; justify-content: center; margin: 6px 0 2px; }
.db-main .val { font-size: 62px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.db-main .unit { font-size: 18px; color: var(--text-2); font-weight: 600; }
.db-main .val.over { color: var(--red); animation: dbShake .5s ease infinite; }
@keyframes dbShake { 0%,100% { transform: none; } 25% { transform: translateX(-1.5px); } 75% { transform: translateX(1.5px); } }
.db-bar { position: relative; height: 14px; background: #eef1f6; border-radius: 999px; overflow: hidden; margin: 16px 0 6px; }
.db-bar .fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: 999px; background: linear-gradient(90deg, #22c55e, #84cc16, #f59e0b, #ef4444); background-size: 760px 100%; transition: width .12s linear; }
.db-bar .th { position: absolute; top: -4px; bottom: -4px; width: 3px; background: #111827; border-radius: 2px; opacity: .75; }
.db-marks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); }
.db-canvas { width: 100%; height: 90px; margin-top: 14px; border-radius: 10px; background: #f8fafd; border: 1px solid var(--line); }
.db-status { text-align: center; margin-top: 10px; font-size: 14px; font-weight: 600; }

/* 计时器 */
.timer-display { font-size: 52px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; margin: 8px 0 18px; letter-spacing: 2px; }
.timer-inputs { display: flex; gap: 10px; justify-content: center; align-items: center; margin-bottom: 16px; }
.timer-inputs input { width: 74px; text-align: center; font-size: 20px; font-weight: 700; padding: 10px 6px; border: 1.5px solid var(--line); border-radius: 10px; outline: none; }
.timer-inputs input:focus { border-color: var(--primary); }
.timer-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.lap-list { margin-top: 16px; max-height: 160px; overflow: auto; border-top: 1px dashed var(--line); }
.lap-list div { display: flex; justify-content: space-between; padding: 7px 4px; border-bottom: 1px dashed var(--line); font-size: 13px; color: var(--text-2); }

/* 便签 */
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(175px, 1fr)); gap: 12px; }
.sticky {
  border-radius: 12px; padding: 12px; min-height: 120px; position: relative; display: flex; flex-direction: column;
  box-shadow: 0 4px 14px rgba(31,45,90,.09); transition: .16s;
}
.sticky:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(31,45,90,.13); }
.sticky.yellow { background: #fff8d9; } .sticky.blue { background: #ddeeff; }
.sticky.green { background: #ddf5e4; } .sticky.pink { background: #ffe3ee; }
.sticky textarea {
  flex: 1; background: transparent; border: none; outline: none; resize: none; font-size: 14px; line-height: 1.65;
}
.sticky .bar { display: flex; justify-content: space-between; align-items: center; margin-top: 6px; }
.sticky .bar .t { font-size: 11px; color: rgba(60,70,100,.55); }
.notes-add { display: flex; gap: 10px; margin-bottom: 16px; }
.notes-add textarea { flex: 1; }
.color-dots { display: flex; gap: 8px; align-items: center; }
.color-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.color-dot.sel { border-color: var(--primary); transform: scale(1.12); }
.color-dot.yellow { background: #fff8d9; } .color-dot.blue { background: #ddeeff; }
.color-dot.green { background: #ddf5e4; } .color-dot.pink { background: #ffe3ee; }

/* 点名 */
.pick-display {
  font-size: 46px; font-weight: 800; text-align: center; padding: 30px 10px; min-height: 120px;
  display: flex; align-items: center; justify-content: center; color: var(--primary);
  letter-spacing: 2px;
}
.pick-display.rolling { color: var(--text-3); }

/* 壁纸面板 */
.wp-section-title { font-size: 13px; font-weight: 700; color: var(--text-2); margin: 16px 0 10px; }
.wp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.wp-item {
  aspect-ratio: 16/10; border-radius: 12px; overflow: hidden; cursor: pointer; position: relative;
  border: 3px solid transparent; background-size: cover; background-position: center; transition: .16s;
}
.wp-item:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.wp-item.sel { border-color: var(--primary); }
.wp-item.sel::after {
  content: "✓"; position: absolute; right: 6px; top: 4px; color: #fff; font-weight: 800;
  text-shadow: 0 1px 6px rgba(0,0,0,.6); font-size: 15px;
}
.wp-item .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 3px 8px; font-size: 11px; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.55)); }
.wp-upload { display: flex; align-items: center; justify-content: center; border: 2px dashed var(--line); background: #fafbfe; border-radius: 12px; color: var(--text-2); flex-direction: column; gap: 4px; font-size: 12px; cursor: pointer; aspect-ratio: 16/10; }
.wp-upload:hover { border-color: var(--primary); color: var(--primary); }
.wp-ctrls { margin-top: 18px; display: flex; flex-direction: column; gap: 14px; }
.wp-ctrls .row label { width: 84px; flex: none; font-size: 13px; color: var(--text-2); font-weight: 600; }
.wp-ctrls .row .val { width: 44px; text-align: right; font-size: 12px; color: var(--text-3); font-variant-numeric: tabular-nums; }

/* 公告面板 */
.ann-list { display: flex; flex-direction: column; gap: 10px; }
.ann-item { background: #f8fafd; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.ann-item .meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--text-3); margin-bottom: 5px; }
.ann-item .txt { font-size: 14px; white-space: pre-wrap; word-break: break-word; }

/* 画板 */
.draw-wrap { position: fixed; inset: 0; z-index: 150; background: #fff; display: flex; flex-direction: column; }
.draw-toolbar {
  display: flex; align-items: center; gap: 8px; padding: 10px 14px; flex-wrap: wrap;
  border-bottom: 1px solid var(--line); background: #fff;
}
.draw-toolbar .sep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.pen-dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; }
.pen-dot.sel { border-color: var(--primary); transform: scale(1.1); }
.size-btn {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line);
}
.size-btn.sel { border-color: var(--primary); background: var(--primary-soft); }
.size-btn .dotc { background: #1f2937; border-radius: 50%; }
.draw-canvas-wrap { flex: 1; position: relative; overflow: hidden; }
.draw-canvas-wrap canvas { position: absolute; inset: 0; touch-action: none; cursor: crosshair; }
.draw-tip { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(23,32,54,.75); color: #fff; font-size: 12px; padding: 6px 14px; border-radius: 999px; pointer-events: none; transition: opacity .4s; }

/* ============================================================
   教师控制台
   ============================================================ */
.console-body { background: var(--bg); min-height: 100vh; }
.console-topbar {
  position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 12px;
  padding: 12px 22px; background: rgba(255,255,255,.88); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.console-topbar .title { font-size: 17px; font-weight: 800; display: flex; gap: 8px; align-items: center; }
.console-topbar .stats { display: flex; gap: 8px; flex-wrap: wrap; }

.console-main {
  display: grid; grid-template-columns: minmax(0, 1fr) 370px; gap: 18px;
  padding: 18px 22px 40px; max-width: 1680px; margin: 0 auto;
}
@media (max-width: 1100px) { .console-main { grid-template-columns: 1fr; } }

.students-board { min-width: 0; }
.students-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 14px; }
.stu-card {
  background: #fff; border-radius: 14px; overflow: hidden; border: 1.5px solid rgba(230,234,242,.85);
  box-shadow: var(--shadow); transition: .16s; cursor: pointer; position: relative;
}
.stu-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.stu-card.alerting { border-color: var(--red); animation: cardAlert 1.2s ease infinite; }
@keyframes cardAlert { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,.35); } 50% { box-shadow: 0 0 0 6px rgba(239,68,68,0); } }
.stu-card .shot { position: relative; aspect-ratio: 4/3; background: #0f1524; }
.stu-card .shot img { width: 100%; height: 100%; object-fit: cover; }
.stu-card .shot .no-cam { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; color: #8b94a8; font-size: 13px; }
.stu-card .shot .no-cam .ico { font-size: 30px; opacity: .7; }
.stu-card .shot .badges { position: absolute; left: 8px; top: 8px; display: flex; gap: 6px; }
.stu-card .shot .ts { position: absolute; right: 8px; bottom: 6px; font-size: 11px; color: #e6eaf4; text-shadow: 0 1px 4px #000; }
.stu-card .info { padding: 10px 12px 12px; }
.stu-card .info .name-row { display: flex; align-items: center; gap: 7px; margin-bottom: 8px; }
.stu-card .info .name { font-weight: 700; font-size: 14.5px; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stu-card .db-row { display: flex; align-items: center; gap: 8px; }
.stu-card .db-row .mini-bar { flex: 1; height: 8px; background: #eef1f6; border-radius: 999px; overflow: hidden; }
.stu-card .db-row .mini-bar i { display: block; height: 100%; width: 0; border-radius: 999px; background: #22c55e; transition: width .3s; }
.stu-card .db-row .mini-bar i.over { background: var(--red); }
.stu-card .db-row .v { font-size: 12px; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; width: 46px; text-align: right; }

.side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.alert-item {
  display: flex; gap: 10px; padding: 11px 12px; border-radius: 12px; background: #f8fafd;
  border: 1px solid var(--line); align-items: flex-start;
}
.alert-item.new { background: var(--red-soft); border-color: #fecaca; }
.alert-item .ico { font-size: 18px; line-height: 1.35; }
.alert-item .body { flex: 1; min-width: 0; }
.alert-item .t1 { font-size: 13.5px; font-weight: 600; }
.alert-item .t3 { font-size: 12.5px; color: var(--text-2); margin-top: 3px; word-break: break-word; }
.alert-item .t2 { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.alert-item .acts { display: flex; gap: 4px; }

.set-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--line); }
.set-row:last-child { border-bottom: none; }
.set-row > label { flex: 1; font-size: 13.5px; color: var(--text-2); }
.set-row .val { font-size: 13px; font-weight: 700; color: var(--primary); width: 58px; text-align: right; font-variant-numeric: tabular-nums; }
.set-row select.input { width: 108px; padding: 7px 10px; }

.pick-box { text-align: center; }
.pick-box .picked { font-size: 34px; font-weight: 800; color: var(--primary); margin: 10px 0 14px; min-height: 46px; letter-spacing: 1px; }
.pick-box .picked.rolling { color: var(--text-3); }

/* 放大查看 */
.viewer-img { width: 100%; border-radius: 12px; background: #0f1524; aspect-ratio: 4/3; object-fit: contain; }

/* ============================================================
   分段切换按钮（普通公告 / 临时提醒、滚动 / 轮盘）
   ============================================================ */
.seg {
  display: flex; gap: 4px; padding: 3px; background: #eef1f6; border-radius: 10px;
}
.seg-btn {
  flex: 1; border: none; background: transparent; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 600; color: var(--text-2); padding: 7px 10px; border-radius: 8px;
  transition: .15s; white-space: nowrap;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: #fff; color: var(--primary); box-shadow: 0 1px 3px rgba(20,30,60,.12); }

/* ============================================================
   抽签轮盘
   ============================================================ */
.pick-wheel-wrap {
  position: relative; width: 236px; height: 236px; margin: 6px auto 14px;
}
.pick-wheel { width: 100%; height: 100%; display: block; }
.pick-pointer {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent;
  border-top: 16px solid var(--red); filter: drop-shadow(0 2px 3px rgba(0,0,0,.25)); z-index: 2;
}

/* ============================================================
   点名名单管理
   ============================================================ */
.pool-import {
  background: #f8fafd; border: 1px solid var(--line); border-radius: 12px;
  padding: 12px; margin-bottom: 14px;
}
.pool-import textarea.input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.7; }
.pool-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.pool-list { display: flex; flex-direction: column; gap: 7px; max-height: 380px; overflow: auto; padding-right: 2px; }
.pool-row {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: .15s;
}
.pool-row.off { background: #f6f7fa; opacity: .62; }
.pool-row .input.nm { flex: 1; min-width: 70px; padding: 6px 9px; font-size: 13.5px; }
.pool-row .input.wt { width: 66px; padding: 6px 7px; font-size: 13px; text-align: center; }
.pool-row .prob { width: 62px; text-align: right; font-variant-numeric: tabular-nums; }
.switch.sm { width: 36px; height: 20px; }
.switch.sm i::after { width: 14px; height: 14px; top: 3px; left: 3px; }
.switch.sm input:checked + i::after { transform: translateX(16px); }

/* ============================================================
   公告条目：临时提醒 + 附加信息
   ============================================================ */
.ann-item.remind { background: var(--amber-soft); border-color: #fde68a; }
.ann-item .sub { font-size: 11.5px; color: var(--text-3); margin-top: 6px; font-variant-numeric: tabular-nums; }
.ann-item .meta .spacer { flex: 1; }

/* ============================================================
   学生端公告横幅：临时提醒增强
   ============================================================ */
.wb-banner.remind {
  background: linear-gradient(135deg, rgba(180, 83, 9, .96), rgba(217, 119, 6, .96));
  border: 1px solid rgba(255, 255, 255, .25);
}
.wb-banner .banner-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.wb-banner .banner-tag { font-size: 12px; font-weight: 800; letter-spacing: .3px; }
.wb-banner .banner-count {
  font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .18); white-space: nowrap; font-variant-numeric: tabular-nums;
}
.wb-banner.remind .ico { animation: bellShake 1.1s ease infinite; }
@keyframes bellShake {
  0%, 60%, 100% { transform: rotate(0); }
  68% { transform: rotate(-12deg); }
  76% { transform: rotate(10deg); }
  84% { transform: rotate(-7deg); }
  92% { transform: rotate(4deg); }
}
