:root {
  --ink: #16211d;
  --muted: #62706a;
  --line: #dbe4df;
  --paper: #fbfaf5;
  --panel: #ffffff;
  --wash: #eff6f2;
  --teal: #0b7a75;
  --teal-dark: #075e59;
  --gold: #c98218;
  --red: #b42318;
  --green: #16803c;
  --shadow: 0 18px 45px rgba(28, 47, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(11, 122, 117, 0.06) 1px, transparent 1px),
    linear-gradient(rgba(11, 122, 117, 0.05) 1px, transparent 1px),
    var(--paper);
  background-size: 32px 32px;
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  background: var(--teal);
  cursor: pointer;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 14px;
  color: #fff;
  background: var(--teal);
  font-weight: 700;
  text-align: center;
  text-decoration: none;
}

button:hover {
  background: var(--teal-dark);
}

.button-link:hover {
  background: var(--teal-dark);
}

button.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #f6faf8;
}

.button-link.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #f6faf8;
}

button.secondary:hover {
  background: #e7f0ec;
}

.button-link.secondary:hover {
  background: #e7f0ec;
}

button.warning {
  color: #fff;
  background: var(--red);
}

button.danger-button {
  color: var(--red);
  border-color: rgba(180, 35, 24, 0.28);
  background: #fff6f5;
}

button.danger-button:hover {
  color: #fff;
  border-color: var(--red);
  background: var(--red);
}

button.compact {
  min-height: 32px;
  padding: 5px 10px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

textarea.compact-textarea {
  min-height: 44px;
  height: 44px;
  resize: vertical;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.app-shell {
  width: min(1360px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 22px 0 42px;
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 18px;
  font-weight: 800;
}

.brand > div:last-child {
  display: grid;
  align-content: center;
  gap: 4px;
}

.brand-title {
  font-size: 28px;
  line-height: 1.05;
}

.brand-subtitle {
  font-size: 16px;
  line-height: 1.2;
}

.brand-mark {
  display: block;
  width: 80px;
  height: 80px;
  flex: 0 0 80px;
  filter: drop-shadow(0 9px 16px rgba(28, 47, 40, 0.14));
}

.brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.brand-mark__paper {
  fill: #fff8df;
  stroke: #102c29;
  stroke-width: 2.4;
}

.brand-mark__fold {
  fill: #e7f3ee;
  stroke: #102c29;
  stroke-linejoin: round;
  stroke-width: 2.1;
}

.brand-mark__seal {
  fill: #0b7a75;
}

.brand-mark__han {
  fill: #fff8df;
  font-size: 11px;
  font-weight: 900;
  text-anchor: middle;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
}

.brand-mark__step {
  fill: none;
  stroke: #0b7a75;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.1;
}

.brand-mark__check {
  fill: none;
  stroke: #c98218;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.2;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.view {
  display: grid;
  gap: 18px;
}

.hero {
  min-height: 230px;
  display: grid;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background:
    linear-gradient(130deg, rgba(255, 226, 168, 0.9), rgba(239, 246, 242, 0.8)),
    url("data:image/svg+xml,%3Csvg width='900' height='300' viewBox='0 0 900 300' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='%230b7a75' stroke-width='2' opacity='.25'%3E%3Cpath d='M60 210h130M86 92h90M112 60v190M300 66h160M340 66c-20 68-7 124 39 169M430 92c-31 39-70 67-119 83M570 80h190M610 80v150M610 150h130M790 78c-21 42-22 88-2 139'/%3E%3C/g%3E%3C/svg%3E") right center / auto 100% no-repeat;
  box-shadow: var(--shadow);
}

.hero h1 {
  max-width: 680px;
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero p {
  max-width: 620px;
  margin: 0;
  color: #34443e;
  font-size: 17px;
}

.student-login-page {
  position: relative;
  min-height: min(680px, calc(100vh - 130px));
  overflow: hidden;
  border: 1px solid rgba(22, 33, 29, 0.12);
  border-radius: 18px;
  padding: clamp(22px, 5vw, 56px);
  background:
    radial-gradient(circle at 23% 30%, rgba(250, 213, 126, 0.18), transparent 18%),
    radial-gradient(circle at 84% 26%, rgba(112, 211, 200, 0.22), transparent 20%),
    linear-gradient(135deg, #182342 0%, #102e39 54%, #0b514b 100%);
  box-shadow: 0 28px 70px rgba(18, 34, 47, 0.24);
  isolation: isolate;
}

.student-login-page::before {
  content: "";
  position: absolute;
  inset: auto -8% -28% -8%;
  height: 58%;
  background:
    repeating-radial-gradient(ellipse at 50% 100%, transparent 0 22px, rgba(80, 211, 221, 0.26) 23px 25px, transparent 26px 42px);
  transform: perspective(520px) rotateX(62deg);
  transform-origin: bottom;
  opacity: 0.72;
  z-index: -1;
}

.student-login-page::after {
  content: "汉 词 句 读 说 写";
  position: absolute;
  right: 7%;
  top: 13%;
  max-width: 500px;
  color: rgba(255, 255, 255, 0.055);
  font-size: clamp(52px, 8vw, 116px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0;
  z-index: -1;
}

.student-login-scene {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

.login-orbit {
  position: absolute;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid rgba(108, 220, 228, 0.5);
  border-radius: 50%;
  color: #bff7f2;
  background: rgba(12, 43, 66, 0.28);
  box-shadow: 0 0 28px rgba(74, 199, 209, 0.24);
  font-size: 14px;
  font-weight: 900;
}

.login-orbit::after {
  content: "";
  position: absolute;
  top: 70px;
  width: 1px;
  height: 150px;
  background: linear-gradient(rgba(108, 220, 228, 0.58), transparent);
}

.login-orbit--one {
  left: 12%;
  top: 25%;
}

.login-orbit--two {
  left: 31%;
  top: 17%;
}

.login-orbit--three {
  left: 47%;
  top: 34%;
}

.student-login-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
  gap: clamp(26px, 7vw, 86px);
  align-items: center;
  min-height: 520px;
}

.student-login-brand {
  max-width: 650px;
  color: #f8fcf8;
}

.login-kicker {
  display: inline-flex;
  margin-bottom: 18px;
  border: 1px solid rgba(168, 244, 236, 0.38);
  border-radius: 999px;
  padding: 7px 12px;
  color: #a8f4ec;
  background: rgba(9, 42, 58, 0.44);
  font-size: 13px;
  font-weight: 900;
}

.student-login-brand h1 {
  margin: 0 0 18px;
  max-width: 700px;
  font-size: clamp(42px, 6.2vw, 68px);
  line-height: 0.98;
  letter-spacing: 0;
}

.student-login-brand p {
  max-width: 560px;
  margin: 0;
  color: rgba(248, 252, 248, 0.78);
  font-size: 18px;
  line-height: 1.7;
}

.student-login-form {
  display: grid;
  gap: 16px;
  border: 1px solid rgba(116, 217, 225, 0.34);
  border-radius: 12px;
  padding: 28px;
  color: #f8fcf8;
  background:
    linear-gradient(180deg, rgba(16, 67, 84, 0.82), rgba(9, 38, 57, 0.74)),
    rgba(13, 55, 73, 0.78);
  box-shadow: 0 24px 60px rgba(4, 16, 24, 0.32);
  backdrop-filter: blur(10px);
}

.student-login-form__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 4px;
}

.student-login-form__title h2 {
  margin: 0;
  font-size: 24px;
}

.student-login-form__title span {
  color: #8fe9e4;
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.student-login-form label {
  color: rgba(248, 252, 248, 0.8);
}

.student-login-form input {
  min-height: 52px;
  border-color: rgba(147, 227, 231, 0.26);
  color: #f8fcf8;
  background: rgba(4, 27, 42, 0.34);
}

.student-login-form input::placeholder {
  color: rgba(248, 252, 248, 0.48);
}

.student-login-form button {
  min-height: 52px;
  margin-top: 4px;
  color: #082a2c;
  background: #7de4dc;
  font-weight: 900;
}

.student-login-form button:hover {
  background: #a8f4ec;
}

.local-login-hint {
  margin: -2px 0 0;
  border: 1px solid rgba(250, 213, 126, 0.28);
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffe5a6;
  background: rgba(94, 71, 15, 0.25);
  font-size: 13px;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}

.panel,
.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 10px 24px rgba(29, 43, 38, 0.07);
}

.panel {
  padding: 18px;
}

.card {
  display: grid;
  gap: 10px;
  padding: 18px;
}

.card h2,
.panel h2,
.panel h3 {
  margin: 0;
}

.level-title {
  white-space: nowrap;
  font-size: clamp(21px, 2vw, 28px);
  line-height: 1.15;
}

.student-level-single {
  display: grid;
  min-height: 360px;
}

.student-level-card {
  min-height: 340px;
  align-content: center;
  gap: 18px;
  padding: clamp(26px, 5vw, 56px);
  background:
    linear-gradient(135deg, rgba(239, 246, 242, 0.98), rgba(255, 248, 223, 0.7)),
    #fff;
}

.student-level-card .level-title {
  white-space: normal;
  font-size: clamp(30px, 4vw, 52px);
}

.student-level-card p {
  max-width: 720px;
  font-size: 18px;
}

.student-level-card button {
  width: min(420px, 100%);
  min-height: 48px;
  font-weight: 800;
}

.student-task-header {
  min-height: 0;
  padding: 10px 16px;
}

.student-task-header__text {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.student-task-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
}

.task-list-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.student-task-card {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 74px;
  padding: 10px 16px;
  padding-top: 30px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 242, 0.92)),
    #fff;
}

.student-task-card h2 {
  margin: 0;
  font-size: 20px;
  line-height: 1.18;
}

.student-task-card p {
  margin: 0;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.student-task-card__badges {
  position: absolute;
  top: 12px;
  right: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.student-task-card__meta {
  padding-right: 220px;
}

.student-task-card__footer {
  display: grid;
  grid-template-columns: max-content max-content minmax(180px, 1fr);
  align-items: center;
  gap: 8px;
}

.student-task-card__footer button {
  justify-self: end;
  min-width: 210px;
  min-height: 34px;
  padding-block: 7px;
}

.task-badge {
  min-width: 92px;
  color: #12312e;
  background: #eaf3ef;
  font-size: 12px;
  letter-spacing: 0;
}

.task-badge.latest {
  color: #fff;
  background: #0b7a75;
}

.task-badge.complete {
  color: #144a34;
  background: #dff2e8;
}

.task-badge.incomplete {
  color: #6f4a06;
  background: #fff1c7;
}

.preview-level-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.preview-level-actions button,
.preview-level-actions .button-link {
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 72px;
  border-color: rgba(17, 132, 125, 0.22);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(239, 246, 242, 0.92)),
    #fff;
}

.preview-level-actions strong {
  font-size: 20px;
}

.preview-level-actions span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.local-only-note {
  margin: 0;
  text-align: center;
}

.muted {
  color: var(--muted);
}

.row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.row.wrap {
  flex-wrap: wrap;
}

.stack {
  display: grid;
  gap: 12px;
}

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

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

.tab {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.tab.active {
  color: #fff;
  background: var(--teal);
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
  background: #fff;
}

.task-package-table {
  table-layout: fixed;
  min-width: 1080px;
}

.task-package-table .task-col-title {
  width: 20%;
}

.task-package-table .task-col-topic {
  width: 22%;
}

.task-package-table .task-col-description {
  width: 30%;
}

.task-package-table .task-col-count {
  width: 8%;
}

.task-package-table .task-col-actions {
  width: 20%;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  vertical-align: middle;
}

th {
  background: var(--wash);
  font-size: 13px;
}

.task-package-table th,
.task-package-table td {
  height: 58px;
  padding: 10px 14px;
}

.task-package-table td:nth-child(2),
.task-package-table td:nth-child(3) {
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.task-package-table th:last-child,
.task-package-table td:last-child {
  text-align: right;
}

.task-actions {
  display: grid;
  grid-template-columns: 58px 86px 58px;
  align-items: center;
  justify-content: end;
  gap: 8px;
  white-space: nowrap;
}

.task-actions button.compact {
  min-width: 0;
  min-height: 30px;
  padding: 4px 9px;
}

.pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink);
  background: #eef5f1;
  font-size: 13px;
  font-weight: 700;
}

.level-label {
  font-size: 20px;
  line-height: 1.15;
}

.level-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(160px, 1fr));
  gap: 10px;
}

.level-tab {
  display: grid;
  gap: 4px;
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
  text-align: left;
}

.level-tab:hover,
.level-tab.active {
  color: #fff;
  background: var(--teal);
}

.level-tab span {
  font-size: 13px;
  font-weight: 800;
  opacity: 0.82;
}

.pill.live {
  color: #fff;
  background: var(--green);
}

.pill.draft {
  color: #3d2d09;
  background: #ffe2a8;
}

.pill.danger {
  color: #fff;
  background: var(--red);
}

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

.choice-list,
.word-bank {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  color: var(--ink);
  border: 1px solid var(--line);
  background: #fff;
}

.choice.selected,
.word.selected {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.word {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  color: var(--ink);
  border: 1px solid #cbd8d2;
  background: #fff;
}

.word:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.sentence-answer-box {
  display: grid;
  gap: 10px;
  min-height: 104px;
  border: 1px solid rgba(11, 122, 117, 0.3);
  border-radius: 8px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, 0.98), rgba(234, 245, 240, 0.98));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 14px 28px rgba(28, 47, 40, 0.1);
}

.sentence-answer-box__label {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--teal-dark);
  background: rgba(11, 122, 117, 0.1);
  font-size: 14px;
  font-weight: 900;
}

.sentence-answer-box__content {
  display: flex;
  align-items: center;
  min-height: 44px;
}

.sentence-answer-words {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.sentence-answer-words span,
.sentence-answer-words button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid rgba(11, 122, 117, 0.18);
  border-radius: 8px;
  padding: 7px 11px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 7px 16px rgba(28, 47, 40, 0.08);
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.word .hanzi-reading,
.sentence-answer-words .hanzi-reading {
  justify-items: center;
}

.sentence-answer-words button {
  cursor: pointer;
}

.sentence-answer-words button:hover {
  border-color: rgba(11, 122, 117, 0.36);
  color: var(--teal-dark);
  background: #eef8f4;
}

.sentence-answer-placeholder {
  color: #6f7b75;
  font-size: 20px;
  font-weight: 800;
}

.feedback {
  border-left: 4px solid var(--gold);
  padding: 10px 12px;
  background: #fff7e6;
  white-space: pre-line;
  line-height: 1.6;
}

.feedback.correct {
  border-left-color: var(--line);
  background: #fff;
}

.feedback.partial {
  border-left-color: #d98a00;
  background: #fff8e8;
}

.feedback.incorrect {
  border-left-color: var(--red);
  background: #fff0ee;
}

.ai-pending {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-dark);
  font-weight: 700;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(11, 122, 117, 0.22);
  border-top-color: var(--teal);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.match-board {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 12px;
}

.drop-row,
.drag-chip {
  min-height: 44px;
  border: 1px dashed #b7c8c1;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
}

.drop-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  align-items: center;
}

.hanzi-reading {
  display: inline-grid;
  grid-template-rows: 18px 26px;
  gap: 1px;
  justify-items: start;
  line-height: 1.1;
}

.hanzi-reading__pinyin {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  min-height: 18px;
}

.hanzi-reading__hanzi {
  font-size: 20px;
  font-weight: 850;
  line-height: 26px;
}

.drag-chip {
  cursor: grab;
}

.drag-chip.image {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.drag-chip.image .match-image {
  width: 72px;
  height: 54px;
}

.drag-chip.disabled {
  color: #7c8984;
  border-color: #d6dfdb;
  background: #edf2ef;
  opacity: 0.72;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

.result-number {
  font-size: 42px;
  line-height: 1;
  font-weight: 900;
}

.notice {
  border: 1px solid #f1d08f;
  border-radius: 8px;
  padding: 12px;
  background: #fff9eb;
}

.error {
  color: var(--red);
  font-weight: 700;
}

.success {
  color: var(--green);
  font-weight: 700;
}

.config-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.84);
}

.ai-config-panel {
  display: grid;
  gap: 12px;
}

.ai-status-row {
  align-items: center;
}

.switch-line {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  grid-auto-flow: column;
  gap: 8px;
  min-width: 150px;
  color: var(--ink);
}

.switch-line input {
  width: 18px;
  height: 18px;
}

.class-strip-list {
  display: grid;
  gap: 10px;
}

.class-group-strip {
  overflow: hidden;
  border: 1px solid rgba(11, 122, 117, 0.2);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(29, 43, 38, 0.06);
}

.class-group-strip.is-open {
  border-color: rgba(11, 122, 117, 0.55);
}

.class-group-strip__button {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  width: 100%;
  min-height: 68px;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 16px 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--teal), #0f625e);
  text-align: left;
}

.class-group-strip__button:hover,
.class-group-strip.is-open .class-group-strip__button {
  background: linear-gradient(135deg, #075e59, #0b7a75);
}

.class-group-strip__button span {
  display: inline-grid;
  gap: 4px;
}

.class-group-strip__button small {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 800;
}

.class-group-detail {
  display: grid;
  gap: 10px;
  padding: 12px;
  background: #f8fbf9;
}

.task-strip-list {
  display: grid;
  gap: 8px;
}

.task-strip-item {
  display: grid;
  gap: 10px;
}

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

.class-strip.is-open {
  border-color: rgba(11, 122, 117, 0.45);
  box-shadow: 0 10px 24px rgba(29, 43, 38, 0.07);
}

.class-strip__button {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  width: 100%;
  min-height: 58px;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 0;
  padding: 12px 14px;
  color: var(--ink);
  background: #ecf6f3;
  text-align: left;
}

.class-strip__button:hover,
.class-strip.is-open .class-strip__button {
  color: #fff;
  background: var(--teal);
}

.class-strip__button span {
  display: inline-grid;
  gap: 3px;
}

.class-strip__button small {
  font-weight: 800;
  opacity: 0.78;
}

.class-strip__meta {
  display: grid;
  grid-template-columns: repeat(4, max-content);
  align-items: center;
  justify-self: end;
  justify-content: end;
  gap: 12px;
  color: inherit;
  font-size: 13px;
  font-weight: 800;
  text-align: right;
}

.class-strip__meta .latest-accuracy {
  justify-self: end;
}

.class-detail {
  padding: 14px;
  background: #fff;
}

.analytics-summary {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(11, 122, 117, 0.18);
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(239, 246, 242, 0.96), rgba(255, 248, 223, 0.42)),
    #fff;
}

.analytics-summary__head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.analytics-summary__head strong {
  min-width: 0;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.summary-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 112px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.82);
}

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

.summary-card strong {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.55;
}

.summary-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.summary-list li {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.summary-list li > span {
  display: inline-grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  color: #0b4d48;
  background: #dff1ec;
  font-size: 12px;
  font-weight: 900;
}

.summary-list li > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-empty {
  color: var(--ink);
  font-size: 13px;
}

.status-card strong {
  font-size: 18px;
}

.status-card small {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.5;
}

.student-register-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr)) 82px;
  gap: 10px;
  align-items: end;
}

.student-add-button {
  width: 82px;
  height: 42px;
  padding: 0;
  justify-content: center;
}

.metric-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.metric {
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--wash);
  text-align: center;
}

.metric strong {
  overflow-wrap: anywhere;
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.1;
}

.task-metrics .metric strong {
  font-size: 18px;
}

.task-metrics .error-tag-metric strong {
  display: block;
  max-width: 100%;
  font-size: 15px;
  line-height: 1.35;
  white-space: normal;
}

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

.segmented-control {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f6faf8;
}

.segmented-control button {
  min-width: 108px;
}

.segmented-control button.active {
  color: #fff;
  border-color: var(--teal);
  background: var(--teal);
}

.task-strip {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(11, 122, 117, 0.22);
  color: #17332f;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(236, 246, 243, 0.95)),
    linear-gradient(90deg, rgba(11, 122, 117, 0.16), rgba(201, 130, 24, 0.08));
  box-shadow: 0 8px 18px rgba(29, 43, 38, 0.06);
  text-align: left;
}

.task-strip:hover,
.task-strip.active {
  color: #102c29;
  border-color: rgba(11, 122, 117, 0.48);
  background:
    linear-gradient(135deg, #ffffff, #e6f4ef),
    linear-gradient(90deg, rgba(11, 122, 117, 0.24), rgba(201, 130, 24, 0.12));
  box-shadow: inset 4px 0 0 var(--teal), 0 10px 22px rgba(29, 43, 38, 0.08);
}

.task-strip span {
  display: inline-grid;
  gap: 3px;
}

.task-strip small {
  font-weight: 800;
  opacity: 0.78;
}

.analytics-task-detail {
  border: 1px solid rgba(11, 122, 117, 0.18);
  border-radius: 8px;
  padding: 12px;
  background: #fbfdfc;
}

.template-category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 10px;
}

.template-category {
  display: grid;
  min-height: 58px;
  align-content: center;
  gap: 6px;
  border-color: var(--line);
  color: var(--ink);
  background: #fff;
  text-align: center;
}

.template-category:hover,
.template-category.active {
  color: #fff;
  background: var(--teal);
}

.template-category span {
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
}

.template-help {
  display: grid;
  gap: 4px;
  border: 1px solid #c7d8d1;
  border-radius: 8px;
  padding: 12px;
  background: #f7fbf9;
}

.question-draft-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfefd;
}

.fixed-prompt {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f3f8f6;
}

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

.fixed-prompt strong {
  line-height: 1.45;
}

.question-template-fields {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: stretch;
}

.keyword-match-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 12px;
}

.keyword-sentence-field {
  display: grid;
  grid-template-rows: auto minmax(42px, 1fr);
  gap: 8px;
  min-height: 100%;
  align-content: stretch;
}

.keyword-sentence-field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.keyword-sentence-field input {
  align-self: center;
  min-height: 44px;
}

.cue-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.sentence-check-list {
  display: grid;
  gap: 8px;
}

.sentence-check-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 0;
}

.pair-builder {
  display: grid;
  gap: 8px;
}

.pair-builder__head,
.pair-builder__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 128px;
  align-items: center;
  gap: 8px;
}

.pair-builder__row.image-row {
  align-items: end;
}

.answer-builder {
  display: grid;
  gap: 8px;
}

.answer-builder__head,
.answer-builder__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 8px;
}

.answer-builder__head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.answer-builder__head span:last-child {
  text-align: center;
}

.answer-builder .pair-builder__actions {
  align-items: center;
}

.answer-builder .pair-builder__actions button {
  font-size: 18px;
  font-weight: 900;
}

.keyword-builder {
  display: grid;
  gap: 8px;
}

.keyword-builder__head,
.keyword-builder__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px;
  align-items: center;
  gap: 8px;
}

.keyword-builder__head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.keyword-builder__head span:last-child {
  text-align: center;
}

.keyword-answer-cell {
  position: relative;
  min-width: 0;
}

.keyword-answer-cell input {
  padding-right: 94px;
}

.sentence-word-editor {
  display: grid;
  gap: 10px;
}

.sentence-word-builder.no-distractors .keyword-answer-cell input {
  padding-right: 12px;
}

.expression-builder {
  grid-template-columns: repeat(2, minmax(220px, 1fr));
  align-items: stretch;
}

.expression-side {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 120px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfefd;
}

.record-placeholder {
  min-height: 44px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: #fff;
}

.audio-preview {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.audio-preview audio {
  width: 100%;
}

.teacher-audio-answer {
  display: grid;
  gap: 6px;
  min-width: 180px;
  text-align: left;
}

.teacher-audio-answer strong {
  font-size: 12px;
  color: var(--ink);
}

.missing-audio-answer {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  color: var(--muted);
  font-weight: 800;
}

.auto-review-hint {
  display: block;
  margin-top: 6px;
  color: #566761;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.keyword-distractor-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  position: absolute;
  top: 7px;
  right: 8px;
  width: auto;
  min-width: 76px;
  min-height: 28px;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 8px;
  background: rgba(246, 250, 248, 0.94);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.keyword-distractor-toggle input {
  width: 14px;
  height: 14px;
  padding: 0;
}

.pair-builder__head {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.pair-builder__head span:last-child {
  text-align: center;
}

.pair-builder__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  justify-self: stretch;
}

.pair-builder__actions button {
  width: 100%;
  height: 38px;
  min-height: 38px;
  padding: 0;
  justify-content: center;
}

.image-upload-cell {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.image-upload-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  min-height: 34px;
}

.image-upload-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 112px;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
  white-space: nowrap;
}

.image-upload-button input {
  display: none;
}

.image-upload-preview {
  display: flex;
  align-items: center;
  height: 34px;
  min-width: 0;
}

.match-image {
  width: 54px;
  height: 34px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.sentence-judge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: #fbfefd;
}

.compact-choice-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.student-detail {
  border: 1px solid rgba(11, 122, 117, 0.3);
  border-radius: 8px;
  padding: 14px;
  background: #f7fbf9;
}

.student-detail tr.answer-wrong td {
  color: var(--red);
  font-weight: 800;
}

.teacher-review-controls {
  display: grid;
  grid-template-columns: 1fr;
  align-items: stretch;
  gap: 8px;
  min-width: 260px;
}

.teacher-review-head {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) 72px;
  align-items: center;
  gap: 8px;
}

.teacher-review-head span {
  font-weight: 900;
  white-space: nowrap;
}

.teacher-review-head button {
  justify-self: end;
  min-width: 68px;
}

.teacher-review-controls span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.teacher-review-buttons {
  display: grid;
  grid-template-columns: repeat(3, minmax(48px, 1fr));
  gap: 6px;
}

.teacher-review-buttons button.compact {
  width: 100%;
  min-width: 0;
}

.teacher-feedback-quick,
.teacher-feedback-input {
  width: 100%;
}

.teacher-feedback-input {
  min-height: 68px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.45;
}

.teacher-review-controls .active {
  color: #fff;
  background: var(--teal);
}

.teacher-review-controls .warning-text.active {
  color: #fff;
  background: var(--red);
}

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

.category-score-grid.compact {
  margin: 4px 0;
}

.category-score-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f7fbf9;
}

.category-score-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.category-score-card strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

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

.danger-zone {
  display: flex;
  justify-content: flex-end;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.progress-cell {
  display: grid;
  grid-template-columns: 1fr 54px;
  gap: 10px;
  align-items: center;
}

.progress-bar {
  overflow: hidden;
  height: 12px;
  border: 1px solid #c7d8d1;
  border-radius: 999px;
  background: #eef4f1;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--teal);
}

.accuracy-value {
  font-weight: 900;
}

.accuracy-low {
  color: var(--red);
}

.accuracy-mid {
  color: var(--gold);
}

.accuracy-ok {
  color: var(--ink);
}

@media (max-width: 760px) {
  .topbar,
  .row {
    align-items: stretch;
    flex-direction: column;
  }

  .nav {
    justify-content: stretch;
  }

  .nav button,
  .row button {
    width: 100%;
  }

  .split,
  .match-board,
  .level-tabs,
  .template-category-grid,
  .analytics-summary__grid,
  .category-score-grid,
  .metric-row,
  .preview-level-actions,
  .student-register-grid {
    grid-template-columns: 1fr;
  }

  .student-add-button {
    width: 100%;
  }

  .student-task-card {
    padding-top: 26px;
  }

  .student-task-card__badges {
    position: static;
    justify-content: flex-start;
  }

  .student-task-card__meta {
    padding-right: 0;
  }

  .student-task-card__footer {
    grid-template-columns: 1fr;
  }

  .student-task-card__footer button {
    width: 100%;
    min-width: 0;
  }

  .analytics-table-head,
  .segmented-control {
    display: grid;
    grid-template-columns: 1fr;
  }

  .class-strip__button,
  .class-strip__meta,
  .task-strip {
    grid-auto-flow: row;
    align-items: stretch;
  }

  .hero {
    padding: 22px;
    background-position: center top;
  }

  .student-login-page {
    min-height: auto;
    border-radius: 14px;
    padding: 20px;
  }

  .student-login-card {
    grid-template-columns: 1fr;
    gap: 22px;
    min-height: auto;
  }

  .student-login-brand h1 {
    font-size: 40px;
  }

  .student-login-brand p {
    font-size: 15px;
  }

  .student-login-form {
    padding: 20px;
  }

  .login-orbit {
    display: none;
  }
}
