:root {
  --ink: #1d2927;
  --ink-soft: #40504d;
  --muted: #73807d;
  --line: #dde3df;
  --line-strong: #cbd4cf;
  --paper: #f4f4ef;
  --surface: #ffffff;
  --surface-soft: #f8faf7;
  --brand: #245c52;
  --brand-deep: #17463e;
  --brand-soft: #e7f0ec;
  --accent: #d3a043;
  --accent-soft: #fbf2df;
  --danger: #a34840;
  --danger-soft: #fae9e7;
  --warning: #9b6d19;
  --warning-soft: #fff5db;
  --success: #267259;
  --success-soft: #e5f4ed;
  --shadow: 0 14px 38px rgba(31, 55, 48, 0.08);
  --font: "Microsoft YaHei UI", "Microsoft YaHei", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 4%, rgba(211, 160, 67, 0.08), transparent 25rem),
    radial-gradient(circle at 93% 0%, rgba(36, 92, 82, 0.08), transparent 30rem),
    var(--paper);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
}

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

button {
  border: 0;
}

button:not(:disabled),
select:not(:disabled) {
  cursor: pointer;
}

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

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  padding: 11px 12px;
  line-height: 1.75;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: #aebcb5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(36, 92, 82, 0.11);
}

input::placeholder,
textarea::placeholder {
  color: #a3aaa7;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(211, 160, 67, 0.45);
  outline-offset: 2px;
}

.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;
}

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

.app-shell {
  width: min(1720px, calc(100% - 40px));
  margin: 0 auto;
  padding: 12px 0 32px;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 8px;
  display: grid;
  grid-template-columns: max-content max-content minmax(320px, 1fr) max-content;
  align-items: center;
  min-height: 62px;
  padding: 9px 12px;
  border: 1px solid rgba(221, 227, 223, 0.95);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(31, 55, 48, 0.08);
  backdrop-filter: blur(12px);
  gap: 13px;
}

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

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  box-shadow: 0 7px 15px rgba(28, 81, 70, 0.18);
  font-family: "STKaiti", "KaiTi", var(--font);
  font-size: 21px;
  font-weight: 700;
}

.brand h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.025em;
  white-space: nowrap;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.module-tabs {
  display: flex;
  align-items: center;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f4f7f3;
  gap: 2px;
}

.module-tab {
  display: inline-flex;
  min-height: 32px;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  border-radius: 7px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
  text-decoration: none;
}

.module-tab.is-active {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 4px 10px rgba(36, 92, 82, 0.16);
}

.module-tab:disabled {
  opacity: 1;
  color: #8d9894;
}

.module-status {
  padding: 0 4px;
  border: 1px solid #d7ded9;
  border-radius: 99px;
  background: #fff;
  font-size: 8px;
  font-weight: 600;
}

.summary-strip {
  display: grid;
  min-width: 0;
  grid-template-columns: repeat(6, minmax(38px, 1fr)) minmax(105px, 1.7fr);
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfa;
}

.summary-metric {
  min-width: 0;
  padding: 4px 8px;
  border-left: 1px solid var(--line);
}

.summary-metric:first-child {
  border-left: 0;
}

.summary-metric > span,
.summary-progress > div > span {
  display: block;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-metric strong {
  display: block;
  margin-top: 1px;
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.25;
}

.summary-total strong {
  color: var(--brand);
}

.summary-alert.has-issues {
  background: var(--danger-soft);
}

.summary-alert.has-issues strong {
  color: var(--danger);
}

.summary-progress {
  padding-right: 10px;
}

.summary-progress > div {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}

.summary-progress strong {
  flex: 0 0 auto;
  color: var(--brand);
  font-size: 13px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.topbar-actions .button {
  min-height: 34px;
  padding: 0 9px;
  font-size: 11px;
}

.save-state,
.editor-save-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.save-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #a2aca8;
}

.save-state.is-saving .save-dot,
.editor-save-state.is-saving .save-dot {
  background: var(--accent);
  animation: pulse 900ms infinite alternate;
}

.save-state.is-saved .save-dot,
.editor-save-state.is-saved .save-dot {
  background: var(--success);
}

.save-state.is-error .save-dot,
.editor-save-state.is-error .save-dot {
  background: var(--danger);
}

@keyframes pulse {
  from { opacity: 0.35; transform: scale(0.8); }
  to { opacity: 1; transform: scale(1.18); }
}

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 17px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-weight: 650;
  white-space: nowrap;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button-primary {
  color: #fff;
  background: var(--brand);
  box-shadow: 0 7px 16px rgba(36, 92, 82, 0.16);
}

.button-primary:hover:not(:disabled) {
  background: var(--brand-deep);
}

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

.button-secondary:hover:not(:disabled) {
  border-color: #aab8b1;
  background: var(--surface-soft);
}

.button-ghost {
  color: var(--ink-soft);
  background: transparent;
}

.button-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.7);
}

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

.text-button {
  padding: 4px 2px;
  color: var(--brand);
  background: none;
  font-size: 12px;
  font-weight: 650;
}

.text-button:hover {
  color: var(--brand-deep);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.icon-button {
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  background: #fff;
  font-size: 11px;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.progress-track {
  width: 100%;
  height: 4px;
  min-width: 32px;
  overflow: hidden;
  border-radius: 99px;
  background: #e6eae5;
}

.progress-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand), #4e8c7e 72%, var(--accent));
  transition: width 380ms ease;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 370px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.list-panel,
.editor-panel {
  border: 1px solid rgba(221, 227, 223, 0.95);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.list-panel {
  position: sticky;
  top: 82px;
  display: flex;
  height: calc(100vh - 96px);
  min-height: 680px;
  max-height: 960px;
  flex-direction: column;
  overflow: hidden;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 15px;
}

.panel-heading p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.teacher-account {
  padding: 0 14px 13px;
}

.teacher-login {
  padding: 11px 12px 10px;
  border: 1px solid #d5e1db;
  border-radius: 11px;
  background:
    linear-gradient(135deg, rgba(231, 240, 236, 0.78), rgba(255, 255, 255, 0.94)),
    #fff;
}

.teacher-login-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.teacher-login-heading strong {
  color: var(--brand-deep);
  font-size: 12px;
}

.teacher-login-heading span {
  color: var(--muted);
  font-size: 9px;
}

.teacher-login-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.teacher-login-row input {
  height: 36px;
  border-color: #cad7d1;
  background: #fff;
  font-size: 12px;
}

.teacher-login-row .button {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 8px;
  font-size: 11px;
}

.teacher-login-error {
  min-height: 0;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 10px;
}

.teacher-login-error:empty {
  display: none;
}

.teacher-session {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 11px;
  border: 1px solid #c9dbd3;
  border-radius: 11px;
  background: #f3f8f5;
}

.teacher-avatar {
  display: grid;
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--brand);
  font-family: "STKaiti", "KaiTi", var(--font);
  font-size: 16px;
}

.teacher-session-info {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}

.teacher-session-info strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teacher-session-info span {
  color: var(--muted);
  font-size: 9px;
}

.teacher-session .text-button {
  flex: 0 0 auto;
  font-size: 10px;
}

.task-workspace {
  display: flex;
  min-height: 0;
  flex: 1;
  flex-direction: column;
}

.filters {
  padding: 0 14px 13px;
  border-bottom: 1px solid var(--line);
}

.search-box {
  position: relative;
  display: block;
}

.search-box svg {
  position: absolute;
  top: 12px;
  left: 12px;
  width: 17px;
  height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  height: 41px;
  padding-left: 38px;
  border-color: transparent;
  background: #f3f5f1;
  font-size: 12px;
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 9px;
}

.filter-grid label {
  display: block;
}

.filter-grid label > span {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
}

.filter-grid select {
  height: 34px;
  padding: 0 7px;
  border-color: var(--line);
  border-radius: 7px;
  background: #fff;
  font-size: 11px;
}

.filter-grid .check-filter {
  display: flex;
  align-items: center;
  align-self: end;
  height: 34px;
  gap: 6px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  font-size: 11px;
}

.filter-grid .check-filter input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}

.filter-grid .check-filter span {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

.record-list {
  flex: 1;
  overflow-y: auto;
  padding: 7px;
  scrollbar-color: #c8d1cc transparent;
  scrollbar-width: thin;
}

.list-empty {
  padding: 54px 20px;
  color: var(--muted);
  text-align: center;
}

.list-empty strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-soft);
}

.record-item {
  position: relative;
  width: 100%;
  padding: 12px 12px 11px 16px;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  transition: background 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.record-item::before {
  position: absolute;
  top: 19px;
  left: 7px;
  width: 3px;
  height: 18px;
  border-radius: 99px;
  background: #d5dbd7;
  content: "";
}

.record-item:hover {
  border-color: var(--line);
  background: #f9fbf8;
}

.record-item.is-active {
  border-color: #b8cdc5;
  background: var(--brand-soft);
  box-shadow: inset 0 0 0 1px rgba(36, 92, 82, 0.04);
}

.record-item.is-active::before {
  background: var(--brand);
}

.record-item[data-status="doubtful"]::before {
  background: var(--warning);
}

.record-item[data-status="modified"]::before {
  background: var(--accent);
}

.record-item[data-status="confirmed"]::before {
  background: var(--success);
}

.record-item-top {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}

.record-order {
  color: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.record-tag {
  padding: 1px 6px;
  border-radius: 4px;
  color: #53605d;
  background: #edf0ed;
  font-size: 9px;
}

.record-item.is-active .record-tag {
  background: rgba(255, 255, 255, 0.72);
}

.record-type {
  margin-left: auto;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.record-item h3 {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.record-item-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 10px;
}

.record-flags {
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-flag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--muted);
}

.mini-flag::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.mini-flag.flag-change {
  color: var(--warning);
}

.mini-flag.flag-issue {
  color: var(--danger);
}

.editor-panel {
  min-height: 760px;
  overflow: hidden;
}

.empty-state {
  display: flex;
  min-height: 660px;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  padding: 50px;
  text-align: center;
}

.empty-mark {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  margin-bottom: 14px;
  border: 1px solid #cfdcd6;
  border-radius: 22px;
  color: var(--brand);
  background: var(--brand-soft);
  font-family: "STKaiti", "KaiTi", var(--font);
  font-size: 34px;
}

.empty-state h2 {
  margin: 0;
  font-size: 18px;
}

.empty-state p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.record-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(231, 240, 236, 0.8), rgba(255, 255, 255, 0.9) 58%),
    var(--surface);
}

.record-kicker {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.dot-divider {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #a4afaa;
}

.change-badge {
  padding: 1px 7px;
  border-radius: 99px;
  color: #7a5416;
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 650;
}

.record-header h2 {
  max-width: 880px;
  margin: 7px 0 4px;
  font-size: 21px;
  line-height: 1.45;
}

.record-header p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.record-nav {
  display: flex;
  gap: 7px;
}

.record-nav .button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 11px;
}

.form-section {
  padding: 25px 28px 29px;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 17px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.section-index {
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.section-heading h3 {
  margin: 0;
  font-size: 15px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.basic-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.primary-fields,
.task-fields,
.goal-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 13px;
}

.primary-fields {
  margin-top: 13px;
}

.task-fields {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.task-fields .field-card[data-key="prompt"],
.task-fields .field-card[data-key="hint"] {
  grid-column: 1 / -1;
}

.goal-fields {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  align-items: stretch;
  margin-top: 13px;
}

.goal-fields .field-card {
  display: flex;
  flex-direction: column;
}

.goal-fields .field-card textarea {
  flex: 1 1 auto;
}

.field-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.field-card:focus-within {
  border-color: #b7cbc3;
  background: #fff;
}

.field-label-row {
  display: flex;
  min-height: 24px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.field-label {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.field-label-hint {
  color: var(--muted);
  font-size: 10px;
}

.field-review-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 99px;
  color: var(--muted);
  background: #fff;
  font-size: 9px;
  white-space: nowrap;
}

.field-review-button::before {
  width: 7px;
  height: 7px;
  border: 1px solid #aeb8b3;
  border-radius: 50%;
  content: "";
}

.field-review-button.is-checked {
  color: var(--success);
  border-color: #bfd8ca;
  background: var(--success-soft);
}

.field-review-button.is-checked::before {
  border-color: var(--success);
  background: var(--success);
  box-shadow: inset 0 0 0 2px var(--success-soft);
}

.field-card input,
.field-card select,
.field-card textarea {
  border-color: #d7dfda;
  background: #fff;
}

.field-card textarea {
  min-height: 76px;
  overflow-y: hidden;
  line-height: 1.7;
}

.field-card[data-key="lesson"] textarea,
.field-card[data-key="writing_topic"] textarea,
.field-card[data-key="ability"] textarea {
  min-height: 92px;
}

.field-card[data-key="prompt"] textarea {
  min-height: 112px;
}

.field-card[data-key="hint"] textarea {
  min-height: 92px;
}

.field-card[data-key="objective"] textarea {
  min-height: 108px;
}

.rubric-summary {
  display: grid;
  grid-template-columns: 110px 150px minmax(130px, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  border: 1px solid #d7e2dc;
  border-radius: 12px;
  background: #f7faf7;
}

.rubric-summary > div:first-child span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.rubric-summary > div:first-child strong {
  display: block;
  font-size: 18px;
}

.rubric-total-field {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rubric-total-field label {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}

.rubric-total-field > div {
  display: flex;
  align-items: center;
  gap: 5px;
}

.rubric-total-field input {
  width: 72px;
  height: 34px;
  font-weight: 700;
}

.rubric-total-field span {
  color: var(--muted);
  font-size: 11px;
}

.rubric-check {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
}

.rubric-check-icon {
  position: relative;
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  border: 1px solid #aab6b0;
  border-radius: 50%;
}

.rubric-check.is-ok {
  color: var(--success);
}

.rubric-check.is-ok .rubric-check-icon {
  border-color: var(--success);
  background: var(--success);
}

.rubric-check.is-ok .rubric-check-icon::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 7px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  content: "";
  transform: rotate(45deg);
}

.rubric-check.is-error {
  color: var(--danger);
  font-weight: 650;
}

.rubric-check.is-error .rubric-check-icon {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.rubric-check.is-error .rubric-check-icon::after {
  position: absolute;
  top: 3px;
  left: 7px;
  color: var(--danger);
  content: "!";
  font-size: 10px;
  font-weight: 800;
}

.rubric-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 13px;
  color: var(--muted);
  font-size: 10px;
}

.rubric-legend span {
  padding: 4px 8px;
  border-radius: 999px;
  font-weight: 700;
}

.rubric-legend-good {
  color: #276345;
  background: #eaf6ee;
}

.rubric-legend-medium {
  color: #7a5a15;
  background: #fff7dd;
}

.rubric-legend-poor {
  color: #88443d;
  background: #fff0ee;
}

.rubric-legend small {
  margin-left: auto;
}

.rubric-cards {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.rubric-card {
  overflow: hidden;
  border: 1px solid #d7dfda;
  border-radius: 12px;
  background: #fff;
}

.rubric-card-header {
  display: grid;
  grid-template-columns: 44px minmax(220px, 1fr) 105px 132px;
  align-items: end;
  gap: 10px;
  padding: 12px;
  background: #f7f9f6;
}

.rubric-card-header .rubric-index {
  align-self: center;
  color: var(--muted);
  font-size: 11px;
}

.rubric-name-cell,
.rubric-score-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.rubric-name-cell span,
.rubric-score-cell span {
  color: var(--muted);
  font-size: 10px;
}

.rubric-name-cell input,
.rubric-score-cell input {
  width: 100%;
  height: 35px;
}

.rubric-score-cell {
  position: relative;
}

.rubric-score-cell input {
  padding-right: 25px;
}

.rubric-score-cell::after {
  position: absolute;
  right: 10px;
  bottom: 8px;
  color: var(--muted);
  content: "分";
  font-size: 10px;
  pointer-events: none;
}

.rubric-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.rubric-action {
  width: 29px;
  height: 29px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  background: #fff;
  font-size: 13px;
}

.rubric-action:hover:not(:disabled) {
  color: var(--brand);
  border-color: #b7cbc3;
  background: var(--brand-soft);
}

.rubric-action.is-delete:hover:not(:disabled) {
  color: var(--danger);
  border-color: #e2c0bc;
  background: var(--danger-soft);
}

.rubric-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  border-top: 1px solid var(--line);
  background: var(--line);
}

.rubric-level {
  min-width: 0;
  padding: 12px;
  background: #fff;
}

.rubric-level-good {
  box-shadow: inset 0 3px #4e8b68;
}

.rubric-level-medium {
  box-shadow: inset 0 3px #c69a36;
}

.rubric-level-poor {
  box-shadow: inset 0 3px #bd665d;
}

.rubric-level-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.rubric-level-badge {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 7px;
  font-size: 12px;
}

.rubric-level-good .rubric-level-badge {
  color: #276345;
  background: #eaf6ee;
}

.rubric-level-medium .rubric-level-badge {
  color: #7a5a15;
  background: #fff7dd;
}

.rubric-level-poor .rubric-level-badge {
  color: #88443d;
  background: #fff0ee;
}

.rubric-level-range {
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
}

.rubric-level-description {
  width: 100%;
  min-height: 90px;
  resize: vertical;
  font-size: 12px;
  line-height: 1.55;
}

.rubric-level-range-row {
  display: grid;
  grid-template-columns: auto 54px 12px auto 54px auto;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
}

.rubric-level-range-row label {
  white-space: nowrap;
}

.rubric-level-range-row input {
  width: 100%;
  height: 30px;
  padding: 0 6px;
  text-align: center;
  font-size: 11px;
}

.rubric-range-separator,
.rubric-range-unit {
  text-align: center;
}

.rubric-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-top: 1px solid #edf0ed;
  color: var(--muted);
  background: #fbfcfa;
  font-size: 10px;
}

.rubric-card-footer strong {
  flex: 0 0 auto;
}

.rubric-card-footer .is-ok {
  color: var(--success);
}

.rubric-card-footer .is-error {
  color: var(--danger);
}

.status-options {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.status-option {
  display: flex;
  min-height: 66px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink-soft);
  background: #fff;
  text-align: left;
}

.status-option:hover {
  border-color: #b7c6bf;
  background: var(--surface-soft);
}

.status-option strong {
  font-size: 12px;
}

.status-option span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.status-option.is-selected {
  border-color: var(--brand);
  box-shadow: inset 0 0 0 1px rgba(36, 92, 82, 0.05);
  background: var(--brand-soft);
}

.status-option[data-status="modified"].is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.status-option[data-status="doubtful"].is-selected {
  border-color: var(--warning);
  background: var(--warning-soft);
}

.review-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 13px;
  margin-top: 14px;
}

.review-meta label > span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
}

.review-meta textarea {
  min-height: 92px;
}

.editor-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px 22px;
  background: #fbfcfa;
}

.editor-footer > div:first-child {
  display: flex;
  flex-direction: column;
  color: var(--muted);
  font-size: 10px;
}

.editor-footer > div:last-child {
  display: flex;
  gap: 8px;
}

.toast-region {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 30;
  display: flex;
  width: min(380px, calc(100vw - 44px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 12px 30px rgba(25, 46, 40, 0.14);
  color: var(--ink-soft);
  font-size: 12px;
  animation: toast-in 180ms ease both;
}

.toast.is-error {
  border-color: #e5c3bf;
  color: var(--danger);
  background: #fff9f8;
}

.toast.is-success {
  border-color: #bfd8ca;
  color: var(--success);
  background: #f8fdfa;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal {
  width: min(520px, calc(100vw - 36px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(19, 45, 38, 0.2);
}

.modal::backdrop {
  background: rgba(20, 35, 31, 0.38);
  backdrop-filter: blur(2px);
}

.modal-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  margin-bottom: 13px;
  border-radius: 50%;
  color: var(--danger);
  background: var(--danger-soft);
  font-weight: 800;
}

.modal h2 {
  margin: 0;
  font-size: 18px;
}

.modal > form > p:not(.eyebrow) {
  margin: 9px 0 22px;
  color: var(--muted);
  font-size: 12px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 22px;
}

.help-modal {
  width: min(680px, calc(100vw - 36px));
}

.preview-modal {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
}

.preview-form {
  display: flex;
  width: 100%;
  height: 100dvh;
  min-height: 0;
  flex-direction: column;
}

.preview-header {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px clamp(16px, 3vw, 34px);
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.preview-header > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 13px;
}

.preview-header h2 {
  margin: 0;
  font-size: 17px;
  white-space: nowrap;
}

.preview-header > div > p:last-child {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-close {
  position: static;
  flex: 0 0 auto;
}

.preview-body {
  display: grid;
  min-height: 0;
  flex: 1;
  align-content: start;
  overflow: auto;
  padding: clamp(18px, 3vw, 34px);
  background: #e9edeb;
}

.preview-body.is-image {
  align-content: center;
  padding: 14px;
  background: #16201d;
}

.preview-image {
  display: block;
  max-width: 100%;
  max-height: calc(100dvh - 146px);
  width: auto;
  height: auto;
  margin: auto;
  border-radius: 3px;
  background: #fff;
  box-shadow: 0 14px 46px rgba(0, 0, 0, 0.3);
  object-fit: contain;
}

.preview-state {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin: auto;
  padding: 30px 20px;
  color: var(--muted);
  text-align: center;
}

.preview-state > span {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  margin-bottom: 4px;
  border-radius: 50%;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 800;
}

.preview-state strong {
  color: var(--ink-soft);
  font-size: 14px;
}

.preview-state p {
  max-width: 440px;
  margin: 0;
  font-size: 11px;
}

.word-preview-content {
  width: min(980px, 100%);
  min-height: calc(100dvh - 158px);
  margin: 0 auto;
  padding: clamp(38px, 5vw, 68px);
  color: #202725;
  background: #fff;
  box-shadow: 0 14px 40px rgba(26, 48, 42, 0.14);
  font-family: "SimSun", "Songti SC", serif;
  font-size: 16px;
  line-height: 2;
}

.word-preview-content p {
  margin: 0 0 0.85em;
}

.word-preview-content h1,
.word-preview-content h2,
.word-preview-content h3,
.word-preview-content h4 {
  margin: 0.8em 0 0.45em;
  font-family: var(--font);
  line-height: 1.45;
}

.word-preview-content table {
  width: 100%;
  margin: 1em 0;
  border-collapse: collapse;
}

.word-preview-content td,
.word-preview-content th {
  padding: 5px 7px;
  border: 1px solid #d7dcd9;
}

.word-preview-content img {
  max-width: 100%;
  height: auto;
}

.word-preview-notice {
  width: min(980px, 100%);
  margin: 10px auto 0;
  padding: 8px 11px;
  border-left: 3px solid var(--accent);
  color: var(--muted);
  background: var(--accent-soft);
  font-size: 10px;
}

.preview-actions {
  display: flex;
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 9px;
  padding: 10px clamp(16px, 3vw, 34px);
  border-top: 1px solid var(--line);
  background: #fff;
}

.preview-fullscreen {
  margin-right: auto;
  border-color: var(--line);
}

.help-modal form {
  position: relative;
}

.modal-close {
  position: absolute;
  top: -7px;
  right: -7px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: var(--muted);
  background: #f2f4f1;
  font-size: 21px;
  line-height: 1;
}

.help-steps {
  display: grid;
  gap: 10px;
  margin: 19px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: help-step;
}

.help-steps li {
  position: relative;
  min-height: 62px;
  padding: 10px 12px 10px 50px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
  counter-increment: help-step;
}

.help-steps li::before {
  position: absolute;
  top: 13px;
  left: 13px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  border-radius: 8px;
  color: var(--brand);
  background: var(--brand-soft);
  content: counter(help-step);
  font-size: 10px;
  font-weight: 800;
}

.help-steps strong,
.help-steps span {
  display: block;
}

.help-steps strong {
  font-size: 12px;
}

.help-steps span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.help-note {
  margin-top: 13px;
  padding: 10px 12px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  color: #6e5527;
  font-size: 11px;
}

.loading-layer {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(244, 244, 239, 0.9);
  backdrop-filter: blur(3px);
  transition: opacity 220ms ease;
}

.loading-layer.is-done {
  opacity: 0;
  pointer-events: none;
}

.loading-card {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 28px 38px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.loading-card strong {
  margin-top: 13px;
  font-size: 14px;
}

.loading-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.loading-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #dce7e2;
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 750ms linear infinite;
}

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

@media (max-width: 1400px) {
  .brand p {
    display: none;
  }

  .summary-metric {
    padding-right: 6px;
    padding-left: 6px;
  }

  .save-state span:last-child {
    display: none;
  }
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: minmax(310px, 350px) minmax(0, 1fr);
  }

  .record-header {
    flex-direction: column;
  }

  .record-nav {
    align-self: flex-end;
  }

  .summary-strip {
    grid-template-columns: repeat(6, minmax(34px, 1fr)) minmax(92px, 1.5fr);
  }
}

@media (max-width: 960px) {
  .app-shell {
    width: min(100% - 24px, 900px);
  }

  .topbar {
    position: relative;
    top: 0;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    align-items: center;
  }

  .topbar-actions {
    grid-column: 3;
    grid-row: 1;
    width: auto;
    flex-wrap: nowrap;
  }

  .brand {
    grid-column: 1;
    grid-row: 1;
  }

  .module-tabs {
    grid-column: 2;
    grid-row: 1;
  }

  .save-state {
    margin-right: 0;
  }

  .summary-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .list-panel {
    position: static;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .record-list {
    max-height: 470px;
  }

  .basic-fields {
    grid-template-columns: repeat(2, 1fr);
  }

  .basic-fields .field-card {
    grid-column: auto !important;
  }

  .rubric-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .rubric-card-header {
    grid-template-columns: 36px minmax(0, 1fr) 92px 120px;
  }

  .status-options {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 16px, 600px);
    padding-top: 10px;
  }

  .brand p,
  .save-state {
    display: none;
  }

  .topbar {
    grid-template-columns: minmax(0, 1fr) max-content;
    gap: 8px;
  }

  .module-tabs {
    grid-column: 1 / -1;
    grid-row: 2;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .module-tab {
    justify-content: center;
    padding: 0 5px;
  }

  .topbar-actions {
    grid-column: 2;
    grid-row: 1;
  }

  .summary-strip {
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(2, 1fr);
  }

  .summary-metric {
    border-top: 1px solid var(--line);
  }

  .summary-metric:nth-child(odd) {
    border-left: 0;
  }

  .summary-progress {
    grid-column: 1 / -1;
  }

  .filter-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .record-header,
  .form-section,
  .editor-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .section-heading p {
    padding-left: 27px;
    text-align: left;
  }

  .basic-fields,
  .primary-fields,
  .task-fields,
  .goal-fields {
    grid-template-columns: 1fr;
  }

  .task-fields .field-card[data-key="prompt"],
  .task-fields .field-card[data-key="hint"] {
    grid-column: auto;
  }

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

  .rubric-legend {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .rubric-legend small {
    width: 100%;
    margin-left: 0;
  }

  .rubric-card-header {
    grid-template-columns: 30px minmax(0, 1fr) 76px;
    gap: 8px;
    padding: 10px;
  }

  .rubric-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    padding-top: 2px;
  }

  .rubric-levels {
    grid-template-columns: 1fr;
  }

  .rubric-level-description {
    min-height: 78px;
  }

  .rubric-card-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .status-options,
  .review-meta {
    grid-template-columns: 1fr;
  }

  .editor-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-footer > div:last-child {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
}

/* Sample upload workspace */
.sample-task-item[data-sample-status="uploaded"]::before {
  background: var(--success);
}

.sample-task-item[data-sample-status="pending"]::before {
  background: var(--accent);
}

.sample-list-badge {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 99px;
  font-size: 9px;
  font-weight: 700;
}

.sample-list-badge.is-uploaded {
  color: var(--success);
  background: var(--success-soft);
}

.sample-list-badge.is-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.sample-editor {
  min-height: 720px;
}

.sample-content {
  min-width: 0;
}

.sample-record-header {
  align-items: center;
}

.sample-state-badge {
  padding: 2px 8px;
  border-radius: 99px;
  font-size: 10px;
  font-weight: 700;
}

.sample-state-badge.is-uploaded {
  color: var(--success);
  background: var(--success-soft);
}

.sample-state-badge.is-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.sample-body {
  display: grid;
  gap: 0;
}

.sample-task-section {
  border-bottom: 1px solid var(--line);
}

.task-fact-strip {
  display: grid;
  grid-template-columns:
    repeat(3, minmax(100px, 0.7fr))
    minmax(220px, 1.7fr);
  gap: 9px;
  margin-bottom: 14px;
}

.task-fact {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.task-fact span {
  display: block;
  color: var(--muted);
  font-size: 10px;
}

.task-fact strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-size: 13px;
}

.task-fact-wide strong {
  font-size: 12px;
  line-height: 1.7;
}

.task-copy-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 10px;
}

.task-copy-card {
  display: flex;
  height: 100%;
  min-width: 0;
  flex-direction: column;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.task-copy-card > span {
  display: block;
  margin-bottom: 6px;
  color: var(--brand);
  font-size: 11px;
  font-weight: 700;
}

.task-copy-wide {
  grid-column: 1 / -1;
}

.task-copy-text {
  min-width: 0;
  flex: 1 1 auto;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.upload-section {
  padding-bottom: 28px;
}

.current-sample {
  margin-bottom: 14px;
  padding: 13px 14px;
  border: 1px solid #bad7ca;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--success-soft), #fbfdfb);
}

.current-sample-heading,
.selection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.current-sample-heading strong,
.selection-heading strong {
  display: block;
  margin-top: 2px;
  font-size: 13px;
}

.current-sample-heading > span,
.current-sample > p {
  color: var(--muted);
  font-size: 10px;
}

.sample-eyebrow {
  color: var(--success);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.uploaded-files {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.uploaded-essay {
  padding: 9px;
  border: 1px solid #c6d9d0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.uploaded-essay-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.uploaded-essay-heading strong {
  overflow: hidden;
  color: var(--brand-deep);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-essay-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
}

.uploaded-file {
  display: flex;
  min-width: 0;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  padding: 6px 7px 6px 9px;
  border: 1px solid #c6d9d0;
  border-radius: 8px;
  background: #fff;
}

.uploaded-file-badge {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 34px;
  min-height: 24px;
  align-items: center;
  justify-content: center;
  padding: 0 7px;
  border-radius: 6px;
  color: var(--brand-deep);
  background: var(--brand-soft);
  font-size: 9px;
  font-weight: 750;
}

.uploaded-file-info {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 1px;
}

.uploaded-file-info strong {
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-file-info span {
  color: var(--muted);
  font-size: 9px;
}

.uploaded-file-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.uploaded-file-action {
  min-height: 29px;
  padding: 0 9px;
  font-size: 10px;
  text-decoration: none;
}

.uploaded-file-action.button-ghost {
  border-color: var(--line);
}

.current-sample > p {
  margin: 8px 0 0;
}

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

.unified-upload-grid {
  grid-template-columns: minmax(0, 1fr);
}

.upload-mode-card {
  display: grid;
  min-width: 0;
  min-height: 108px;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 14px;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  color: var(--ink);
  background: #fff;
  text-align: left;
  transition: border-color 150ms ease, background 150ms ease, box-shadow 150ms ease;
}

.upload-mode-card:hover:not(:disabled),
.upload-mode-card.is-selected {
  border-color: #91b7a9;
  background: #f8fcfa;
  box-shadow: 0 7px 18px rgba(36, 92, 82, 0.08);
}

.upload-mode-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(145deg, var(--brand), var(--brand-deep));
  font-family: "STKaiti", "KaiTi", var(--font);
  font-size: 19px;
}

.upload-mode-icon-word {
  background: linear-gradient(145deg, #527c9b, #2f526c);
}

.upload-mode-card strong,
.upload-mode-card small {
  display: block;
}

.upload-mode-card strong {
  font-size: 13px;
}

.upload-mode-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.55;
}

.upload-mode-action {
  grid-column: 2;
  color: var(--brand);
  font-size: 10px;
  font-weight: 700;
}

.selection-panel {
  margin-top: 13px;
  padding: 13px 14px;
  border: 1px solid #d8d2bd;
  border-radius: 12px;
  background: #fffdf7;
}

.selection-panel .sample-eyebrow {
  color: var(--warning);
}

.selection-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 10px;
}

.selection-essay-group {
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.selection-essay-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.selection-essay-heading strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-essay-heading span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 9px;
}

.selection-essay-files {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.overwrite-warning {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid #e2c77e;
  border-radius: 8px;
  color: #765310;
  background: #fff8e6;
  font-size: 10px;
  line-height: 1.65;
}

.overwrite-warning:empty {
  display: none;
}

.selection-item {
  display: grid;
  min-width: 0;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.selection-item img {
  width: 64px;
  height: 58px;
  border-radius: 7px;
  object-fit: cover;
  background: #edf0ed;
}

.selection-item strong,
.selection-item span {
  display: block;
}

.selection-item strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-item div span {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-doc-mark {
  display: grid !important;
  width: 58px;
  height: 52px;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(145deg, #527c9b, #2f526c);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.upload-error {
  margin: 7px 0 0;
  color: var(--danger);
  font-size: 10px;
}

.upload-error:empty {
  display: none;
}

.upload-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 10px;
}

.upload-guidance {
  display: grid;
  gap: 3px;
  margin-top: 13px;
  padding: 11px 13px;
  border-left: 3px solid #c7b580;
  border-radius: 0 8px 8px 0;
  color: var(--muted);
  background: #faf8f1;
  font-size: 10px;
  line-height: 1.65;
}

.upload-guidance strong {
  color: var(--ink-soft);
  font-size: 11px;
}

@media (max-width: 960px) {
  .sample-record-header {
    align-items: flex-start;
  }
}

@media (max-width: 620px) {
  .task-fact-strip,
  .task-copy-grid,
  .upload-mode-grid,
  .selection-preview,
  .selection-essay-files {
    grid-template-columns: 1fr;
  }

  .task-copy-wide {
    grid-column: auto;
  }

  .upload-mode-card {
    min-height: 96px;
  }

  .current-sample-heading,
  .selection-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
  }

  .upload-actions .button {
    width: 100%;
  }

  .uploaded-file {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .uploaded-file-info {
    min-width: calc(100% - 52px);
  }

  .uploaded-file-actions {
    width: 100%;
    padding-left: 43px;
  }

  .preview-modal {
    width: 100vw;
    height: 100dvh;
    max-height: none;
  }

  .preview-form {
    height: 100dvh;
    max-height: none;
  }

  .preview-header,
  .preview-body,
  .preview-actions {
    padding-right: 15px;
    padding-left: 15px;
  }

  .preview-header > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 1px;
  }

  .preview-header h2 {
    font-size: 15px;
  }

  .preview-header > div > p:last-child {
    max-width: calc(100vw - 92px);
  }

  .preview-actions {
    gap: 6px;
    padding-top: 8px;
    padding-bottom: 8px;
  }

  .preview-actions .button {
    min-height: 38px;
    padding-right: 11px;
    padding-left: 11px;
    font-size: 11px;
  }

  .word-preview-content {
    min-height: calc(100dvh - 151px);
    padding: 24px 20px;
    font-size: 14px;
  }
}
