:root {
  color-scheme: light;
  --ink: #1e293b;
  --muted: #68788b;
  --accent: #245f86;
  --accent-soft: #eaf2f8;
  --line: #e1e7ef;
  --surface: #fff;
  --background: #f4f6f9;
  font-family: "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--background); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, .button { cursor: pointer; }
button:disabled { cursor: wait; opacity: .6; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, .button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 14px; background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; font-weight: 600; }
button:hover, .button:hover { border-color: #9aaec0; text-decoration: none; }
.primary { background: var(--accent); color: white; border-color: var(--accent); }
.primary:hover { background: #1c4e71; }
.danger { color: #a22e35; background: #fff8f8; border-color: #efd7d8; }
.subtle { color: var(--muted); background: transparent; }
:focus-visible { outline: 3px solid #a8c7dc; outline-offset: 3px; }
input, select, textarea { width: 100%; padding: 10px 12px; min-height: 42px; border: 1px solid #ccd6e1; border-radius: 7px; background: white; color: var(--ink); }
textarea { resize: vertical; min-height: 96px; }
input[type="checkbox"] { min-height: 0; width: 17px; height: 17px; accent-color: var(--accent); }
input[readonly] { background: #f1f4f7; color: var(--muted); }
label { display: block; font-weight: 600; }
label > input, label > select, label > textarea { margin-top: 7px; font-weight: 400; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: 26px; letter-spacing: -.6px; line-height: 1.3; margin-bottom: 7px; }
h2 { font-size: 18px; letter-spacing: -.25px; margin-bottom: 12px; }
h3 { font-size: 15px; margin-bottom: 10px; }
small, .muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: 2px; font-size: 11px; font-weight: 700; color: var(--accent); margin-bottom: 14px; }
.boot-state { padding: 80px 30px; text-align: center; color: var(--muted); }
.topbar { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 13px 30px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand img { width: 64px; height: 44px; object-fit: cover; border-radius: 6px; }
.brand strong { display: block; font-size: 16px; }
.brand small { display: block; font-size: 11px; letter-spacing: .8px; }
.account-tools, .toolbar, .actions, .heading { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.heading { justify-content: space-between; margin-bottom: 24px; }
.heading p { margin: 0; }
.account-name { text-align: right; margin-right: 4px; min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
.account-name strong, .account-name small { display: block; }
.layout { display: grid; grid-template-columns: 218px minmax(0, 1fr); min-height: calc(100dvh - 76px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 27px 16px; }
.nav-label { padding: 0 12px; margin: 0 0 11px; font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.nav-button { display: flex; width: 100%; justify-content: flex-start; background: transparent; border: 0; margin-bottom: 5px; padding: 11px 13px; font-weight: 500; }
.nav-button.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.nav-separator { height: 1px; background: var(--line); margin: 21px 12px; }
.sidebar-note { margin: 28px 12px 0; font-size: 12px; color: var(--muted); }
.content { width: 100%; max-width: 1400px; padding: 32px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 23px; margin-bottom: 20px; }
.panel > :last-child { margin-bottom: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; margin-bottom: 24px; }
.metric { border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding: 19px 21px; }
.metric span { color: var(--muted); font-size: 12px; }
.metric strong { display: block; font-size: 31px; font-weight: 650; letter-spacing: -1px; margin: 7px 0 2px; font-variant-numeric: tabular-nums; }
.metric small { font-size: 11px; }
.columns { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
th { background: #f7f9fb; color: #69778a; font-weight: 600; white-space: nowrap; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
tr:last-child td { border-bottom: 0; }
td small { display: block; }
td .actions { flex-wrap: nowrap; }
td button { padding: 5px 9px; min-height: 30px; font-size: 12px; }
.tag { display: inline-flex; align-items: center; border-radius: 5px; padding: 3px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; background: #edf1f5; color: #5f7083; }
.tag.good { color: #24704c; background: #eaf5ee; }
.tag.warn { color: #965923; background: #fcf1e4; }
.tag.accent { color: var(--accent); background: var(--accent-soft); }
.filter-input { max-width: 290px; }
.filter-select { max-width: 170px; }
.empty { padding: 34px 20px; text-align: center; color: var(--muted); border: 1px dashed #d8e0e9; border-radius: 9px; }
.empty strong { display: block; margin-bottom: 6px; color: var(--ink); }
.notice { border: 1px solid #d7e5ee; background: #f0f6fa; color: #3d5c75; padding: 13px 16px; border-radius: 8px; margin-bottom: 20px; font-size: 13px; }
.notice.warning { background: #fff7ed; border-color: #f0dfc7; color: #87591e; }
.error-message { color: #a22e35; background: #fff2f2; border: 1px solid #f0d0d3; padding: 10px 14px; border-radius: 7px; margin-bottom: 15px; white-space: pre-wrap; }
.error-message:empty { display: none; }
.form-grid, .detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.full { grid-column: 1 / -1; }
.field-help { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; font-weight: 400; }
.checkbox-label { display: flex; align-items: center; gap: 10px; font-weight: 500; padding: 10px 0; }
.checkbox-label input { margin: 0; }
.form-section { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.form-section:first-child { padding-top: 0; margin-top: 0; border-top: 0; }
.form-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.detail-item { padding: 12px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.detail-item small { display: block; margin-bottom: 5px; }
.detail-item div { white-space: pre-wrap; }
.form-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 26px; }
.form-choice { display: block; padding: 24px 20px; text-align: left; border-radius: 11px; min-height: 155px; }
.form-choice:hover { border-color: var(--accent); background: #f9fcff; }
.form-choice .choice-number { display: block; font-size: 11px; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 18px; }
.form-choice strong { display: block; color: var(--accent); font-size: 21px; margin-bottom: 6px; }
.form-choice small { display: block; font-weight: 400; line-height: 1.6; }
.bar-item { display: grid; grid-template-columns: 50px minmax(0, 1fr) 75px; gap: 14px; align-items: center; margin: 19px 0; }
progress { appearance: none; border: 0; width: 100%; height: 10px; border-radius: 5px; overflow: hidden; background: #eaf0f5; accent-color: var(--accent); }
progress::-webkit-progress-bar { background: #eaf0f5; border-radius: 5px; }
progress::-webkit-progress-value { background: #4b85ad; border-radius: 5px; }
.list-item { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.list-item:last-child { border-bottom: 0; }
.list-item small { display: block; }
.login-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); min-height: 100dvh; }
.login-intro { display: flex; flex-direction: column; justify-content: center; padding: clamp(40px, 7vw, 110px); background: #eaf0f6; border-right: 1px solid #dce4ed; }
.login-intro .brand { margin-bottom: 70px; }
.login-intro h1 { font-size: clamp(29px, 3vw, 44px); line-height: 1.4; letter-spacing: -1px; margin-bottom: 25px; }
.login-intro p { max-width: 420px; color: #5e7287; font-size: 15px; line-height: 1.9; }
.login-points { margin-top: 32px; display: grid; gap: 14px; font-size: 13px; color: #46627a; }
.login-side { display: flex; align-items: center; justify-content: center; padding: 40px; }
.login-box { width: 100%; max-width: 360px; }
.password-layout { width: min(100%, 560px); margin: 0 auto; padding: 40px 24px; }
.password-layout h1 { font-size: 25px; }
.password-layout .form-footer { flex-wrap: wrap; }
.login-box h2 { font-size: 25px; margin-bottom: 9px; }
.login-form { display: grid; gap: 20px; margin-top: 30px; }
.login-form .primary { margin-top: 5px; width: 100%; }
.auth-switch { margin: 20px 0 0; }
.auth-switch a { margin-left: 8px; font-weight: 600; }
.identity-section { padding-bottom: 24px; margin-bottom: 26px; border-bottom: 1px solid var(--line); }
.identity-fields { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.identity-fields label, .account-filters label { min-width: 0; }
.identity-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.identity-footer p { margin: 0; font-size: 12px; }
.primary-direction-section { letter-spacing: 0; }
.direction-controls { display: grid; grid-template-columns: minmax(0, 300px) max-content minmax(0, 1fr); align-items: end; gap: 16px; }
.direction-controls label { min-width: 0; }
.direction-controls button { min-width: 112px; min-height: 44px; }
.direction-controls button:disabled, .direction-controls select:disabled { cursor: not-allowed; }
.primary-direction-section[aria-busy="true"] button, .primary-direction-section[aria-busy="true"] select { cursor: wait; }
.direction-status { padding-bottom: 10px; font-size: 12px; overflow-wrap: anywhere; }
.primary-direction-section .error-message { margin: 14px 0 0; }
.account-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.account-filter-footer { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.account-results { min-width: 0; }
.account-results td { overflow-wrap: anywhere; }
.account-results table { min-width: 820px; }
.account-results[aria-busy="true"] { opacity: .6; }
.account-reset { width: 40px; height: 40px; padding: 9px; }
.account-reset img { width: 18px; height: 18px; }
.privacy-note { font-size: 12px; color: var(--muted); margin-top: 22px; }
dialog { width: min(900px, calc(100vw - 32px)); max-height: 90dvh; padding: 0; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: 0 24px 90px #233b532b; }
dialog::backdrop { background: #15273875; }
.dialog-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 26px; border-bottom: 1px solid var(--line); background: #fff; position: sticky; top: 0; z-index: 1; }
.dialog-header h2 { margin: 0; }
.dialog-content { padding: 24px 26px 28px; }
.close-dialog { padding: 5px 10px; font-weight: 500; }
.followup-records ol { list-style: none; padding: 0; margin: 0; }
.followup-records li { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.followup-records li:last-child { border-bottom: 0; }
.followup-entry { min-width: 0; }
.followup-entry p { white-space: pre-wrap; overflow-wrap: anywhere; margin: 8px 0 0; }
.followup-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--muted); }
.record-remove { width: 38px; height: 38px; padding: 9px; }
.record-remove:hover { background: #fff2f2; border-color: #e5bdc0; }
.student-picker-count { margin: 14px 0 10px; font-size: 12px; }
.student-picker-list { height: 340px; overflow-y: auto; overscroll-behavior: contain; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.student-picker-option { display: grid; grid-template-columns: 18px minmax(0, 1fr); align-items: center; gap: 12px; padding: 11px 10px; border-bottom: 1px solid var(--line); cursor: pointer; }
.student-picker-option input { width: 18px; height: 18px; min-height: 0; margin: 0; accent-color: var(--accent); }
.student-picker-option > span { min-width: 0; overflow-wrap: anywhere; }
.student-picker-option strong, .student-picker-option small { display: block; }
.student-picker-option small { font-size: 12px; font-weight: 400; }
.student-picker-option:has(:checked) { background: var(--accent-soft); }
.chart-student-dialog .panel-head > input { max-width: 320px; }
.chart-student-dialog h2 { letter-spacing: 0; overflow-wrap: anywhere; }
.chart-student-dialog table { min-width: 480px; }
.revision { padding: 14px 0; border-top: 1px solid var(--line); }
.revision summary { cursor: pointer; font-weight: 600; }
.revision .detail-grid { margin-top: 14px; }
.file-list { list-style: none; padding: 0; margin: 10px 0; }
.file-list li { padding: 9px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.submission-attachments { min-width: 0; }
.submission-attachments h3 { letter-spacing: 0; }
.submission-attachments input[type="file"] { min-width: 0; max-width: 100%; font-weight: 400; }
.attachment-picker { display: flex; align-items: center; gap: 10px; }
.attachment-picker img { width: 18px; height: 18px; }
.attachment-summary { font-size: 12px; font-weight: 400; }
.uploaded-attachments > li { display: grid; grid-template-columns: minmax(0, 1fr) 38px; align-items: center; gap: 16px; }
.uploaded-attachments .attachment-name a { overflow-wrap: anywhere; }
.attachment-marked .attachment-name a { color: var(--muted); text-decoration: line-through; }
.attachment-deletion-state { color: #a22e35; }
.pending-attachments { list-style: none; margin: 16px 0 0; padding: 0; }
.pending-attachments > li { display: grid; grid-template-columns: minmax(0, 1fr) 150px 38px; gap: 16px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.attachment-name, .pending-attachments label { min-width: 0; }
.attachment-name strong { display: block; font-size: 13px; overflow-wrap: anywhere; font-weight: 600; }
.attachment-name small { display: block; font-variant-numeric: tabular-nums; }
.pending-attachments label { font-size: 12px; }
.pending-attachments select { margin-top: 4px; }
.attachment-remove { width: 38px; height: 38px; min-height: 38px; padding: 9px; }
.attachment-remove img { width: 18px; height: 18px; }
.pager { display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 18px; }
.credential { font-family: Consolas, monospace; user-select: all; padding: 14px; background: #f3f6f8; overflow-wrap: anywhere; border-radius: 7px; }
#notifications { position: fixed; bottom: 24px; right: 24px; z-index: 5; display: grid; gap: 10px; max-width: min(420px, calc(100vw - 40px)); }
.toast { padding: 14px 20px; border: 1px solid #d6e3dc; border-radius: 9px; background: #f1f9f4; color: #2c6141; box-shadow: 0 8px 24px #233b5312; }
.toast.error { background: #fff3f3; color: #943138; border-color: #ecd4d6; }
@media (max-width: 1100px) { .form-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } .content { padding: 24px; } .columns { grid-template-columns: 1fr; } }
@media (max-width: 760px) {
  .direction-controls { grid-template-columns: minmax(0, 1fr) max-content; gap: 10px 12px; }
  .direction-status { grid-column: 1 / -1; padding-bottom: 0; }
  .pending-attachments > li { grid-template-columns: minmax(0, 1fr) 38px; gap: 10px; }
  .pending-attachments .attachment-name { grid-column: 1; }
  .pending-attachments label { grid-column: 1; grid-row: 2; }
  .pending-attachments .attachment-remove { grid-column: 2; grid-row: 1; }
  .identity-fields, .account-filters { grid-template-columns: 1fr; }
  .topbar { padding: 13px 18px; align-items: flex-start; flex-wrap: wrap; }
  .brand strong { font-size: 14px; } .brand img { width: 53px; height: 39px; }
  .account-tools { width: 100%; justify-content: flex-end; gap: 7px; }
  .account-name { margin-right: auto; text-align: left; }
  .layout { grid-template-columns: 1fr; } .sidebar { padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); display: flex; overflow-x: auto; gap: 7px; }
  .nav-button { width: auto; flex: none; margin: 0; padding: 9px 12px; } .nav-label, .nav-separator, .sidebar-note { display: none; }
  .content { padding: 21px 16px; } .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  h1 { font-size: 23px; } .panel { padding: 18px; } .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .login-layout { grid-template-columns: 1fr; } .login-intro { padding: 27px; border-right: 0; }
  .login-intro .brand { margin-bottom: 25px; } .login-intro h1 { font-size: 28px; margin-bottom: 13px; }
  .login-intro p { margin: 0; font-size: 13px; } .login-points { display: none; } .login-side { padding: 35px 25px; }
  .dialog-content { padding: 20px; } .dialog-header { padding: 17px 20px; } .filter-input, .filter-select { max-width: 100%; }
}
@media (prefers-reduced-motion: no-preference) { button, .button { transition: background-color .15s ease, border-color .15s ease; } }
