:root {
  --ink: #1b1b1a; --ink2: #5f5e5a; --line: #e4e3de; --bg: #f6f5f2;
  --card: #ffffff; --brand: #185fa5; --brand-soft: #e6f1fb;
  --danger: #a32d2d; --danger-soft: #fcebeb; --ok: #0f6e56; --amber: #854f0b; --amber-soft: #faeeda;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; color: var(--ink); background: var(--bg); font-size: 14px; line-height: 1.6; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-weight: 500; margin: 0; }
.muted { color: var(--ink2); }
.small { font-size: 12px; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.login-box { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 28px; }
.login-box h1 { font-size: 19px; margin-bottom: 4px; }
.login-box p { color: var(--ink2); font-size: 13px; margin: 0 0 20px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; margin-bottom: 6px; color: var(--ink2); }
.inp, .ta, .sel { width: 100%; border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 9px 11px; outline: none; }
.inp:focus, .ta:focus, .sel:focus { border-color: var(--brand); }
.ta { min-height: 100px; resize: vertical; }
.btn { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 8px; padding: 9px 16px; }
.btn:hover { border-color: #b4b2a9; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: #0c447c; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.err { color: var(--danger); font-size: 13px; min-height: 20px; }

/* ---------- 管理页 ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); padding: 14px 24px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar h1 { font-size: 17px; }
.badge { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink2); }
.badge.on { background: #e1f5ee; border-color: #9fe1cb; color: var(--ok); }
.badge.off { background: var(--danger-soft); border-color: #f7c1c1; color: var(--danger); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 20px 24px 60px; }
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 900px) { .grid { grid-template-columns: 1fr; } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.card h2 { font-size: 15px; margin-bottom: 4px; }
.card .sub { color: var(--ink2); font-size: 12.5px; margin: 0 0 14px; }
.hint { font-size: 12px; color: var(--ink2); margin-top: 6px; line-height: 1.6; }
.chk { display: inline-flex; gap: 7px; align-items: center; font-size: 13px; color: var(--ink2); }
.quick { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.quick button { font-size: 12px; padding: 4px 10px; border-radius: 999px; }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.notice-box { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: var(--brand-soft); }
.notice-box.warn { background: var(--amber-soft); border-color: #fac775; }
.notice-box.danger { background: var(--danger-soft); border-color: #f7c1c1; }
.notice-box h3 { font-size: 14px; }
video { width: 100%; border-radius: 10px; background: #171717; aspect-ratio: 16/9; object-fit: contain; }
.log { max-height: 230px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; }
.log-row { display: flex; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line); font-size: 12px; }
.log-row:last-child { border-bottom: 0; }
.log-row time { color: var(--ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.log-row b { font-weight: 500; white-space: nowrap; }
.log-row span { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.countdown { font-variant-numeric: tabular-nums; color: var(--danger); font-size: 13px; }

/* ---------- 一体机大屏 ---------- */
#screenBody { background: #0b0b0c; color: #f5f5f4; height: 100vh; overflow: hidden; }
#stage { position: relative; height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; }
#clock { font-size: clamp(64px, 12vw, 170px); font-weight: 300; letter-spacing: .04em; font-variant-numeric: tabular-nums; line-height: 1; }
#date { font-size: clamp(16px, 2.4vw, 30px); color: #8a8a88; margin-top: 14px; }
#standby { opacity: .82; }
#conn { position: absolute; bottom: 22px; left: 0; right: 0; font-size: 13px; color: #6f6f6d; }
#conn.off { color: #e24b4a; }
#soundBtn { position: absolute; bottom: 54px; left: 50%; transform: translateX(-50%); background: #1d1d1f; color: #d8d8d6; border: 1px solid #333; border-radius: 999px; padding: 8px 18px; font-size: 13px; }
#noticeCard { display: none; position: absolute; inset: 0; padding: 6vh 7vw; background: #faf9f6; color: #1b1b1a; flex-direction: column; justify-content: center; align-items: center; }
#noticeCard.show { display: flex; }
#noticeTitle { font-size: clamp(26px, 4vw, 54px); color: #185fa5; margin-bottom: 24px; }
#noticeText { font-size: clamp(34px, 6.4vw, 92px); line-height: 1.35; font-weight: 500; white-space: pre-wrap; word-break: break-word; }
#noticeMeta { margin-top: 34px; font-size: clamp(14px, 1.8vw, 22px); color: #777; }
#viewing { display: none; position: absolute; top: 0; left: 0; right: 0; z-index: 5; background: #a32d2d; color: #fff; padding: 14px 20px; font-size: clamp(16px, 2.2vw, 28px); letter-spacing: .03em; }
#viewing.show { display: block; }
#viewing small { display: block; font-size: 13px; opacity: .88; letter-spacing: 0; }
#speakTip { display: none; position: absolute; bottom: 96px; left: 50%; transform: translateX(-50%); background: #185fa5; color: #fff; padding: 10px 22px; border-radius: 999px; font-size: 16px; }
#speakTip.show { display: block; }
