/* Shared interface: a quiet canvas, clear controls, and a focused workspace. */
:root {
  --bg: oklch(1 0 0);
  --page: oklch(.972 .004 150);
  --surface: oklch(.978 .003 150);
  --surface-2: oklch(.946 .006 150);
  --ink: oklch(.26 .015 150);
  --muted: oklch(.49 .012 150);
  --line: oklch(.895 .006 150);
  --primary: oklch(.43 .095 145);
  --primary-hover: oklch(.36 .085 145);
  --primary-soft: oklch(.95 .026 145);
  --red: oklch(.49 .17 25);
  --red-soft: oklch(.975 .015 25);
  --amber: oklch(.47 .105 65);
  --amber-soft: oklch(.975 .027 82);
  --blue: oklch(.46 .12 250);
  --purple: oklch(.48 .14 300);
  --purple-soft: oklch(.967 .02 300);
  --sidebar-bg: oklch(.235 .017 155);
  --sidebar-muted: oklch(.76 .014 150);
  --radius: 12px;
  --shadow: 0 2px 6px oklch(.2 .015 150 / .025), 0 12px 34px oklch(.2 .015 150 / .035);
  font-size: 14px;
  line-height: 1.55;
}

body { background: var(--page); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font-family: inherit; }
button { min-height: 40px; padding: 8px 14px; border-radius: 8px; font-size: 13px; font-weight: 550; }
button:hover:not(:disabled) { background: var(--surface-2); }
button.primary { box-shadow: 0 1px 2px oklch(.2 .03 145 / .1); }
button.primary:hover:not(:disabled) { background: var(--primary-hover); }
button.small { min-height: 34px; padding: 5px 11px; font-size: 12px; }
button.icon-button { min-width: 40px; min-height: 40px; }
button.quiet { font-weight: 500; }
.control-link { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 13px; font-weight: 550; text-decoration: none; }
.control-link:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }
:focus-visible { outline: 3px solid oklch(.68 .115 145); outline-offset: 3px; }
svg.icon { width: 18px; height: 18px; stroke-width: 1.75; }
h1 { font-size: 28px; line-height: 1.35; font-weight: 680; letter-spacing: -.035em; }
h2 { font-size: 18px; line-height: 1.45; font-weight: 650; }
h3 { font-size: 15px; font-weight: 650; }
.small-text { font-size: 12px; }
.help-text { font-size: 12px; line-height: 1.75; }
.mono { font-size: .95em; }

/* Navigation gives the otherwise light application a stable visual anchor. */
.shell { grid-template-columns: 224px minmax(0, 1fr); }
.sidebar { width: 224px; padding: 26px 16px 14px; background: var(--sidebar-bg); border-right: 0; color: oklch(.98 .003 150); }
.sidebar .brand { padding-left: 10px; margin-bottom: 34px; gap: 12px; }
.brand-mark { width: 38px; height: 38px; border-radius: 11px; font-size: 22px; }
.brand-mark:is(img) { display: block; object-fit: cover; }
.sidebar .brand-mark { background: oklch(.89 .072 145); color: oklch(.27 .035 145); }
.brand b { font-size: 23px; font-weight: 650; letter-spacing: -.025em; }
.sidebar .brand small { margin-top: 3px; color: var(--sidebar-muted); font-size: 11px; }
.sidebar .nav-label { margin: 12px 0 12px; padding: 0 13px; color: var(--sidebar-muted); font-size: 11px; }
.sidebar .nav { gap: 6px; }
.sidebar .nav button { min-height: 46px; padding: 11px 13px; border-radius: 8px; color: oklch(.84 .01 150); font-size: 13px; gap: 12px; }
.sidebar .nav button:hover { color: oklch(1 0 0); background: oklch(.29 .02 150); }
.sidebar .nav button.active { color: oklch(.97 .02 145); background: oklch(.33 .036 150); font-weight: 600; }
.sidebar .nav button.active .icon { color: oklch(.85 .09 145); }
.sidebar .nav button:focus-visible { outline-color: oklch(.85 .09 145); }
.sidebar-foot { padding-top: 24px; }
.sidebar-foot > .quiet { color: var(--sidebar-muted); margin: 0 5px 10px; }
.sidebar-foot > .quiet:hover { color: oklch(1 0 0); background: oklch(.29 .02 150); }
.sidebar .user-block { padding: 16px 8px 8px; border-top-color: oklch(.37 .014 150); gap: 10px; }
.sidebar .avatar { background: oklch(.34 .03 150); color: oklch(.91 .045 145); border-radius: 10px; width: 36px; height: 36px; }
.sidebar .user-block strong { font-size: 13px; color: oklch(.97 .005 150); }
.sidebar .user-block small { color: var(--sidebar-muted); font-size: 11px; }
.sidebar .user-block .quiet { color: var(--sidebar-muted); min-width: 32px; padding: 5px; }
.sidebar .user-block .quiet:hover { background: oklch(.3 .02 150); color: oklch(1 0 0); }

/* Page chrome stays compact so the classroom is the main surface. */
.topbar { min-height: 68px; padding: 0 32px; gap: 18px; background: var(--bg); border-bottom-color: var(--line); }
.breadcrumb { font-size: 12px; color: var(--muted); }
.breadcrumb strong { font-weight: 550; }
.session-picker { max-width: 340px; min-height: 36px; padding: 6px 26px 6px 11px; border: 1px solid var(--line); background: var(--bg); border-radius: 7px; font-size: 12px; }
.connection { font-size: 11px; gap: 7px; }
.connection-dot { width: 6px; height: 6px; box-shadow: 0 0 0 3px var(--primary-soft); }
.connection.offline .connection-dot { box-shadow: 0 0 0 3px var(--red-soft); }
.page { padding: 28px 32px 36px; max-width: 1760px; }
.page-heading { gap: 22px; margin-bottom: 24px; align-items: center; }
.page-heading p { margin-top: 8px; font-size: 13px; line-height: 1.7; max-width: 78ch; }
.heading-actions { gap: 8px; }
.panel { border-radius: var(--radius); border-color: var(--line); box-shadow: 0 1px 3px oklch(.2 .02 150 / .025); }
.panel-head { min-height: 58px; padding: 16px 20px; }
.panel-head h2 { font-size: 15px; }
.panel-body { padding: 22px; }
.pill { font-size: 11px; font-weight: 550; padding: 3px 8px; border-radius: 5px; }
.notice { padding: 13px 16px; font-size: 12px; line-height: 1.75; border-radius: 9px; }
.notice.warning { color: var(--amber); border-color: oklch(.9 .04 80); }
.notice.error { color: var(--red); border-color: oklch(.9 .04 25); }
.stats-strip { border-color: var(--line); box-shadow: none; margin-bottom: 20px; }
.stat { padding: 18px 22px; }
.stat strong { font-size: 27px; font-weight: 620; letter-spacing: -.03em; }
.stat span { font-size: 12px; }
.stat p { font-size: 11px; margin-top: 5px; }
.student-stats .stat { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 7px; }
.student-stats .stat > span { margin: 0; }
.empty { padding: 52px 24px; }
.empty > .icon { width: 32px; height: 32px; color: var(--primary); margin-bottom: 10px; }
.empty p { font-size: 13px; line-height: 1.8; }

/* Consistent tables and forms across records, roster, and evidence. */
table { font-size: 13px; }
th { padding: 12px 17px; background: var(--surface); color: var(--muted); font-size: 11px; font-weight: 600; }
td { padding: 15px 17px; }
tbody tr:hover { background: oklch(.986 .004 145); }
.table-title { font-size: 14px; font-weight: 600; }
.table-foot { padding: 13px 18px; font-size: 12px; }
.sub { margin-top: 4px; font-size: 11px; }
.toolbar { margin: 18px 0; gap: 14px; }
.search { background: var(--bg); border-radius: 8px; }
.search input { min-height: 40px; font-size: 13px; }
.tabs { gap: 26px; margin-bottom: 22px; }
.tabs button { min-height: 45px; padding: 9px 1px 12px; font-size: 13px; }
.tabs button:hover { background: transparent; color: var(--primary); }
.field { gap: 8px; }
.field > label { font-size: 12px; color: var(--ink); font-weight: 600; }
.field input:not([type="checkbox"]):not([type="radio"]), .field textarea, .field select {
  min-height: 42px; padding: 10px 12px; border: 1px solid oklch(.84 .008 150); border-radius: 8px; background: var(--bg); color: var(--ink); font-size: 13px;
}
.field textarea { min-height: 110px; line-height: 1.7; }
input::placeholder, textarea::placeholder { color: oklch(.5 .01 150); opacity: 1; }
.field .hint { font-size: 11px; line-height: 1.65; }
.form-grid { gap: 18px 16px; }
.form-actions { gap: 9px; }
.request-layout { gap: 22px; }
.request-item { padding: 20px; }
.request-item h3 { font-size: 15px; }
.request-item > p { font-size: 13px; line-height: 1.75; }
.rules-list li { padding: 20px 0; }
.rules-list li p { font-size: 13px; line-height: 1.8; }
.timeline-item { padding-top: 18px; padding-bottom: 18px; }
.timeline-item p { font-size: 12px; line-height: 1.8; }
.detail-section { padding: 20px; }
.detail-line { font-size: 12px; }
.detail-section .help-text { color: var(--muted); }
.bag { font-size: 15px; border-radius: 8px; }
.room-scroll { padding: 0 20px 20px; }
.seat-toolbar { padding: 14px 20px; }
.room { min-width: 700px; }
.seat-row { gap: 8px; margin-bottom: 8px; }
.seat { min-height: 66px; padding: 10px 6px; border-radius: 8px; box-shadow: 0 1px 2px oklch(.2 .02 150 / .035); }
.seat-id { font-size: 10px; color: var(--muted); }
.seat-name { font-size: 13px; font-weight: 600; }
.seat-state { font-size: 10px; }
.seat.occupied { border-color: oklch(.8 .04 145); background: var(--primary-soft); }
.seat:disabled { opacity: 1; cursor: default; }
.seat:not(.occupied):disabled { background: var(--surface); color: var(--muted); box-shadow: none; }
.seat.is-mine { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.seat.selected { background: var(--primary); color: var(--bg); border-color: var(--primary); }
.seat.selected .seat-id, .seat.selected .seat-state { color: oklch(.92 .025 145); }
.selection-box { margin: 0 20px 20px; padding: 18px; background: var(--bg); border-radius: 9px; }
.selection-box .rules-check { font-size: 12px; line-height: 1.8; }
.checkin-receipt { padding: 20px; }
.checkin-receipt h3 { font-size: 15px; }
.checkin-receipt p { font-size: 12px; margin-top: 5px; }

/* Dialogs share the same visual language as the page, with clear action order. */
dialog { border-radius: 15px; border-color: var(--line); box-shadow: 0 24px 90px oklch(.16 .025 150 / .22); }
dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
dialog::backdrop { background: oklch(.18 .018 150 / .48); }
.dialog-head { padding: 20px 24px; background: var(--bg); flex-shrink: 0; }
.dialog-head h2 { font-size: 18px; font-weight: 650; }
.dialog-head .icon-button { color: var(--muted); }
.dialog-body { padding: 24px; min-height: 0; overflow: auto; flex: 1 1 auto; }
.dialog-actions { padding: 16px 24px; background: var(--surface); gap: 9px; flex-shrink: 0; }
.dossier { gap: 22px; }
.dossier .panel { box-shadow: none; }
.material-preview { border-color: var(--line); border-radius: 9px; }
.toast { border-radius: 10px; font-size: 13px; box-shadow: 0 8px 26px oklch(.2 .02 150 / .18); }

/* A calm sign-in page: the classroom motif lives in the brand panel. */
.login-page { background: var(--bg); grid-template-columns: minmax(360px, .95fr) minmax(440px, 1fr); }
.login-story { background: var(--sidebar-bg); padding: 44px 64px; border: 0; color: oklch(.985 .003 150); }
.login-story .brand-mark { color: oklch(.26 .035 145); background: oklch(.89 .072 145); }
.login-story .brand b { color: oklch(.985 .003 150); }
.login-story .brand small, .login-story > small { color: oklch(.77 .017 150); font-size: 12px; }
.login-story h1 { max-width: 12em; font-size: 42px; line-height: 1.45; font-weight: 580; margin-top: 40px; letter-spacing: -.03em; }
.login-story h1 span { color: oklch(.84 .08 145); }
.login-story p { font-size: 14px; color: oklch(.8 .012 150); line-height: 1.9; }
.login-illustration { grid-template-columns: repeat(5, 40px); gap: 12px; margin: 34px 0; }
.login-illustration i { height: 28px; background: oklch(.29 .025 150); border: 1px solid oklch(.43 .035 150); border-radius: 5px; }
.login-illustration i:nth-child(3n) { background: oklch(.62 .075 145); border-color: oklch(.72 .08 145); }
.login-form-area { padding: 50px; }
.login-form-wrap { max-width: 360px; }
.login-form-wrap h2 { font-size: 29px; font-weight: 650; }
.login-form-wrap > p { margin-top: 10px; margin-bottom: 30px; font-size: 13px; line-height: 1.8; }
.login-form-wrap form { gap: 20px; }
.login-form-wrap .field > label { font-size: 13px; }
.login-form-wrap .field input { min-height: 46px; font-size: 14px; }
.login-form-wrap .primary { min-height: 46px; font-size: 14px; }
.login-switch { margin-top: 22px; font-size: 13px; }
.login-privacy { font-size: 11px; line-height: 1.85; margin-top: 34px; }

@media (min-width: 1600px) {
  .page { padding: 32px 40px 40px; }
  .topbar { padding: 0 40px; }
}
@media (max-width: 1100px) {
  .shell { grid-template-columns: 200px minmax(0, 1fr); }
  .sidebar { width: 200px; padding-left: 12px; padding-right: 12px; }
  .sidebar .nav button { font-size: 12px; padding-left: 12px; }
  .topbar { padding: 0 24px; }
  .page { padding: 24px; }
  .page-heading { align-items: flex-start; }
  .page-heading h1 { font-size: 26px; }
  .heading-actions { justify-content: flex-end; }
  .login-story { padding: 40px; }
  .login-story h1 { font-size: 36px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { width: 238px; padding: 24px 16px 16px; }
  .sidebar { visibility: hidden; }
  .shell.menu-open .sidebar { visibility: visible; }
  .sidebar .nav button { font-size: 14px; min-height: 48px; }
  .topbar { min-height: 62px; padding: 0 18px; gap: 12px; }
  .page { padding: 22px 20px 30px; }
  .breadcrumb { display: none; }
  .mobile-menu { display: inline-flex; }
  .page-heading { gap: 14px; }
  .page-heading h1 { font-size: 25px; }
  .page-heading p { font-size: 12px; }
  .login-page { grid-template-columns: 1fr; background: var(--page); }
  .login-story { display: none; }
  .login-form-area { padding: 32px 24px; }
  .login-form-wrap { max-width: 400px; padding: 30px; background: var(--bg); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
  .login-form-wrap:before { content: "在课"; display: block; margin-bottom: 30px; color: var(--primary); font-size: 26px; font-weight: 700; }
  .login-form-wrap h2 { font-size: 25px; }
}
@media (max-width: 580px) {
  button { min-height: 44px; }
  button.icon-button { min-height: 44px; min-width: 44px; }
  button.small { min-height: 38px; }
  .topbar { padding: 0 10px; gap: 6px; }
  .session-picker { max-width: 238px; font-size: 11px; min-height: 36px; padding-left: 8px; }
  .connection { font-size: 0; }
  .page { padding: 20px 14px 28px; }
  .page-heading h1 { font-size: 23px; }
  .page-heading { flex-direction: column; align-items: stretch; gap: 12px; }
  .page-heading p { font-size: 12px; line-height: 1.65; }
  .heading-actions { justify-content: flex-start; width: 100%; gap: 6px; }
  .heading-actions button { min-height: 38px; font-size: 12px; padding: 6px 10px; }
  .panel-head { padding: 15px 17px; }
  .panel-body { padding: 18px; }
  .notice { font-size: 12px; padding: 11px 13px; }
  .stats-strip .stat { padding: 14px 11px; }
  .stat strong { font-size: 23px; }
  .stat span { font-size: 11px; }
  .student-stats .stat strong { font-size: 13px !important; white-space: nowrap; line-height: 1.5; letter-spacing: -.02em; }
  .student-stats .stat:first-child strong { font-size: 18px !important; }
  th { padding: 11px 13px; }
  td { padding: 14px 13px; }
  .tabs { gap: 20px; overflow-x: auto; white-space: nowrap; }
  .tabs button { font-size: 12px; flex-shrink: 0; }
  .dialog-head { padding: 17px 18px; }
  .dialog-head h2 { font-size: 16px; }
  .dialog-body { padding: 18px; }
  .dialog-actions { padding: 14px 18px; }
  .dialog-actions button { min-height: 42px; font-size: 12px; }
  .request-item { padding: 17px; }
  .room-scroll { padding: 0 14px 16px; }
  .seat-toolbar { padding: 14px; }
  .seat { min-height: 60px; }
  .selection-box { margin: 0 14px 16px; padding: 14px; }
  .login-form-area { padding: 20px; }
  .login-form-wrap { padding: 26px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *:before, *:after { animation-duration: 0s !important; transition-duration: 0s !important; scroll-behavior: auto !important; }
}
