* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "PingFang SC", sans-serif;
  background: #e2e8f0;
  padding-top: 56px;
}
.bar {
  position: fixed; top: 0; left: 0; right: 0; height: 50px; z-index: 10;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: #0f172a; color: #fff;
}
.brand { font-weight: 600; white-space: nowrap; }
.sp { flex: 1; }
.bar button, .bar label.btn {
  height: 36px; padding: 0 14px; display: inline-flex; align-items: center;
  border: 1px solid #475569; border-radius: 8px;
  background: #1e293b; color: #e2e8f0; font-size: 14px; cursor: pointer;
}
.bar button.sel, .bar label.btn.sel { background: #2563eb; border-color: #3b82f6; }
button.pen.sel { outline: 2px solid var(--c); outline-offset: 1px; background: #1e293b; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; flex: none; }
.dot.on { background: #22c55e; }
.dot.away { background: #eab308; }
#writing { font-size: 12px; background: #14532d; color: #86efac; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
.bar button:disabled { opacity: .45; cursor: default; }

/* 学生当前页画中画（自由翻阅时显示） */
#pip {
  display: none; position: fixed; right: 12px; bottom: 12px; z-index: 15;
  width: 132px; background: #fff; border: 2px solid #2563eb; border-radius: 10px;
  overflow: hidden; cursor: pointer; box-shadow: 0 4px 16px rgba(0, 0, 0, .3);
}
#pip canvas { display: block; width: 100%; }
#pip span {
  position: absolute; left: 0; right: 0; bottom: 0; text-align: center;
  font-size: 11px; padding: 2px 0; background: rgba(37, 99, 235, .85); color: #fff;
}
.dim { font-size: 12px; color: #94a3b8; white-space: nowrap; }
#pageBadge { font-size: 12px; background: #334155; padding: 4px 10px; border-radius: 999px; white-space: nowrap; }
input[type="file"] { display: none; }

#pages { padding: 10px; }
.page {
  position: relative; max-width: 900px; margin: 0 auto 14px;
  background: #fff; box-shadow: 0 1px 8px rgba(0, 0, 0, .18);
}
.page canvas.pdf { display: block; width: 100%; }
.page canvas.ink {
  position: absolute; inset: 0; width: 100%; height: 100%;
  touch-action: manipulation;
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
}

/* 出卷面板 */
.panel {
  display: none; position: fixed; top: 56px; right: 10px; z-index: 20;
  background: #fff; color: #0f172a; border-radius: 12px; padding: 14px 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .25); max-width: 92vw;
}
.panel.open { display: block; }
.panel .row { display: flex; align-items: center; gap: 8px; margin: 8px 0; flex-wrap: wrap; font-size: 14px; }
.panel input[type="number"] { width: 72px; height: 32px; font-size: 15px; padding: 0 6px; border: 1px solid #cbd5e1; border-radius: 6px; }
.panel select { height: 32px; font-size: 15px; border: 1px solid #cbd5e1; border-radius: 6px; }
.panel .btn2 {
  display: inline-flex; align-items: center; height: 30px; padding: 0 10px; cursor: pointer;
  border: 1px solid #cbd5e1; border-radius: 6px; background: #f1f5f9; font-size: 13px;
}
.panel .primary { height: 36px; padding: 0 16px; border: 0; border-radius: 8px; background: #2563eb; color: #fff; font-size: 14px; cursor: pointer; }
.dim2 { font-size: 13px; color: #64748b; }

/* 首页 */
.home {
  max-width: 460px; margin: 12vh auto 0; padding: 28px;
  background: #fff; border-radius: 16px; box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
}
.home h1 { margin: 0 0 6px; font-size: 26px; }
.home p { color: #475569; line-height: 1.7; }
.home a.big {
  display: block; margin: 12px 0; padding: 14px; text-align: center;
  border-radius: 10px; text-decoration: none; font-size: 17px; font-weight: 600;
}
.home a.stu { background: #1d4ed8; color: #fff; }
.home a.tea { background: #dc2626; color: #fff; }
