:root {
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-soft: #f7f4ee;
  --surface-muted: #f8faf9;
  --text: #15191f;
  --muted: #69737f;
  --line: rgba(21, 25, 31, 0.1);
  --brand: #145c4f;
  --brand-dark: #0f453c;
  --accent: #b66a2c;
  --type-daily: var(--accent);
  --type-daily-soft: #fff0dc;
  --type-audio: var(--brand);
  --type-audio-soft: var(--brand-soft);
  --type-screen: #28606f;
  --type-screen-soft: rgba(40, 96, 111, 0.1);
  --type-writing: #3b5c8a;
  --type-writing-soft: rgba(59, 92, 138, 0.1);
  --type-homework: #5f4b8b;
  --type-homework-soft: rgba(95, 75, 139, 0.1);
  --danger: #b42318;
  --brand-soft: rgba(20, 92, 79, 0.08);
  --brand-line: rgba(20, 92, 79, 0.22);
  --danger-soft: #fff1ef;
  --danger-line: #f4c7c3;
  --shadow: 0 22px 55px rgba(21, 25, 31, 0.11);
  --soft-shadow: 0 10px 24px rgba(21, 25, 31, 0.06);
  --scrim: rgba(21, 25, 31, 0.62);
  --border-width: 1px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 28px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(243, 245, 244, 0.95) 36%),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

body.attachment-viewer-open {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  width: min(1080px, calc(100% - 32px));
  margin: 36px auto;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 22px;
}

.status-pill {
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--brand);
  background: rgba(20, 92, 79, 0.08);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 14px;
  border-radius: 8px;
  padding: 4px;
  background: rgba(21, 25, 31, 0.06);
}

.tab-button,
.primary-button,
.ghost-button,
.danger-button,
.record-button,
.stop-button {
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  cursor: pointer;
}

.tab-button {
  flex: 1 1 128px;
  color: var(--muted);
  background: transparent;
}

.tab-button.active {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.9);
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.deadline-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  border: 1px solid rgba(20, 92, 79, 0.12);
  border-radius: 8px;
  padding: 12px 14px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

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

.deadline-strip strong {
  color: var(--brand);
}

.panel {
  display: none;
  background: var(--surface);
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel.active {
  display: block;
}

.upload-form {
  padding: 28px;
}

.student-hub-intro {
  display: grid;
  gap: 14px;
  padding: 24px 28px 12px;
}

.student-hub-intro p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
}

.student-summary-section {
  padding: var(--space-5) var(--space-6) 0;
  border-bottom: var(--border-width) solid var(--line);
}

.student-summary-toolbar {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-3);
  align-items: end;
}

.student-summary-toolbar h2 {
  margin-bottom: var(--space-2);
}

.student-summary-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.student-summary-toolbar label {
  margin: 0;
}

.student-summary-form {
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)) auto;
}

.student-summary-field {
  min-width: 0;
}

.student-summary-view-button {
  min-width: 112px;
  white-space: nowrap;
}

.student-summary-container .student-summary-grid {
  padding: var(--space-4) 0 var(--space-5);
}

.student-summary-container > .empty-inline {
  padding: var(--space-4) 0 var(--space-5);
}

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

.task-card {
  min-width: 0;
  min-height: 74px;
  border: 1px solid rgba(21, 25, 31, 0.08);
  border-radius: 8px;
  padding: 12px;
  color: var(--text);
  background: #f8faf9;
  cursor: pointer;
  text-align: left;
}

.task-card strong,
.task-card span {
  display: block;
}

.task-card strong {
  margin-bottom: 5px;
  font-size: 17px;
}

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

.task-card.active {
  border-color: rgba(20, 92, 79, 0.32);
  color: #ffffff;
  background: var(--brand);
  box-shadow: var(--soft-shadow);
}

.task-card.active span {
  color: rgba(255, 255, 255, 0.78);
}

.task-form[hidden] {
  display: none;
}

.section-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-title-row p {
  max-width: 640px;
  margin-bottom: 0;
  color: var(--muted);
}

.compact-row {
  margin-bottom: 14px;
}

.required-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  color: #8a3a12;
  background: #fff0dc;
  font-size: 14px;
  font-weight: 700;
}

.required-badge.compact {
  padding: 5px 9px;
  font-size: 12px;
}

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

.full-row {
  grid-column: 1 / -1;
}

label span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 14px;
}

label .select-help {
  margin: 8px 0 0;
  color: #8a3a12;
  font-size: 13px;
  line-height: 1.45;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  color: var(--text);
  background: #f6f8f7;
  font-size: 16px;
}

input:hover,
select:hover,
input:focus,
select:focus {
  border-color: rgba(20, 92, 79, 0.22);
  background: #ffffff;
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(33, 105, 92, 0.22);
  outline-offset: 2px;
}

.upload-zone,
.file-drop {
  display: block;
  margin-top: 22px;
  border: 1px dashed rgba(20, 92, 79, 0.28);
  border-radius: 8px;
  padding: 24px;
  background: rgba(20, 92, 79, 0.05);
  cursor: pointer;
}

.upload-zone:hover,
.file-drop:hover {
  background: rgba(20, 92, 79, 0.08);
}

.upload-zone input,
.file-drop input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.file-main {
  margin-bottom: 6px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

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

.word-upload-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.word-upload-preview:empty {
  display: none;
}

.word-upload-file {
  position: relative;
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  background: var(--surface-muted);
}

.word-upload-thumb,
.word-upload-file-icon {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--surface);
}

.word-upload-thumb {
  object-fit: cover;
}

.word-upload-file-icon {
  display: grid;
  place-items: center;
  border: 1px dashed var(--brand-line);
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 700;
}

.word-upload-file-meta {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.word-upload-file-meta strong,
.word-upload-file-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.word-upload-file-meta span {
  color: var(--muted);
  font-size: 13px;
}

.word-upload-remove {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 999px;
  color: var(--danger);
  background: var(--danger-soft);
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.word-upload-remove:hover {
  background: #ffe1dd;
}

.recorder-box {
  margin-top: 22px;
  border: 0;
  border-radius: 8px;
  padding: 22px;
  background:
    linear-gradient(135deg, rgba(20, 92, 79, 0.1), rgba(182, 106, 44, 0.08)),
    var(--surface-soft);
}

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

.recorder-head h2 {
  margin-bottom: 6px;
}

.recorder-head p,
.recorder-status {
  margin-bottom: 0;
  color: var(--muted);
}

.timer {
  min-width: 86px;
  border: 0;
  border-radius: 8px;
  padding: 10px 12px;
  color: #ffffff;
  background: #ffffff;
  background: var(--brand);
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  box-shadow: var(--soft-shadow);
}

.record-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 12px;
}

.record-button {
  color: #ffffff;
  border-color: var(--brand);
  background: var(--brand);
}

.stop-button {
  color: #ffffff;
  border-color: var(--danger);
  background: var(--danger);
}

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

.segment-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.segment-item {
  display: grid;
  grid-template-columns: minmax(116px, 0.7fr) minmax(220px, 1.4fr) 44px;
  gap: 12px;
  align-items: center;
  border: 0;
  border-radius: 8px;
  padding: 12px 12px 12px 14px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.segment-meta strong,
.segment-meta span {
  display: block;
}

.segment-meta span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.delete-segment-button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 999px;
  color: var(--danger);
  background: #fff1ef;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.delete-segment-button:hover {
  background: #ffe1dd;
}

.actions,
.teacher-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.actions {
  justify-content: flex-start;
  margin-top: 18px;
}

.primary-button {
  color: #ffffff;
  border-color: var(--brand);
  background: var(--brand);
  box-shadow: 0 12px 24px rgba(20, 92, 79, 0.18);
}

.primary-button:hover {
  background: var(--brand-dark);
}

.ghost-button {
  color: var(--text);
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(21, 25, 31, 0.11);
}

.danger-button {
  color: var(--danger);
  background: #fff7f6;
  border-color: #f4c7c3;
}

.message {
  min-height: 24px;
  margin: 14px 0 0;
  color: var(--brand);
}

.message.is-success,
.message.is-error,
.message.is-submitting {
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--brand-soft);
  font-weight: 700;
}

.message.is-error {
  border-color: var(--danger-line);
  color: var(--danger);
  background: var(--danger-soft);
}

.message.is-submitting {
  color: var(--text);
  background: var(--surface-muted);
}

.teacher-login {
  padding: 28px;
}

.teacher-login form {
  max-width: 420px;
  display: grid;
  gap: 14px;
}

.teacher-login p {
  margin-bottom: 0;
  color: var(--muted);
}

.consent-notice {
  border-radius: 8px;
  padding: 12px 14px;
  color: #7a3d12;
  background: #fff4e6;
}

.consent-check {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.consent-check input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.consent-check span {
  margin: 0;
  color: var(--text);
  font-size: 15px;
}

.teacher-tools {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(21, 25, 31, 0.08);
}

.teacher-tools p {
  margin-bottom: 0;
  color: var(--muted);
}

.empty-state {
  padding: 30px 28px;
  color: var(--muted);
}

.submission-list {
  display: grid;
  gap: 12px;
  padding: 18px 28px 28px;
}

.dashboard-section {
  padding: 24px 28px;
  border-bottom: 1px solid rgba(21, 25, 31, 0.08);
}

.manager-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(120px, 180px) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.teacher-filters {
  display: grid;
  grid-template-columns: minmax(130px, 1.1fr) minmax(120px, 0.9fr) minmax(140px, 0.9fr) minmax(130px, 0.9fr) auto;
  gap: 10px;
  align-items: end;
  padding: 16px 28px;
  border-bottom: 1px solid rgba(21, 25, 31, 0.08);
  background: #fbfcfb;
}

.manager-notice {
  margin: -8px 0 14px;
  border-radius: 8px;
  padding: 11px 12px;
  color: #7a3d12;
  background: #fff7ec;
  line-height: 1.55;
}

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

.student-card {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(220px, 1.2fr) minmax(240px, 1.4fr);
  gap: 12px;
  align-items: start;
  border-radius: 8px;
  padding: 12px;
  background: #f6f8f7;
}

.student-card.is-hidden {
  color: var(--muted);
  background: #eeeeec;
}

.student-card.is-hidden .code-block code {
  color: var(--muted);
}

.student-card strong,
.student-card span {
  display: block;
}

.student-card span,
.code-block span {
  color: var(--muted);
  font-size: 13px;
}

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

.code-block code {
  display: inline-block;
  margin-top: 4px;
  border-radius: 6px;
  padding: 5px 8px;
  color: var(--brand);
  background: #ffffff;
  font-weight: 700;
}

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

.student-actions .ghost-button,
.student-actions .danger-button {
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.student-delete-confirm {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  padding: 10px;
  background: var(--danger-soft);
}

.student-delete-confirm strong,
.student-delete-confirm span,
.student-delete-confirm label {
  display: block;
}

.student-delete-confirm span,
.student-delete-confirm label span {
  color: var(--muted);
  font-size: 13px;
}

.student-delete-confirm input {
  width: 100%;
  margin-top: 4px;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px;
  background: #ffffff;
}

.student-delete-force {
  grid-column: 1 / -1;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid var(--danger-line);
  border-radius: 8px;
  padding: 9px 10px;
  background: #ffffff;
}

.student-delete-force input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 1px;
}

.student-delete-force strong,
.student-delete-force small {
  display: block;
}

.student-delete-force strong {
  margin-bottom: 3px;
  color: var(--danger);
  font-size: 13px;
}

.student-delete-force small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.student-delete-error {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

.student-delete-confirm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.student-delete-confirm-actions .ghost-button,
.student-delete-confirm-actions .danger-button {
  min-height: 38px;
  padding: 0 11px;
  font-size: 13px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  padding: 18px 28px 10px;
}

.week-card {
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff, #fbfbfa);
  box-shadow: var(--soft-shadow);
}

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

.student-summary-week-card {
  display: grid;
  gap: var(--space-3);
}

.student-summary-type-row {
  --summary-type-accent: var(--type-audio);
  --summary-type-soft: var(--type-audio-soft);
  display: grid;
  gap: var(--space-2);
  border-top: var(--border-width) solid var(--line);
  padding-top: var(--space-3);
}

.week-card-head + .student-summary-type-row {
  border-top: 0;
  padding-top: 0;
}

.student-summary-type-row[data-summary-type="word_checkin"] {
  --summary-type-accent: var(--type-daily);
  --summary-type-soft: var(--type-daily-soft);
}

.student-summary-type-row[data-summary-type="screen_recording"] {
  --summary-type-accent: var(--type-screen);
  --summary-type-soft: var(--type-screen-soft);
}

.student-summary-type-row[data-summary-type="writing_explanation"] {
  --summary-type-accent: var(--type-writing);
  --summary-type-soft: var(--type-writing-soft);
}

.student-summary-type-row[data-summary-type="homework_upload"] {
  --summary-type-accent: var(--type-homework);
  --summary-type-soft: var(--type-homework-soft);
}

.student-summary-type-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.student-summary-type-row .type-badge {
  background: var(--summary-type-accent);
}

.student-summary-type-count {
  color: var(--summary-type-accent);
  font-size: 13px;
  font-weight: 700;
  text-align: right;
}

.student-summary-day-strip {
  margin-top: 0;
}

.student-summary-day-strip .day-pill {
  min-width: 0;
  min-height: 48px;
  display: grid;
  align-content: center;
  gap: 2px;
  color: var(--muted);
  background: var(--surface-muted);
}

.student-summary-day-strip .day-pill strong,
.student-summary-day-strip .day-pill small {
  display: block;
  font-size: 11px;
  line-height: 1.15;
}

.student-summary-day-strip .day-pill.done {
  color: var(--summary-type-accent);
  background: var(--summary-type-soft);
}

.student-summary-day-strip .day-pill.missing {
  color: var(--muted);
  background: var(--surface-muted);
}

.week-card-head,
.word-progress,
.mini-counts {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.week-card-head span,
.word-progress span,
.mini-counts span {
  color: var(--muted);
  font-size: 13px;
}

.word-progress {
  margin-top: 12px;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}

.day-pill {
  min-height: 34px;
  border-radius: 6px;
  padding: 5px 3px;
  font-size: 11px;
  text-align: center;
}

.day-pill.done {
  color: var(--brand);
  background: rgba(20, 92, 79, 0.1);
}

.day-pill.missing {
  color: #9a3412;
  background: #fff2e8;
}

.mini-counts {
  justify-content: flex-start;
  flex-wrap: wrap;
  margin-top: 10px;
}

.mini-counts span {
  border-radius: 999px;
  padding: 5px 8px;
  background: #f0f2f1;
}

.mini-counts .late-count,
.late-badge {
  color: #9a3412;
  background: #fff2e8;
}

.type-sections {
  display: grid;
  gap: 10px;
  padding: 8px 28px 28px;
}

.type-section {
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.type-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  padding: 0 14px;
  cursor: pointer;
  font-weight: 700;
}

.empty-inline {
  margin: 0;
  padding: 14px;
  color: var(--muted);
}

.compact-list {
  display: grid;
  gap: 8px;
  padding: 0 12px 12px;
}

.compact-item {
  border-radius: 8px;
  background: #f8faf9;
}

.compact-item summary {
  display: grid;
  grid-template-columns: auto auto minmax(80px, 1fr) minmax(56px, 0.8fr) minmax(96px, 1.2fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 8px 10px;
  cursor: pointer;
}

.compact-item summary span,
.compact-item summary time {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-body {
  padding: 0 10px 10px;
}

.submission-card {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.5fr);
  gap: 16px;
  border: 1px solid rgba(21, 25, 31, 0.08);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff, #fbfbfa);
}

.submission-type-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.type-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 10px;
  color: #ffffff;
  background: var(--type-audio);
  font-size: 13px;
  font-weight: 700;
}

.late-badge {
  width: fit-content;
  border-radius: 999px;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 700;
}

.type-badge.daily {
  background: var(--type-daily);
}

.type-badge.writing {
  background: var(--type-writing);
}

.type-badge.screen {
  background: var(--type-screen);
}

.type-badge.homework {
  background: var(--type-homework);
}

.meta,
.player-area,
.continuous-player,
.segment-item {
  min-width: 0;
}

.meta {
  display: grid;
  gap: 6px;
}

.meta strong {
  font-size: 18px;
}

.meta span {
  color: var(--muted);
  font-size: 14px;
}

.player-area {
  display: grid;
  align-content: center;
  gap: 10px;
}

audio {
  display: block;
  width: 100%;
}

.download-link {
  width: fit-content;
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.download-link:hover {
  text-decoration: underline;
}

.continuous-player {
  display: grid;
  gap: 10px;
}

.player-title {
  color: var(--muted);
  font-size: 14px;
}

.segment-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(124px, 1fr));
  gap: 12px;
}

.image-card {
  min-width: 0;
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  color: var(--text);
  background: var(--surface-muted);
  text-decoration: none;
}

.image-card:hover,
.image-card:focus-within {
  border-color: var(--brand-line);
  background: var(--surface-muted);
}

.attachment-view-trigger {
  min-width: 0;
  display: grid;
  gap: 6px;
  border: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.attachment-name,
.attachment-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-name {
  font-weight: 700;
}

.attachment-meta,
.attachment-open-hint {
  color: var(--muted);
  font-size: 13px;
}

.attachment-open-hint {
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--brand);
  background: var(--brand-soft);
  font-weight: 700;
}

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

.attachment-actions a {
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.attachment-actions a:hover {
  text-decoration: underline;
}

.attachment-thumb,
.attachment-video {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  background: var(--surface);
}

.attachment-thumb {
  object-fit: cover;
}

.attachment-video {
  object-fit: contain;
}

.attachment-file-icon {
  min-height: 92px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--brand-line);
  border-radius: 6px;
  color: var(--brand);
  background: var(--brand-soft);
  font-size: 13px;
  font-weight: 700;
}

.attachment-viewer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--scrim);
}

.attachment-viewer[hidden] {
  display: none;
}

.attachment-viewer-panel {
  width: min(920px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 14px;
  overflow: hidden;
  border-radius: 8px;
  padding: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.attachment-viewer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.attachment-viewer-title,
.attachment-viewer-meta {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.attachment-viewer-title {
  font-size: 18px;
}

.attachment-viewer-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.attachment-viewer-close {
  flex: 0 0 auto;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface-muted);
  cursor: pointer;
}

.attachment-viewer-preview {
  min-height: 240px;
  display: grid;
  place-items: center;
  overflow: auto;
  border-radius: 8px;
  background: var(--surface-muted);
}

.attachment-viewer-preview img,
.attachment-viewer-preview video {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 220px);
  border-radius: 6px;
  object-fit: contain;
}

.attachment-viewer-preview video {
  width: 100%;
  background: var(--text);
}

.attachment-viewer-file {
  display: grid;
  gap: 6px;
  place-items: center;
  padding: 24px;
  color: var(--muted);
  text-align: center;
}

.attachment-viewer-file strong {
  color: var(--text);
  font-size: 18px;
}

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

.attachment-viewer-actions a {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 0 14px;
  text-decoration: none;
}

.parent-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(21, 25, 31, 0.08);
}

.parent-toolbar p {
  margin-bottom: 0;
  color: var(--muted);
}

.parent-overview {
  padding: 24px 28px 10px;
}

.parent-overview.compact {
  padding-bottom: 0;
}

.parent-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(20, 92, 79, 0.12);
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(20, 92, 79, 0.1), rgba(255, 255, 255, 0.96) 52%),
    #ffffff;
}

.parent-hero.compact {
  grid-template-columns: 1fr;
  padding: 16px 18px;
}

.parent-kicker {
  display: block;
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
}

.parent-hero h2 {
  margin-bottom: 6px;
  font-size: 28px;
}

.parent-hero p {
  max-width: 620px;
  margin-bottom: 0;
  color: var(--muted);
}

.parent-deadline {
  display: inline-block;
  margin-top: 10px;
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--brand);
  background: rgba(20, 92, 79, 0.08);
  font-size: 13px;
  font-weight: 700;
}

.parent-score {
  min-width: 116px;
  border-radius: 8px;
  padding: 14px 16px;
  color: #ffffff;
  background: var(--brand);
  text-align: center;
  box-shadow: var(--soft-shadow);
}

.parent-score span,
.parent-score strong {
  display: block;
}

.parent-score span {
  margin-bottom: 4px;
  font-size: 13px;
  opacity: 0.86;
}

.parent-score strong {
  font-size: 30px;
  line-height: 1;
}

.parent-sections {
  display: grid;
  gap: 12px;
  padding: 12px 28px 28px;
}

.parent-stat-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.parent-section {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(21, 25, 31, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.parent-category-card {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 96px;
  padding: 11px 14px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.parent-category-card:hover,
.parent-category-card:focus-visible {
  border-color: var(--brand-line);
  background: linear-gradient(180deg, #ffffff, var(--surface-muted));
}

.parent-section-card-main {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.parent-section-card-side {
  flex: 0 0 auto;
  display: grid;
  justify-items: end;
  gap: 8px;
}

.parent-section-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.parent-section-summary {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.parent-section-title > span:last-child {
  min-width: 0;
}

.parent-section-title strong,
.parent-section-title small,
.parent-section-summary,
.parent-section-count strong,
.parent-section-count small {
  display: block;
}

.parent-section-title small,
.parent-section-count small {
  color: var(--muted);
  font-size: 12px;
}

.parent-section-count {
  flex: 0 0 auto;
  min-width: 74px;
  text-align: right;
}

.parent-section-count strong {
  font-size: 22px;
  line-height: 1.1;
}

.parent-section-action {
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--brand);
  background: rgba(20, 92, 79, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.parent-detail-view {
  grid-template-columns: 1fr;
}

.parent-section-detail {
  overflow: hidden;
  border: 1px solid rgba(21, 25, 31, 0.08);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--soft-shadow);
}

.parent-section-detail-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(21, 25, 31, 0.08);
  padding: 12px 14px;
}

.parent-section-back {
  min-height: 38px;
  padding: 0 12px;
}

.parent-section-detail-title {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.parent-section-detail-title > div {
  min-width: 0;
}

.parent-section-detail-title strong,
.parent-section-detail-title small {
  display: block;
}

.parent-section-detail-title small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.parent-section-detail-count {
  min-width: 82px;
}

.parent-section-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.parent-day-strip {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.parent-day {
  min-width: 0;
  border-radius: 7px;
  padding: 9px 4px;
  text-align: center;
}

.parent-day strong,
.parent-day small {
  display: block;
}

.parent-day strong {
  font-size: 12px;
}

.parent-day small {
  margin-top: 2px;
  font-size: 11px;
}

.parent-day.done {
  color: var(--brand);
  background: rgba(20, 92, 79, 0.1);
}

.parent-day.missing {
  color: #9a3412;
  background: #fff2e8;
}

.parent-section-note,
.parent-empty {
  margin: 0;
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--muted);
  background: #f8faf9;
}

.parent-section-note {
  color: #7a3d12;
  background: #fff7ec;
}

.parent-item-list {
  display: grid;
  gap: 10px;
}

.parent-item {
  border-radius: 8px;
  padding: 13px;
  background: #f8faf9;
}

.parent-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  margin-bottom: 10px;
}

.parent-item-head strong,
.parent-item-head span {
  display: block;
  min-width: 0;
}

.parent-item-head strong {
  overflow-wrap: anywhere;
}

.parent-item-head span,
.parent-item-head time {
  color: var(--muted);
  font-size: 13px;
}

.parent-item-body {
  min-width: 0;
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100% - 12px, 1040px);
    margin: 8px auto 14px;
  }

  .top-bar,
  .teacher-tools,
  .deadline-strip,
  .parent-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-bar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .eyebrow {
    margin-bottom: 4px;
    font-size: 12px;
  }

  h1 {
    font-size: 28px;
    line-height: 1.08;
  }

  .status-pill {
    padding: 6px 10px;
    font-size: 12px;
  }

  .tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-bottom: 8px;
  }

  body:not([data-active-panel="teacherPanel"]) .tabs {
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 10px 22px rgba(21, 25, 31, 0.08);
  }

  .tab-button,
  .primary-button,
  .ghost-button,
  .danger-button,
  .record-button,
  .stop-button {
    min-height: 48px;
  }

  .tab-button {
    padding: 0 8px;
    font-weight: 700;
  }

  .attachment-viewer {
    padding: 8px;
  }

  .attachment-viewer-panel {
    max-height: calc(100vh - 16px);
    gap: 12px;
    padding: 12px;
  }

  .attachment-viewer-head,
  .attachment-viewer-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .attachment-viewer-preview {
    min-height: 220px;
  }

  .attachment-viewer-preview img {
    max-height: calc(100vh - 260px);
  }

  .attachment-viewer-actions a {
    justify-content: center;
  }

  .deadline-strip {
    gap: 5px;
    margin-bottom: 8px;
    padding: 10px 12px;
  }

  .deadline-strip span,
  .deadline-strip small {
    font-size: 12px;
  }

  .deadline-strip strong {
    font-size: 14px;
  }

  .form-grid,
  .submission-card,
  .segment-item,
  .manager-form,
  .teacher-filters,
  .student-card,
  .compact-item summary {
    grid-template-columns: 1fr;
  }

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

  .student-actions {
    justify-content: stretch;
  }

  .student-delete-confirm {
    grid-template-columns: 1fr;
  }

  .student-delete-confirm-actions {
    justify-content: stretch;
  }

  .student-actions .ghost-button,
  .student-delete-confirm-actions .ghost-button,
  .student-delete-confirm-actions .danger-button {
    flex: 1 1 140px;
  }

  .delete-segment-button {
    width: 100%;
    height: 42px;
    border-radius: 8px;
    font-size: 22px;
  }

  .recorder-head {
    flex-direction: column;
    gap: 10px;
  }

  .section-title-row {
    flex-direction: column;
    gap: 10px;
  }

  .student-hub-intro {
    gap: 10px;
    padding: 14px 12px 8px;
  }

  .student-hub-intro p {
    font-size: 14px;
    line-height: 1.55;
  }

  .student-summary-section {
    padding: var(--space-4) var(--space-4) 0;
  }

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

  .student-summary-view-button {
    width: 100%;
  }

  .student-summary-type-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .student-summary-type-count {
    text-align: left;
  }

  .student-summary-day-strip {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .task-switch {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    position: sticky;
    top: 60px;
    z-index: 9;
    border-radius: 8px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--soft-shadow);
    backdrop-filter: blur(10px);
  }

  .task-card {
    min-height: 58px;
    padding: 10px;
  }

  .task-card strong {
    margin-bottom: 3px;
    font-size: 16px;
  }

  .task-card span {
    font-size: 12px;
  }

  .required-badge {
    width: fit-content;
  }

  .timer {
    width: 100%;
  }

  #studentPanel .upload-form {
    padding-top: 16px;
    padding-bottom: 18px;
  }

  #studentPanel .section-title-row {
    margin-bottom: 14px;
  }

  #studentPanel .section-title-row h2 {
    margin-bottom: 5px;
    font-size: 20px;
  }

  #studentPanel .section-title-row p {
    font-size: 14px;
    line-height: 1.55;
  }

  #studentPanel .form-grid {
    gap: 12px;
  }

  label .select-help {
    font-size: 12px;
  }

  .upload-zone,
  .file-drop {
    margin-top: 16px;
    padding: 18px;
  }

  .file-main {
    font-size: 16px;
  }

  .file-sub {
    font-size: 13px;
    line-height: 1.45;
  }

  .recorder-box {
    margin-top: 16px;
    padding: 16px;
  }

  .recorder-head h2 {
    font-size: 20px;
  }

  .recorder-head p,
  .recorder-status {
    font-size: 14px;
    line-height: 1.55;
  }

  .record-actions,
  .actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .word-upload-preview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segment-downloads {
    display: grid;
    grid-template-columns: 1fr;
  }

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

  .parent-hero,
  .parent-item-head {
    grid-template-columns: 1fr;
  }

  .parent-score {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }

  .parent-score span {
    margin-bottom: 0;
  }

  #parentPanel .teacher-login {
    padding: 16px;
  }

  #parentPanel .teacher-login form {
    max-width: none;
    gap: 12px;
  }

  #parentPanel .teacher-login h2 {
    font-size: 22px;
  }

  #parentPanel .teacher-login p {
    font-size: 14px;
    line-height: 1.55;
  }

  .consent-notice {
    padding: 10px 12px;
  }

  .consent-check {
    align-items: flex-start;
    border-radius: 8px;
    padding: 10px 12px;
    background: #f8faf9;
  }

  .parent-toolbar {
    gap: 8px;
    border-bottom: 0;
    padding-top: 16px;
    padding-bottom: 10px;
  }

  .parent-toolbar h2 {
    margin-bottom: 4px;
    font-size: 22px;
  }

  .parent-overview {
    padding-top: 10px;
  }

  .parent-hero {
    gap: 12px;
    padding: 14px;
  }

  .parent-hero h2 {
    font-size: 24px;
  }

  .parent-hero p {
    font-size: 14px;
    line-height: 1.55;
  }

  .parent-deadline {
    border-radius: 8px;
    font-size: 12px;
  }

  .parent-score {
    padding: 12px 14px;
  }

  .parent-score strong {
    font-size: 24px;
  }

  .parent-sections {
    gap: 8px;
  }

  .parent-stat-cards {
    grid-template-columns: 1fr;
  }

  .parent-category-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    align-items: center;
    min-height: 92px;
    padding: 12px;
  }

  .parent-section-card-main {
    gap: 7px;
  }

  .parent-section-card-side {
    grid-row: 1 / span 2;
    gap: 7px;
  }

  .parent-section-title {
    align-items: flex-start;
  }

  .parent-section-title .type-badge {
    min-width: 44px;
    text-align: center;
  }

  .parent-section-summary {
    grid-column: 1;
    font-size: 12px;
  }

  .parent-section-count {
    display: flex;
    gap: 8px;
    align-items: baseline;
    min-width: 0;
    text-align: right;
  }

  .parent-section-count strong {
    font-size: 18px;
  }

  .parent-section-action {
    padding: 5px 8px;
    font-size: 12px;
  }

  .parent-section-detail-head {
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
    padding: 12px;
  }

  .parent-section-back {
    grid-column: 1 / -1;
    width: fit-content;
  }

  .parent-section-detail-title {
    align-items: flex-start;
  }

  .parent-section-detail-title small {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .parent-section-detail-count {
    min-width: 0;
  }

  .parent-section-body {
    padding: 12px;
  }

  .parent-day-strip {
    overflow-x: auto;
    grid-template-columns: repeat(7, minmax(44px, 1fr));
    padding-bottom: 2px;
  }

  .parent-section-note,
  .parent-empty {
    padding: 10px;
    font-size: 13px;
    line-height: 1.5;
  }

  .parent-item {
    padding: 11px;
  }

  .parent-item-head {
    gap: 4px;
    margin-bottom: 8px;
  }

  .parent-item-head span,
  .parent-item-head time {
    font-size: 12px;
  }

  .download-link {
    width: 100%;
    min-height: 38px;
    display: inline-flex;
    align-items: center;
  }

  .upload-form,
    .teacher-login,
    .teacher-tools,
    .dashboard-section,
    .teacher-filters,
    .parent-toolbar,
    .parent-overview,
    .parent-sections,
    .week-grid,
    .type-sections,
  .submission-list,
  .empty-state {
    padding-left: 16px;
    padding-right: 16px;
  }
}
