/* 教師後台：沿用暖紙與炭墨的代幣，只補這個頁面專用的版面。 */
@layer components {
body.teacher-page { height: auto; min-height: 100dvh; overflow: auto; display: block; }
.teacher-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--border); background: var(--panel); }
.teacher-brand { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.teacher-brand-name { font-size: 17px; font-weight: 650; letter-spacing: .02em; }
.teacher-account { display: flex; align-items: center; gap: 6px; }
.teacher-main { width: min(1040px, 100%); margin: 0 auto; padding: 24px 18px 56px; }
.teacher-main h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; overflow-wrap: anywhere; }
.teacher-main h2 { font-size: 16px; margin: 0 0 12px; }
.teacher-section { padding: 20px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); margin-bottom: 20px; }
.teacher-notice { max-width: 420px; margin: 8vh auto 0; text-align: center; }
.teacher-notice h1 { margin-bottom: 10px; }
.teacher-login { display: flex; flex-direction: column; gap: 12px; max-width: 360px; margin: 6vh auto 0; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--panel); }
.teacher-login .field, .teacher-form .field { flex-direction: column; align-items: stretch; gap: 4px; }
.teacher-form { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) auto; gap: 12px; align-items: end; }
.teacher-form .btn { min-height: 38px; }
.teacher-error { color: var(--danger); font-size: 13px; margin: 0; }
.teacher-error:empty { display: none; }
.teacher-usage { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.teacher-class-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.teacher-class-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none; min-height: 44px; }
.teacher-class-card:hover { border-color: var(--border-strong); background: var(--panel-2); }
.teacher-class-card strong { font-size: 16px; overflow-wrap: anywhere; }
.teacher-code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--muted); }
.teacher-empty { padding: 28px 18px; border: 1px dashed var(--border-strong); border-radius: var(--radius); color: var(--muted); text-align: center; }
.teacher-back { display: inline-block; margin-bottom: 14px; color: var(--muted); font-size: 13px; text-decoration: none; min-height: 32px; line-height: 32px; }
.teacher-back:hover { color: var(--text); }
.teacher-class-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; margin-bottom: 6px; }
.teacher-class-title { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.teacher-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 12px; }
.teacher-toolbar .grow { flex: 1; min-width: 8px; }
.teacher-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); }
.teacher-table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 1.5; }
.teacher-table th { background: var(--panel-2); color: var(--muted); font-size: 12px; font-weight: 600; text-align: left; white-space: nowrap; }
.teacher-table th, .teacher-table td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.teacher-table tr:last-child td { border-bottom: 0; }
.teacher-table :is(td, th):has(> input[type=checkbox]) { width: 36px; padding-right: 0; }
.teacher-table input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.teacher-table .num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.teacher-table tr[data-disabled="true"] td { color: var(--muted); }
.teacher-dialog { width: min(520px, calc(100vw - 24px)); }
.teacher-dialog.wide { width: min(720px, calc(100vw - 24px)); }
.teacher-dialog textarea { width: 100%; min-height: 150px; resize: vertical; font-family: inherit; font-size: 14px; line-height: 1.6; box-sizing: border-box; }
.teacher-dialog .field input { width: 100%; box-sizing: border-box; }
.teacher-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); }
.teacher-tabs button { border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); padding: 8px 12px; min-height: 40px; font-size: 14px; cursor: pointer; }
.teacher-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.teacher-preview { margin: 0; padding: 10px 12px; max-height: 160px; overflow: auto; list-style: none; background: var(--panel-2); border-radius: var(--radius-sm); font-size: 13px; }
.teacher-preview:empty { display: none; }
.teacher-preview li { display: flex; gap: 12px; }
.teacher-preview code, .teacher-secret { font-family: ui-monospace, Consolas, monospace; }
.teacher-warning { margin: 0; padding: 10px 12px; border: 1px solid var(--accent); border-radius: var(--radius-sm); background: var(--accent-soft); font-size: 13px; }
.teacher-secret { user-select: all; font-size: 14px; letter-spacing: .04em; }
.teacher-skipped { margin: 0; font-size: 13px; color: var(--muted); }
.teacher-print { display: none; }
@media (max-width: 640px) {
  .teacher-main { padding: 18px 14px 48px; }
  .teacher-form { grid-template-columns: minmax(0, 1fr); }
  .teacher-section { padding: 16px; }
  .teacher-table .secondary { display: none; }
  .teacher-table th, .teacher-table td { padding: 10px 8px; }
  .teacher-toolbar .grow { flex-basis: 100%; }
  .teacher-header { padding: 12px 14px; }
}
@media print {
  body.teacher-printing > :not(.teacher-print) { display: none; }
  body.teacher-printing { background: #fff; color: #000; }
  body.teacher-printing .teacher-print { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0; }
  .teacher-slip { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border: 1px dashed #666; break-inside: avoid; font-size: 13px; line-height: 1.6; }
  .teacher-slip .teacher-secret { font-size: 15px; font-weight: 700; }
}
}
