:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #9aa8b7;
  --dim: #657386;
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(9, 16, 28, 0.72);
  --panel-strong: rgba(13, 22, 38, 0.9);
  --field: rgba(255, 255, 255, 0.07);
  --accent: #1d9bff;
  --accent-2: #52d7ff;
  --danger: #ff705f;
  --success: #44d7a8;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -12%, rgba(36, 143, 255, 0.42), transparent 34%),
    radial-gradient(circle at 8% 18%, rgba(82, 215, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #060b14 0%, #0a1322 48%, #05070d 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.06) 42%, transparent 56%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

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

button.primary {
  border-color: rgba(82, 215, 255, 0.48);
  background: linear-gradient(135deg, var(--accent), #1568ff);
  color: white;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(29, 155, 255, 0.28);
}

button.active,
button:hover:not(:disabled) {
  border-color: rgba(82, 215, 255, 0.62);
  background: rgba(29, 155, 255, 0.14);
  transform: translateY(-1px);
}

.recorder-shell {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 16px;
  display: grid;
  gap: 12px;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 104px;
  padding: 14px 22px;
  overflow: hidden;
}

.hero::after {
  width: 230px;
  height: 100px;
  flex: 0 0 auto;
  border-radius: 999px;
  content: "";
  background: radial-gradient(circle, rgba(82, 215, 255, 0.28), transparent 68%);
  filter: blur(2px);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 48px;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-size: 16px;
}

.swc-brand {
  display: grid;
  gap: 6px;
  width: min(430px, 66vw);
}

.swc-mark {
  width: fit-content;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 8vw, 86px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #fff4a4 0%, #d99a1d 42%, #8f5b00 54%, #ffd667 78%, #b27405 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 22px rgba(255, 199, 67, 0.34),
    0 12px 28px rgba(0, 0, 0, 0.38);
}

.swc-subtitle {
  display: grid;
  grid-template-columns: 42px auto 42px;
  gap: 12px;
  align-items: center;
  width: fit-content;
  color: #ffe87a;
  font-size: clamp(12px, 1.8vw, 18px);
  font-weight: 800;
  letter-spacing: 0.24em;
  text-shadow: 0 0 18px rgba(255, 214, 103, 0.26);
}

.swc-subtitle span {
  height: 1px;
  background: linear-gradient(90deg, transparent, #f7d76b);
}

.swc-subtitle span:last-child {
  background: linear-gradient(90deg, #f7d76b, transparent);
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(82, 215, 255, 0.34);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(82, 215, 255, 0.1);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.panel {
  padding: 14px;
}

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

.section-heading span {
  color: var(--muted);
  font-weight: 800;
}

.student-grid {
  display: grid;
  grid-template-columns: minmax(220px, 420px);
  gap: 9px;
}

.student-panel {
  display: grid;
  gap: 14px;
  justify-items: start;
}

.onboarding-copy {
  display: grid;
  gap: 6px;
}

.step-label {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
}

.onboarding-copy h2 {
  font-size: 28px;
}

.onboarding-copy p {
  color: var(--muted);
}

.begin-flow {
  width: min(420px, 100%);
  min-height: 52px;
  font-size: 18px;
}

.flow-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  padding: 9px 12px;
  color: var(--muted);
  font-weight: 900;
}

.flow-summary button {
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  padding: 0;
  font-weight: 900;
  text-align: left;
}

.flow-summary button::after {
  content: " 修改";
  color: var(--accent-2);
  font-size: 12px;
}

.workbench {
  animation: flowIn 220ms ease both;
}

@keyframes flowIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

input,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  font-size: 16px;
  padding: 10px 12px;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: rgba(82, 215, 255, 0.54);
  background: rgba(255, 255, 255, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--dim);
}

textarea {
  resize: vertical;
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 10px;
  border: 1px solid rgba(82, 215, 255, 0.16);
  border-radius: 8px;
  background: rgba(82, 215, 255, 0.08);
  padding: 10px 11px;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.consent-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.85fr);
  gap: 12px;
  align-items: start;
}

.task-panel {
  display: grid;
  gap: 11px;
}

.prompt-card {
  display: grid;
  gap: 8px;
  min-height: 148px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.03)),
    rgba(255, 255, 255, 0.04);
  padding: 18px;
}

.prompt-card strong {
  font-size: 38px;
  line-height: 1.05;
}

.prompt-card p {
  color: var(--muted);
  line-height: 1.45;
}

.example-box {
  display: grid;
  gap: 7px;
  border: 1px solid rgba(82, 215, 255, 0.14);
  border-radius: 8px;
  background: rgba(82, 215, 255, 0.07);
  padding: 10px;
}

.example-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.example-heading > span {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.voice-switch {
  display: flex;
  gap: 5px;
}

.voice-switch button {
  min-height: 28px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 800;
}

.voice-switch button.active {
  border-color: rgba(82, 215, 255, 0.6);
  background: rgba(82, 215, 255, 0.18);
  color: var(--accent-2);
}

.example-play {
  width: 100%;
  min-height: 42px;
  border-color: rgba(82, 215, 255, 0.35);
  background: rgba(82, 215, 255, 0.12);
  color: var(--accent-2);
  font-weight: 900;
}

.example-play.done {
  border-color: rgba(68, 215, 168, 0.36);
  background: rgba(68, 215, 168, 0.14);
  color: var(--success);
}

#exampleHint {
  color: var(--muted);
  font-size: 12px;
}

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

.prompt-meta span {
  border: 1px solid rgba(82, 215, 255, 0.16);
  border-radius: 999px;
  background: rgba(82, 215, 255, 0.1);
  color: var(--accent-2);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

#promptFilename {
  display: none;
}

.meter-wrap {
  display: grid;
  grid-template-columns: 1fr 52px;
  gap: 10px;
  align-items: center;
}

.meter-track {
  height: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #48d7ff, #5df2c8 55%, #ffe66d),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 8px, transparent 8px 16px);
  box-shadow:
    0 0 18px rgba(82, 215, 255, 0.7),
    0 0 36px rgba(93, 242, 200, 0.25);
  transition: width 55ms linear;
}

body.recording-active .meter-track {
  background: rgba(82, 215, 255, 0.13);
}

body.voice-detected .meter-track {
  box-shadow:
    inset 0 0 0 1px rgba(82, 215, 255, 0.36),
    0 0 28px rgba(82, 215, 255, 0.25);
}

#recordTimer {
  color: var(--accent-2);
  font-weight: 900;
  text-align: right;
}

.controls,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.controls #recordBtn {
  flex: 2 1 260px;
  min-height: 58px;
  font-size: 19px;
}

.controls button {
  flex: 1 1 120px;
}

audio {
  width: 100%;
  height: 38px;
  filter: invert(1) hue-rotate(180deg);
}

.checklist-panel .section-heading {
  align-items: stretch;
  flex-direction: column;
}

.checklist-panel .export-actions {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 0.8fr;
  width: 100%;
}

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

.task-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 8px;
  align-items: center;
  min-height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 8px;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.task-row.active {
  border-color: rgba(82, 215, 255, 0.52);
  background: rgba(82, 215, 255, 0.13);
}

.task-row:hover,
.task-row:focus-visible {
  border-color: rgba(82, 215, 255, 0.42);
  background: rgba(82, 215, 255, 0.1);
  outline: none;
}

.task-row:active {
  transform: translateY(1px);
}

.task-row[aria-disabled="true"] {
  cursor: not-allowed;
}

.task-action {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.task-index {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.task-row.done .task-index {
  background: linear-gradient(135deg, var(--success), var(--accent-2));
  color: #03151f;
}

.task-row strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px;
  line-height: 1.18;
}

.task-row span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
}

.submit-feedback {
  display: grid;
  gap: 5px;
  margin: 10px 0 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 11px;
}

.submit-feedback strong {
  font-size: 14px;
}

.submit-feedback p {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.submit-feedback.pending {
  border-color: rgba(82, 215, 255, 0.34);
  background: rgba(29, 155, 255, 0.12);
}

.submit-feedback.success {
  border-color: rgba(68, 215, 168, 0.36);
  background: rgba(68, 215, 168, 0.12);
}

.submit-feedback.error {
  border-color: rgba(255, 112, 95, 0.44);
  background: rgba(255, 112, 95, 0.12);
}

.submit-feedback.success strong {
  color: var(--success);
}

.submit-feedback.error strong {
  color: var(--danger);
}

.modal-backdrop {
  position: fixed;
  z-index: 10;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.66);
  backdrop-filter: blur(14px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(360px, 100%);
  border: 1px solid rgba(82, 215, 255, 0.3);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04)),
    #08111f;
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.6);
  padding: 24px;
  text-align: center;
}

.modal-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: 0 auto 14px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--success), var(--accent-2));
  color: #03151f;
  font-size: 30px;
  font-weight: 900;
}

.modal-card h2 {
  font-size: 28px;
}

.modal-card p {
  margin: 10px 0 20px;
  color: var(--muted);
}

.modal-card button {
  width: 100%;
}

@media (max-width: 920px) {
  h1 {
    font-size: 42px;
  }

  .hero::after {
    display: none;
  }
}

@media (max-width: 700px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
  }

  .recorder-shell {
    min-height: 100dvh;
    padding: 8px;
    gap: 6px;
    grid-template-rows: auto auto auto;
    overflow: visible;
  }

  .hero {
    min-height: 0;
    align-items: center;
    flex-direction: row;
    padding: 8px 10px;
  }

  h1 {
    font-size: 30px;
  }

  .swc-brand {
    width: min(240px, 62vw);
    gap: 4px;
  }

  .swc-mark {
    font-size: 44px;
  }

  .swc-subtitle {
    grid-template-columns: 20px auto 20px;
    gap: 6px;
    font-size: 9px;
    letter-spacing: 0.18em;
  }

  .status-pill {
    max-width: 124px;
    padding: 7px 9px;
    font-size: 12px;
    text-align: center;
  }

  .panel {
    padding: 9px;
  }

  .section-heading,
  .compact-panel .section-heading {
    flex-direction: row;
    align-items: center;
    margin-bottom: 7px;
  }

  h2 {
    font-size: 14px;
  }

  .student-panel label:not(.consent-row) span {
    display: none;
  }

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

  .student-grid {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .student-panel {
    justify-items: stretch;
  }

  .onboarding-copy h2 {
    font-size: 22px;
  }

  .begin-flow {
    width: 100%;
    min-height: 46px;
    font-size: 16px;
  }

  .consent-row {
    margin-top: 7px;
    padding: 7px 8px;
    font-size: 11px;
    line-height: 1.25;
  }

  .consent-row input {
    width: 16px;
    height: 16px;
  }

  input,
  textarea {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 16px;
  }

  .workbench {
    min-height: 0;
    grid-template-rows: auto auto;
    gap: 6px;
  }

  .task-panel {
    min-height: 0;
    gap: 7px;
  }

  .prompt-card {
    min-height: 0;
    padding: 10px;
    gap: 6px;
  }

  .prompt-card strong {
    font-size: 27px;
  }

  .prompt-card p {
    line-height: 1.32;
    font-size: 13px;
  }

  .example-box {
    padding: 8px;
    gap: 6px;
  }

  .example-heading > span {
    font-size: 12px;
  }

  .voice-switch button {
    min-height: 26px;
    padding-inline: 10px;
  }

  .example-play {
    min-height: 36px;
    font-size: 13px;
  }

  #exampleHint {
    font-size: 11px;
  }

  .prompt-meta span {
    padding: 4px 8px;
  }

  .meter-wrap {
    grid-template-columns: 1fr 48px;
    gap: 8px;
  }

  .meter-track {
    height: 12px;
  }

  .controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }

  .controls #recordBtn {
    grid-column: 1 / -1;
    order: -1;
    min-height: 48px;
    font-size: 17px;
  }

  .controls button {
    min-height: 36px;
    font-size: 14px;
  }

  audio {
    height: 32px;
  }

  #taskNote {
    height: 38px;
    min-height: 38px;
  }

  .export-actions,
  .checklist-panel .export-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
  }

  .export-actions button {
    min-width: 0;
    min-height: 34px;
    padding-inline: 6px;
    font-size: 13px;
  }

  .checklist-panel {
    min-height: 0;
  }

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

  .task-row {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 54px;
    padding: 6px 4px;
    text-align: center;
  }

  .task-index {
    width: 22px;
    height: 22px;
  }

  .task-row strong {
    font-size: 11px;
    line-height: 1.08;
  }

  .task-row span {
    display: none;
  }

  .task-action {
    display: none;
  }

  .submit-feedback {
    margin-top: 7px;
    padding: 8px;
  }

  .submit-feedback strong {
    font-size: 13px;
  }

  .submit-feedback p {
    font-size: 13px;
    line-height: 1.3;
  }

  .hero,
  .panel,
  .student-grid > label,
  .prompt-card,
  .controls > button,
  .export-actions > button,
  .task-row,
  input,
  textarea {
    min-width: 0;
  }

  .student-grid > label {
    overflow: hidden;
  }

  #sessionDate {
    width: 100%;
    max-width: 100%;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
  }

  .consent-row {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
  }

  .consent-row span {
    display: block;
  }

  .consent-row input {
    justify-self: center;
    margin: 0;
  }

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

  .controls #recordBtn {
    grid-column: 1 / -1;
  }

  .controls button:not(#recordBtn) {
    width: 100%;
  }

  .task-panel > audio,
  .task-panel > textarea,
  .checklist-panel,
  .submit-feedback {
    width: 100%;
  }

}
