/* Campus OJ teaching UI. Layout/form/table conventions adapted from Tabler 1.6.1
   (MIT, ec33733290bd0f314ca19f6be58bc69a6ab3e4fa). See vendor/TABLER-LICENSE.
   Scoped product CSS: the legacy Demo stylesheets are not loaded by teaching.html. */
:root {
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", system-ui, sans-serif;
  font-synthesis: none;
  font-size: 15px;
  color: #202b3b;
  background: #f3f4f6;
  --ink: #202b3b;
  --muted: #586474;
  --line: #dce1e7;
  --surface: #fff;
  --blue: #1559a1;
  --blue-hover: #10477f;
  --sidebar: 232px;
  --radius: 6px;
  --sample-ink: var(--ink);
  --sample-muted: var(--muted);
  --sample-border: var(--line);
  --sample-blue: var(--blue);
}
* { box-sizing: border-box; }
html { scrollbar-gutter: stable; }
body { margin: 0; line-height: 1.6; }
button, input, select, textarea { font: inherit; }
button, a, input, select, summary { touch-action: manipulation; }
button { cursor: pointer; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--ink); }
[hidden] { display: none !important; }
:where(button, a, input, select, textarea, summary):focus-visible { outline: 3px solid #4283c5; outline-offset: 3px; }
.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.product-shell { color: var(--ink); font-size: 15px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 20; display: flex; flex-direction: column; padding: 24px 16px 20px; background: #1d2839; color: #dce5ef; border-right: 1px solid #26364b; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; padding: 0 10px 24px; }
.brand:hover { text-decoration: none; }
.brand-mark { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; flex: none; background: #335578; color: #fff; border-radius: 6px; }
.brand-mark .icon { width: 24px; height: 24px; }
.brand-name { font-size: 19px; font-weight: 650; letter-spacing: -.3px; }
.brand-sub, .eyebrow { display: none; }
.nav-label { margin: 12px 12px 8px; font-size: 13px; color: #a9b9cb; }
.sidebar nav { display: grid; gap: 4px; }
.nav-item { position: relative; display: flex; align-items: center; gap: 12px; padding: 12px; min-height: 46px; border-radius: var(--radius); color: #d0dbe8; font-size: 15px; transition: background-color 150ms, color 150ms; }
.nav-item .icon { color: #a9bdd2; }
.nav-item:hover { color: #fff; background: #2a3a50; text-decoration: none; }
.nav-item.active { color: #fff; background: #314b68; font-weight: 600; }
.nav-item.active .icon { color: #fff; }
.nav-item.active::before { content: ''; position: absolute; left: -16px; top: 10px; bottom: 10px; width: 3px; border-radius: 0 2px 2px 0; background: #8bbef4; }
.sidebar a:focus-visible { outline-color: #a9cefa; }
.sidebar-bottom { margin-top: auto; border-top: 1px solid #3c4b5f; padding: 18px 12px 0; }
.sidebar-bottom .badge { color: #c2d1e1; background: transparent; border: 1px solid #5d7088; font-size: 13px; }
.shell { margin-left: var(--sidebar); min-height: 100vh; }
.topbar { min-height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px 32px; border-bottom: 1px solid var(--line); background: #fff; }
.topbar-title { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.topbar-title .icon { width: 18px; height: 18px; }
.topbar-meta, .user-chip { display: flex; align-items: center; gap: 12px; }
.user-chip { font-size: 14px; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; background: #edf1f5; border: 1px solid #d6dde6; border-radius: 50%; color: #40566f; }
.user-chip .badge { padding: 2px 7px; font-size: 12px; }
.main { margin: 0; padding: 28px 32px 40px; width: 100%; max-width: none; min-width: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 0 0 24px; }
.page-head h1 { font-size: 27px; line-height: 1.4; font-weight: 650; margin: 0; letter-spacing: -.4px; overflow-wrap: anywhere; }
.subtitle { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 8px 0 0; max-width: 1000px; }
.head-actions, .row-gap, .table-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.head-actions { justify-content: flex-end; flex: none; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 14px; border: 1px solid #c9d1dc; border-radius: var(--radius); background: #fff; color: #344358; font-size: 14px; font-weight: 500; line-height: 1.45; text-align: center; white-space: nowrap; transition: background-color 150ms, border-color 150ms, box-shadow 150ms; }
.btn:hover { background: #eef1f5; border-color: #aab7c6; text-decoration: none; }
.btn:active:not(:disabled) { background: #e3e9f0; }
.btn .icon { width: 18px; height: 18px; }
.btn.primary { color: #fff; background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { color: #fff; background: var(--blue-hover); border-color: var(--blue-hover); }
.btn.primary:active { background: #0d3b6a; }
.btn.danger { color: #9b2925; background: #fff; border-color: #d6aaa6; }
.btn.danger:hover { background: #fff1f1; border-color: #b86059; }
.btn.small { min-height: 34px; padding: 6px 10px; font-size: 14px; }
.btn:disabled { color: #626b78; background: #e7ebf0; border-color: #cfd6df; cursor: not-allowed; opacity: 1; }
.back-link, .product-back { min-height: 32px; padding: 0; margin-bottom: 12px; border: 0; background: transparent; color: var(--blue); font-size: 14px; }
.back-link:hover, .product-back:hover { background: transparent; color: var(--blue-hover); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; overflow: hidden; }
.panel + .panel { margin-top: 20px; }
.panel-head, .result-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 22px; border-bottom: 1px solid var(--line); min-height: 62px; flex-wrap: wrap; }
.panel-head h2, .result-head h3 { font-size: 18px; font-weight: 600; line-height: 1.5; margin: 0; }
.panel-body, .form-section { padding: 24px; }
.panel-body > :last-child { margin-bottom: 0; }
.panel-foot { padding: 16px 24px; border-top: 1px solid var(--line); background: #fafbfc; color: var(--muted); font-size: 14px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 20px; }
.card-grid > .panel { margin: 0; }
.navigation-card { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 20px; column-gap: 16px; row-gap: 8px; align-content: start; padding: 24px; min-height: 150px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink); background: #fff; transition: border-color 150ms, background-color 150ms; }
.navigation-card:hover { border-color: #91b4d9; background: #fafcfe; text-decoration: none; }
.card-emblem { display: inline-flex; grid-row: 1 / span 3; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 6px; background: #edf3fa; color: #32669a; }
.card-emblem .icon { width: 24px; height: 24px; }
.navigation-card h2 { grid-column: 2; font-size: 19px; font-weight: 600; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.navigation-card .badge { grid-column: 2; justify-self: start; }
.card-label { grid-column: 2; font-size: 14px; color: var(--muted); }
.card-arrow { grid-column: 3; grid-row: 1 / span 3; align-self: center; color: #5d7691; }
.student-class-card { min-height: 182px; }
.list-toolbar { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.list-toolbar .form-field { margin: 0; }
.list-toolbar p { margin: 0; color: var(--muted); font-size: 14px; }
.term-selector { width: min(380px, 100%); }
.page-tabs { display: flex; flex-wrap: wrap; gap: 28px; border-bottom: 1px solid var(--line); margin: 0 0 24px; }
.page-tabs a, .tab-button { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: 15px; font-weight: 500; min-height: 46px; padding: 10px 0 13px; background: transparent; border: 0; border-bottom: 2px solid transparent; transition: color 150ms, border-color 150ms; }
.page-tabs a:hover, .tab-button:hover { color: var(--blue); text-decoration: none; }
.page-tabs a.active, .tab-button.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.page-tabs .icon { width: 18px; height: 18px; }
.class-frame > .page-head { margin-bottom: 10px; }
.class-status { margin-bottom: 12px; min-height: 27px; }
.class-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.class-tabs { margin-bottom: 24px; }
.compact-task { position: relative; display: flex; align-items: center; gap: 20px; padding: 20px 24px; border-bottom: 1px solid var(--line); color: var(--ink); transition: background-color 150ms; }
.compact-task:last-child { border-bottom: 0; }
.compact-task > .task-emblem { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; background: #f0f3f7; color: #62748a; flex: none; }
.compact-task > .task-item-content { flex: 1; min-width: 0; }
.compact-task h3 { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0; overflow-wrap: anywhere; flex: 1; min-width: 160px; }
.compact-task p { color: var(--muted); font-size: 14px; line-height: 1.65; margin: 0; }
.task-title-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px 12px; }
.task-title-row > .badge { flex: none; }
.compact-task .task-source, .compact-task .task-times { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 18px; margin-top: 6px; }
.task-source > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.task-times > span { overflow-wrap: anywhere; }
.task-notes { margin-top: 6px; }
.task-link:hover { background: #f8fafc; text-decoration: none; }
.task-arrow { color: #65758a; flex: none; }
.task-state-columns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 20px; }
.task-state-columns > .panel { margin: 0; }
.task-state-columns .task-emblem { display: none; }
.task-state-columns .compact-task { padding: 20px; }
.badge, .tag { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; line-height: 1.5; padding: 3px 8px; color: #45546a; background: #f0f3f7; border: 1px solid #d8e0e9; border-radius: 4px; font-weight: 500; white-space: normal; }
.badge.ac { color: #176b3b; background: #eef8f1; border-color: #bddbc8; }
.badge.wa, .badge.re, .badge.ole { color: #9b2925; background: #fff1f1; border-color: #ecc9c6; }
.badge.ce, .badge.processing { color: #754704; background: #fff4d5; border-color: #e6d296; }
.badge.tle, .badge.mle, .badge.blue, .badge.status-pending { color: #1b4f86; background: #eef3fc; border-color: #c9d8ec; }
.badge.status-se, .badge.system_error { color: #8d2924; background: #fff0eb; border-color: #e6b4a6; }
.empty-state { padding: 32px 24px; color: var(--muted); grid-column: 1 / -1; text-align: left; }
.card-grid > .empty-state { border: 1px dashed #bac6d3; border-radius: var(--radius); background: #fff; }
.empty-state h3 { font-size: 18px; font-weight: 600; margin: 0 0 8px; }
.empty-state p { font-size: 14px; line-height: 1.7; max-width: 660px; margin: 0; }
.empty-state .btn { margin-top: 16px; }
.table-wrap { overflow: auto; max-width: 100%; overscroll-behavior-inline: contain; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 1.6; }
.data-table th { text-align: left; background: #f7f8fa; color: #556171; font-size: 13px; font-weight: 600; padding: 12px 20px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.data-table td { padding: 16px 20px; vertical-align: middle; border-bottom: 1px solid #e5e9ee; color: var(--ink); }
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #fafbfd; }
.data-table td:first-child a { font-weight: 500; }
.data-table td .small { display: block; margin-top: 4px; }
.data-table .table-actions { flex-wrap: nowrap; }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.grades-table { table-layout: fixed; max-width: none; }
.grade-panel { width: max-content; max-width: 100%; }
.grade-panel.grade-empty { width: 660px; }
.grades-table :is(th,td) { text-align: center; padding: 14px 18px; white-space: normal; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.grades-table :is(th,td):first-child, .grades-table :is(th,td):last-child { text-align: left; }
.grades-table th > .small { display: block; margin-top: 5px; }
.grades-table :is(th,td):last-child { border-left: 1px solid var(--line); }
.student-number { font: 14px/1.6 Consolas, "Cascadia Mono", monospace; color: var(--muted); margin-top: 4px; }
.small:not(.btn), .muted, .field-help, .source-note, .stat-note, .grade-explanation, .record-summary, .record-id, .audit-id { color: var(--muted); font-size: 14px; line-height: 1.65; }
.record-id, .audit-id { overflow-wrap: anywhere; }
.grade-explanation { max-width: 1000px; margin-bottom: 20px; }
.score-total { font-size: 22px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.grades-table .score-total { font-size: 18px; white-space: normal; }
.btn.score-link { min-height: 32px; border: 0; background: transparent; padding: 4px 8px; color: var(--ink); font-size: 15px; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.btn.score-link:hover { background: #edf4fc; }
.grades-table .grade-link { color: var(--ink); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.grades-table .grade-link:hover { color: var(--blue); text-decoration-style: solid; }
.grades-table :is(.grade-link,.score-link,.grade-title-trigger):focus-visible { outline: 2px solid #487daf; outline-offset: 3px; }
.grade-title { width: 100%; color: var(--ink); }
.grade-title-trigger { display: block; width: 100%; padding: 0; border: 0; background: transparent; color: var(--ink); font-family: inherit; font-size: 14px; font-weight: 500; line-height: 1.6; text-align: center; cursor: help; }
.grade-title-link { cursor: pointer; text-decoration: underline dotted; text-underline-offset: 4px; }
.grade-title-link:hover { color: var(--blue); text-decoration-style: solid; }
.grade-title-text { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; min-height: 3.2em; }
.grade-tooltip { position: fixed; inset: auto; margin: 0; width: max-content; max-width: min(380px, calc(100vw - 24px)); padding: 10px 14px; border: 1px solid #b9c9db; border-radius: 6px; background: #fff; color: var(--ink); font-family: inherit; font-size: 14px; line-height: 1.65; overflow-wrap: anywhere; box-shadow: 0 6px 24px #182b4026; z-index: 30; pointer-events: none; }
.grade-tooltip[hidden] { display: none; }
.student-identity { display: inline-flex; flex-direction: column; min-width: 0; vertical-align: middle; overflow-wrap: anywhere; }
.student-identity .student-number { margin-top: 2px; }
.admin-grades-table { width: 620px; max-width: 100%; table-layout: fixed; }
.admin-grades-table :is(th,td):first-child { width: 65%; white-space: normal; overflow-wrap: anywhere; }
.admin-grades-table :is(th,td):last-child { text-align: center; white-space: normal; }
#record-filter { justify-content: flex-start; align-items: flex-end; gap: 12px; }
#record-filter [name="source"] { width: 160px; }
#record-filter [name="search"] { width: min(300px, 100%); }
#record-filter .form-field:has([name="search"]) { width: min(300px, 100%); }
#record-filter > .btn { margin-bottom: 0; }
.form-stack { display: grid; gap: 20px; align-content: start; }
.form-grid, .time-inputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; }
.form-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; color: var(--ink); font-size: 14px; }
.form-field > span, .form-field > label { font-weight: 500; }
.field-input, .field-select, .form-field textarea { display: block; width: 100%; min-width: 0; min-height: 40px; padding: 9px 12px; color: var(--ink); background: #fff; border: 1px solid #bcc7d4; border-radius: var(--radius); font-size: 14px; line-height: 1.5; transition: border-color 150ms, box-shadow 150ms; }
.field-input:hover, .field-select:hover, .form-field textarea:hover { border-color: #809ab7; }
.field-input:focus, .field-select:focus, .form-field textarea:focus { border-color: #397dc1; box-shadow: 0 0 0 3px #397dc11c; }
input::placeholder, textarea::placeholder { color: #627080; opacity: 1; }
.form-field textarea { resize: vertical; min-height: 100px; line-height: 1.7; }
.form-field small { color: var(--muted); font-size: 14px; line-height: 1.65; font-weight: 400; }
.form-field .code-field { font: 14px/1.65 Consolas, "Cascadia Mono", monospace; white-space: pre; tab-size: 4; }
.field-error:empty, .form-error:empty { display: none; }
.form-error { padding: 12px 16px; background: #fff1f1; border: 1px solid #e4b4b1; border-radius: var(--radius); color: #8d2924; font-size: 14px; line-height: 1.7; margin-bottom: 16px; }
.form-field .field-error { color: #8d2924; }
.invalid-field :is(input, select, textarea) { border-color: #b34e47; }
.form-inline { display: flex; gap: 16px; align-items: flex-end; flex-wrap: wrap; }
.form-inline .form-field { flex: 1; min-width: 200px; }
.form-section + .form-section { border-top: 1px solid var(--line); }
.form-section h2 { font-size: 18px; font-weight: 600; margin: 0 0 20px; }
.form-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 12px; padding: 18px 24px; border-top: 1px solid var(--line); background: #fafbfc; }
.form-actions .field-help { margin-right: auto; max-width: 65%; }
.check-row { display: flex; align-items: center; gap: 10px; color: #344358; font-size: 14px; }
.check-row input { width: 18px; height: 18px; accent-color: var(--blue); flex: none; }
.language-options { display: flex; flex-wrap: wrap; gap: 16px 24px; }
input:disabled, select:disabled, textarea:disabled { color: #596575; background: #f0f2f5; cursor: not-allowed; }
.section-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.section-actions h2 { margin: 0; }
.test-row { display: grid; grid-template-columns: 24px 1fr 1fr 70px; gap: 16px; padding: 20px 0; align-items: start; border-bottom: 1px solid var(--line); }
.test-row:last-child { border-bottom: 0; }
.test-number { color: var(--muted); padding-top: 38px; }
.test-row .btn { align-self: center; }
.test-row .form-field textarea { min-height: 100px; }
.invite-code { display: inline-block; font: 600 20px Consolas, monospace; letter-spacing: 2px; background: #eef3f9; color: #29598b; border: 1px solid #d4e0ee; padding: 8px 14px; border-radius: var(--radius); }
.notice, .mode-banner, .teacher-preview, .frozen-task { font-size: 14px; line-height: 1.7; color: #694a13; background: #fff8e7; border: 1px solid #dfceaa; padding: 14px 18px; border-radius: var(--radius); margin-bottom: 20px; overflow-wrap: anywhere; }
.mode-banner { display: flex; flex-wrap: wrap; gap: 8px; }
.mode-banner strong { font-weight: 600; }
.teacher-preview, .frozen-task { color: #3f526a; background: #f3f6fa; border-color: #d3deeb; }
.frozen-task h2 { font-size: 18px; }
.frozen-task ul { padding-left: 20px; margin-bottom: 0; }
.task-unavailable { padding: 32px 24px; }
.task-unavailable h2 { font-size: 22px; margin-bottom: 12px; }
.task-unavailable p { color: var(--muted); max-width: 780px; font-size: 15px; line-height: 1.8; }
.task-context { margin-bottom: 20px; }
.task-facts { display: flex; gap: 12px 24px; flex-wrap: wrap; color: var(--muted); font-size: 14px; margin-top: 12px; }
.task-facts strong { color: var(--ink); font-weight: 500; margin-left: 8px; }
.teacher-countdown { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 14px; margin-top: 12px; }
.teacher-countdown strong { color: var(--blue); font-size: 18px; font-variant-numeric: tabular-nums; }
.task-rules { color: var(--muted); font-size: 14px; margin: 16px 0; }
.task-rules p { margin: 8px 0; line-height: 1.7; }
summary { cursor: pointer; }
.task-problem-nav { display: flex; gap: 8px; flex-wrap: nowrap; overflow: auto; max-width: 100%; padding: 4px 3px 8px; margin-bottom: 20px; }
.task-problem-nav a { display: flex; align-items: center; flex: none; gap: 12px; padding: 10px 14px; border: 1px solid #cbd5e1; border-radius: var(--radius); background: #fff; color: #344358; font-size: 14px; max-width: min(400px, 90%); }
.task-problem-nav a > span { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.task-problem-nav small { font-size: 14px; color: var(--muted); white-space: nowrap; }
.task-problem-nav a.active { border-color: #78a4d4; color: #145495; background: #edf4fc; }
.task-problem-nav a:hover { text-decoration: none; border-color: #78a4d4; }
.problem-layout { display: grid; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 24px; align-items: start; }
.problem-layout > .panel { margin: 0; }
.readonly-statement { max-width: 1120px; }
.statement-section + .statement-section { margin-top: 24px; }
.statement-section h3 { font-size: 16px; font-weight: 600; line-height: 1.5; margin-bottom: 10px; }
.statement-section p { color: var(--ink); font-size: 15px; line-height: 1.85; white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
.sample-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.sample-label { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.sample-box { min-width: 0; }
.sample-box pre { padding: 12px 16px; margin: 0; background: #f6f7f9; border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; font: 14px/1.7 Consolas, "Cascadia Mono", monospace; color: #303b4a; }
.editor-panel { min-width: 0; }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.editor-head .field-select { max-width: 170px; min-height: 36px; }
.code-editor { display: block; width: 100%; padding: 20px; min-height: 300px; height: clamp(300px, 40vh, 500px); max-height: 75vh; color: #27374d; background: #fcfdfe; border: 0; border-radius: 0; resize: vertical; white-space: pre; tab-size: 4; font: 15px/1.7 Consolas, "Cascadia Mono", monospace; }
.code-editor:focus { outline-offset: -3px; }
.code-editor[readonly] { color: #536274; background: #f3f5f8; }
.editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-top: 1px solid var(--line); }
.draft-indicator { font-size: 14px; color: #694a13; flex: 1; }
.draft-indicator.saved { color: #176b3b; }
.editor-actions { margin-left: auto; display: flex; gap: 8px; }
#language-help { padding: 12px 20px; font-size: 14px; color: var(--muted); }
.submit-status { padding: 12px 20px; font-size: 14px; color: #1b4f86; background: #eef3fc; border-top: 1px solid var(--line); }
.submit-status:empty { display: none; }
.submission-result { margin-top: 20px; }
.submission-result p { font-size: 14px; color: var(--muted); line-height: 1.7; }
.result-summary { display: flex; gap: 8px 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.compile-log, .code-view { background: #f5f7fa; border: 1px solid var(--line); padding: 16px; border-radius: var(--radius); color: #27374d; font: 14px/1.7 Consolas, "Cascadia Mono", monospace; overflow: auto; white-space: pre-wrap; max-height: 420px; }
.submission-history { margin-top: 24px; }
.record-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; color: var(--muted); font-size: 14px; overflow-wrap: anywhere; }
.more-actions { position: relative; display: inline-block; font-size: 14px; }
.more-actions > summary { display: flex; align-items: center; gap: 8px; list-style: none; min-height: 40px; padding: 8px 12px; border: 1px solid #c9d1dc; border-radius: var(--radius); background: #fff; color: #344358; }
.more-actions > summary::-webkit-details-marker { display: none; }
.more-actions > summary:hover { background: #eef1f5; }
.more-actions > div { position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; min-width: 220px; padding: 8px; display: grid; gap: 4px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px #1d28391f; }
.more-actions > div .btn { border: 0; background: transparent; justify-content: flex-start; }
.more-actions > div .btn:hover { background: #f0f4f9; }
.more-actions[open] > div { animation: menu-enter 150ms ease-out; }
.task-export-menu > div { left: 0; right: auto; }
.task-export-menu > summary:focus-visible { outline: 2px solid #487daf; outline-offset: 3px; }
@keyframes menu-enter { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.admin-records > details { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 16px; }
.admin-records summary { color: #344358; font-size: 14px; }
.inline-code { font-family: Consolas, monospace; background: #eef1f5; border-radius: 4px; padding: 2px 6px; }
.access-error { padding: 28px; }
.access-error p { color: var(--muted); }
.loading-line { padding: 40px 24px; color: var(--muted); font-size: 15px; }
.toast { position: fixed; left: calc(50% + var(--sidebar) / 2); bottom: 24px; transform: translateX(-50%) translateY(12px); opacity: 0; pointer-events: none; z-index: 110; max-width: min(640px, 85vw); padding: 14px 20px; color: #fff; background: #243c58; border-radius: var(--radius); font-size: 14px; line-height: 1.6; box-shadow: 0 6px 24px #1d283924; transition: opacity 150ms, transform 150ms; }
.toast.visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: #8d2924; }
dialog { padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 8px; width: min(780px, calc(100vw - 48px)); max-height: 88vh; color: var(--ink); box-shadow: 0 16px 64px #13233740; }
dialog::backdrop { background: #17243570; }
.dialog-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 18px 24px; border-bottom: 1px solid var(--line); background: #fff; }
.dialog-head h2 { font-size: 20px; font-weight: 600; margin: 0; }
.dialog-body { padding: 24px; }
.dialog-body h3 { font-size: 16px; margin: 24px 0 12px; }
.dialog-body h3:first-child { margin-top: 0; }
.dialog-body p { font-size: 15px; line-height: 1.8; color: #455264; }
.dialog-body .form-stack p { margin: 0; }
.dialog-actions { padding: 18px 24px; display: flex; align-items: center; justify-content: flex-end; gap: 12px; border-top: 1px solid var(--line); background: #fafbfc; }
.record-dialog { width: min(960px, calc(100vw - 48px)); }
.discard-dialog { width: min(540px, calc(100vw - 32px)); }
.discard-dialog .dialog-body p { margin: 0; }
.problem-library-toolbar { justify-content: flex-start; align-items: flex-end; }
.problem-library-toolbar > .form-field:first-child { width: min(380px, 100%); }
.problem-library-toolbar > .field-help { margin-left: auto; }
.problem-library-toolbar .library-tag-filter { width: 210px; max-width: 100%; }
.problem-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; }
.library-title .problem-tags { margin: 8px 0 0; }
.problem-tag { display: inline-block; max-width: 100%; padding: 3px 8px; border: 1px solid #d3dfed; border-radius: 4px; color: #315b86; background: #f0f5fb; font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.problem-tag.inactive { color: #657184; border-color: #d9dfe6; background: #f5f6f8; }
.problem-tag-section .form-field > p { margin: 0; }
.tag-picker-search { max-width: 420px; }
.tag-picker-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 20px; max-width: 820px; max-height: 224px; overflow: auto; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfc; }
.tag-picker-option { min-width: 0; padding: 5px 0; align-items: flex-start; }
.tag-picker-option > span { min-width: 0; overflow-wrap: anywhere; }
.tag-picker-option small { display: block; font-size: 12px; margin-top: 3px; }
.tag-picker-option[hidden], .tag-admin-panel tr[hidden] { display: none; }
.tag-admin-panel code { font: 13px/1.6 Consolas, monospace; overflow-wrap: anywhere; }
.tag-admin-panel .data-table td:last-child { width: 200px; }
.tag-admin-panel .data-table td:first-child { overflow-wrap: anywhere; }
@media (max-width: 740px) { .problem-library-toolbar .library-tag-filter { width: 100%; } .tag-picker-options { grid-template-columns: 1fr; } }
.library-batch-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.library-batch-toolbar .batch-note { flex-basis: 100%; }
.problem-library-panel .data-table .table-actions { flex-wrap: wrap; }
.problem-library-panel .library-title { min-width: 160px; max-width: 420px; overflow-wrap: anywhere; }
.problem-library-panel .library-title .badge { margin-left: 8px; }
.problem-library-panel .data-table td, .problem-library-panel .data-table th { padding-inline: 16px; }
.problem-select-cell { width: 60px; }
.problem-select, .import-item-select { width: 17px; height: 17px; accent-color: var(--blue); cursor: pointer; }
.problem-library-table td:nth-child(3) { white-space: nowrap; }
.problem-library-table td:last-child { width: 290px; }
.shared-library-table td:last-child { width: 240px; }
.problem-file-dialog { width: min(960px, calc(100vw - 48px)); }
.problem-file-dialog .dialog-body { max-height: calc(88vh - 162px); overflow: auto; overscroll-behavior: contain; }
.problem-file-dialog .dialog-actions { flex-wrap: wrap; }
.problem-file-dialog .dialog-actions > .field-help { margin-right: auto; }
.problem-file-help li { margin: 9px 0; font-size: 15px; line-height: 1.8; }
.problem-file-help .row-gap { margin: 22px 0; }
.problem-ai-text { font-family: inherit; font-size: 13px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.import-file-preview { margin-top: 24px; border-top: 1px solid var(--line); padding-top: 8px; }
.import-file-preview h3 { overflow-wrap: anywhere; }
.import-file-preview .data-table { min-width: 600px; }
.import-file-preview .data-table :is(th,td) { padding: 12px; }
.import-file-preview .library-title { max-width: 280px; overflow-wrap: anywhere; }
.import-item-error { color: #a83332; }
@media (max-width: 1100px) { .problem-library-table td:last-child { width: 220px; } .problem-library-panel .data-table :is(th,td) { padding-inline: 12px; } .problem-library-table .table-actions .btn { padding-inline: 10px; } }
.product-login { min-height: 100vh; }
.login-layout { min-height: 100vh; width: min(448px, calc(100% - 40px)); margin: auto; display: flex; flex-direction: column; justify-content: center; gap: 24px; padding: 40px 0; }
.login-intro { text-align: center; }
.login-intro .brand { justify-content: center; color: #263b54; padding: 0; }
.login-intro h1 { font-size: 23px; font-weight: 600; margin: 20px 0 6px; }
.login-intro > p { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.login-card { width: 100%; }
.login-card .panel-body { padding: 28px 32px; }
.login-card h2 { font-size: 20px; font-weight: 600; margin-bottom: 24px; }
.login-card .btn.primary { width: 100%; margin-top: 4px; }
.login-card .panel-foot { padding: 16px 24px; text-align: center; font-size: 13px; }
.boot-state { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; color: var(--muted); }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 200; background: #fff; color: var(--blue); padding: 10px 16px; border: 1px solid var(--blue); border-radius: var(--radius); }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (min-width: 1600px) { .main { padding: 32px 40px 48px; } .topbar { padding-inline: 40px; } .card-grid { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); } }
@media (max-width: 1200px) { :root { --sidebar: 216px; } .main { padding: 24px; } .topbar { padding-inline: 24px; } .task-state-columns { grid-template-columns: 1fr; } .head-actions { flex-shrink: 1; } .problem-layout { gap: 20px; } }
@media (max-width: 850px) { .main { padding: 20px; } .problem-layout { grid-template-columns: 1fr; } .product-practice > .editor-panel { grid-row: 1; } .page-head { flex-wrap: wrap; } .head-actions { justify-content: flex-start; } .sample-grid { gap: 12px; } .data-table th, .data-table td { padding-inline: 16px; } }
@media (max-width: 740px) { :root { --sidebar: 0px; } .sidebar { position: static; width: 100%; padding: 16px; } .sidebar .brand { padding-bottom: 12px; } .sidebar nav { display: flex; overflow: auto; gap: 8px; } .nav-item { flex: none; padding: 10px; font-size: 14px; } .nav-item.active::before { display: none; } .nav-label, .sidebar-bottom { display: none; } .shell { margin: 0; } .topbar { padding: 12px 16px; } .topbar-title { display: none; } .topbar-meta { width: 100%; justify-content: space-between; } .main { padding: 20px 16px 32px; } .page-head h1 { font-size: 24px; } .page-tabs { gap: 20px; } .card-grid, .product-navigation .card-grid { grid-template-columns: 1fr; } .panel-body, .form-section { padding: 20px; } .form-grid, .time-inputs { grid-template-columns: 1fr; } .form-actions { padding: 16px 20px; } .form-actions .field-help { width: 100%; max-width: none; } .compact-task { padding: 18px 20px; gap: 12px; } .task-emblem { display: none; } .test-row { grid-template-columns: 24px 1fr; } .test-row .form-field, .test-row .btn { grid-column: 2; } .record-meta { grid-template-columns: 1fr; } .toast { left: 50%; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
