/* ============ 班级广播 · 简约浅色主题 ============ */
:root {
  --bg: #f2f5f9;
  --card: #ffffff;
  --border: #e6ebf2;
  --text: #1d2436;
  --muted: #8b94a8;
  --accent: #4f6ef7;
  --accent-soft: #eef1ff;
  --ok: #16a34a;
  --danger: #ef4444;
  --warn: #f59e0b;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 10px 28px -16px rgba(16,24,40,.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100%; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.view { min-height: 100vh; display: flex; flex-direction: column; }

/* ---------- 通用卡片/按钮 ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 20px; box-shadow: var(--shadow);
}
.btn {
  border: none; border-radius: 12px; padding: 13px 16px; font-size: 15px;
  font-weight: 600; cursor: pointer; color: #fff; width: 100%;
  font-family: inherit; transition: transform .06s, box-shadow .15s, opacity .15s;
}
.btn:active { transform: scale(.985); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.big { padding: 15px; font-size: 16px; border-radius: 14px; }
.btn.small { width: auto; padding: 7px 13px; font-size: 13px; border-radius: 10px; }
.btn.primary { background: var(--accent); box-shadow: 0 6px 16px -6px rgba(79,110,247,.55); }
.btn.primary:hover:not(:disabled) { box-shadow: 0 8px 20px -6px rgba(79,110,247,.65); }
.btn.record { background: linear-gradient(135deg, #f15f79, #e63956); box-shadow: 0 6px 16px -6px rgba(230,57,86,.5); }
.btn.record.recording { animation: pulse 1s infinite; }
.btn.danger { background: #fff; color: var(--danger); border: 1.5px solid #fecaca; }
.btn.danger:hover { background: #fef2f2; }
.btn.warn { background: #fff; color: #b45309; border: 1.5px solid #fde68a; }
.btn.warn:hover { background: #fffbeb; }
.btn.outline { background: #fff; color: var(--accent); border: 1.5px solid #c7d2fe; }
.btn.outline:hover { background: var(--accent-soft); }
.btn.outline.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.pill-btn { width: auto; padding: 9px 16px; font-size: 14px; border-radius: 999px; }
.pill-btn.primary-soft { background: var(--accent-soft); color: var(--accent); }
.pill-btn.primary-soft:hover { background: #e0e7ff; }
.pill-btn.solid { background: var(--accent); color: #fff; }
.pill-btn.ghost { background: #f1f3f7; color: #6b7280; }
.pill-btn.ghost:hover { background: #e8ebf1; }
@keyframes pulse { 50% { filter: brightness(1.12); box-shadow: 0 0 0 8px rgba(230,57,86,.12); } }

/* ---------- 顶栏 ---------- */
header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 26px; background: rgba(255,255,255,.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 18px;
}
.brand-name { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
}
.pill .dot { width: 8px; height: 8px; border-radius: 50%; }
.pill.online { background: #ecfdf3; color: #067647; border: 1px solid #abefc6; }
.pill.online .dot { background: var(--ok); box-shadow: 0 0 0 3px rgba(22,163,74,.18); animation: blink 1.6s infinite; }
.pill.offline { background: #fef2f2; color: #b42318; border: 1px solid #fecdca; }
.pill.offline .dot { background: #d92d20; }
@keyframes blink { 50% { opacity: .45; } }

/* ---------- 布局 ---------- */
.grid {
  flex: 1; width: 100%; max-width: 1060px; margin: 0 auto;
  padding: 22px 20px 10px; display: grid; gap: 16px;
  grid-template-columns: 1fr 1fr;
}
.col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; }
.card-head h2 { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head .ico {
  width: 28px; height: 28px; border-radius: 8px; background: var(--accent-soft);
  display: grid; place-items: center; font-size: 14px;
}

/* ---------- 文字通知 ---------- */
textarea {
  width: 100%; resize: vertical; border-radius: 12px; border: 1.5px solid var(--border);
  background: #fafbfd; color: var(--text); padding: 12px 14px; font-size: 15px;
  font-family: inherit; margin-bottom: 10px; min-height: 64px; transition: border .15s;
}
textarea:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(79,110,247,.12); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip {
  background: #f1f3f7; border: 1px solid transparent; color: #5b6475;
  padding: 6px 13px; border-radius: 999px; font-size: 13px; cursor: pointer;
  transition: all .12s; font-family: inherit;
}
.chip:hover { background: var(--accent-soft); color: var(--accent); border-color: #c7d2fe; }

/* ---------- 语音通知 ---------- */
.hint { color: var(--muted); font-size: 12.5px; margin-bottom: 11px; line-height: 1.6; }
.offline-hint { margin-top: 10px; font-size: 12.5px; color: var(--danger); }
.warn-text { margin-top: 10px; font-size: 12.5px; color: #b45309; min-height: 18px; }
.vu-box { margin-top: 12px; }
.vu { display: flex; align-items: flex-end; gap: 3px; height: 30px; background: #f3f5f9; border-radius: 10px; padding: 5px 8px; }
.vu i { flex: 1; background: #d3dbea; border-radius: 3px; height: 4px; transition: height .06s ease-out; }
.vu i.hot { background: var(--accent); }
.vu-label { display: block; color: var(--muted); font-size: 12px; margin-top: 7px; }
.voice-card {
  display: flex; align-items: center; gap: 9px; margin-top: 13px;
  background: #f7f9fc; border: 1px solid var(--border); border-radius: 14px; padding: 11px 13px;
  flex-wrap: wrap;
}
.voice-bubble {
  background: var(--accent); color: #fff; border-radius: 12px; padding: 9px 14px;
  font-size: 14px; font-weight: 600; min-width: 64px; text-align: center;
}

/* ---------- 监控 ---------- */
.video-wrap {
  position: relative; aspect-ratio: 16/9; background: #10131a; border-radius: 12px; overflow: hidden;
}
#videoImg { width: 100%; height: 100%; object-fit: cover; display: none; }
#videoImg.show { display: block; }
.video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 8px;
  align-items: center; justify-content: center; color: #8b94a8; font-size: 14px;
}
.video-placeholder .vp-ico { font-size: 30px; opacity: .85; }
.video-placeholder small { color: #5f6b80; font-size: 12px; }

/* ---------- 电源 ---------- */
.row { display: flex; gap: 12px; }
.power-msg { margin-top: 10px; font-size: 12.5px; color: var(--warn); min-height: 18px; }

/* ---------- 监控：紧凑卡片 + 全屏浮层 ---------- */
.monitor-actions { display: flex; gap: 8px; }
#videoOverlay {
  position: fixed; inset: 0; z-index: 200; background: #0b0e14;
  display: flex; flex-direction: column; padding: 12px 14px 14px;
}
#videoOverlay .vo-top {
  display: flex; align-items: center; justify-content: space-between;
  color: #e6ebf4; font-size: 15px; font-weight: 600; padding: 2px 2px 10px;
}
#videoOverlay .vo-close {
  background: rgba(255,255,255,.12); color: #fff; border: none; border-radius: 10px;
  padding: 8px 16px; font-size: 13px; cursor: pointer; font-family: inherit;
}
#videoOverlay .vo-close:hover { background: rgba(255,255,255,.22); }
#videoOverlay #videoImg { flex: 1; width: 100%; object-fit: contain; display: none; border-radius: 8px; background: #000; }
#videoOverlay #videoImg.show { display: block; }
#videoOverlay .video-placeholder {
  position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center; color: #8b94a8; font-size: 15px;
}
#videoOverlay .video-placeholder .vp-ico { font-size: 40px; }
#videoOverlay .video-placeholder small { color: #5f6b80; font-size: 13px; }

/* ---------- 动态记录 ---------- */
.log-card { grid-column: 1 / -1; padding: 18px 20px; }
.log-area {
  max-height: 190px; overflow-y: auto; font-size: 13px; line-height: 2.1;
  color: #4b5563; padding-right: 8px;
}
.log-area .t { color: var(--muted); margin-right: 10px; font-variant-numeric: tabular-nums; }
.log-area small { color: var(--muted); margin-left: 4px; }
.log-empty { color: #b6bfce; }
.log-area::-webkit-scrollbar { width: 6px; }
.log-area::-webkit-scrollbar-thumb { background: #d5dbe6; border-radius: 3px; }

.footer { text-align: center; color: #b0b8c6; font-size: 12px; padding: 14px 0 26px; }

/* ---------- 口令页 ---------- */
#login { align-items: center; justify-content: center; background: radial-gradient(1200px 600px at 30% 0%, #eef1ff 0%, var(--bg) 55%); }
.login-card { text-align: center; width: min(380px, 92vw); padding: 34px 28px 26px; border-radius: 24px; }
.login-card .logo {
  width: 62px; height: 62px; margin: 0 auto 14px; border-radius: 20px;
  background: var(--accent-soft); display: grid; place-items: center; font-size: 30px;
}
.login-card h1 { font-size: 22px; font-weight: 800; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }
.pin-dots { display: flex; gap: 14px; justify-content: center; margin-bottom: 22px; }
.pin-dots span {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid #cfd6e4; transition: all .15s;
}
.pin-dots span.fill { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px rgba(79,110,247,.18); }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.key {
  font-size: 20px; padding: 13px 0; border-radius: 12px; border: 1px solid var(--border);
  background: #f8f9fc; color: var(--text); cursor: pointer; font-family: inherit;
  transition: all .1s;
}
.key:hover { background: var(--accent-soft); border-color: #c7d2fe; }
.key:active { transform: scale(.96); }
.key.ghost { background: transparent; color: var(--muted); }
.msg { margin-top: 14px; color: var(--danger); min-height: 20px; font-size: 13.5px; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
  .log-card { grid-column: auto; }
  header { padding: 12px 16px; }
}
