:root {
  --ink: #17202a;
  --muted: #697586;
  --line: #e5edf3;
  --bg: #f6fafc;
  --panel: #fff;
  --brand: #22b8cf;
  --brand-dark: #07879c;
  --yellow: #ffd43b;
  --green: #2f9e44;
  --red: #e03131;
  --orange: #f08c00;
  --blue: #1c7ed6;
  --shadow: 0 14px 36px rgba(23, 32, 42, .08);
}

.oj-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fbfd;
  color: var(--ink);
  line-height: 1.2;
  white-space: nowrap;
}

.oj-status b {
  min-width: 34px;
  color: #007f97;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.oj-status em {
  overflow: hidden;
  text-overflow: ellipsis;
  font-style: normal;
  color: var(--muted);
}

.oj-status.green,
.oj-status.success {
  border-color: #bdebd5;
  background: #f1fbf5;
}

.oj-status.red,
.oj-status.danger {
  border-color: #ffd0d0;
  background: #fff6f6;
}

.oj-status.orange,
.oj-status.warning {
  border-color: #ffe1b7;
  background: #fff8ed;
}

.builder-taxonomy-strip {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
}

.builder-advanced-filter {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfdff;
  overflow: hidden;
}

.builder-advanced-filter summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.builder-advanced-filter summary::-webkit-details-marker {
  display: none;
}

.builder-advanced-filter summary::after {
  content: "展开";
  color: var(--brand-strong);
  font-size: 14px;
}

.builder-advanced-filter[open] summary::after {
  content: "收起";
}

.builder-advanced-filter summary em {
  margin-left: auto;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.knowledge-filter-body {
  display: grid;
  gap: 12px;
  padding: 0 14px 14px;
}

.selected-filter-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(29, 181, 203, 0.12);
  color: #006f83;
  font-weight: 700;
}

.knowledge-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.taxonomy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.taxonomy-row.compact .taxonomy-chip,
.taxonomy-row.knowledge .taxonomy-chip {
  min-height: 34px;
  padding: 6px 10px;
}

.taxonomy-chip {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  min-height: 38px;
  padding: 8px 12px;
  cursor: pointer;
}

.taxonomy-chip.active {
  border-color: var(--brand);
  background: rgba(29, 181, 203, 0.12);
  color: #006f83;
}

@media (max-width: 768px) {
  .oj-status {
    width: 100%;
    white-space: normal;
  }

  .taxonomy-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .taxonomy-chip {
    width: 100%;
    text-align: left;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  letter-spacing: 0;
}
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.is-hidden { display: none !important; }

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(34,184,207,.15), rgba(246,250,252,0) 460px),
    var(--bg);
}

.login-card {
  width: min(440px, 100%);
  display: grid;
  gap: 14px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.login-card img {
  width: 210px;
  height: 70px;
  object-fit: contain;
  object-position: left center;
}

.login-card h1 {
  font-size: 26px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.login-card label {
  display: grid;
  gap: 7px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.login-error {
  min-height: 20px;
  color: var(--red);
  font-size: 13px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fff;
  overflow-y: auto;
}

.brand {
  display: block;
  padding: 10px 10px 18px;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
}

.brand img {
  display: block;
  width: 172px;
  height: 56px;
  object-fit: contain;
  object-position: left center;
}

.brand span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.menu {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.menu-group {
  display: grid;
  gap: 6px;
}

.menu-group-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 0 10px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.menu-group-items {
  display: grid;
  gap: 6px;
}

.menu-group-arrow {
  display: none;
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1;
  transition: transform .18s ease;
}

.menu-item {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: #3d4b5c;
  font-weight: 800;
  text-align: left;
}

.menu-item.active,
.menu-item:hover {
  border-color: rgba(34,184,207,.35);
  background: rgba(34,184,207,.1);
  color: #06697a;
}

.mobile-nav-toggle {
  display: none;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.main {
  min-width: 0;
  padding: 26px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
}

.page-crumb {
  min-height: 18px;
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

h1 {
  margin: 0;
  font-size: 30px;
  line-height: 1.2;
}

.account {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(23,32,42,.04);
}

.account label { color: var(--muted); font-size: 13px; font-weight: 800; }
select, input, textarea {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}
select, input { min-height: 38px; padding: 0 10px; }
textarea {
  width: 100%;
  min-height: 96px;
  padding: 12px;
  resize: vertical;
}

.view-stack {
  min-width: 0;
}

.view {
  display: none;
  min-width: 0;
}

.view.active {
  display: block;
}

.simple-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.simple-hero h2 {
  margin: 0 0 8px;
  font-size: 24px;
  line-height: 1.25;
}

.simple-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.simple-hero p:not(.eyebrow),
.card-head p,
.page-detail-head p {
  display: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.quick-task-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.task-card {
  display: grid;
  gap: 8px;
  min-height: 138px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 24px rgba(23,32,42,.05);
}

.task-card:hover {
  border-color: rgba(34,184,207,.45);
  transform: translateY(-1px);
}

.task-card b {
  align-self: end;
  color: var(--brand-dark);
}

.task-card.blue { border-top: 4px solid var(--blue); }
.task-card.green { border-top: 4px solid var(--green); }
.task-card.orange { border-top: 4px solid var(--orange); }

.task-title {
  font-weight: 900;
  font-size: 16px;
}

.task-text {
  color: var(--muted);
  line-height: 1.55;
}

.highlight-item {
  border-color: rgba(240,140,0,.35);
  background: #fff9ef;
}

.page-detail-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.page-detail-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
}

.page-detail-head p {
  margin: 0;
  color: var(--muted);
}

.workflow-layout {
  display: grid;
  grid-template-columns: minmax(360px, .88fr) minmax(460px, 1.12fr);
  gap: 14px;
  align-items: start;
}

.workflow-layout.single {
  grid-template-columns: minmax(0, 1fr);
}

.workflow-sidebar,
.workflow-main,
.workflow-detail {
  min-width: 0;
}

.workflow-sidebar {
  display: grid;
  gap: 14px;
}

.workflow-main {
  display: grid;
  gap: 14px;
}

.workflow-detail {
  margin-top: 14px;
}

.workflow-list .card-body {
  max-height: 680px;
  overflow: auto;
  scrollbar-gutter: stable;
}

.workflow-list .item,
.workflow-list .question-row {
  scroll-margin: 16px;
}

.report-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.report-layout .card {
  min-width: 0;
}

.report-wide {
  grid-column: 1 / -1;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 6px 18px rgba(23,32,42,.035);
  transition: border-color .15s ease, box-shadow .15s ease;
}

.card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 18px 12px;
  border-bottom: 1px solid var(--line);
}

.card-head h2,
.card-head h3 {
  margin: 0;
  font-size: 20px;
}

.card-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.card-body { padding: 18px; }

.card + .card,
article.card + article.card {
  margin-top: 14px;
}

.attendance-students {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfe;
}

.attendance-row {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) 120px minmax(160px, 2fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.attendance-row:first-of-type {
  border-top: 0;
}

.metric {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.metric b { display: block; font-size: 28px; }
.metric span { display: block; margin-top: 5px; color: var(--muted); font-size: 13px; }

.language-overview { margin-bottom: 14px; }

.language-card {
  width: 100%;
  text-align: left;
}

.language-card b { font-size: 20px; }

.active-item {
  border-color: rgba(34,184,207,.55) !important;
  background: rgba(34,184,207,.08) !important;
}

.list { display: grid; gap: 10px; }
.item {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.item:hover {
  border-color: rgba(34,184,207,.34);
  background: #fbfeff;
}

.item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.item h3 {
  margin: 0;
  font-size: 17px;
}

.item.compact {
  padding: 10px;
  box-shadow: none;
}

.flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.flow-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.flow-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.flow-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.flow-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.flow-steps span {
  min-height: 24px;
  padding: 4px 8px;
  border-radius: 8px;
  background: #f6fafc;
  color: #425466;
  font-size: 12px;
  font-weight: 800;
}

.question-flow-shell {
  margin-bottom: 14px;
}

.question-flow-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.question-flow-card {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.question-flow-card:hover {
  border-color: rgba(34,184,207,.45);
  background: rgba(34,184,207,.06);
}

.question-flow-card b {
  font-size: 24px;
}

.question-flow-card small {
  color: var(--muted);
  line-height: 1.55;
}

.builder-panel {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.builder-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.builder-head b {
  display: block;
  font-size: 16px;
}

.builder-head span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.lesson-detail {
  display: grid;
  gap: 12px;
}

.reader {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.reader iframe {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: #fff;
}

.text-reader {
  padding: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.muted { color: var(--muted); }
.small { font-size: 13px; }

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #edf8fa;
  color: #087287;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.tag.green { background: #edf9f0; color: var(--green); }
.tag.orange { background: #fff4e6; color: var(--orange); }
.tag.red { background: #fff0f0; color: var(--red); }
.tag.blue { background: #edf6ff; color: var(--blue); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  transition: border-color .15s ease, background .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.btn:hover {
  border-color: rgba(34,184,207,.55);
  background: #f7fcfd;
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible,
.menu-item:focus-visible,
.link-btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(34,184,207,.24);
  outline-offset: 2px;
}

.btn.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.btn.primary:hover {
  border-color: var(--brand-dark);
  background: var(--brand-dark);
}

.btn.danger { border-color: #ffc9c9; color: var(--red); }

.btn.danger:hover {
  background: #fff5f5;
}

.btn-outline-primary {
  border-color: rgba(34,184,207,.45);
  background: #fff;
  color: var(--brand-dark);
}

.btn-outline-primary:hover {
  background: rgba(34,184,207,.1);
}

.link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-weight: 900;
  text-align: left;
}

.metric-link,
.language-card {
  cursor: pointer;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}

.metric-link:hover,
.language-card:hover {
  border-color: rgba(34,184,207,.55);
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(23,32,42,.08);
}

.management-tabs {
  position: sticky;
  top: 0;
  z-index: 4;
  padding: 10px 0;
  background: rgba(246, 248, 251, .94);
  backdrop-filter: blur(10px);
}

.item.compact {
  padding: 10px 12px;
}

form.item {
  margin: 0;
}

input:disabled,
select:disabled,
textarea:disabled {
  background: #f3f6f8;
  color: #667085;
  cursor: not-allowed;
}

.password-prompt {
  margin-bottom: 14px;
  border-color: rgba(245, 158, 11, .35);
  background: #fffaf0;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.form-grid label { display: grid; gap: 6px; color: #344054; font-size: 13px; font-weight: 900; }
.form-grid .full { grid-column: 1 / -1; }

.check-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(420px, 1.22fr);
  gap: 14px;
}

.codebox {
  min-height: 360px;
  font-family: Consolas, Monaco, monospace;
  font-size: 14px;
  line-height: 1.55;
  color: #dbe7ef;
  background: #111923;
  border-color: #243243;
}

.console {
  min-height: 138px;
  padding: 14px;
  border: 1px solid #dce7ee;
  border-radius: 8px;
  background: #0f1720;
  color: #dbe7ef;
  font-family: Consolas, Monaco, monospace;
  white-space: pre-wrap;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.card-body > .table,
.item > .table {
  display: block;
  overflow-x: auto;
}

.table th,
.table td {
  padding: 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}
.table th { background: #f8fbfc; color: #435266; font-size: 13px; }
.table tr:last-child td { border-bottom: 0; }

.table-hover tbody tr:hover {
  background: #f5fbfd;
}

.question-picker-table {
  max-height: 430px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.question-picker-table .table {
  min-width: 880px;
  border: 0;
}

.question-picker-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fcfd;
}

.scale-picker {
  gap: 14px;
}

.scale-filterbar {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  align-items: end;
}

.scale-filterbar .wide {
  grid-column: span 2;
}

.scale-table {
  max-height: 520px;
}

.scale-table .table {
  min-width: 980px;
}

.selected-tray {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid #d8edf2;
  border-radius: 8px;
  background: #f7fcfd;
}

.selected-tray-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.selected-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 260px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid rgba(34,184,207,.28);
  border-radius: 999px;
  background: #fff;
  color: #244052;
  font-size: 12px;
  font-weight: 900;
}

.selected-chip span {
  color: var(--muted);
  font-weight: 800;
}

.selected-chip:hover {
  border-color: rgba(224,49,49,.35);
  background: #fff8f8;
}

.pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding-top: 2px;
}

.scale-list .card-body {
  display: grid;
  gap: 12px;
}

.class-filterbar {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.scale-card-list {
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.class-list-item {
  width: 100%;
  color: var(--ink);
  text-align: left;
}

.compact-list {
  max-height: 320px;
  overflow: auto;
  padding-right: 4px;
}

.roster-check-list {
  max-height: 360px;
  overflow: auto;
  padding-right: 4px;
}

.check span {
  display: grid;
  gap: 2px;
}

.check small {
  color: var(--muted);
  font-size: 12px;
}

.exam-paper .card-body {
  background: #f8fbfd;
}

.exam-sheet {
  display: grid;
  gap: 16px;
}

.exam-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.exam-answer-card {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 12px;
}

.exam-card-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.exam-card-dot {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
}

.exam-card-dot.done {
  border-color: rgba(34,184,207,.45);
  background: #edf8fa;
  color: var(--brand-dark);
}

.exam-card-dot.marked {
  border-color: rgba(240,140,0,.45);
  background: #fff4e6;
  color: var(--orange);
}

.exam-card-dot.right {
  border-color: rgba(47,158,68,.45);
  background: #edf9f0;
  color: var(--green);
}

.exam-card-dot.wrong {
  border-color: rgba(224,49,49,.45);
  background: #fff0f0;
  color: var(--red);
}

.exam-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.exam-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.exam-legend i {
  width: 10px;
  height: 10px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
}

.exam-legend i.done { background: var(--brand); border-color: var(--brand); }
.exam-legend i.marked { background: var(--orange); border-color: var(--orange); }
.exam-legend i.right { background: var(--green); border-color: var(--green); }
.exam-legend i.wrong { background: var(--red); border-color: var(--red); }

.review-workspace {
  display: grid;
  grid-template-columns: minmax(300px, .85fr) minmax(460px, 1.2fr) minmax(320px, .95fr);
  gap: 14px;
  align-items: start;
}

.review-workspace .workflow-list .card-body {
  max-height: 760px;
}

.review-detail-card {
  min-width: 0;
}

.review-detail-card pre {
  max-height: 320px;
  overflow: auto;
  padding: 12px;
  border-radius: 8px;
  background: #f8fbfd;
  border: 1px solid var(--line);
  white-space: pre-wrap;
}

.review-filterbar {
  grid-template-columns: repeat(3, minmax(120px, 1fr));
}

.message-workspace {
  display: grid;
  grid-template-columns: minmax(340px, .9fr) minmax(460px, 1.1fr);
  gap: 14px;
  align-items: start;
}

.message-filterbar {
  grid-template-columns: minmax(180px, 1.4fr) minmax(120px, .8fr) minmax(120px, .8fr);
}

.message-detail-card {
  min-width: 0;
}

.management-stack {
  display: grid;
  gap: 14px;
}

.split-grid {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(360px, 1fr);
  gap: 14px;
  align-items: start;
}

.message-list .scale-card-list,
.course-list {
  max-height: none;
  overflow: visible;
  padding-right: 0;
}

.schedule-layout {
  display: grid;
  gap: 14px;
}

.schedule-filterbar {
  grid-template-columns: minmax(180px, 1.4fr) repeat(3, minmax(130px, .8fr));
}

.schedule-card .card-body {
  overflow-x: auto;
}

.schedule-calendar {
  min-width: 980px;
  display: grid;
  grid-template-columns: repeat(7, minmax(132px, 1fr));
  gap: 10px;
}

.schedule-day {
  min-height: 360px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.schedule-day-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f4fafc;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.schedule-day-body {
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
}

.schedule-event {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(34,184,207,.25);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.schedule-event:hover {
  border-color: rgba(34,184,207,.55);
  background: #f7fcfd;
}

.schedule-time {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.schedule-event b {
  font-size: 14px;
}

.schedule-event small,
.schedule-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.schedule-empty {
  min-height: 78px;
  display: grid;
  place-items: center;
  border: 1px dashed #d8e5eb;
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-head {
  align-items: center;
}

.calendar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.schedule-month-calendar {
  min-width: 1080px;
  display: grid;
  grid-template-columns: repeat(7, minmax(140px, 1fr));
  gap: 8px;
}

.schedule-month-week {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5fbfd;
  color: #435266;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.schedule-month-day {
  min-height: 176px;
  display: grid;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.schedule-month-day.today {
  border-color: rgba(34,184,207,.65);
  box-shadow: 0 0 0 3px rgba(34,184,207,.12);
}

.schedule-month-day.blank {
  background: #f8fbfc;
  border-style: dashed;
}

.schedule-month-day-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: #fbfdff;
  color: #344054;
  font-size: 12px;
  font-weight: 900;
}

.schedule-month-day-head b {
  font-size: 16px;
}

.schedule-month-calendar .schedule-event {
  min-height: 0;
  padding: 8px;
}

.schedule-month-calendar .schedule-event b {
  font-size: 13px;
}

.schedule-month-calendar .schedule-empty {
  min-height: 54px;
}

.card-foot {
  padding: 10px 18px 16px;
  border-top: 1px solid var(--line);
}

.exam-question {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.exam-question.is-right {
  border-color: rgba(47,158,68,.35);
}

.exam-question.is-wrong {
  border-color: rgba(224,49,49,.35);
}

.exam-question-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.exam-question-head h3 {
  margin: 4px 0 0;
  font-size: 20px;
}

.choice-grid {
  display: grid;
  gap: 10px;
}

.choice-option {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  font-weight: 800;
}

.choice-option:has(input:checked) {
  border-color: rgba(34,184,207,.55);
  background: rgba(34,184,207,.08);
}

.answer-analysis {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding: 12px;
  border-radius: 8px;
  background: #f8fbfd;
  border: 1px solid var(--line);
}

.answer-analysis pre {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.exam-submit {
  justify-self: end;
  min-width: 180px;
}

.progress {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f0f4;
}
.progress i {
  display: block;
  height: 100%;
  background: var(--brand);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 30;
  display: none;
  max-width: 360px;
  padding: 13px 15px;
  border-radius: 8px;
  background: #111923;
  color: #fff;
  box-shadow: var(--shadow);
  font-size: 14px;
}
.toast.show { display: block; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(15, 23, 32, .48);
}

.modal.show { display: flex; }

.modal-panel {
  width: min(980px, 100%);
  max-height: 88vh;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal-panel p {
  color: #344054;
  line-height: 1.7;
}

.modal-panel select,
.modal-panel input {
  width: 100%;
  margin: 8px 0 12px;
}

.question-bank-layout {
  grid-template-columns: minmax(360px, .9fr) minmax(420px, 1.1fr);
}

.filterbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.filterbar label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.question-list {
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.question-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.question-row.active,
.question-row:hover {
  border-color: rgba(34,184,207,.5);
  background: #f0fbfd;
}

.question-row b,
.question-row small {
  display: block;
}

.question-row small {
  margin-top: 5px;
  color: var(--muted);
}

.question-detail h3 {
  margin: 0 0 10px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.choice-options {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.choice-option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.editor-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #243243;
  border-bottom: 0;
  border-radius: 8px 8px 0 0;
  background: #172331;
  color: #dbe7ef;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
}

.editor-title + .codebox {
  border-radius: 0 0 8px 8px;
}

.oj-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 14px;
}

.oj-problem-list {
  min-width: 0;
}

.oj-main {
  display: grid;
  grid-template-columns: minmax(320px, .9fr) minmax(420px, 1.1fr);
  gap: 14px;
}

.oj-main.oj-stack {
  grid-template-columns: 1fr !important;
}

.oj-stack .oj-statement,
.oj-stack .oj-editor-card,
.oj-stack .oj-submissions {
  grid-column: 1 / -1;
}

.oj-stack .oj-statement .card-body {
  display: grid;
  gap: 14px;
}

.oj-submissions {
  grid-column: 1 / -1;
}

.oj-editor-card .codebox {
  min-height: 420px;
}

.oj-stack .oj-editor-card .codebox {
  min-height: 540px;
}

.programming-panel-stacked {
  display: grid;
  gap: 14px;
}

.program-statement-block,
.program-editor-block {
  min-width: 0;
}

.program-editor-block .codebox {
  min-height: 480px;
}

.course-category-admin .compact-actions {
  align-items: center;
  gap: 8px;
  justify-content: flex-end;
}

.teacher-pay-report {
  width: 100%;
}

.teacher-pay-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.teacher-pay-table table {
  min-width: 920px;
}

.teacher-pay-table th,
.teacher-pay-table td {
  vertical-align: top;
}

.question-taxonomy .card-body {
  display: grid;
  gap: 14px;
}

.taxonomy-section {
  display: grid;
  gap: 10px;
}

.taxonomy-section h3 {
  margin: 0;
  color: #344054;
  font-size: 16px;
}

.taxonomy-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 10px;
}

.taxonomy-grid.compact,
.taxonomy-grid.knowledge {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 132px), 1fr));
}

.taxonomy-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #17212f;
  font-weight: 900;
  text-align: left;
  box-shadow: 0 6px 16px rgba(23, 32, 42, .04);
}

.taxonomy-chip b {
  display: inline-grid;
  min-width: 30px;
  min-height: 28px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  background: #eef9fb;
  color: #078096;
  font-size: 13px;
}

.taxonomy-chip:hover,
.taxonomy-chip.active {
  border-color: rgba(34,184,207,.55);
  background: #eafcff;
  color: #06697a;
}

.training-shell {
  display: grid;
  grid-template-columns: minmax(300px, 380px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.training-index {
  position: sticky;
  top: 18px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(34,184,207,.08), rgba(255,255,255,0) 42%),
    #fff;
}

.training-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.training-head h2 {
  margin: 0 0 4px;
}

.training-head span {
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.training-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

.training-filters label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.training-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 290px);
  overflow: auto;
  padding: 14px;
}

.training-row {
  position: relative;
  border-color: #dcebf2;
  background:
    linear-gradient(90deg, rgba(34,184,207,.08), rgba(255,255,255,0) 60%),
    #fff;
}

.training-row em {
  display: block;
  margin-top: 6px;
  color: #0b7c8c;
  font-style: normal;
  font-size: 12px;
  font-weight: 900;
}

.training-main {
  min-width: 0;
}

.training-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid rgba(34,184,207,.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 96% 10%, rgba(34,184,207,.18), transparent 28%),
    linear-gradient(135deg, #fff, #f7fcff);
}

.training-detail-head h2 {
  margin: 0 0 8px;
}

.training-empty,
.training-empty-inline {
  display: grid;
  place-items: center;
  min-height: 360px;
  padding: 36px;
  text-align: center;
  border: 1px dashed rgba(34,184,207,.36);
  background:
    linear-gradient(135deg, rgba(34,184,207,.10), rgba(255,255,255,.95)),
    #fff;
}

.training-empty h2 {
  margin: 8px 0 6px;
}

.training-empty p {
  max-width: 520px;
  margin: 0 auto 18px;
  color: var(--muted);
  line-height: 1.8;
}

.training-empty-icon {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(34,184,207,.38);
  border-radius: 50%;
  color: #0b7c8c;
  background: #f0fbfd;
  font-weight: 1000;
  letter-spacing: 0;
}

.training-empty-inline {
  min-height: 180px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 900;
}

.scratch-layout {
  display: grid;
  grid-template-columns: minmax(360px, .9fr) minmax(360px, 1.1fr);
  gap: 14px;
}

.scratch-stage-card {
  grid-row: span 2;
}

.scratch-stage {
  position: relative;
  height: 300px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(#dff8ff, #f8fdff 56%, #d7f5dd 56%);
}

.scratch-sprite {
  position: absolute;
  left: 42%;
  top: 48%;
  display: grid;
  place-items: center;
  width: 82px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 900;
  transition: transform .25s ease;
}

.scratch-score {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 900;
}

.scratch-blocks {
  min-height: 180px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  border: 1px dashed #b6cad6;
  border-radius: 8px;
  background: #f8fbfc;
}

.scratch-block {
  padding: 9px 11px;
  border-radius: 8px;
  background: #ffd43b;
  color: #3b2f00;
  font-weight: 900;
}

.compact-panel .card-body,
.compact-form {
  gap: 12px;
}

.section-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.section-title {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
}

.section-title h3 {
  margin: 0;
  font-size: 20px;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.class-delivery-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.delivery-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(280px, 1fr));
  gap: 14px;
  align-items: start;
}

.delivery-card {
  display: grid;
  gap: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fdff 100%);
}

.compact-checks {
  max-height: 260px;
  overflow: auto;
  padding-right: 4px;
}

.schedule-slot-row {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) minmax(104px, 1fr) minmax(104px, 1fr) minmax(88px, .8fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fcff;
}

.schedule-slot-row + .schedule-slot-row {
  margin-top: 10px;
}

.icon-btn {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

.table-wrap .table {
  min-width: 720px;
}

.schedule-filter-card {
  align-self: start;
}

.schedule-calendar {
  align-items: stretch;
}

.schedule-event {
  min-height: 132px;
}

@media (max-width: 1040px) {
  .oj-layout,
  .training-shell,
  .oj-main,
  .exam-workspace,
  .review-workspace,
  .message-workspace,
  .schedule-filterbar,
  .scratch-layout,
  .workflow-layout,
  .split-grid,
  .delivery-steps,
  .report-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .app { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }
  .brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    padding: 0;
    border-bottom: 0;
  }
  .brand img {
    width: min(170px, 58vw);
    height: 48px;
  }
  .brand span {
    display: none;
  }
  .mobile-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .mobile-nav-toggle::after {
    content: "⌄";
    margin-left: 8px;
    color: var(--brand-dark);
    transition: transform .18s ease;
  }
  .app.nav-open .mobile-nav-toggle::after {
    transform: rotate(180deg);
  }
  .menu {
    grid-column: 1 / -1;
    display: none;
    grid-template-columns: 1fr;
    gap: 10px;
    max-height: min(68vh, 560px);
    margin-top: 4px;
    padding-top: 10px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
  }
  .app.nav-open .menu {
    display: grid;
  }
  .menu-group {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
  }
  .menu-group-title {
    min-height: 44px;
    padding: 0 12px;
    background: #f8fbfd;
    color: #516274;
    font-size: 14px;
  }
  .menu-group-arrow {
    display: inline-block;
  }
  .menu-group.is-collapsed .menu-group-arrow {
    transform: rotate(-90deg);
  }
  .menu-group.is-collapsed .menu-group-items {
    display: none;
  }
  .menu-group-items {
    padding: 8px;
  }
  .menu-item {
    min-height: 42px;
    padding: 0 12px;
  }
  .editor-layout,
  .quick-task-grid,
  .grid.cols-2,
  .grid.cols-3,
  .grid.cols-4 { grid-template-columns: 1fr; }
  .schedule-slot-row {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 640px) {
  .main { padding: 18px; }
  .simple-hero { align-items: flex-start; flex-direction: column; }
  .hero-actions { width: 100%; justify-content: stretch; }
  .hero-actions .btn { flex: 1; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .account { width: 100%; justify-content: space-between; }
  .menu { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid,
  .check-list { grid-template-columns: 1fr; }
  .attendance-row { grid-template-columns: 1fr; }
  .item-row { align-items: flex-start; flex-direction: column; }
}
/* Responsive hardening layer: keep complex teacher/admin workflows usable on desktop, tablet and phone. */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 0;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
}

input,
select,
textarea,
button {
  max-width: 100%;
  min-width: 0;
  font: inherit;
}

input,
select,
textarea {
  width: 100% !important;
  max-width: 100% !important;
}

input[type="file"] {
  min-width: 0 !important;
  width: 100% !important;
  white-space: normal;
}

input[type="checkbox"],
input[type="radio"] {
  width: auto !important;
  min-width: 16px !important;
  max-width: 16px !important;
  height: 16px;
  flex: 0 0 auto;
}

.check input[type="checkbox"],
.check input[type="radio"],
.question-row input[type="checkbox"],
.question-row input[type="radio"],
.attendance-row input[type="checkbox"],
.attendance-row input[type="radio"],
.selected-chip input[type="checkbox"],
.selected-chip input[type="radio"] {
  margin-top: 2px;
}

textarea {
  resize: vertical;
}

button,
.btn,
.button,
[role="button"] {
  white-space: normal;
  overflow-wrap: anywhere;
}

.app,
.page,
.page-shell,
.main,
.content,
.workspace,
.panel,
.card,
.section,
.form-card,
.table-card {
  min-width: 0;
}

.container,
.page,
.page-shell,
.main,
.content,
.workspace {
  max-width: 100%;
}

.grid,
.cards,
.card-grid,
.form-grid,
.stats-grid,
.dashboard-grid,
.management-grid,
.workflow-grid,
.lesson-grid,
.teaching-grid,
.course-grid,
.exam-grid,
.schedule-grid,
.two-column,
.three-column {
  min-width: 0;
}

.workflow-layout,
.split-grid,
.report-layout,
.message-workspace,
.exam-workspace,
.review-workspace,
.oj-layout,
.oj-main,
.training-shell,
.scratch-layout,
.delivery-steps,
.schedule-layout {
  min-width: 0;
}

.delivery-steps {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)) !important;
}

.delivery-card,
.delivery-card .form-grid,
.class-delivery-panel,
.workflow-detail,
.lesson-detail,
.question-detail,
.exam-paper,
.oj-editor-card,
.oj-statement {
  min-width: 0;
  max-width: 100%;
}

.grid.cols-3,
.grid.cols-4,
.language-overview,
.dashboard-actions {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)) !important;
}

.grid.cols-2,
.split-grid,
.report-layout {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
}

.workflow-layout,
.question-bank-layout,
.message-workspace,
.exam-workspace,
.review-workspace {
  grid-template-columns: minmax(280px, .9fr) minmax(0, 1.1fr) !important;
}

.oj-layout,
.training-shell {
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr) !important;
}

.oj-main {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)) !important;
}

.schedule-slot-row,
.attendance-row {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)) !important;
}

.card-head,
.section-line,
.item-row,
.topbar,
.account {
  min-width: 0;
}

.card-head > *,
.section-line > *,
.item-row > *,
.topbar > *,
.account > * {
  min-width: 0;
}

.muted,
.card p,
.item-row,
.schedule-event,
.question-row,
.training-row,
.task-card,
.metric {
  overflow-wrap: anywhere;
}

.form-grid,
.workflow-grid,
.lesson-grid,
.teaching-grid,
.course-grid,
.exam-grid,
.schedule-grid,
.management-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)) !important;
}

.stats-grid,
.cards,
.card-grid,
.dashboard-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)) !important;
}

.field,
.form-field,
.form-control,
.input-group,
.select-group,
.upload-row,
.toolbar,
.actions,
.button-row,
.filters,
.filter-grid {
  min-width: 0;
}

.input-group,
.upload-row,
.toolbar,
.actions,
.button-row {
  flex-wrap: wrap;
}

.toolbar > *,
.actions > *,
.button-row > *,
.upload-row > * {
  min-width: 0 !important;
  max-width: 100% !important;
}

.card,
.panel,
.section,
.form-card,
.table-card {
  overflow: hidden;
}

.table-wrap,
.table-container,
.scroll-x,
.data-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  max-width: 100%;
}

.ai-assistant,
.floating-assistant,
.assistant-bot,
.chat-float,
.robot-float {
  right: clamp(12px, 2vw, 28px) !important;
  bottom: clamp(12px, 2vw, 28px) !important;
  max-width: min(96px, 18vw) !important;
  max-height: min(96px, 18vw) !important;
  pointer-events: auto;
}

@media (max-width: 1280px) {
  .page,
  .page-shell,
  .main,
  .content,
  .workspace {
    padding-left: clamp(12px, 2vw, 24px);
    padding-right: clamp(12px, 2vw, 24px);
  }

  .form-grid,
  .filter-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
  }

  .workflow-layout,
  .question-bank-layout,
  .message-workspace,
  .exam-workspace,
  .review-workspace,
  .split-grid,
  .report-layout,
  .delivery-steps,
  .oj-layout,
  .training-shell {
    grid-template-columns: 1fr !important;
  }
}

.code-preview {
  margin: 0 0 14px;
  padding: 16px;
  border-radius: 8px;
  background: #101b28;
  color: #d8ecff;
  overflow: auto;
  line-height: 1.6;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
}

.program-objective-panel .objective-option {
  align-items: flex-start;
  gap: 12px;
}

.program-objective-panel .objective-option span {
  flex: 1 1 auto;
  min-width: 0;
}

.program-objective-panel .objective-option input {
  flex: 0 0 220px;
  max-width: 100%;
}

@media (max-width: 720px) {
  .program-objective-panel .objective-option {
    display: grid;
  }

  .program-objective-panel .objective-option input {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 900px) {
  body {
    overflow-x: hidden;
  }

  .page,
  .page-shell,
  .main,
  .content,
  .workspace {
    padding: 12px !important;
  }

  .grid,
  .cards,
  .card-grid,
  .form-grid,
  .stats-grid,
  .dashboard-grid,
  .management-grid,
  .workflow-grid,
  .lesson-grid,
  .teaching-grid,
  .course-grid,
  .exam-grid,
  .schedule-grid,
  .two-column,
  .three-column {
    display: grid;
    grid-template-columns: 1fr !important;
  }

  .filters,
  .filter-grid,
  .toolbar,
  .actions,
  .button-row,
  .upload-row {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .toolbar button,
  .actions button,
  .button-row button,
  .toolbar .btn,
  .actions .btn,
  .button-row .btn {
    width: 100%;
  }

  .card,
  .panel,
  .section,
  .form-card,
  .table-card {
    border-radius: 8px;
  }

  .oj-main,
  .oj-main.oj-stack,
  .programming-panel-stacked,
  .report-layout {
    grid-template-columns: 1fr !important;
  }

  .oj-stack .oj-editor-card .codebox,
  .program-editor-block .codebox {
    min-height: 420px;
  }

  .card-body:has(table) {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .teacher-pay-report {
    grid-column: 1 / -1;
  }

  .teacher-pay-table table,
  .table {
    min-width: 760px;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: clamp(26px, 8vw, 36px) !important;
    line-height: 1.15;
  }

  h2 {
    font-size: clamp(22px, 6vw, 30px) !important;
    line-height: 1.2;
  }

  h3 {
    font-size: clamp(18px, 5vw, 24px) !important;
  }

  input,
  select,
  textarea {
    min-height: 44px;
  }

  .card,
  .panel,
  .section,
  .form-card,
  .table-card {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .ai-assistant,
  .floating-assistant,
  .assistant-bot,
  .chat-float,
  .robot-float {
    display: none !important;
  }

  .main,
  .content,
  .workspace,
  .page,
  .page-shell {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }

  .card-head,
  .training-detail-head,
  .page-detail-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .oj-stack .oj-editor-card .codebox,
  .program-editor-block .codebox {
    min-height: 340px;
  }

  .teacher-pay-table table,
  .table {
    min-width: 680px;
  }
}

/* OJ workspace upgrade: Luogu-style statement first, full-width editor second, detailed judge panel third. */
.training-index-toggle {
  display: none;
}

.oj-meta-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.oj-meta-strip > div {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(34, 184, 207, .22);
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff, #f5fbfe);
}

.oj-meta-strip b {
  display: block;
  color: #0f2437;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.oj-meta-strip span {
  color: #66788a;
  font-size: 13px;
  font-weight: 800;
}

.oj-result-panel {
  min-height: 150px;
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.oj-result-empty {
  display: grid;
  min-height: 120px;
  place-items: center;
  border: 1px dashed rgba(34, 184, 207, .32);
  border-radius: 8px;
  color: #66788a;
  background: #f8fcff;
  font-weight: 900;
}

.oj-result-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
}

.oj-result-summary b {
  display: block;
  margin-bottom: 4px;
  font-size: 22px;
}

.oj-result-summary span {
  color: #66788a;
  font-weight: 800;
}

.oj-result-score {
  display: grid;
  place-items: center;
  width: 78px;
  height: 62px;
  border-radius: 8px;
  background: #f3f7fa;
  color: #0f2437;
  font-size: 24px;
  font-weight: 1000;
}

.oj-result-score small {
  font-size: 12px;
  color: #66788a;
}

.oj-result-summary.accepted,
.oj-case.accepted {
  border-color: rgba(18, 183, 106, .35);
  background: #f0fff7;
}

.oj-result-summary.wrong,
.oj-case.wrong {
  border-color: rgba(240, 68, 56, .32);
  background: #fff5f5;
}

.oj-result-summary.timeout,
.oj-case.timeout,
.oj-result-summary.memory,
.oj-case.memory {
  border-color: rgba(247, 144, 9, .34);
  background: #fff8ed;
}

.oj-result-summary.error,
.oj-case.error {
  border-color: rgba(177, 64, 255, .25);
  background: #fbf6ff;
}

.oj-case-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: 10px;
}

.oj-case-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
}

.oj-case {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

.oj-case summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 12px;
  cursor: pointer;
}

.oj-case-static {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.oj-case summary span,
.oj-case summary em,
.oj-case-static span,
.oj-case-static em {
  min-width: 0;
  overflow-wrap: anywhere;
}

.oj-case summary b {
  font-size: 13px;
}

.oj-case summary em {
  grid-column: 1 / -1;
  color: #66788a;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.oj-case-static em {
  color: #66788a;
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
}

.oj-case-detail {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.oj-case-detail label {
  display: grid;
  gap: 6px;
  color: #344054;
  font-size: 13px;
  font-weight: 900;
}

.oj-case-detail pre,
.oj-test-overview pre,
.oj-case pre {
  max-height: 180px;
  margin: 0;
  overflow: auto;
  padding: 10px;
  border-radius: 8px;
  background: #101b28;
  color: #d8ecff;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  white-space: pre-wrap;
}

.oj-test-overview {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f8fcff;
}

.oj-test-overview > summary {
  cursor: pointer;
  font-weight: 900;
  color: #0b7c8c;
}

.oj-editor-card .toolbar label {
  min-width: min(100%, 220px);
}

/* UX cleanup: make actions obvious and reduce duplicate visual noise. */
.btn {
  min-height: 42px;
  padding: 8px 16px;
  border-color: #c9dbe6;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15, 36, 55, .06);
  letter-spacing: 0;
}

.btn:hover {
  border-color: rgba(34, 184, 207, .68);
  background: #f3fbfd;
  box-shadow: 0 8px 18px rgba(15, 36, 55, .08);
  transform: translateY(-1px);
}

.btn.primary {
  border-color: #18aeca;
  background: #18b7cf;
  color: #fff;
  box-shadow: 0 10px 22px rgba(24, 183, 207, .22);
}

.btn.primary:hover {
  border-color: #0d8fa6;
  background: #0d9db4;
  box-shadow: 0 12px 26px rgba(24, 183, 207, .28);
}

.btn.danger {
  border-color: #ffb4b4;
  background: #fff7f7;
  color: #d92d20;
}

.btn.danger:hover {
  border-color: #f97066;
  background: #fff0f0;
  color: #b42318;
}

.toolbar,
.actions,
.button-row,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.item-row {
  gap: 12px;
  align-items: flex-start;
}

.item-row > .toolbar {
  margin-top: 0;
  margin-left: auto;
  justify-content: flex-end;
}

.workflow-list .item > .item-row > .toolbar,
.compact-list .item > .item-row > .toolbar,
.scale-card-list .item > .item-row > .toolbar {
  padding: 4px;
  border: 1px solid rgba(213, 226, 235, .72);
  border-radius: 8px;
  background: #f8fbfd;
}

.card-head {
  gap: 14px;
}

.card-head > .btn,
.card-head > .toolbar,
.page-detail-head > .btn,
.page-detail-head > .toolbar {
  margin-left: auto;
}

.card-head p,
.page-detail-head p,
.simple-hero p:not(.eyebrow) {
  display: none;
}

.language-overview {
  display: none;
}

.task-card b,
.metric-link,
.language-card,
.item.active-item {
  border-color: rgba(34, 184, 207, .45);
}

.workflow-builder,
.workflow-list,
.workflow-detail > .card {
  box-shadow: 0 14px 34px rgba(15, 36, 55, .06);
}

@media (max-width: 760px) {
  .btn {
    min-height: 44px;
    padding: 9px 13px;
  }

  .item-row {
    flex-direction: column;
  }

  .item-row > .toolbar,
  .card-head > .toolbar,
  .page-detail-head > .toolbar,
  .hero-actions {
    width: 100%;
    margin-left: 0;
    justify-content: stretch;
  }

  .item-row > .toolbar .btn,
  .card-head > .toolbar .btn,
  .page-detail-head > .toolbar .btn,
  .hero-actions .btn,
  .form-grid .full > .btn,
  .form-grid .full.toolbar > .btn {
    flex: 1 1 130px;
  }

  .workflow-list .item > .item-row > .toolbar,
  .compact-list .item > .item-row > .toolbar,
  .scale-card-list .item > .item-row > .toolbar {
    padding: 6px;
  }
}

@media (max-width: 1040px) {
  .mobile-nav-toggle {
    min-width: 96px;
    border-color: rgba(34, 184, 207, .42);
    background: #eefcff;
    color: #075f70;
    font-weight: 1000;
  }

  .mobile-nav-toggle::after {
    content: "v";
    margin-left: 8px;
    color: #075f70;
    font-size: 13px;
    font-weight: 1000;
  }

  .menu-group {
    box-shadow: 0 8px 20px rgba(15, 36, 55, .04);
  }

  .menu-group-title {
    font-weight: 1000;
  }

  .menu-item {
    width: 100%;
    font-weight: 900;
  }
}

@media (max-width: 900px) {
  .training-shell {
    position: relative;
    display: block;
  }

  .training-index-toggle {
    position: sticky;
    top: 8px;
    z-index: 6;
    display: inline-flex;
    margin-bottom: 10px;
  }

  .training-index {
    display: none;
    position: static;
    margin-bottom: 14px;
  }

  .training-shell.show-index .training-index {
    display: block;
  }

  .training-list {
    max-height: 52vh;
  }

  .oj-meta-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .oj-result-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .oj-result-score {
    width: 100%;
    height: auto;
    min-height: 54px;
  }
}

@media (max-width: 520px) {
  .oj-meta-strip {
    grid-template-columns: 1fr;
  }

  .oj-case summary {
    grid-template-columns: 1fr;
  }

  .training-row {
    display: grid !important;
    grid-template-columns: 1fr;
  }
}
