* { box-sizing: border-box; margin: 0; padding: 0; }
:root{
  /* 稳重政务配色：深红为主、墨黑文字、浅灰背景 */
  --red:#9e1c1c; --red-d:#7d1515; --red-l:#faf2f2;
  --ink:#1f2329; --muted:#6b7280; --line:#e3e6ea; --bg:#f4f5f7;
  --green:#2f7d32; --blue:#1f5faa; --amber:#b06a00;
  --card:#ffffff;
  --shadow:0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}
body{ font-family:-apple-system,"Segoe UI","Microsoft YaHei","PingFang SC",sans-serif; color:var(--ink); background:var(--bg); line-height:1.65; -webkit-font-smoothing:antialiased; }
a{ color:var(--red); text-decoration:none; }
.btn{ display:inline-flex; align-items:center; gap:6px; border:none; cursor:pointer; padding:9px 18px; border-radius:4px; font-size:14px; background:var(--red); color:#fff; transition:background .15s; font-weight:500; letter-spacing:.3px; }
.btn:hover{ background:var(--red-d); }
.btn:disabled{ background:#c2c7cd; cursor:not-allowed; }
.btn.ghost{ background:#fff; color:var(--ink); border:1px solid var(--line); }
.btn.ghost:hover{ background:#f3f4f6; }
.btn.green{ background:var(--green);} .btn.green:hover{filter:brightness(.94);}
.btn.blue{ background:var(--blue);} .btn.blue:hover{filter:brightness(.94);}
.btn.amber{ background:var(--amber);} .btn.amber:hover{filter:brightness(.94);}
.btn.sm{ padding:6px 12px; font-size:13px; border-radius:4px; }
.btn.block{ width:100%; justify-content:center; }
.card{ background:var(--card); border:1px solid var(--line); border-radius:6px; box-shadow:var(--shadow); padding:22px; }
.card + .card{ margin-top:18px; }
.input{ width:100%; padding:10px 13px; border:1px solid var(--line); border-radius:4px; font-size:15px; outline:none; background:#fff; color:var(--ink); }
.input:focus{ border-color:var(--red); box-shadow:0 0 0 2px var(--red-l); }
label{ font-size:13px; color:var(--muted); display:block; margin-bottom:6px; }
.field{ margin-bottom:16px; }
.topbar{ background:var(--red); color:#fff; padding:0 22px; height:56px; display:flex; align-items:center; justify-content:space-between; border-bottom:3px solid var(--red-d); }
.topbar .title{ font-size:17px; font-weight:600; display:flex; align-items:center; gap:10px; letter-spacing:.5px; }
.topbar .badge{ background:rgba(255,255,255,.18); padding:2px 10px; border-radius:3px; font-size:12px; }
.topbar .usr{ font-size:14px; }
.wrap{ max-width:1100px; margin:22px auto; padding:0 18px; }
.tag{ display:inline-block; padding:2px 9px; border-radius:3px; font-size:12px; font-weight:500; }
.tag.a{ background:#fdeaea; color:#9e1c1c; } .tag.b{ background:#e8f0fb; color:#1f5faa; }
.tag.ok{ background:#e7f3e8; color:#2f7d32; } .tag.no{ background:#eef0f2; color:#6b7280; } .tag.gu{ background:#fbf0dc; color:#b06a00;}
table{ width:100%; border-collapse:collapse; font-size:14px; }
th,td{ padding:9px 12px; border-bottom:1px solid var(--line); text-align:left; }
th{ background:#f3f4f6; color:#374151; font-weight:600; font-size:13px; position:sticky; top:0; border-bottom:2px solid var(--line); }
tbody tr:nth-child(even) td{ background:#fafbfc; }
tr:hover td{ background:#f5f7f9; }
.grid{ display:grid; gap:16px; }
.muted{ color:var(--muted); } .center{ text-align:center; }
.rep-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:14px; }
.rep-item{ display:flex; align-items:center; justify-content:space-between; gap:12px; padding:14px 16px; border:1px solid var(--line); border-radius:6px; background:#fafbfc; }
.rep-t{ font-weight:600; font-size:14px; }
.rep-d{ font-size:12px; color:var(--muted); margin-top:3px; }
.toast{ position:fixed; top:18px; left:50%; transform:translateX(-50%); background:#1f2329; color:#fff; padding:11px 20px; border-radius:4px; z-index:9999; box-shadow:var(--shadow); opacity:0; transition:.25s; pointer-events:none; font-size:14px;}
.toast.show{ opacity:1; }
.toast.err{ background:#9e1c1c; } .toast.ok{ background:#2f7d32; }
.hide{ display:none !important; }
/* 岗位卡片 */
.pos-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px; }
.pos{ border:1px solid var(--line); border-radius:6px; padding:16px; cursor:pointer; transition:border-color .15s,background .15s; background:#fff; }
.pos:hover{ border-color:var(--red); }
.pos.sel{ border-color:var(--red); background:var(--red-l); }
.pos.full{ opacity:.55; cursor:not-allowed; background:#f6f7f8;}
.pos.locked{ cursor:not-allowed; background:#f6f7f8; border-style:dashed; }
.pos .sch{ font-size:16px; font-weight:600; margin-bottom:8px; }
.pos .rem{ font-size:13px; color:var(--muted); }
.pos .rem b{ font-size:22px; color:var(--ink); }
.pos .locktip{ font-size:12px; color:var(--muted); margin-top:6px; }
.timer{ font-size:40px; font-weight:700; font-variant-numeric:tabular-nums; letter-spacing:1px; }
.timer.warn{ color:var(--amber);} .timer.danger{ color:var(--red); animation:blink 1s infinite;}
@keyframes blink{ 50%{opacity:.4;} }
.stat-grid{ display:grid; grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:14px; }
.stat{ background:#fff; border:1px solid var(--line); border-left:3px solid var(--red); border-radius:6px; padding:16px 18px; }
.stat .num{ font-size:28px; font-weight:700; color:var(--ink); } .stat .lab{ color:var(--muted); font-size:13px; margin-top:2px; }
.tabs{ display:flex; gap:2px; border-bottom:2px solid var(--line); margin-bottom:18px; flex-wrap:wrap;}
.tab{ padding:10px 18px; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; color:var(--muted); font-weight:500;}
.tab.active{ color:var(--red); border-bottom-color:var(--red); }
.progress{ height:8px; background:var(--line); border-radius:4px; overflow:hidden; }
.progress > i{ display:block; height:100%; background:var(--red); }
/* 通知单预览：直接嵌入由 Word 转换而来的 PDF，保证与 Word 打开效果一致 */
.notice-doc{ background:#fff; max-width:210mm; margin:0 auto; border:1px solid var(--line); border-radius:4px;
  overflow:hidden; min-height:297mm; }
.notice-pdf-iframe{ width:100%; height:297mm; border:none; display:block; }
.notice-lian{ margin-bottom:0; }
.lian-title{ text-align:center; font-family:'方正小标宋简体','STZhongsong','SimSun','宋体',serif; font-size:18pt; font-weight:normal; line-height:22pt; margin:0 0 4pt 0; }
.lian-to{ text-align:left; font-size:16pt; line-height:22pt; font-weight:normal; margin:0; padding-left:0; text-decoration:underline; }
.lian-body{ font-size:16pt; line-height:22pt; text-indent:1.13cm; margin:0; }
.sign{ font-size:16pt; line-height:22pt; margin:0; }
.spacer{ font-size:16pt; line-height:22pt; margin:0; }
.issuer{ text-align:center; font-size:16pt; line-height:22pt; margin:0; font-weight:normal; }
.date{ text-align:left; text-indent:7.9cm; font-size:16pt; line-height:22pt; margin:0; font-weight:normal; }
.cut-line{ border:none; border-top:1px dashed #333; width:100%; height:0; font-size:0; line-height:0; margin:7pt 0; }
u{ text-decoration:underline; }
[contenteditable="true"]{ outline:1px dashed transparent; border-radius:3px; transition:.15s;}
[contenteditable="true"]:hover{ outline-color:#cbd2da; }
[contenteditable="true"]:focus{ outline:2px solid var(--red); background:#fffdf7; }

/* 登录页 */
.login-wrap{ min-height:100vh; display:flex; align-items:center; justify-content:center; background:var(--bg); padding:24px; }
.login-card{ width:400px; max-width:92vw; border-top:4px solid var(--red); }
.login-card .login-hd{ background:var(--red); color:#fff; padding:18px 20px; text-align:center; }
.login-card .login-hd .t{ font-size:19px; font-weight:600; letter-spacing:1px; }
.login-card .login-hd .s{ font-size:12px; opacity:.85; margin-top:4px; }
.login-card .login-bd{ padding:22px 24px 24px; }
.login-seal{ display:inline-block; width:46px; height:46px; line-height:46px; text-align:center; border:2px solid var(--red); color:var(--red); border-radius:50%; font-size:22px; font-weight:700; margin-bottom:6px; }
.tip{ font-size:13px; color:var(--muted); line-height:1.9; }
.tip-box{ background:var(--red-l); border:1px solid #f0d6d6; border-radius:4px; padding:12px 14px; font-size:13px; color:#7d1515; }
.tip-box.amber{ background:#fbf3e2; border-color:#f0dcb4; color:#8a5400; }
.tip-box b{ font-weight:600; }
.hd-rule{ height:2px; background:linear-gradient(90deg,var(--red),transparent); margin:2px 0 14px; }
/* 叫号台 */
.call-panel{ border:1px solid var(--line); border-radius:6px; background:#fff; }
.call-now{ background:#fbf2f2; border:1px solid #f0d6d6; border-radius:6px; padding:14px 16px; margin-bottom:12px; }
.call-now .nm{ font-size:20px; font-weight:700; color:var(--red); }
.call-now .mt{ font-size:13px; color:var(--muted); }
.call-off{ color:var(--muted); font-size:14px; padding:6px 0; }
.call-actions{ display:flex; gap:8px; flex-wrap:wrap; }
.call-row{ display:flex; align-items:center; gap:10px; padding:8px 0; border-bottom:1px dashed var(--line); font-size:15px; }
.call-row:last-of-type{ border-bottom:none; }
.call-subj{ display:inline-block; min-width:88px; padding:3px 10px; background:var(--red-l); color:#7d1515; border-radius:4px; font-size:14px; font-weight:600; text-align:center; }

/* 待打印通知单提醒面板 */
.print-panel{ position:fixed; right:18px; bottom:18px; width:340px; max-width:calc(100vw - 24px); background:#fff; border:1px solid var(--line); border-radius:8px; box-shadow:0 8px 32px rgba(0,0,0,.16); z-index:999; overflow:hidden; }
.pp-head{ background:var(--red); color:#fff; padding:11px 14px; font-size:14px; font-weight:600; display:flex; justify-content:space-between; align-items:center; }
.pp-badge{ background:#fff; color:var(--red); border-radius:3px; padding:0 8px; margin-left:4px; font-size:12px; display:inline-block; min-width:20px; text-align:center; }
.pp-actions{ display:flex; gap:4px; }
.pp-mute,.pp-close{ background:rgba(255,255,255,.15); border:none; color:#fff; cursor:pointer; border-radius:4px; width:28px; height:26px; font-size:13px; line-height:1; }
.pp-mute:hover,.pp-close:hover{ background:rgba(255,255,255,.3); }
.pp-list{ max-height:46vh; overflow:auto; }
.pp-empty{ padding:22px; text-align:center; color:var(--muted); font-size:13px; }
.pp-item{ display:flex; justify-content:space-between; align-items:center; gap:8px; padding:11px 14px; border-bottom:1px solid var(--line); }
.pp-item:last-child{ border-bottom:none; }
.pp-info{ min-width:0; flex:1; }
.pp-sub{ font-size:12px; color:var(--muted); margin-top:2px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pp-time{ font-size:11px; color:#9ca3af; margin-top:1px; }
.pp-btns{ display:flex; gap:5px; flex-shrink:0; }
.pp-btns .btn.sm{ padding:5px 9px; font-size:12px; }
.print-bell{ position:fixed; right:18px; bottom:18px; width:54px; height:54px; border-radius:50%; background:var(--red); color:#fff; border:none; font-size:20px; cursor:pointer; z-index:999; box-shadow:0 6px 20px rgba(158,28,28,.35); }
.print-bell:hover{ background:var(--red-d); }
.bell-count{ position:absolute; top:-4px; right:-4px; background:var(--amber); color:#fff; border-radius:20px; min-width:20px; height:20px; font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center; padding:0 5px; border:2px solid #fff; }

/* 管理端代选岗弹窗 */
.pick-mask{ position:fixed; inset:0; background:rgba(15,23,42,.5); z-index:1000; display:flex; align-items:center; justify-content:center; padding:16px; }
.pick-box{ background:#fff; border-radius:8px; width:440px; max-width:100%; max-height:80vh; display:flex; flex-direction:column; padding:20px; box-shadow:0 16px 48px rgba(0,0,0,.22); }
.pick-list{ overflow:auto; border:1px solid var(--line); border-radius:6px; }
.pick-item{ display:flex; align-items:center; gap:10px; padding:11px 14px; cursor:pointer; border-bottom:1px solid var(--line); font-size:14px; }
.pick-item:last-child{ border-bottom:none; }
.pick-item:hover{ background:#f5f7f9; }
.pick-item.off{ opacity:.45; cursor:not-allowed; }
.pick-item input{ accent-color:var(--red); width:16px; height:16px; }
.pick-name{ flex:1; font-weight:600; }
.pick-rest{ font-size:12px; color:var(--green); white-space:nowrap; }
.pick-rest.zero{ color:#9ca3af; }

/* 打印：隐藏所有浮动通知/控件，仅保留通知单正文 */
@media print{
  @page { size: A4; margin: 1cm 2.5cm; }
  html, body { margin: 0 !important; padding: 0 !important; background:#fff !important; }
  .topbar,.tabs,.no-print,.btn,.toast,.print-panel,.print-bell,.call-panel,.pick-mask{ display:none !important; }
  .wrap{ margin:0; padding:0; max-width:none;}
  .notice-doc{ box-shadow:none; border:none; margin:0; padding:0; max-width:none; border-radius:0; min-height:auto; }
  .notice-pdf-iframe{ height:100vh; }
  .card{ box-shadow:none; border:none; padding:0; border-radius:0; }
}

/* ============ 移动端适配 ============ */
@media (max-width:768px){
  .topbar{ padding:0 12px; min-height:50px; height:auto; flex-wrap:wrap; gap:8px; }
  .topbar .title{ font-size:15px; }
  .topbar .badge{ font-size:11px; padding:2px 8px; }
  .wrap{ padding:0 12px; margin:14px auto; }
  .card{ padding:16px; }
  .tabs{ gap:0; overflow-x:auto; -webkit-overflow-scrolling:touch; flex-wrap:nowrap; }
  .tab{ padding:9px 13px; font-size:13px; white-space:nowrap; }
  .pos-grid{ grid-template-columns:1fr; gap:10px; }
  .pos .rem b{ font-size:18px; }
  .timer{ font-size:34px; }
  .stat-grid{ grid-template-columns:repeat(auto-fit,minmax(120px,1fr)); gap:10px; }
  .stat .num{ font-size:24px; }
  .rep-item{ flex-direction:column; align-items:stretch; gap:10px; }
  .rep-item .btn{ width:100%; justify-content:center; }
  .notice-doc{ max-width:100%; min-height:auto; }
  .notice-pdf-iframe{ height:420mm; }
  .info-card > div{ grid-template-columns:repeat(auto-fit,minmax(110px,1fr)); }
  #posTable, #teacherTable, #posOverview > div > table, #schoolSummary > div > table,
  .card > div > table, table{ display:block; width:100%; overflow-x:auto; white-space:nowrap; -webkit-overflow-scrolling:touch; }
  th,td{ white-space:nowrap; }
  input.input, select.input, textarea.input{ font-size:16px; }
  #doneCard{ padding:28px !important; }
  .btn{ padding:9px 14px; font-size:13px; }
  #startBtn, #confirmBtn{ width:100%; justify-content:center; }
  .print-panel{ right:8px; bottom:8px; left:8px; width:auto; }
  .print-bell{ right:14px; bottom:14px; }
  .pick-box{ width:100%; padding:16px; }
}
